commit 14b3235b41c85c80d0fff4c1fca28777a45f4233 Author: float <1iro@dev> Date: Sun Nov 29 23:19:13 2026 +0900 SkidSolutions diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..73cb780 --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +# Gradle & build outputs +/build/ +/.gradle/ +/out/ + +# Local game run directory +/run/ + +# IDE project metadata +/.idea/ +/.run/ +*.iml +*.ipr +*.iws +/.vscode/ + +# OS metadata +.DS_Store +Thumbs.db diff --git a/README.md b/README.md new file mode 100644 index 0000000..16eec34 --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# Novoline 6.99 (Minecraft 1.8.8 + OptiFine HD U H8) + +100% standalone Java source Gradle project (`3,633` `.java` files / `3,655` classes). + +## Requirements +- Any JDK 17+ to run Gradle (Java 8 toolchain & all Minecraft/Maven/Native libraries are downloaded automatically on first Gradle sync/run). + +## Usage + +### IntelliJ IDEA +1. Open the `novoline-6.99` folder in IntelliJ IDEA (**File -> Open...**). +2. Wait for Gradle sync to finish automatically. +3. Run the `application -> runClient` Gradle task (or `build -> clientJar` to build `build/libs/novoline-6.99-runtime.jar`). + +### Command Line +```powershell +# Launch client +.\gradlew.bat runClient + +# Build standalone runtime JAR (build/libs/novoline-6.99-runtime.jar) +.\gradlew.bat clientJar +``` diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..7c1bcf3 --- /dev/null +++ b/build.gradle @@ -0,0 +1,325 @@ +import org.gradle.internal.jvm.Jvm + +plugins { + id 'java' + id 'idea' +} + +group = 'cc.novoline' +version = '6.99' + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + +repositories { + mavenCentral() + maven { + name = 'Mojang' + url = 'https://libraries.minecraft.net/' + } +} + +configurations { + asmTools + mcLibs + mcNatives + clientBundle + implementation.extendsFrom(mcLibs, clientBundle) +} + +def java8Compiler = javaToolchains.compilerFor { + languageVersion = JavaLanguageVersion.of(8) +} +def java8Launcher = javaToolchains.launcherFor { + languageVersion = JavaLanguageVersion.of(8) +} +def gradleHostJavaExe = Jvm.current().javaExecutable.absolutePath + +def customDepsJar = file('libs/novoline-custom-deps.jar') +def jfxJar = file('libs/jfxrt-java8.jar') + +// Resolve nashorn.jar automatically from the provisioned Java 8 Toolchain +def resolveJava8Nashorn = { + def j8Home = java8Launcher.get().metadata.installationPath.asFile + def c1 = new File(j8Home, 'jre/lib/ext/nashorn.jar') + if (c1.isFile()) return files(c1) + def c2 = new File(j8Home, 'lib/ext/nashorn.jar') + return c2.isFile() ? files(c2) : files() +} + +dependencies { + compileOnly files(layout.buildDirectory.dir('tmp/restored-props')) + implementation files(customDepsJar, jfxJar) + implementation files({ resolveJava8Nashorn() }) + + // Client libraries bundled into standalone runtime JAR (resolved from Maven Central) + clientBundle 'it.unimi.dsi:fastutil:8.2.1' + clientBundle 'net.sf.trove4j:trove4j:3.0.3' + clientBundle 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.20' + clientBundle 'org.jetbrains.kotlin:kotlin-reflect:1.6.20' + clientBundle 'com.squareup.okhttp3:okhttp:4.11.0' + + // Minecraft 1.8.8 official libraries (resolved automatically from Mojang & Maven Central) + mcLibs 'com.mojang:netty:1.8.8' + mcLibs 'oshi-project:oshi-core:1.1' + mcLibs 'net.java.dev.jna:jna:3.4.0' + mcLibs 'net.java.dev.jna:platform:3.4.0' + mcLibs 'com.ibm.icu:icu4j-core-mojang:51.2' + mcLibs 'net.sf.jopt-simple:jopt-simple:4.6' + mcLibs 'com.paulscode:codecjorbis:20101023' + mcLibs 'com.paulscode:codecwav:20101023' + mcLibs 'com.paulscode:libraryjavasound:20101123' + mcLibs 'com.paulscode:librarylwjglopenal:20100824' + mcLibs 'com.paulscode:soundsystem:20120107' + mcLibs 'io.netty:netty-all:4.0.23.Final' + mcLibs 'com.google.guava:guava:17.0' + mcLibs 'org.apache.commons:commons-lang3:3.3.2' + mcLibs 'commons-io:commons-io:2.4' + mcLibs 'commons-codec:commons-codec:1.9' + mcLibs 'net.java.jinput:jinput:2.0.5' + mcLibs 'net.java.jutils:jutils:1.0.0' + mcLibs 'com.google.code.gson:gson:2.2.4' + mcLibs 'com.mojang:authlib:1.5.21' + mcLibs 'com.mojang:realms:1.7.39' + mcLibs 'org.apache.commons:commons-compress:1.8.1' + mcLibs 'org.apache.httpcomponents:httpclient:4.3.3' + mcLibs 'commons-logging:commons-logging:1.1.3' + mcLibs 'org.apache.httpcomponents:httpcore:4.3.2' + mcLibs 'org.apache.logging.log4j:log4j-api:2.0-beta9' + mcLibs 'org.apache.logging.log4j:log4j-core:2.0-beta9' + mcLibs 'org.lwjgl.lwjgl:lwjgl:2.9.4-nightly-20150209' + mcLibs 'org.lwjgl.lwjgl:lwjgl_util:2.9.4-nightly-20150209' + mcLibs 'tv.twitch:twitch:6.5' + + // Native libraries for LWJGL / OpenAL / JInput / Twitch (auto-extracted on runClient) + def osName = System.getProperty('os.name', '').toLowerCase(Locale.ROOT) + if (osName.contains('win')) { + mcNatives 'org.lwjgl.lwjgl:lwjgl-platform:2.9.4-nightly-20150209:natives-windows' + mcNatives 'net.java.jinput:jinput-platform:2.0.5:natives-windows' + mcNatives 'tv.twitch:twitch-platform:6.5:natives-windows-64' + mcNatives 'tv.twitch:twitch-external-platform:4.5:natives-windows-64' + } else if (osName.contains('mac')) { + mcNatives 'org.lwjgl.lwjgl:lwjgl-platform:2.9.4-nightly-20150209:natives-osx' + mcNatives 'net.java.jinput:jinput-platform:2.0.5:natives-osx' + mcNatives 'tv.twitch:twitch-platform:6.5:natives-osx' + } else { + mcNatives 'org.lwjgl.lwjgl:lwjgl-platform:2.9.4-nightly-20150209:natives-linux' + mcNatives 'net.java.jinput:jinput-platform:2.0.5:natives-linux' + } + + // Build-time ASM post-processor dependencies + asmTools 'org.ow2.asm:asm:9.10.1' + asmTools 'org.ow2.asm:asm-tree:9.10.1' + asmTools 'org.ow2.asm:asm-analysis:9.10.1' + asmTools 'org.ow2.asm:asm-commons:9.10.1' +} + +idea { + module { + downloadJavadoc = false + downloadSources = false + scopes.COMPILE.plus += [configurations.compileClasspath] + } +} + +ext { + propertyJavaIncludes = [ + 'cc/novoline/modules/configurations/property/AbstractNumberProperty.java', + 'cc/novoline/modules/configurations/property/object/ColorProperty.java', + 'cc/novoline/modules/configurations/property/object/DoubleProperty.java', + 'cc/novoline/modules/configurations/property/object/FloatProperty.java', + 'cc/novoline/modules/configurations/property/object/IntProperty.java', + 'cc/novoline/modules/configurations/property/object/ListProperty.java', + 'cc/novoline/modules/configurations/property/object/LongProperty.java', + 'cc/novoline/modules/configurations/property/object/StringProperty.java' + ] + emptySourceDir = layout.buildDirectory.dir('tmp/empty-sourcepath').get().asFile +} + +def configureJava8Compile = { JavaCompile t, boolean allowImplicitFromSrc -> + t.javaCompiler.set(java8Compiler) + t.options.encoding = 'UTF-8' + t.options.fork = true + t.options.forkOptions.memoryMaximumSize = allowImplicitFromSrc ? '512m' : '1536m' + if (allowImplicitFromSrc) { + t.options.sourcepath = files('src/main/java') + t.options.compilerArgs.addAll(['-XDignore.symbol.file', '-Xlint:-options', '-proc:none']) + } else { + t.doFirst { emptySourceDir.mkdirs() } + t.options.sourcepath = files(emptySourceDir) + t.options.compilerArgs.addAll(['-XDignore.symbol.file', '-Xlint:-options', '-proc:none', '-implicit:none']) + } +} + +def propRawOutDir = layout.buildDirectory.dir('tmp/javac-props') +def propRestoredDir = layout.buildDirectory.dir('tmp/restored-props') + +tasks.register('compilePropertiesJava', JavaCompile) { + description = 'Phase 1: Compiles the 8 Novoline @Property hierarchy classes from pure Java source.' + source = fileTree('src/main/java') { + include propertyJavaIncludes + } + classpath = files(customDepsJar, jfxJar, { resolveJava8Nashorn() }, configurations.clientBundle, configurations.mcLibs) + destinationDirectory.set(propRawOutDir) + configureJava8Compile(it, true) +} + +tasks.register('restorePropertySignatures', Exec) { + description = 'Phase 2: Restores original JVM generic bridge methods on the 8 @Property classes.' + dependsOn 'compilePropertiesJava', configurations.asmTools + doFirst { + propRestoredDir.get().asFile.mkdirs() + commandLine( + gradleHostJavaExe, + '-Xmx512m', + '-cp', configurations.asmTools.asPath, + file('tools/PropertySignatures.java').absolutePath, + 'restore', + file('tools/property-bridges.tsv').absolutePath, + propRawOutDir.get().asFile.absolutePath, + propRestoredDir.get().asFile.absolutePath + ) + } +} + +tasks.named('compileJava', JavaCompile) { + dependsOn 'restorePropertySignatures' + exclude propertyJavaIncludes + configureJava8Compile(it, false) + finalizedBy 'restoreClientBytecode' +} + +tasks.register('restoreBooleanArguments', Exec) { + description = 'Phase 3a: Merges restored @Property classes and restores non-canonical int->boolean arguments.' + dependsOn configurations.asmTools + def outClassesDir = sourceSets.main.java.destinationDirectory.get().asFile + def boolReport = layout.buildDirectory.file('reports/boolean-arguments.tsv').get().asFile + doFirst { + copy { + from propRestoredDir + into outClassesDir + } + boolReport.parentFile.mkdirs() + commandLine( + gradleHostJavaExe, + '-Xmx512m', + '-cp', configurations.asmTools.asPath, + file('tools/BooleanArgumentBytecode.java').absolutePath, + outClassesDir.absolutePath, + boolReport.absolutePath + ) + } +} + +tasks.register('restoreClientBytecode', Exec) { + description = 'Phase 3b: Restores ZKM bridges, class versions/flags, and strips spurious narrowing casts.' + dependsOn 'restoreBooleanArguments', configurations.asmTools + def outClassesDir = sourceSets.main.java.destinationDirectory.get().asFile + doFirst { + commandLine( + gradleHostJavaExe, + '-Xmx512m', + '-cp', configurations.asmTools.asPath, + file('tools/Stage4BytecodeRestore.java').absolutePath, + file('tools/bridge-delegates.tsv').absolutePath, + file('tools/bytecode-metadata.tsv').absolutePath, + outClassesDir.absolutePath + ) + } +} + +tasks.named('classes') { + dependsOn 'restoreClientBytecode' +} + +tasks.named('jar') { + dependsOn 'restoreClientBytecode' +} + +tasks.register('clientJar', Exec) { + group = 'build' + description = 'Builds 100% standalone novoline-6.99-runtime.jar from compiled sources + resources + third-party libs.' + dependsOn 'classes', configurations.clientBundle + def outClassesDir = sourceSets.main.java.destinationDirectory.get().asFile + def resourcesDir = file('src/main/resources') + def runtimeOut = layout.buildDirectory.file('libs/novoline-6.99-runtime.jar').get().asFile + doFirst { + def bundlePath = files(customDepsJar, configurations.clientBundle).asPath + commandLine( + gradleHostJavaExe, + '-Xmx512m', + file('tools/BuildStandaloneClientJar.java').absolutePath, + outClassesDir.absolutePath, + resourcesDir.absolutePath, + bundlePath, + runtimeOut.absolutePath + ) + } +} + +tasks.named('assemble') { + dependsOn 'clientJar' +} + +def extractedNativesDir = layout.buildDirectory.dir('natives') + +tasks.register('extractNatives', Sync) { + description = 'Extracts platform LWJGL/OpenAL/JInput/Twitch native libraries from Mojang Maven.' + dependsOn configurations.mcNatives + from { + configurations.mcNatives.collect { zipTree(it) } + } + exclude 'META-INF/**' + into extractedNativesDir +} + +def resolveDefaultMcAssetsDir = { + def custom = findProperty('mcAssetsDir') + if (custom != null) return file(custom) + def osName = System.getProperty('os.name', '').toLowerCase(Locale.ROOT) + def home = System.getProperty('user.home', '.') + File cand + if (osName.contains('win')) { + def appData = System.getenv('APPDATA') ?: new File(home, 'AppData/Roaming').absolutePath + cand = new File(appData, '.minecraft/assets') + } else if (osName.contains('mac')) { + cand = new File(home, 'Library/Application Support/minecraft/assets') + } else { + cand = new File(home, '.minecraft/assets') + } + return cand.isDirectory() ? cand : file('run/assets') +} + +tasks.register('runClient', JavaExec) { + group = 'application' + description = 'Builds novoline-6.99-runtime.jar from 100% full Java source and launches Novoline 6.99 under Java 8.' + dependsOn 'clientJar', 'extractNatives', configurations.mcLibs + javaLauncher.set(java8Launcher) + def runtimeOut = layout.buildDirectory.file('libs/novoline-6.99-runtime.jar').get().asFile + def runDir = file('run') + workingDir = runDir + maxHeapSize = '2G' + mainClass = 'net.minecraft.client.main.Main' + classpath = files(runtimeOut, jfxJar, { resolveJava8Nashorn() }, configurations.mcLibs) + doFirst { + runDir.mkdirs() + def assetsDir = resolveDefaultMcAssetsDir() + assetsDir.mkdirs() + new File(runDir, 'Novoline/configs').mkdirs() + new File(runDir, 'Novoline/scripts').mkdirs() + jvmArgs("-Djava.library.path=${extractedNativesDir.get().asFile.absolutePath}") + args( + '--version', 'Novoline-6.99', + '--accessToken', '0', + '--assetsDir', assetsDir.absolutePath, + '--assetIndex', '1.8', + '--userProperties', '{}', + '--gameDir', runDir.absolutePath + ) + } +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..f359479 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,2 @@ +org.gradle.jvmargs=-Xmx2G -Dfile.encoding=UTF-8 +org.gradle.parallel=true diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e644113 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..7e7d24f --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.0-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..8ef643e --- /dev/null +++ b/gradlew @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# 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. +# + +############################################################################## +# +# Gradle 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 Gradle +# +# 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/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# 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 "${APP_HOME:-./}" > /dev/null && pwd -P ) || 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 + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# 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" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + 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='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# 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" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..16e26a1 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@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=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/libs/jfxrt-java8.jar b/libs/jfxrt-java8.jar new file mode 100644 index 0000000..6ce8fc9 Binary files /dev/null and b/libs/jfxrt-java8.jar differ diff --git a/libs/novoline-custom-deps.jar b/libs/novoline-custom-deps.jar new file mode 100644 index 0000000..ae8b5fe Binary files /dev/null and b/libs/novoline-custom-deps.jar differ diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..9a22247 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,5 @@ +plugins { + id 'org.gradle.toolchains.foojay-resolver-convention' version '0.9.0' +} + +rootProject.name = 'novoline-6.99' diff --git a/src/main/java/cc/novoline/Initializer.java b/src/main/java/cc/novoline/Initializer.java new file mode 100644 index 0000000..d0e9bc5 --- /dev/null +++ b/src/main/java/cc/novoline/Initializer.java @@ -0,0 +1,1699 @@ +package cc.novoline; + +import cc.novoline.commands.NovoCommandHandler; +import cc.novoline.commands.impl.AutoRegisterCommand; +import cc.novoline.commands.impl.BindCommand; +import cc.novoline.commands.impl.ConfigAliasCommand; +import cc.novoline.commands.impl.ConfigCommand; +import cc.novoline.commands.impl.DirectMessageCommand; +import cc.novoline.commands.impl.FontCommand; +import cc.novoline.commands.impl.FriendCommand; +import cc.novoline.commands.impl.HelpCommand; +import cc.novoline.commands.impl.HideCommand; +import cc.novoline.commands.impl.IgnCommand; +import cc.novoline.commands.impl.IrcChatCommand; +import cc.novoline.commands.impl.KickCommand; +import cc.novoline.commands.impl.KillsultsCommand; +import cc.novoline.commands.impl.NameHistoryCommand; +import cc.novoline.commands.impl.PanicCommand; +import cc.novoline.commands.impl.PitBountyCommand; +import cc.novoline.commands.impl.RenameCommand; +import cc.novoline.commands.impl.ReportCommand; +import cc.novoline.commands.impl.SayCommand; +import cc.novoline.commands.impl.ScriptCommand; +import cc.novoline.commands.impl.SpectateCommand; +import cc.novoline.commands.impl.TargetCommand; +import cc.novoline.commands.impl.TeleportCommand; +import cc.novoline.commands.impl.ToggleCommand; +import cc.novoline.commands.impl.VClipCommand; +import cc.novoline.commands.impl.WaypointCommand; +import cc.novoline.gui.screen.ClickGUI; +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.gui.screen.click.DiscordGUI; +import cc.novoline.irc.NovolineWebSocket; +import cc.novoline.irc.packet.TokenCloudPacket; +import cc.novoline.modules.PlayerManager; +import cc.novoline.modules.binds.KeyboardKeybind; +import cc.novoline.modules.binds.ModuleKeybind; +import cc.novoline.modules.configurations.property.object.KeyBindProperty; +import cc.novoline.script.ScriptManager; +import cc.novoline.utils.ServerCommandTracker; +import cc.novoline.utils.ServerUtils; +import cc.novoline.utils.helper.ClientBootstrapUtil; +import cc.novoline.utils.helper.SoundAlertHelper; +import cc.novoline.utils.notifications.NotificationManager; +import cc.novoline.utils.shader.FramebufferBlurShader; +import cc.novoline.utils.tasks.TaskManager; + +import cc.novoline.events.EventManager; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.ModuleFactory; +import cc.novoline.modules.combat.AimAssist; +import cc.novoline.modules.combat.AntiBot; +import cc.novoline.modules.combat.AutoClicker; +import cc.novoline.modules.combat.AutoGApple; +import cc.novoline.modules.combat.AutoHead; +import cc.novoline.modules.combat.AutoPot; +import cc.novoline.modules.combat.Criticals; +import cc.novoline.modules.combat.HitBox; +import cc.novoline.modules.combat.KillAura; +import cc.novoline.modules.combat.Killsults; +import cc.novoline.modules.combat.Reach; +import cc.novoline.modules.combat.TargetHUD; +import cc.novoline.modules.combat.Velocity; +import cc.novoline.modules.configurations.ConfigManager; +import cc.novoline.modules.exploits.Blink; +import cc.novoline.modules.exploits.ClickTeleport; +import cc.novoline.modules.exploits.Disabler; +import cc.novoline.modules.exploits.Fireball; +import cc.novoline.modules.exploits.NoFall; +import cc.novoline.modules.exploits.Phase; +import cc.novoline.modules.misc.AntiAlts; +import cc.novoline.modules.misc.AntiFireBall; +import cc.novoline.modules.misc.AutoHypixel; +import cc.novoline.modules.misc.AutoTool; +import cc.novoline.modules.misc.ChatFutures; +import cc.novoline.modules.misc.Debug; +import cc.novoline.modules.misc.FastPlace; +import cc.novoline.modules.misc.LightningTracker; +import cc.novoline.modules.misc.MiddleClick; +import cc.novoline.modules.misc.Notifier; +import cc.novoline.modules.misc.Optimization; +import cc.novoline.modules.misc.ResetVL; +import cc.novoline.modules.misc.StaffAnalyzer; +import cc.novoline.modules.misc.UhcCrafts; +import cc.novoline.modules.move.AutoJump; +import cc.novoline.modules.move.FastSneak; +import cc.novoline.modules.move.Fly; +import cc.novoline.modules.move.GuiMove; +import cc.novoline.modules.move.HClip; +import cc.novoline.modules.move.LongJump; +import cc.novoline.modules.move.NoJumpDelay; +import cc.novoline.modules.move.NoSlowDown; +import cc.novoline.modules.move.SafeWalk; +import cc.novoline.modules.move.Speed; +import cc.novoline.modules.move.Sprint; +import cc.novoline.modules.move.Step; +import cc.novoline.modules.move.TargetStrafe; +import cc.novoline.modules.move.WaterWalk; +import cc.novoline.modules.player.AntiObbyTrap; +import cc.novoline.modules.player.AntiVoid; +import cc.novoline.modules.player.AutoArmor; +import cc.novoline.modules.player.BedBreaker; +import cc.novoline.modules.player.ChestStealer; +import cc.novoline.modules.player.Freecam; +import cc.novoline.modules.player.GameSpeed; +import cc.novoline.modules.player.InvManager; +import cc.novoline.modules.player.NoRotate; +import cc.novoline.modules.player.Respawn; +import cc.novoline.modules.player.Scaffold; +import cc.novoline.modules.player.SpeedMine; +import cc.novoline.modules.visual.Animations; +import cc.novoline.modules.visual.Arrows; +import cc.novoline.modules.visual.Atomsphere; +import cc.novoline.modules.visual.BlockOutline; +import cc.novoline.modules.visual.BreadCrumbs; +import cc.novoline.modules.visual.Brightness; +import cc.novoline.modules.visual.Camera; +import cc.novoline.modules.visual.Chams; +import cc.novoline.modules.visual.ChestESP; +import cc.novoline.modules.visual.ClickGui; +import cc.novoline.modules.visual.Crosshair; +import cc.novoline.modules.visual.CustomHitGlint; +import cc.novoline.modules.visual.DMGParticles; +import cc.novoline.modules.visual.Glint; +import cc.novoline.modules.visual.Glow; +import cc.novoline.modules.visual.HUD; +import cc.novoline.modules.visual.HypixelStats; +import cc.novoline.modules.visual.ItemESP; +import cc.novoline.modules.visual.ItemPhysic; +import cc.novoline.modules.visual.JumpCircle; +import cc.novoline.modules.visual.MoreBends; +import cc.novoline.modules.visual.Nametags; +import cc.novoline.modules.visual.NoEffects; +import cc.novoline.modules.visual.NoTitle; +import cc.novoline.modules.visual.PlayerESP; +import cc.novoline.modules.visual.Projectiles; +import cc.novoline.modules.visual.Radar; +import cc.novoline.modules.visual.Scoreboard; +import cc.novoline.modules.visual.SessionInfo; +import cc.novoline.modules.visual.SimsESP; +import cc.novoline.modules.visual.TabGui; +import cc.novoline.modules.visual.Tracers; +import cc.novoline.modules.visual.Trail; +import cc.novoline.modules.visual.Waypoints; +import cc.novoline.modules.visual.Wings; +import cc.novoline.modules.visual.XRay; +import cc.novoline.modules.configurations.holder.ModuleHolder; +import cc.novoline.modules.ModuleRegistry; +import java.lang.reflect.Field; +import java.net.URI; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.concurrent.ThreadLocalRandom; +import java.util.function.Consumer; +import cc.novoline.viaversion.ViaSupportUtil; +import cc.novoline.modules.ModuleArrayMap; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.network.play.client.C0APacketAnimation; +import net.minecraft.network.play.client.C0FPacketConfirmTransaction; +import net.minecraft.network.play.client.C0EPacketClickWindow; +import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C07PacketPlayerDigging$Action; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.skidunion.crypto.AesCbcCipher; +import net.skidunion.security.ProtectionSession; +import org.apache.logging.log4j.Logger; +import org.jetbrains.annotations.NotNull; +import org.lwjgl.opengl.Display; + +public class Initializer { private static final long s; + + private static final Logger l; + + static { + s = 82822816667706L; + l = org.apache.logging.log4j.LogManager.getLogger(); + } + public int[] e; + public Runnable g; + public int n; + public boolean[] k; + public String m; + public Runnable h; + public Runnable j; + public Runnable d; + public ItemStack f; + public Runnable r; + public Runnable o; + private Minecraft c; + public final String a = "game.player.hurt.fall.small"; + public String b; + public double[] q; + public Runnable p; + private boolean i = false; + + private static ChestESP lambdaImpl$create$28(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var6 = EnumModuleType.VISUALS; + String var7 = "ChestESP"; + String var9 = "Chest ESP"; + String var10 = var9; + String var11 = var7; + EnumModuleType var12 = var6; + ModuleManager var13 = var4; + return new ChestESP(var13, var12, var11, var10); + } + + private static JumpCircle lambdaImpl$create$76(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.VISUALS; + String var8 = "JumpCircle"; + String var9 = "Jump Circle"; + String var10 = var9; + String var11 = var8; + return new JumpCircle(var3, var4, var11, var10); + } + + private void lambdaImpl$create$5() { + this.g.run(); + this.p.run(); + } + + private static Wings lambdaImpl$create$82(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var7 = EnumModuleType.VISUALS; + String var8 = "Wings"; + String var9 = var8; + EnumModuleType var10 = var7; + return new Wings(var3, var10, var9); + } + + private static AutoTool lambdaImpl$create$39(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var6 = EnumModuleType.MISC; + String var7 = "AutoTool"; + String var8 = "Auto Tool"; + String var10 = var8; + String var11 = var7; + EnumModuleType var12 = var6; + return new AutoTool(var3, var12, var11, var10); + } + + private static HClip lambdaImpl$create$88(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var5 = EnumModuleType.MOVEMENT; + String var7 = "HClip"; + String var9 = var7; + EnumModuleType var10 = var5; + ModuleManager var11 = var4; + return new HClip(var11, var10, var9); + } + + private static Fly lambdaImpl$create$67(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var5 = EnumModuleType.MOVEMENT; + String var7 = "Fly"; + String var8 = var7; + EnumModuleType var9 = var5; + ModuleManager var10 = var4; + return new Fly(var10, var9, var8); + } + + private static SafeWalk lambdaImpl$create$94(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var7 = EnumModuleType.PLAYER; + String var8 = "SafeWalk"; + String var9 = "Safe Walk"; + String var10 = var9; + String var11 = var8; + EnumModuleType var12 = var7; + return new SafeWalk(var3, var12, var11, var10); + } + + private static AntiAlts lambdaImpl$create$70(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var6 = EnumModuleType.MISC; + String var7 = "AntiAtlas"; + String var9 = "Anti Atlas"; + String var10 = var9; + String var11 = var7; + EnumModuleType var12 = var6; + return new AntiAlts(var3, var12, var11, var10); + } + + private static Projectiles lambdaImpl$create$85(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var7 = EnumModuleType.VISUALS; + String var8 = "Projectiles"; + String var9 = var8; + EnumModuleType var10 = var7; + ModuleManager var11 = var4; + return new Projectiles(var11, var10, var9); + } + + private static PlayerESP lambdaImpl$create$56(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var5 = EnumModuleType.VISUALS; + String var6 = "PlayerESP"; + String var9 = "Player ESP"; + String var10 = var9; + String var11 = var6; + EnumModuleType var12 = var5; + return new PlayerESP(var3, var12, var11, var10); + } + + private static Camera lambdaImpl$create$63(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var5 = EnumModuleType.VISUALS; + String var7 = "Camera"; + String var9 = var7; + EnumModuleType var10 = var5; + return new Camera(var3, var10, var9); + } + + private static ChestStealer lambdaImpl$create$32(ModuleManager moduleManager) { + ModuleManager var5 = moduleManager; + EnumModuleType var7 = EnumModuleType.PLAYER; + String var8 = "ChestStealer"; + String var9 = "Chest Stealer"; + String var10 = var9; + String var11 = var8; + EnumModuleType var12 = var7; + ModuleManager var13 = var5; + return new ChestStealer(var13, var12, var11, var10); + } + + public Initializer() { + this.f = new ItemStack(Items.diamond_sword); + this.m = "youGay"; + this.k = new boolean[]{true, false}; + String $initA = "game.player.hurt.fall.small"; + this.b = "youGay.chmo"; + this.n = 69; + } + + private static AntiBot lambdaImpl$create$13(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var5 = EnumModuleType.COMBAT; + String var7 = "AntiBot"; + String var8 = "Anti Bot"; + String var10 = var8; + String var11 = var7; + EnumModuleType var12 = var5; + return new AntiBot(var3, var12, var11, var10); + } + + private static AutoHypixel lambdaImpl$create$36(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.MISC; + String var6 = "AutoHypixel"; + String var8 = "Auto Hypixel"; + String var9 = var8; + String var10 = var6; + return new AutoHypixel(var3, var4, var10, var9); + } + + private static NoFall lambdaImpl$create$30(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var5 = EnumModuleType.EXPLOITS; + String var6 = "NoFall"; + String var8 = "No Fall"; + String var10 = var8; + String var11 = var6; + EnumModuleType var12 = var5; + ModuleManager var13 = var4; + return new NoFall(var13, var12, var11, var10); + } + + private static AutoPot lambdaImpl$create$15(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.COMBAT; + String var7 = "AutoPotion"; + String var8 = "Auto Potion"; + String var10 = var8; + String var11 = var7; + return new AutoPot(var3, var4, var11, var10); + } + + public void b(String text) { + try { + String textStr = ""; + ProtectionSession.i = ""; + ProtectionSession.p = false; + ProtectionSession.J = true; + ProtectionSession.e = "stfu nigger"; + Novoline.getInstance().getProtectionSession().n = 1488.0; + Novoline.getInstance().getProtectionSession().K = false; + Novoline.getInstance().getProtectionSession().l = false; + ProtectionSession.q.clear(); + Novoline.getInstance().getProtectionSession().R = "there's nothing, what else would you expect?"; + ProtectionSession.I = "STOP DA DEBUG"; + RenderGlobal.stateFlag = true; + WorldClient.stateFlag = true; + this.b = "novoline.lol"; + this.n = 8189; + Field[] fieldArr = ClientBootstrapUtil.class.getDeclaredFields(); + int intVal = fieldArr.length; + Novoline novolineInst = Novoline.getInstance(); + ModuleManager modManager = new ModuleManager(novolineInst, 11); + novolineInst.applyUpdate(modManager); + int intVal2 = Integer.parseInt(ProtectionSession.c); + this.i = intVal2 == 1 || intVal2 == 2 || intVal2 == 4 || intVal2 == 5; + novolineInst.applyUpdate(this.i); + this.g = invokedynamic$b$0(this); + this.r = invokedynamic$b$1(this); + this.j = invokedynamic$b$2(this); + this.p = invokedynamic$b$3(this); + this.o = invokedynamic$b$4(this); + this.h = invokedynamic$b$5(this); + this.d = invokedynamic$b$6(this); + this.m = "OmCWLmtf5"; + this.e = new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + this.q = new double[]{0.42F, 0.54, 0.13, 1.8, 0.028, 0.084, 1.004, 1.18, 0.333125}; + this.k = new boolean[]{false, true}; + Item[] itemArr = new Item[]{Items.stick, Items.book, Items.clock, Items.compass, Items.flint_and_steel, Items.snowball}; + ThreadLocalRandom threadLocalRandom = ThreadLocalRandom.current(); + int intVal3 = threadLocalRandom.nextInt(0, 6); + this.f = new ItemStack(itemArr[intVal3]); + this.c = Minecraft.getMinecraft(); + novolineInst.applyUpdate(new ServerCommandTracker(this.c)); + this.registerModule("sprint", invokedynamic$b$7()); + this.registerModule("hud", invokedynamic$b$8()); + this.registerModule("click_gui", invokedynamic$b$9()); + this.registerModule("session", invokedynamic$b$10()); + this.registerModule("radar", invokedynamic$b$11()); + this.registerModule("scoreboard", invokedynamic$b$12()); + this.registerModule("anti_bot", invokedynamic$b$13()); + this.registerModule("speed_mine", invokedynamic$b$14()); + this.registerModule("auto_pot", invokedynamic$b$15()); + this.registerModule("kill_aura", invokedynamic$b$16()); + this.registerModule("killsults", invokedynamic$b$17()); + this.registerModule("target-hud", invokedynamic$b$18()); + this.registerModule("criticals", invokedynamic$b$19()); + this.registerModule("reach", invokedynamic$b$20()); + this.registerModule("step", invokedynamic$b$21()); + this.registerModule("water-walk", invokedynamic$b$22()); + this.registerModule("no_slow", invokedynamic$b$23()); + this.registerModule("speed", invokedynamic$b$24()); + this.registerModule("velocity", invokedynamic$b$25()); + this.registerModule("glow", invokedynamic$b$26()); + this.registerModule("chams", invokedynamic$b$27()); + this.registerModule("chest_esp", invokedynamic$b$28()); + this.registerModule("nametags", invokedynamic$b$29()); + this.registerModule("no_fall", invokedynamic$b$30()); + this.registerModule("xray", invokedynamic$b$31()); + this.registerModule("chest_stealer", invokedynamic$b$32()); + this.registerModule("auto_armor", invokedynamic$b$33()); + this.registerModule("inv_manager", invokedynamic$b$34()); + this.registerModule("scaffold", invokedynamic$b$35()); + this.registerModule("auto-hypixel", invokedynamic$b$36()); + this.registerModule("gui_move", invokedynamic$b$37()); + this.registerModule("phase", invokedynamic$b$38()); + this.registerModule("auto_tool", invokedynamic$b$39()); + this.registerModule("animations", invokedynamic$b$40()); + this.registerModule("glint-colorize", invokedynamic$b$41()); + this.registerModule("middle-click", invokedynamic$b$42()); + this.registerModule("dmg-particles", invokedynamic$b$43()); + this.registerModule("tracers", invokedynamic$b$44()); + this.registerModule("respawn", invokedynamic$b$45()); + this.registerModule("blink", invokedynamic$b$46()); + this.registerModule("no_effects", invokedynamic$b$47()); + this.registerModule("brightness", invokedynamic$b$48()); + this.registerModule("item_physic", invokedynamic$b$49()); + this.registerModule("item_esp", invokedynamic$b$50()); + this.registerModule("auto_clicker", invokedynamic$b$51()); + this.registerModule("aim_assist", invokedynamic$b$52()); + this.registerModule("fast_place", invokedynamic$b$53()); + this.registerModule("players_finder", invokedynamic$b$54()); + this.registerModule("world_time", invokedynamic$b$55()); + this.registerModule("player_esp", invokedynamic$b$56()); + this.registerModule("hit_box", invokedynamic$b$57()); + this.registerModule("waypoints", invokedynamic$b$58()); + this.registerModule("antiobbytrap", invokedynamic$b$59()); + this.registerModule("freecam", invokedynamic$b$60()); + this.registerModule("tab-gui", invokedynamic$b$61()); + this.registerModule("lightning-trecker", invokedynamic$b$62()); + this.registerModule("camera", invokedynamic$b$63()); + this.registerModule("fast-sneak", invokedynamic$b$64()); + this.registerModule("arrows", invokedynamic$b$65()); + this.registerModule("bed-breaker", invokedynamic$b$66()); + this.registerModule("fly", invokedynamic$b$67()); + this.registerModule("anti_void", invokedynamic$b$68()); + this.registerModule("long-jump", invokedynamic$b$69()); + this.registerModule("anti-alts", invokedynamic$b$70()); + this.registerModule("blocks-overlay", invokedynamic$b$71()); + this.registerModule("game-speed", invokedynamic$b$72()); + this.registerModule("no-rotate", invokedynamic$b$73()); + this.registerModule("no-title", invokedynamic$b$74()); + this.registerModule("click-teleport", invokedynamic$b$75()); + this.registerModule("jump-circle", invokedynamic$b$76()); + this.registerModule("custom-hit-glint", invokedynamic$b$77()); + this.registerModule("staff-analyzer", invokedynamic$b$78()); + this.registerModule("trail", invokedynamic$b$79()); + this.registerModule("disabler", invokedynamic$b$80()); + this.registerModule("auto-head", invokedynamic$b$81()); + this.registerModule("wings", invokedynamic$b$82()); + this.registerModule("mobends", invokedynamic$b$83()); + this.registerModule("optimizations", invokedynamic$b$84()); + this.registerModule("projectiles", invokedynamic$b$85()); + this.registerModule("sims-esp", invokedynamic$b$86()); + this.registerModule("breadcrumbs", invokedynamic$b$87()); + this.registerModule("h-clip", invokedynamic$b$88()); + this.registerModule("chat-futures", invokedynamic$b$89()); + this.registerModule("target-strafe", invokedynamic$b$90()); + this.registerModule("reset-vl", invokedynamic$b$91()); + this.registerModule("no-jump-delay", invokedynamic$b$92()); + this.registerModule("auto-gapple", invokedynamic$b$93()); + this.registerModule("safe-walk", invokedynamic$b$94()); + this.registerModule("hypixel-stats", invokedynamic$b$95()); + this.registerModule("crosshair", invokedynamic$b$96()); + this.registerModule("uhc-crafts", invokedynamic$b$97()); + this.registerModule("fireball", invokedynamic$b$98()); + this.registerModule("anti-fireball", invokedynamic$b$99()); + if (this.i) { + this.registerModule("auto-jump", invokedynamic$b$100()); + this.registerModule("debug", invokedynamic$b$101()); + } + + try { + EnumModuleType[] modCategoryArr = new EnumModuleType[]{ + EnumModuleType.EXPLOITS, EnumModuleType.PLAYER, EnumModuleType.MISC, EnumModuleType.MOVEMENT, EnumModuleType.VISUALS, EnumModuleType.COMBAT + }; + + for (EnumModuleType modCategory : modCategoryArr) { + for (Object val : novolineInst.getModuleManager().getByCategory(modCategory)) { + AbstractModule mod = (AbstractModule)val; + String textStr2 = mod.getName() == null ? "" : mod.getName().toLowerCase().replace("_", "").replace(" ", ""); + String textStr3 = mod.getDescription() == null ? "" : mod.getDescription().toLowerCase().replace("_", "").replace(" ", ""); + if (textStr2.equals("hud") || textStr3.equals("hud")) { + mod.setEnabled(true); + } + + if (textStr2.equals("clickgui") || textStr3.equals("clickgui")) { + mod.handleModuleKeybind(KeyboardKeybind.of(54)); + } + } + } + } catch (Throwable ex) { + } + + novolineInst.applyUpdate(new PlayerManager(novolineInst, "players.novo")); + novolineInst.applyUpdate(new TaskManager()); + novolineInst.applyUpdate(new NotificationManager()); + novolineInst.applyUpdate(new ScriptManager(novolineInst)); + novolineInst.applyUpdate(new NovoCommandHandler(novolineInst)); + novolineInst.getCommandHandler().registerCommand(new TargetCommand(novolineInst, "target", Arrays.asList("tar", "target"))); + novolineInst.getCommandHandler().registerCommand(new BindCommand(novolineInst, "bind", "Binds key for module", Arrays.asList("b", "binding", "binds", "keybind", "setbind"))); + novolineInst.getCommandHandler().registerCommand(new ConfigCommand(novolineInst, "config", "Manages configs stuff", Arrays.asList("cfg", "conf", "configs", "configure", "configuration"))); + novolineInst.getCommandHandler().registerCommand(new FriendCommand(novolineInst, "f", "Adds a friend", "friend")); + novolineInst.getCommandHandler().registerCommand(new NameHistoryCommand(novolineInst, "name", "names")); + novolineInst.getCommandHandler().registerCommand(new ToggleCommand(novolineInst, "t", "Toggles module", "toggle")); + novolineInst.getCommandHandler().registerCommand(new VClipCommand(novolineInst, "vc", "vclip")); + novolineInst.getCommandHandler().registerCommand(new WaypointCommand(novolineInst, "waypoint", "Manages waypoints", Arrays.asList("waypoints", "wp"))); + novolineInst.getCommandHandler().registerCommand(new PanicCommand(novolineInst, "p", "Disable modules", "panic")); + novolineInst.getCommandHandler().registerCommand(new HideCommand(novolineInst, "Hide", "Hides modules from arraylist", Arrays.asList("hide", "h"))); + novolineInst.getCommandHandler().registerCommand(new IrcChatCommand(novolineInst, "chat", "Sends a message to the public chat", Arrays.asList("c", "chat"))); + novolineInst.getCommandHandler().registerCommand(new DirectMessageCommand(novolineInst, "message", "Directly message an online user", Arrays.asList("dm", "msg", "m"))); + novolineInst.getCommandHandler().registerCommand(new RenameCommand(novolineInst, "rename", "Renames the given module", Arrays.asList("modulerename", "modulerename"))); + novolineInst.getCommandHandler().registerCommand(new ConfigAliasCommand(novolineInst, "killsults", Arrays.asList("ks", "sults"))); + novolineInst.getCommandHandler().registerCommand(new PitBountyCommand(novolineInst, "FindBounty", "Finds the bounty", Arrays.asList("fb", "findbounty"))); + novolineInst.getCommandHandler().registerCommand(new FontCommand(novolineInst, "font")); + novolineInst.getCommandHandler().registerCommand(new IgnCommand(novolineInst, "ign")); + novolineInst.getCommandHandler().registerCommand(new KickCommand(novolineInst, "kick", "kicks a user", "kick")); + novolineInst.getCommandHandler().registerCommand(new SayCommand(novolineInst, "displaytitle", "XD", "dt")); + novolineInst.getCommandHandler().registerCommand(new SpectateCommand(novolineInst, "SpectateCommand", "Spectate an entity", Arrays.asList("spec", "spectate"))); + novolineInst.getCommandHandler().registerCommand(new ScriptCommand(novolineInst, "Script", "Script command", Arrays.asList("s", "script"))); + novolineInst.getCommandHandler().registerCommand(new KillsultsCommand(novolineInst, "online", Arrays.asList("online", "onlinelist"))); + novolineInst.getCommandHandler().registerCommand(new ReportCommand(novolineInst, "report", Arrays.asList("wdr", "report"))); + novolineInst.getCommandHandler().registerCommand(new TeleportCommand(novolineInst, "teleport", "Hypixel UHC Teleport", "tp")); + novolineInst.getCommandHandler().registerCommand(new HelpCommand(novolineInst, "claim")); + novolineInst.getCommandHandler().registerCommand(new AutoRegisterCommand(novolineInst, "register", Arrays.asList("r", "reg"))); + TargetHUD targetHud = ModuleRegistry.TARGETHUD.getModule(); + KillAura killAura = ModuleRegistry.KILLAURA.getModule(); + targetHud.handleKillAura(killAura); + EventManager.register(novolineInst.getModuleManager().getByClass(ClickGui.class)); + EventManager.register(novolineInst.getServerCommandTracker()); + ViaSupportUtil.getInstance().performAction(); + novolineInst.getModuleManager().getBindManager().performAction(); + ConfigManager cfgManager = novolineInst.getModuleManager().getConfigManager(); + Path filePath = cfgManager.getConfigPath("default"); + String textStr4 = novolineInst.getDataFolderString(); + Path filePath2 = Paths.get(textStr4 + "scripts"); + ModuleArrayMap moduleArrayMap = novolineInst.getModuleManager().getModules(); + + for (ModuleHolder modHolder : moduleArrayMap.values()) { + AbstractModule mod2 = modHolder.getModule(); + KeyBindProperty keyBindProp = mod2.getKeyBindProperty(); + ModuleKeybind keybind2 = keyBindProp.get(); + keybind2.getKey(); + mod2.getIntValue25(); + } + + if (!Files.exists(filePath2)) { + Files.createDirectory(filePath2); + } + + boolean flag = novolineInst.getModuleManager().getBindManager().isReadyState(); + boolean flag2 = Files.exists(filePath); + if (flag2) { + cfgManager.a(filePath, false); + } + + this.c.ingameGUI.applyFramebufferBlurShader(new FramebufferBlurShader()); + URI uRI = URI.create("ws://novoline.lol:2095"); + NovolineWebSocket novolineWebSocket = new NovolineWebSocket(uRI); + Consumer consumer = invokedynamic$b$102(novolineInst, textStr); + novolineWebSocket = novolineWebSocket.applyUpdate(consumer); + novolineInst.applyUpdate(novolineWebSocket); + novolineInst.getWebSocket().connect(); + Display.setTitle("Novoline " + novolineInst.getVersion() + "\u0000\n"); + System.setProperty("java.net.preferIPv4Stack", "true"); + novolineInst.applyUpdate(new ClickGUI(novolineInst)); + novolineInst.applyUpdate(new AltRepositoryGUI(novolineInst)); + novolineInst.applyUpdate(new DiscordGUI(novolineInst)); + this.a(); + } catch (Throwable ex2) { + ex2.printStackTrace(); + } + } + + private void a(@NotNull String text, @NotNull ModuleFactory moduleFactory) { + Novoline novolineInst = Novoline.getInstance(); + ModuleManager modManager = novolineInst.getModuleManager(); + modManager.register(text, moduleFactory, true); + } + + private static LightningTracker lambdaImpl$create$62(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var6 = EnumModuleType.MISC; + String var7 = "LightningTracker"; + String var8 = "Lightning Tracker"; + String var10 = var8; + String var11 = var7; + EnumModuleType var12 = var6; + ModuleManager var13 = var4; + return new LightningTracker(var13, var12, var11, var10); + } + + private static MoreBends lambdaImpl$create$83(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.VISUALS; + String var5 = "MoreBends"; + String var6 = "More Bends"; + return new MoreBends(var3, var4, var5, var6); + } + + private static Chams lambdaImpl$create$27(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var5 = EnumModuleType.VISUALS; + String var6 = "Chams"; + String var9 = var6; + EnumModuleType var10 = var5; + return new Chams(var3, var10, var9); + } + + private static Scoreboard lambdaImpl$create$12(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var5 = EnumModuleType.VISUALS; + String var6 = "Scoreboard"; + String var9 = var6; + EnumModuleType var10 = var5; + ModuleManager var11 = var4; + return new Scoreboard(var11, var10, var9); + } + + private static MiddleClick lambdaImpl$create$42(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var5 = EnumModuleType.MISC; + String var6 = "MiddleClick"; + String var7 = "Middle Click"; + String var10 = var7; + String var11 = var6; + EnumModuleType var12 = var5; + return new MiddleClick(var3, var12, var11, var10); + } + + private static Fireball lambdaImpl$create$98(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.EXPLOITS; + String var5 = "Fireball"; + return new Fireball(var3, var4, var5); + } + + private static NoTitle lambdaImpl$create$74(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var5 = EnumModuleType.VISUALS; + String var6 = "CustomTitle"; + String var7 = "Custom Title"; + String var10 = var7; + String var11 = var6; + EnumModuleType var12 = var5; + ModuleManager var13 = var4; + return new NoTitle(var13, var12, var11, var10); + } + + private static AutoGApple lambdaImpl$create$93(ModuleManager moduleManager) { + ModuleManager var5 = moduleManager; + EnumModuleType var6 = EnumModuleType.COMBAT; + String var7 = "AutoGapple"; + String var8 = "Auto Gapple"; + String var9 = var8; + String var10 = var7; + EnumModuleType var11 = var6; + ModuleManager var12 = var5; + return new AutoGApple(var12, var11, var10, var9); + } + + private static LongJump lambdaImpl$create$69(ModuleManager moduleManager) { + ModuleManager var5 = moduleManager; + EnumModuleType var6 = EnumModuleType.MOVEMENT; + String var8 = "LongJump"; + String var9 = "Long Jump"; + String var10 = var9; + String var11 = var8; + EnumModuleType var12 = var6; + ModuleManager var13 = var5; + return new LongJump(var13, var12, var11, var10); + } + + private static BedBreaker lambdaImpl$create$66(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var7 = EnumModuleType.PLAYER; + String var8 = "BedBreaker"; + String var9 = "Bed Breaker"; + String var10 = var9; + String var11 = var8; + EnumModuleType var12 = var7; + ModuleManager var13 = var4; + return new BedBreaker(var13, var12, var11, var10); + } + + private static CustomHitGlint lambdaImpl$create$77(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var6 = EnumModuleType.VISUALS; + String var8 = "CustomHitGlint"; + String var9 = "Custom Hit Glint"; + String var10 = var9; + String var11 = var8; + EnumModuleType var12 = var6; + return new CustomHitGlint(var3, var12, var11, var10); + } + + private static Waypoints lambdaImpl$create$58(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.VISUALS; + String var5 = "Waypoints"; + String var6 = ""; + String var7 = "waypoints"; + return new Waypoints(var3, var4, var5, var6, var7); + } + + private static Criticals lambdaImpl$create$19(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.COMBAT; + String var5 = "Criticals"; + return new Criticals(var3, var4, var5); + } + + public void a() { + Minecraft mcClient = this.c; + GuiMainMenu guiMainMenu = new GuiMainMenu(); + mcClient.displayGuiScreen(guiMainMenu); + } + + private static Speed lambdaImpl$create$24(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var6 = EnumModuleType.MOVEMENT; + String var7 = "Speed"; + String var9 = var7; + EnumModuleType var10 = var6; + return new Speed(var3, var10, var9); + } + + private static Atomsphere lambdaImpl$create$55(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var6 = EnumModuleType.VISUALS; + String var7 = "Atmosphere"; + String var9 = var7; + EnumModuleType var10 = var6; + return new Atomsphere(var3, var10, var9); + } + + private static Optimization lambdaImpl$create$84(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var7 = EnumModuleType.MISC; + String var8 = "Optimizations"; + String var9 = var8; + EnumModuleType var10 = var7; + return new Optimization(var3, var10, var9); + } + + private static Disabler lambdaImpl$create$80(ModuleManager moduleManager) { + ModuleManager var5 = moduleManager; + EnumModuleType var7 = EnumModuleType.EXPLOITS; + String var8 = "Disabler"; + String var9 = var8; + EnumModuleType var10 = var7; + ModuleManager var11 = var5; + return new Disabler(var11, var10, var9); + } + + private static XRay lambdaImpl$create$31(ModuleManager moduleManager) { + long var1 = s; + ModuleManager var3 = moduleManager; + char var4 = (char)((var1 >>> 48 ^ 0L) & 65535L); + EnumModuleType var5 = EnumModuleType.VISUALS; + String var7 = "XRay"; + String var9 = var7; + return new XRay(var3, var4, var5, var9); + } + + private static Nametags lambdaImpl$create$29(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.VISUALS; + String var7 = "Nametags"; + String var8 = var7; + return new Nametags(var3, var4, var8); + } + + private static FastSneak lambdaImpl$create$64(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.MOVEMENT; + String var5 = "FastSneak"; + String var6 = "Fast Sneak"; + return new FastSneak(var3, var4, var5, var6); + } + + + + private static StaffAnalyzer lambdaImpl$create$78(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.MISC; + String var7 = "StaffAnalyzer"; + String var8 = "Staff Analyzer"; + String var10 = var8; + String var11 = var7; + return new StaffAnalyzer(var3, var4, var11, var10); + } + + private void lambdaImpl$create$6() { + NetHandlerPlayClient var1 = this.c.getNetHandler(); + EntityPlayerSP var2 = this.c.thePlayer; + BlockPos var3 = var2.getPosition(); + BlockPos var4 = var3.down(); + EnumFacing var5 = EnumFacing.UP; + int var6 = var5.getIndex(); + Block var7 = Blocks.stone; + Item var8 = Item.getItemFromBlock(var7); + ItemStack var9 = new ItemStack(var8); + float var10 = (float)Math.random(); + float var11 = (float)Math.random(); + C08PacketPlayerBlockPlacement var12 = new C08PacketPlayerBlockPlacement(var4, var6, var9, var10, 1.0F, var11); + var1.addToSendQueue(var12); + } + + private static InvManager lambdaImpl$create$34(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.PLAYER; + String var6 = "InventoryManager"; + String var8 = "Inventory Manager"; + String var10 = var8; + String var11 = var6; + return new InvManager(var3, var4, var11, var10); + } + + public String decryptMetadataKey(String key) { + if (key == null || key.indexOf('-') >= 0 || key.length() < 24 || (key.length() & 3) != 0) { + return key; + } + try { + return AesCbcCipher.b(key, "{vj}PpLfn/ZM&+2+", "7Y<+k69=@4sw?{]I"); + } catch (Exception ex) { + return key; + } + } + + private static Arrows lambdaImpl$create$65(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var5 = EnumModuleType.VISUALS; + String var6 = "Arrows"; + String var9 = var6; + EnumModuleType var10 = var5; + return new Arrows(var3, var10, var9); + } + + private void lambdaImpl$create$1() { + int[] var1 = Novoline.C(); + boolean var2 = ServerUtils.isHypixel(); + if (var1 != null || var2) { + int var3 = var2 ? 1 : 0; + EntityPlayerSP var4 = this.c.thePlayer; + InventoryPlayer var5 = var4.inventory; + var3 = var5.currentItem; + + int var8 = var3 < 8 ? var3 + 1 : var3 - 1; + NetHandlerPlayClient var10 = this.c.getNetHandler(); + C09PacketHeldItemChange var6 = new C09PacketHeldItemChange(var8); + var10.addToSendQueue(var6); + return; + } + + NetHandlerPlayClient var7 = this.c.getNetHandler(); + C07PacketPlayerDigging$Action var9 = C07PacketPlayerDigging$Action.RELEASE_USE_ITEM; + C07PacketPlayerDigging var11 = new C07PacketPlayerDigging(var9); + var7.addToSendQueue(var11); + } + + private static Velocity lambdaImpl$create$25(ModuleManager moduleManager) { + ModuleManager var6 = moduleManager; + EnumModuleType var7 = EnumModuleType.COMBAT; + String var8 = "Velocity"; + String var9 = var8; + EnumModuleType var10 = var7; + ModuleManager var11 = var6; + return new Velocity(var11, var10, var9); + } + + private static Animations lambdaImpl$create$40(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var6 = EnumModuleType.VISUALS; + String var8 = "Animations"; + String var9 = var8; + EnumModuleType var10 = var6; + return new Animations(var3, var10, var9); + } + + private static ClickTeleport lambdaImpl$create$75(ModuleManager moduleManager) { + ModuleManager var5 = moduleManager; + EnumModuleType var6 = EnumModuleType.EXPLOITS; + String var8 = "ClickTeleport"; + String var9 = "Click Teleport"; + String var10 = var9; + String var11 = var8; + EnumModuleType var12 = var6; + ModuleManager var13 = var5; + return new ClickTeleport(var13, var12, var11, var10); + } + + private static Glow lambdaImpl$create$26(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.VISUALS; + String var7 = "Glow"; + String var8 = var7; + return new Glow(var3, var4, var8); + } + + private static WaterWalk lambdaImpl$create$22(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.MOVEMENT; + String var6 = "WaterWalk"; + String var7 = "Water Walk"; + String var10 = var7; + String var11 = var6; + return new WaterWalk(var3, var4, var11, var10); + } + + private static Blink lambdaImpl$create$46(ModuleManager moduleManager) { + ModuleManager var5 = moduleManager; + EnumModuleType var7 = EnumModuleType.EXPLOITS; + String var8 = "Blink"; + String var9 = var8; + EnumModuleType var10 = var7; + ModuleManager var11 = var5; + return new Blink(var11, var10, var9); + } + + private static TargetHUD lambdaImpl$create$18(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var5 = EnumModuleType.COMBAT; + String var8 = "TargetHUD"; + String var9 = "Target HUD"; + String var10 = var9; + String var11 = var8; + EnumModuleType var12 = var5; + ModuleManager var13 = var4; + return new TargetHUD(var13, var12, var11, var10); + } + + private static AutoHead lambdaImpl$create$81(ModuleManager moduleManager) { + ModuleManager var5 = moduleManager; + EnumModuleType var6 = EnumModuleType.COMBAT; + String var7 = "AutoHead"; + String var8 = "Auto Head"; + String var10 = var8; + String var11 = var7; + EnumModuleType var12 = var6; + ModuleManager var13 = var5; + return new AutoHead(var13, var12, var11, var10); + } + + private static AutoArmor lambdaImpl$create$33(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var5 = EnumModuleType.PLAYER; + String var8 = "AutoArmor"; + String var9 = "Auto Armor"; + String var10 = var9; + String var11 = var8; + EnumModuleType var12 = var5; + ModuleManager var13 = var4; + return new AutoArmor(var13, var12, var11, var10); + } + + private static AutoJump lambdaImpl$create$100(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.MOVEMENT; + String var5 = "AutoJump"; + String var6 = "Auto Jump"; + return new AutoJump(var3, var4, var5, var6); + } + + private static GameSpeed lambdaImpl$create$72(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var5 = EnumModuleType.PLAYER; + String var6 = "GameSpeed"; + String var9 = "Game Speed"; + String var10 = var9; + String var11 = var6; + EnumModuleType var12 = var5; + ModuleManager var13 = var4; + return new GameSpeed(var13, var12, var11, var10); + } + + private static NoRotate lambdaImpl$create$73(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.MISC; + String var5 = "NoRotate"; + String var6 = "No Rotate"; + return new NoRotate(var3, var4, var5, var6); + } + + private static FastPlace lambdaImpl$create$53(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var5 = EnumModuleType.MISC; + String var8 = "FastPlace"; + String var9 = "Fast Place"; + String var10 = var9; + String var11 = var8; + EnumModuleType var12 = var5; + ModuleManager var13 = var4; + return new FastPlace(var13, var12, var11, var10); + } + + private static Killsults lambdaImpl$create$17(ModuleManager moduleManager) { + ModuleManager var5 = moduleManager; + EnumModuleType var6 = EnumModuleType.COMBAT; + String var7 = "Killsults"; + String var9 = var7; + EnumModuleType var10 = var6; + ModuleManager var11 = var5; + return new Killsults(var11, var10, var9); + } + + private static Tracers lambdaImpl$create$44(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var5 = EnumModuleType.VISUALS; + String var8 = "Tracers"; + String var9 = var8; + EnumModuleType var10 = var5; + ModuleManager var11 = var4; + return new Tracers(var11, var10, var9); + } + + private static TargetStrafe lambdaImpl$create$90(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.COMBAT; + String var5 = "TargetStrafe"; + String var6 = "Target Strafe"; + return new TargetStrafe(var3, var4, var5, var6); + } + + private static ResetVL lambdaImpl$create$91(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.MISC; + String var8 = "ResetVL"; + String var9 = "Reset VL"; + String var10 = var9; + String var11 = var8; + return new ResetVL(var3, var4, var11, var10); + } + + private static Radar lambdaImpl$create$11(ModuleManager moduleManager) { + ModuleManager var6 = moduleManager; + EnumModuleType var7 = EnumModuleType.VISUALS; + String var8 = "Radar"; + String var9 = var8; + EnumModuleType var10 = var7; + ModuleManager var11 = var6; + return new Radar(var11, var10, var9); + } + + private void lambdaImpl$create$4() { + EntityPlayerSP var1 = this.c.thePlayer; + InventoryPlayer var2 = var1.inventory; + int var3 = var2.currentItem; + Container var4 = this.c.thePlayer.inventoryContainer; + NetHandlerPlayClient var5 = this.c.getNetHandler(); + ItemStack var6 = this.c.thePlayer.getHeldItem(); + short var7 = var4.executeStep(); + C0EPacketClickWindow var8 = new C0EPacketClickWindow(0, var3 + 36, 0, 0, var6, var7); + var5.addToSendQueue(var8); + short var9 = var4.executeStep(); + C0EPacketClickWindow var10 = new C0EPacketClickWindow(0, var3 + 36, 0, 0, null, var9); + var5.addToSendQueue(var10); + ModuleRegistry var11 = ModuleRegistry.DISABLER; + AbstractModule var12 = var11.getModule(); + Disabler var13 = (Disabler)var12; + var13.performStep12(); + } + + private static HUD lambdaImpl$create$8(ModuleManager moduleManager) { + long var1 = s; + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.VISUALS; + long var5 = var1 ^ 97692072273654L; + String var7 = "HUD"; + return new HUD(var3, var4, var5, var7); + } + + private static AutoClicker lambdaImpl$create$51(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var6 = EnumModuleType.COMBAT; + String var7 = "AutoClicker"; + String var9 = "Auto Clicker"; + String var10 = var9; + String var11 = var7; + EnumModuleType var12 = var6; + ModuleManager var13 = var4; + return new AutoClicker(var13, var12, var11, var10); + } + + private static Trail lambdaImpl$create$79(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var5 = EnumModuleType.VISUALS; + String var7 = "Trail"; + String var9 = var7; + EnumModuleType var10 = var5; + return new Trail(var3, var10, var9); + } + + private static BlockOutline lambdaImpl$create$71(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var5 = EnumModuleType.VISUALS; + String var7 = "BlockOutline"; + String var9 = "Block Outline"; + String var10 = var9; + String var11 = var7; + EnumModuleType var12 = var5; + ModuleManager var13 = var4; + return new BlockOutline(var13, var12, var11, var10); + } + + private static BreadCrumbs lambdaImpl$create$87(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var7 = EnumModuleType.VISUALS; + String var8 = "Breadcrumbs"; + String var9 = var8; + EnumModuleType var10 = var7; + return new BreadCrumbs(var3, var10, var9); + } + + private static Brightness lambdaImpl$create$48(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var5 = EnumModuleType.VISUALS; + String var6 = "Brightness"; + String var9 = var6; + EnumModuleType var10 = var5; + ModuleManager var11 = var4; + return new Brightness(var11, var10, var9); + } + + private static KillAura lambdaImpl$create$16(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var6 = EnumModuleType.COMBAT; + String var7 = "KillAura"; + String var9 = var7; + EnumModuleType var10 = var6; + return new KillAura(var3, var10, var9); + } + + private static Phase lambdaImpl$create$38(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var5 = EnumModuleType.EXPLOITS; + String var8 = "Phase"; + String var9 = var8; + EnumModuleType var10 = var5; + return new Phase(var3, var10, var9); + } + + private static NoEffects lambdaImpl$create$47(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var7 = EnumModuleType.MISC; + String var8 = "NoEffects"; + String var9 = "No Effects"; + String var10 = var9; + String var11 = var8; + EnumModuleType var12 = var7; + return new NoEffects(var3, var12, var11, var10); + } + + private static ItemESP lambdaImpl$create$50(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.VISUALS; + String var6 = "ItemESP"; + String var7 = "Item ESP"; + String var10 = var7; + String var11 = var6; + return new ItemESP(var3, var4, var11, var10); + } + + private static HypixelStats lambdaImpl$create$95(ModuleManager moduleManager) { + ModuleManager var5 = moduleManager; + EnumModuleType var6 = EnumModuleType.VISUALS; + String var7 = "HypixelStats"; + String var8 = "Hypixel Stats"; + String var10 = var8; + String var11 = var7; + EnumModuleType var12 = var6; + ModuleManager var13 = var5; + return new HypixelStats(var13, var12, var11, var10); + } + + private static AntiVoid lambdaImpl$create$68(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var5 = EnumModuleType.PLAYER; + String var8 = "AntiVoid"; + String var9 = "Anti Void"; + String var10 = var9; + String var11 = var8; + EnumModuleType var12 = var5; + ModuleManager var13 = var4; + return new AntiVoid(var13, var12, var11, var10); + } + + public boolean c() { + int[] intArr = Novoline.C(); + int intVal4 = Integer.parseInt(ProtectionSession.c); + return intArr != null ? (intVal4 & 0xFF) != 0 : intVal4 == 1 || intVal4 == 2 || intVal4 == 4 || intVal4 == 5; + } + + private void a(Object... objectArray) { + SoundAlertHelper.createTextMessage(objectArray); + } + + private void lambdaImpl$create$2() { + int[] var1 = Novoline.C(); + if (var1 == null && ServerUtils.isHypixel()) { + NetHandlerPlayClient var7 = this.c.getNetHandler(); + EntityPlayerSP var8 = this.c.thePlayer; + InventoryPlayer var4 = var8.inventory; + int var5 = var4.currentItem; + C09PacketHeldItemChange var6 = new C09PacketHeldItemChange(var5); + var7.addToSendQueue(var6); + } else { + NetHandlerPlayClient var2 = this.c.getNetHandler(); + C0APacketAnimation var3 = new C0APacketAnimation(); + var2.addToSendQueue(var3); + } + } + + private static ItemPhysic lambdaImpl$create$49(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.VISUALS; + String var5 = "ItemPhysic"; + String var6 = "Item Physic"; + return new ItemPhysic(var3, var4, var5, var6); + } + + private static ChatFutures lambdaImpl$create$89(ModuleManager moduleManager) { + ModuleManager var5 = moduleManager; + EnumModuleType var6 = EnumModuleType.MISC; + String var7 = "ChatFeatures"; + String var9 = "Chat Features"; + String var10 = var9; + String var11 = var7; + EnumModuleType var12 = var6; + ModuleManager var13 = var5; + return new ChatFutures(var13, var12, var11, var10); + } + + public boolean b() { + return this.i; + } + + public static Initializer d() { + return InitializerHolder.resolveInitializer(InitializerHolder.INSTANCE); + } + + private static Freecam lambdaImpl$create$60(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.PLAYER; + String var7 = "Freecam"; + String var8 = var7; + return new Freecam(var3, var4, var8); + } + + private static NoSlowDown lambdaImpl$create$23(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var5 = EnumModuleType.MOVEMENT; + String var6 = "NoSlowDown"; + String var9 = "No Slow Down"; + String var10 = var9; + String var11 = var6; + EnumModuleType var12 = var5; + ModuleManager var13 = var4; + return new NoSlowDown(var13, var12, var11, var10); + } + + private static Sprint lambdaImpl$create$7(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var5 = EnumModuleType.MOVEMENT; + String var8 = "Sprint"; + String var9 = var8; + EnumModuleType var10 = var5; + return new Sprint(var3, var10, var9); + } + + private static SpeedMine lambdaImpl$create$14(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var5 = EnumModuleType.PLAYER; + String var6 = "SpeedMine"; + String var8 = "Speed Mine"; + String var10 = var8; + String var11 = var6; + EnumModuleType var12 = var5; + return new SpeedMine(var3, var12, var11, var10); + } + + private void lambdaImpl$create$3() { + this.r.run(); + this.j.run(); + } + + private static Notifier lambdaImpl$create$54(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var5 = EnumModuleType.MISC; + String var7 = "Notifier"; + String var9 = var7; + EnumModuleType var10 = var5; + ModuleManager var11 = var4; + return new Notifier(var11, var10, var9); + } + + private static void lambdaImpl$create$102(Novoline novoline, String text, Void param) { + NovolineWebSocket var3 = novoline.getWebSocket(); + TokenCloudPacket var4 = new TokenCloudPacket("LT:" + text); + var3.applyUpdate(var4); + } + + public String a(Object obj, String text) { + StringBuilder sb = new StringBuilder(); + String textStr5 = obj.toString(); + int intVal5 = text.length(); + int[] intArr2 = Novoline.C(); + + for (int intVal6 = 0; intVal6 < textStr5.length(); intVal6++) { + sb.append((char)(textStr5.charAt(intVal6) ^ text.charAt(intVal6 % intVal5))); + if (intArr2 != null) { + break; + } + } + + return sb.toString(); + } + + private void lambdaImpl$create$0() { + int[] var1 = Novoline.C(); + boolean var2 = ServerUtils.isHypixel(); + if (var1 != null || var2) { + int var3 = var2 ? 1 : 0; + EntityPlayerSP var4 = this.c.thePlayer; + var3 = var4.getInt(); + + EntityPlayerSP var10 = this.c.thePlayer; + Container var5 = var10.inventoryContainer; + short var6 = var5.executeStep(); + NetHandlerPlayClient var7 = this.c.getNetHandler(); + C0FPacketConfirmTransaction var8 = new C0FPacketConfirmTransaction(var3, var6, true); + var7.addToSendQueue(var8); + return; + } + + NetHandlerPlayClient var9 = this.c.getNetHandler(); + WorldClient var11 = this.c.theWorld; + EntityPig var12 = new EntityPig(var11); + net.minecraft.network.play.client.C02PacketUseEntity$Action var13 = net.minecraft.network.play.client.C02PacketUseEntity$Action.ATTACK; + C02PacketUseEntity var14 = new C02PacketUseEntity(var12, var13); + var9.addToSendQueue(var14); + } + + private static Respawn lambdaImpl$create$45(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.MISC; + String var5 = "Respawn"; + return new Respawn(var3, var4, var5); + } + + private static Reach lambdaImpl$create$20(ModuleManager moduleManager) { + ModuleManager var6 = moduleManager; + EnumModuleType var7 = EnumModuleType.COMBAT; + String var8 = "Reach"; + String var9 = var8; + EnumModuleType var10 = var7; + ModuleManager var11 = var6; + return new Reach(var11, var10, var9); + } + + private static UhcCrafts lambdaImpl$create$97(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.MISC; + String var8 = "UHCCrafts"; + String var9 = "UHC Crafts"; + String var10 = var9; + String var11 = var8; + return new UhcCrafts(var3, var4, var11, var10); + } + + private static GuiMove lambdaImpl$create$37(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.MISC; + String var7 = "GuiMove"; + String var8 = "Gui Move"; + String var10 = var8; + String var11 = var7; + return new GuiMove(var3, var4, var11, var10); + } + + private static ClickGui lambdaImpl$create$9(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.VISUALS; + String var5 = "ClickGUI"; + String var7 = "Click GUI"; + String var10 = var7; + return new ClickGui(var3, var4, var5, var10); + } + + private static AntiFireBall lambdaImpl$create$99(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.MISC; + String var5 = "AntiFireBall"; + String var6 = "Anti Fireball"; + return new AntiFireBall(var3, var4, var5, var6); + } + + private static AimAssist lambdaImpl$create$52(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var5 = EnumModuleType.COMBAT; + String var6 = "AimAssist"; + String var8 = "Aim Assist"; + String var10 = var8; + String var11 = var6; + EnumModuleType var12 = var5; + ModuleManager var13 = var4; + return new AimAssist(var13, var12, var11, var10); + } + + private static Glint lambdaImpl$create$41(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var5 = EnumModuleType.VISUALS; + String var6 = "GlintColorize"; + String var7 = "Glint Colorize"; + String var10 = var7; + String var11 = var6; + EnumModuleType var12 = var5; + return new Glint(var3, var12, var11, var10); + } + + private static HitBox lambdaImpl$create$57(ModuleManager moduleManager) { + ModuleManager var6 = moduleManager; + EnumModuleType var7 = EnumModuleType.COMBAT; + String var8 = "HitBox"; + String var9 = "Hit Box"; + String var10 = var9; + String var11 = var8; + EnumModuleType var12 = var7; + ModuleManager var13 = var6; + return new HitBox(var13, var12, var11, var10); + } + + private static Debug lambdaImpl$create$101(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.MISC; + String var5 = "Debug"; + return new Debug(var3, var4, var5); + } + + private static Scaffold lambdaImpl$create$35(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.PLAYER; + String var5 = "Scaffold"; + return new Scaffold(var3, var4, var5); + } + + private static DMGParticles lambdaImpl$create$43(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var5 = EnumModuleType.VISUALS; + String var6 = "DamageParticles"; + String var9 = "Damage Particles"; + String var10 = var9; + String var11 = var6; + EnumModuleType var12 = var5; + return new DMGParticles(var3, var12, var11, var10); + } + + private static NoJumpDelay lambdaImpl$create$92(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.MISC; + String var5 = "NoJumpDelay"; + String var6 = "No Jump Delay"; + return new NoJumpDelay(var3, var4, var5, var6); + } + + private static Step lambdaImpl$create$21(ModuleManager moduleManager) { + ModuleManager var6 = moduleManager; + EnumModuleType var7 = EnumModuleType.MOVEMENT; + String var8 = "Step"; + String var9 = var8; + EnumModuleType var10 = var7; + ModuleManager var11 = var6; + return new Step(var11, var10, var9); + } + + private static Crosshair lambdaImpl$create$96(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var6 = EnumModuleType.VISUALS; + String var7 = "Crosshair"; + String var9 = var7; + EnumModuleType var10 = var6; + ModuleManager var11 = var4; + return new Crosshair(var11, var10, var9); + } + + private static TabGui lambdaImpl$create$61(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var5 = EnumModuleType.VISUALS; + String var7 = "TabGUI"; + String var9 = "Tab GUI"; + String var10 = var9; + String var11 = var7; + EnumModuleType var12 = var5; + ModuleManager var13 = var4; + return new TabGui(var13, var12, var11, var10); + } + + private static SimsESP lambdaImpl$create$86(ModuleManager moduleManager) { + ModuleManager var4 = moduleManager; + EnumModuleType var5 = EnumModuleType.VISUALS; + String var8 = "SimsESP"; + String var9 = "Sims ESP"; + String var10 = var9; + String var11 = var8; + EnumModuleType var12 = var5; + ModuleManager var13 = var4; + return new SimsESP(var13, var12, var11, var10); + } + + private static AntiObbyTrap lambdaImpl$create$59(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.PLAYER; + String var5 = "AntiObbyTrap"; + String var6 = "Anti Obby Trap"; + return new AntiObbyTrap(var3, var4, var5, var6); + } + + private static SessionInfo lambdaImpl$create$10(ModuleManager moduleManager) { + ModuleManager var3 = moduleManager; + EnumModuleType var4 = EnumModuleType.VISUALS; + String var5 = "SessionInfo"; + String var8 = "Session Info"; + String var9 = var8; + return new SessionInfo(var3, var4, var5, var9); + } + + private static Runnable invokedynamic$b$0(Initializer var0) { return var0::lambdaImpl$create$0; } + private static Runnable invokedynamic$b$1(Initializer var0) { return var0::lambdaImpl$create$1; } + private static Runnable invokedynamic$b$2(Initializer var0) { return var0::lambdaImpl$create$2; } + private static Runnable invokedynamic$b$3(Initializer var0) { return var0::lambdaImpl$create$3; } + private static Runnable invokedynamic$b$4(Initializer var0) { return var0::lambdaImpl$create$4; } + private static Runnable invokedynamic$b$5(Initializer var0) { return var0::lambdaImpl$create$5; } + private static Runnable invokedynamic$b$6(Initializer var0) { return var0::lambdaImpl$create$6; } + private static ModuleFactory invokedynamic$b$7() { return (ModuleFactory) Initializer::lambdaImpl$create$7; } + private static ModuleFactory invokedynamic$b$8() { return (ModuleFactory) Initializer::lambdaImpl$create$8; } + private static ModuleFactory invokedynamic$b$9() { return (ModuleFactory) Initializer::lambdaImpl$create$9; } + private static ModuleFactory invokedynamic$b$10() { return (ModuleFactory) Initializer::lambdaImpl$create$10; } + private static ModuleFactory invokedynamic$b$11() { return (ModuleFactory) Initializer::lambdaImpl$create$11; } + private static ModuleFactory invokedynamic$b$12() { return (ModuleFactory) Initializer::lambdaImpl$create$12; } + private static ModuleFactory invokedynamic$b$13() { return (ModuleFactory) Initializer::lambdaImpl$create$13; } + private static ModuleFactory invokedynamic$b$14() { return (ModuleFactory) Initializer::lambdaImpl$create$14; } + private static ModuleFactory invokedynamic$b$15() { return (ModuleFactory) Initializer::lambdaImpl$create$15; } + private static ModuleFactory invokedynamic$b$16() { return (ModuleFactory) Initializer::lambdaImpl$create$16; } + private static ModuleFactory invokedynamic$b$17() { return (ModuleFactory) Initializer::lambdaImpl$create$17; } + private static ModuleFactory invokedynamic$b$18() { return (ModuleFactory) Initializer::lambdaImpl$create$18; } + private static ModuleFactory invokedynamic$b$19() { return (ModuleFactory) Initializer::lambdaImpl$create$19; } + private static ModuleFactory invokedynamic$b$20() { return (ModuleFactory) Initializer::lambdaImpl$create$20; } + private static ModuleFactory invokedynamic$b$21() { return (ModuleFactory) Initializer::lambdaImpl$create$21; } + private static ModuleFactory invokedynamic$b$22() { return (ModuleFactory) Initializer::lambdaImpl$create$22; } + private static ModuleFactory invokedynamic$b$23() { return (ModuleFactory) Initializer::lambdaImpl$create$23; } + private static ModuleFactory invokedynamic$b$24() { return (ModuleFactory) Initializer::lambdaImpl$create$24; } + private static ModuleFactory invokedynamic$b$25() { return (ModuleFactory) Initializer::lambdaImpl$create$25; } + private static ModuleFactory invokedynamic$b$26() { return (ModuleFactory) Initializer::lambdaImpl$create$26; } + private static ModuleFactory invokedynamic$b$27() { return (ModuleFactory) Initializer::lambdaImpl$create$27; } + private static ModuleFactory invokedynamic$b$28() { return (ModuleFactory) Initializer::lambdaImpl$create$28; } + private static ModuleFactory invokedynamic$b$29() { return (ModuleFactory) Initializer::lambdaImpl$create$29; } + private static ModuleFactory invokedynamic$b$30() { return (ModuleFactory) Initializer::lambdaImpl$create$30; } + private static ModuleFactory invokedynamic$b$31() { return (ModuleFactory) Initializer::lambdaImpl$create$31; } + private static ModuleFactory invokedynamic$b$32() { return (ModuleFactory) Initializer::lambdaImpl$create$32; } + private static ModuleFactory invokedynamic$b$33() { return (ModuleFactory) Initializer::lambdaImpl$create$33; } + private static ModuleFactory invokedynamic$b$34() { return (ModuleFactory) Initializer::lambdaImpl$create$34; } + private static ModuleFactory invokedynamic$b$35() { return (ModuleFactory) Initializer::lambdaImpl$create$35; } + private static ModuleFactory invokedynamic$b$36() { return (ModuleFactory) Initializer::lambdaImpl$create$36; } + private static ModuleFactory invokedynamic$b$37() { return (ModuleFactory) Initializer::lambdaImpl$create$37; } + private static ModuleFactory invokedynamic$b$38() { return (ModuleFactory) Initializer::lambdaImpl$create$38; } + private static ModuleFactory invokedynamic$b$39() { return (ModuleFactory) Initializer::lambdaImpl$create$39; } + private static ModuleFactory invokedynamic$b$40() { return (ModuleFactory) Initializer::lambdaImpl$create$40; } + private static ModuleFactory invokedynamic$b$41() { return (ModuleFactory) Initializer::lambdaImpl$create$41; } + private static ModuleFactory invokedynamic$b$42() { return (ModuleFactory) Initializer::lambdaImpl$create$42; } + private static ModuleFactory invokedynamic$b$43() { return (ModuleFactory) Initializer::lambdaImpl$create$43; } + private static ModuleFactory invokedynamic$b$44() { return (ModuleFactory) Initializer::lambdaImpl$create$44; } + private static ModuleFactory invokedynamic$b$45() { return (ModuleFactory) Initializer::lambdaImpl$create$45; } + private static ModuleFactory invokedynamic$b$46() { return (ModuleFactory) Initializer::lambdaImpl$create$46; } + private static ModuleFactory invokedynamic$b$47() { return (ModuleFactory) Initializer::lambdaImpl$create$47; } + private static ModuleFactory invokedynamic$b$48() { return (ModuleFactory) Initializer::lambdaImpl$create$48; } + private static ModuleFactory invokedynamic$b$49() { return (ModuleFactory) Initializer::lambdaImpl$create$49; } + private static ModuleFactory invokedynamic$b$50() { return (ModuleFactory) Initializer::lambdaImpl$create$50; } + private static ModuleFactory invokedynamic$b$51() { return (ModuleFactory) Initializer::lambdaImpl$create$51; } + private static ModuleFactory invokedynamic$b$52() { return (ModuleFactory) Initializer::lambdaImpl$create$52; } + private static ModuleFactory invokedynamic$b$53() { return (ModuleFactory) Initializer::lambdaImpl$create$53; } + private static ModuleFactory invokedynamic$b$54() { return (ModuleFactory) Initializer::lambdaImpl$create$54; } + private static ModuleFactory invokedynamic$b$55() { return (ModuleFactory) Initializer::lambdaImpl$create$55; } + private static ModuleFactory invokedynamic$b$56() { return (ModuleFactory) Initializer::lambdaImpl$create$56; } + private static ModuleFactory invokedynamic$b$57() { return (ModuleFactory) Initializer::lambdaImpl$create$57; } + private static ModuleFactory invokedynamic$b$58() { return (ModuleFactory) Initializer::lambdaImpl$create$58; } + private static ModuleFactory invokedynamic$b$59() { return (ModuleFactory) Initializer::lambdaImpl$create$59; } + private static ModuleFactory invokedynamic$b$60() { return (ModuleFactory) Initializer::lambdaImpl$create$60; } + private static ModuleFactory invokedynamic$b$61() { return (ModuleFactory) Initializer::lambdaImpl$create$61; } + private static ModuleFactory invokedynamic$b$62() { return (ModuleFactory) Initializer::lambdaImpl$create$62; } + private static ModuleFactory invokedynamic$b$63() { return (ModuleFactory) Initializer::lambdaImpl$create$63; } + private static ModuleFactory invokedynamic$b$64() { return (ModuleFactory) Initializer::lambdaImpl$create$64; } + private static ModuleFactory invokedynamic$b$65() { return (ModuleFactory) Initializer::lambdaImpl$create$65; } + private static ModuleFactory invokedynamic$b$66() { return (ModuleFactory) Initializer::lambdaImpl$create$66; } + private static ModuleFactory invokedynamic$b$67() { return (ModuleFactory) Initializer::lambdaImpl$create$67; } + private static ModuleFactory invokedynamic$b$68() { return (ModuleFactory) Initializer::lambdaImpl$create$68; } + private static ModuleFactory invokedynamic$b$69() { return (ModuleFactory) Initializer::lambdaImpl$create$69; } + private static ModuleFactory invokedynamic$b$70() { return (ModuleFactory) Initializer::lambdaImpl$create$70; } + private static ModuleFactory invokedynamic$b$71() { return (ModuleFactory) Initializer::lambdaImpl$create$71; } + private static ModuleFactory invokedynamic$b$72() { return (ModuleFactory) Initializer::lambdaImpl$create$72; } + private static ModuleFactory invokedynamic$b$73() { return (ModuleFactory) Initializer::lambdaImpl$create$73; } + private static ModuleFactory invokedynamic$b$74() { return (ModuleFactory) Initializer::lambdaImpl$create$74; } + private static ModuleFactory invokedynamic$b$75() { return (ModuleFactory) Initializer::lambdaImpl$create$75; } + private static ModuleFactory invokedynamic$b$76() { return (ModuleFactory) Initializer::lambdaImpl$create$76; } + private static ModuleFactory invokedynamic$b$77() { return (ModuleFactory) Initializer::lambdaImpl$create$77; } + private static ModuleFactory invokedynamic$b$78() { return (ModuleFactory) Initializer::lambdaImpl$create$78; } + private static ModuleFactory invokedynamic$b$79() { return (ModuleFactory) Initializer::lambdaImpl$create$79; } + private static ModuleFactory invokedynamic$b$80() { return (ModuleFactory) Initializer::lambdaImpl$create$80; } + private static ModuleFactory invokedynamic$b$81() { return (ModuleFactory) Initializer::lambdaImpl$create$81; } + private static ModuleFactory invokedynamic$b$82() { return (ModuleFactory) Initializer::lambdaImpl$create$82; } + private static ModuleFactory invokedynamic$b$83() { return (ModuleFactory) Initializer::lambdaImpl$create$83; } + private static ModuleFactory invokedynamic$b$84() { return (ModuleFactory) Initializer::lambdaImpl$create$84; } + private static ModuleFactory invokedynamic$b$85() { return (ModuleFactory) Initializer::lambdaImpl$create$85; } + private static ModuleFactory invokedynamic$b$86() { return (ModuleFactory) Initializer::lambdaImpl$create$86; } + private static ModuleFactory invokedynamic$b$87() { return (ModuleFactory) Initializer::lambdaImpl$create$87; } + private static ModuleFactory invokedynamic$b$88() { return (ModuleFactory) Initializer::lambdaImpl$create$88; } + private static ModuleFactory invokedynamic$b$89() { return (ModuleFactory) Initializer::lambdaImpl$create$89; } + private static ModuleFactory invokedynamic$b$90() { return (ModuleFactory) Initializer::lambdaImpl$create$90; } + private static ModuleFactory invokedynamic$b$91() { return (ModuleFactory) Initializer::lambdaImpl$create$91; } + private static ModuleFactory invokedynamic$b$92() { return (ModuleFactory) Initializer::lambdaImpl$create$92; } + private static ModuleFactory invokedynamic$b$93() { return (ModuleFactory) Initializer::lambdaImpl$create$93; } + private static ModuleFactory invokedynamic$b$94() { return (ModuleFactory) Initializer::lambdaImpl$create$94; } + private static ModuleFactory invokedynamic$b$95() { return (ModuleFactory) Initializer::lambdaImpl$create$95; } + private static ModuleFactory invokedynamic$b$96() { return (ModuleFactory) Initializer::lambdaImpl$create$96; } + private static ModuleFactory invokedynamic$b$97() { return (ModuleFactory) Initializer::lambdaImpl$create$97; } + private static ModuleFactory invokedynamic$b$98() { return (ModuleFactory) Initializer::lambdaImpl$create$98; } + private static ModuleFactory invokedynamic$b$99() { return (ModuleFactory) Initializer::lambdaImpl$create$99; } + private static ModuleFactory invokedynamic$b$100() { return (ModuleFactory) Initializer::lambdaImpl$create$100; } + private static ModuleFactory invokedynamic$b$101() { return (ModuleFactory) Initializer::lambdaImpl$create$101; } + private static Consumer invokedynamic$b$102(Novoline novoline, String text) { return (Void var2) -> lambdaImpl$create$102(novoline, text, var2); } + + private void registerModule(String name, ModuleFactory factory) { this.a(name, factory); } +} diff --git a/src/main/java/cc/novoline/InitializerHolder.java b/src/main/java/cc/novoline/InitializerHolder.java new file mode 100644 index 0000000..00ba92b --- /dev/null +++ b/src/main/java/cc/novoline/InitializerHolder.java @@ -0,0 +1,12 @@ +package cc.novoline; + +public enum InitializerHolder { + INSTANCE; + + private static final InitializerHolder[] initializerHolderArray = new InitializerHolder[]{InitializerHolder.INSTANCE}; + private final Initializer initializerField = new Initializer(); + + public static Initializer resolveInitializer(InitializerHolder initializerHolder) { + return initializerHolder.initializerField; +} +} diff --git a/src/main/java/cc/novoline/Novoline.java b/src/main/java/cc/novoline/Novoline.java new file mode 100644 index 0000000..85b695a --- /dev/null +++ b/src/main/java/cc/novoline/Novoline.java @@ -0,0 +1,375 @@ +package cc.novoline; + +import cc.novoline.commands.NovoCommandHandler; +import cc.novoline.gui.screen.ClickGUI; +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.gui.screen.click.DiscordGUI; +import cc.novoline.gui.screen.login.GuiLogin; +import cc.novoline.irc.NovolineWebSocket; +import cc.novoline.modules.PlayerManager; +import cc.novoline.script.ScriptManager; +import cc.novoline.utils.ServerCommandTracker; +import cc.novoline.utils.fonts.impl.SimpleFontManager; +import cc.novoline.utils.notifications.NotificationManager; +import cc.novoline.utils.tasks.TaskManager; + +import cc.novoline.modules.configurations.ConfigManager; +import com.thealtening.api.response.Account; +import com.thealtening.api.retriever.AsynchronousDataRetriever; +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.concurrent.CompletableFuture; +import cc.novoline.modules.ModuleManager; +import cc.novoline.utils.fonts.api.FontManager; +import ninja.leaping.configurate.objectmapping.ObjectMappingException; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ServerData; +import net.skidunion.security.ProtectionSession; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.jetbrains.annotations.NotNull; + +public final class Novoline { + private TaskManager taskManagerField; + private Initializer initializerField; + private final boolean stateFlag; + private static Novoline instance; + private ProtectionSession protectionSessionField; + private ServerData lastConnectedServer; + private GuiLogin guiLoginField; + private NovolineWebSocket novolineWebSocketField; + private ModuleManager moduleManager; + private ScriptManager scriptManagerField; + private boolean stateFlag2; + private NovoCommandHandler novoCommandHandlerField; + private boolean stateFlag3; + private final Minecraft mc; + private ClickGUI clickGUIField; + private DiscordGUI discordGUIField; + private final String cachedText = "6.99"; + private NotificationManager notificationManagerField; + private AltRepositoryGUI altRepositoryGUIField; + private static final Logger LOGGER = LogManager.getLogger(); + private static int[] p; + private final Path configPath; + private FontManager fontManagerField; + private String cachedText2; + private PlayerManager playerManagerField; + private ServerCommandTracker serverCommandTrackerField; + private final AsynchronousDataRetriever dataRetriever; + + public FontManager getFontManagerField() { + return this.fontManagerField; +} + + public void applyUpdate(ProtectionSession protectionSession) { + this.protectionSessionField = protectionSession; +} + + public static void b(int[] intArray) { + p = intArray; +} + + public ServerData getLastConnectedServer() { + return this.lastConnectedServer; +} + + public boolean isReadyState() { + return false; +} + + public CompletableFuture getCompletableFuture() { + return this.dataRetriever.getAccountDataAsync(); +} + + public void applyUpdate(NovoCommandHandler novoCommandHandler) { + this.novoCommandHandlerField = novoCommandHandler; +} + + public ClickGUI getClickGUIField() { + return this.clickGUIField; +} + + public NotificationManager getNotificationManagerField() { + return this.notificationManagerField; +} + + public void applyUpdate(boolean flag) { + this.stateFlag3 = flag; +} + + public static int[] C() { + return p; +} + + public void applyUpdate(ClickGUI clickGUI) { + this.clickGUIField = clickGUI; +} + + public void performAction() { + try { + ModuleManager modManager = this.getModuleManager(); + ConfigManager cfgManager = modManager.getConfigManager(); + cfgManager.b("default"); + } catch (IOException ex) { + Logger log = getLogger(); + StringBuilder sb = new StringBuilder(); + sb = sb.append("An I/O error occurred while "); + String msgText = ex.getMessage(); + sb = sb.append(msgText); + String textStr = sb.append("!").toString(); + log.warn(textStr, ex); + } catch (ObjectMappingException ex2) { + Logger log2 = getLogger(); + log2.warn("An I/O error occurred while serializing config!", ex2); + } +} + + public String getCachedText2() { + return this.cachedText2; +} + + public Novoline() { + this.stateFlag = false; + this.stateFlag3 = false; + this.mc = Minecraft.getMinecraft(); + this.initializerField = Initializer.d(); + this.novoCommandHandlerField = new NovoCommandHandler(this); + this.dataRetriever = new AsynchronousDataRetriever(null); + this.fontManagerField = SimpleFontManager.getFontManager(); + File fileObj = this.mc.ag; + this.configPath = Paths.get(fileObj.getAbsolutePath()).resolve("Novoline"); + if (instance != null) { + StringBuilder sb = new StringBuilder(); + sb = sb.append("Cannot instantiate "); + Class clazz = this.getClass(); + String textStr = clazz.getCanonicalName(); + sb = sb.append(textStr); + throw new IllegalStateException(sb.append(" twice").toString()); + } +} + + public AsynchronousDataRetriever getDataRetriever() { + return this.dataRetriever; +} + + + + public void applyUpdate(GuiLogin guiLogin) { + this.guiLoginField = guiLogin; +} + + public boolean isStateFlag3() { + return this.stateFlag3; +} + + public ServerCommandTracker getServerCommandTrackerField() { + return this.serverCommandTrackerField; +} + + public String getTextValue() { + StringBuilder sb = new StringBuilder(); + String pathStr = this.mc.ag.getAbsolutePath(); + sb = sb.append(pathStr); + return sb.append("\\Novoline\\").toString(); +} + + public void applyUpdate(NotificationManager notificationManager) { + this.notificationManagerField = notificationManager; +} + + public void performAction2() {} + + public void applyUpdate(NovolineWebSocket novolineWebSocket) { + this.novolineWebSocketField = novolineWebSocket; +} + + public TaskManager getTaskManagerField() { + return this.taskManagerField; +} + + public Initializer getInitializerField() { + return this.initializerField; +} + + public void applyUpdate(String text) { + this.cachedText2 = text; +} + + public void applyUpdate(ScriptManager scriptManager) { + this.scriptManagerField = scriptManager; +} + + public NovolineWebSocket getNovolineWebSocketField() { + return this.novolineWebSocketField; +} + + public ScriptManager getScriptManagerField() { + return this.scriptManagerField; +} + + public Path getConfigPath2() { + return this.configPath; +} + + public DiscordGUI getDiscordGUIField() { + return this.discordGUIField; +} + + public void applyUpdate(ModuleManager manager) { + this.moduleManager = manager; +} + + public static Novoline getInstance() { + try { + if (instance == null) { + instance = new Novoline(); + } + + return instance; + } catch (Throwable ex) { + LOGGER.warn(ex); + throw ex; + } +} + + public void applyUpdate(PlayerManager playerManager) { + this.playerManagerField = playerManager; +} + + public Minecraft getMinecraft() { + return this.mc; +} + + public void applyUpdate(AltRepositoryGUI altRepositoryGUI) { + this.altRepositoryGUIField = altRepositoryGUI; +} + + public String getString() { + return "6.99"; +} + + public PlayerManager getPlayerManagerField() { + return this.playerManagerField; +} + + public void applyUpdate(TaskManager taskManager) { + this.taskManagerField = taskManager; +} + + public void applyUpdate(DiscordGUI discordGUI) { + this.discordGUIField = discordGUI; +} + + public GuiLogin getGuiLoginField() { + return this.guiLoginField; +} + + public void applyUpdate(ServerCommandTracker serverCommandTracker) { + this.serverCommandTrackerField = serverCommandTracker; +} + + public NovoCommandHandler getNovoCommandHandlerField() { + return this.novoCommandHandlerField; +} + + public static Logger getLogger() { + return LOGGER; +} + + static { + b(null); + } + + public void setLastConnectedServer(@NotNull ServerData serverData) { + this.lastConnectedServer = serverData; +} + + public ModuleManager getModuleManager() { + return this.moduleManager; +} + + public void setStateFlag2(boolean flag) { + this.stateFlag2 = flag; +} + + public boolean isReadyState2() { + Novoline novolineInst = this; + + if (this.moduleManager == null) { + return true; + } + + novolineInst = this; + + + + if (novolineInst.playerManagerField == null) { + return true; + } + + novolineInst = this; + + + return novolineInst.notificationManagerField == null; +} + + public AltRepositoryGUI getAltRepositoryGUIField() { + return this.altRepositoryGUIField; +} + + public void performAction3() {} + + public boolean isStateFlag2() { + return this.stateFlag2; +} + + public ProtectionSession getProtectionSession2() { + return this.protectionSessionField; +} + + public NotificationManager getNotificationManager() { + return this.getNotificationManagerField(); +} + public PlayerManager getPlayerManager() { + return this.getPlayerManagerField(); +} + public TaskManager getTaskManager() { + return this.getTaskManagerField(); +} + public Path getDataFolder() { + return this.getConfigPath2(); +} + public DiscordGUI getDiscordGUI() { + return this.getDiscordGUIField(); +} + public ClickGUI getClickGUI() { + return this.getClickGUIField(); +} + public ScriptManager getScriptManager() { + return this.getScriptManagerField(); +} + public AltRepositoryGUI getAltRepositoryGUI() { + return this.getAltRepositoryGUIField(); +} + public FontManager getFontManager() { + return this.getFontManagerField(); +} + public String getVersion() { + return this.getString(); +} + + public NovoCommandHandler getCommandHandler() { return this.getNovoCommandHandlerField(); } + public String getDataFolderString() { return this.getTextValue(); } + public NovolineWebSocket getWebSocket() { return this.getNovolineWebSocketField(); } + public ProtectionSession getProtectionSession() { return this.getProtectionSession2(); } + public ServerCommandTracker getServerCommandTracker() { return this.getServerCommandTrackerField(); } + public GuiLogin getGuiLogin() { return this.getGuiLoginField(); } + public Initializer getInitializer() { return this.getInitializerField(); } + public boolean isUninitialized() { return this.isReadyState2(); } + public void saveDefaultConfig() { this.performAction(); } + + public java.nio.file.Path getConfigPath() { return this.getConfigPath2(); } +} diff --git a/src/main/java/cc/novoline/auth/Boot.java b/src/main/java/cc/novoline/auth/Boot.java new file mode 100644 index 0000000..5e85712 --- /dev/null +++ b/src/main/java/cc/novoline/auth/Boot.java @@ -0,0 +1,103 @@ +package cc.novoline.auth; + +import cc.novoline.auth.minecraft.MicrosoftOAuthCodeExchanger; +import cc.novoline.auth.minecraft.auth.Account; +import cc.novoline.auth.minecraft.user.MicrosoftOAuthExchangeCode; +import cc.novoline.auth.minecraft.user.MinecraftAuthenticationException; +import cc.novoline.auth.minecraft.user.MinecraftOAuthAuthenticate; +import cc.novoline.auth.minecraft.user.MinecraftProfileConverter; +import cc.novoline.auth.minecraft.user.MinecraftUser; +import cc.novoline.auth.minecraft.user.RedirectUrl; +import cc.novoline.auth.minecraft.user.gos.GameOwnershipValidator; +import cc.novoline.auth.minecraft.user.mcsauth.MinecraftServicesAuthenticator; +import cc.novoline.auth.minecraft.user.oauth.exchange.MicrosoftOAuthCodeExchangerImpl; +import cc.novoline.auth.minecraft.user.oauth.exchange.MicrosoftOAuthRefreshCodeExchangerIMpl; +import cc.novoline.auth.minecraft.user.preq.MinecraftProfileRequester; +import cc.novoline.auth.minecraft.user.xb.auth.XboxLiveAuthenticator; +import cc.novoline.auth.minecraft.user.xb.xsts.XSTSAuthenticator; +import java.io.IOException; +import java.net.URLDecoder; +import java.util.Objects; +import java.util.concurrent.atomic.AtomicReference; +import net.freeutils.httpserver.HTTPServer; +import net.freeutils.httpserver.HTTPServer.VirtualHost; + +public class Boot { + private static final HTTPServer server = new HTTPServer(28562); + private static final VirtualHost host = server.getVirtualHost(null); + public static OAuthApplication microsoftAuth = OAuthApplication.NOVOLINE_APP_PARAMETERS; + + public static void close() { + server.stop(); +} + + public static MinecraftUser startServer() throws IOException { + AtomicReference atomicReference = null; + host.addContext( + "/", + (arg, arg2) -> { + if (arg.getParams().containsKey("error")) { + arg2.getHeaders().add("Content-Type", "text/plain"); + arg2.send(500, URLDecoder.decode(arg.getParams().get("error_description"))); + close(); + return 0; + } + + if (!arg.getParams().containsKey("code")) { + arg2.getHeaders().add("Content-Type", "text/plain"); + arg2.send(400, "Code is missing"); + close(); + return 0; + } + + try { + Account account = new Account(); + account.setPassword(arg.getParams().get("code")); + account.setUsername("********"); + if (Objects.isNull(account.getAccessToken())) { + MicrosoftOAuthCodeExchanger val = new MicrosoftOAuthCodeExchangerImpl( + "1f2e7916-9ecf-4495-a87b-f9f54ae7b707", "https://login.live.com/oauth20_token.srf" + ); + MicrosoftOAuthExchangeCode microsoftOAuthExchangeCode = new MicrosoftOAuthExchangeCode(arg.getParams().get("code"), new RedirectUrl("http://localhost:28562")); + atomicReference.set(doRequest(val, microsoftOAuthExchangeCode)); + } else if (account.getMicrosoftOAuthToken().isExpired()) { + MicrosoftOAuthCodeExchanger val2 = new MicrosoftOAuthRefreshCodeExchangerIMpl( + "1f2e7916-9ecf-4495-a87b-f9f54ae7b707", "https://login.live.com/oauth20_token.srf" + ); + MicrosoftOAuthExchangeCode microsoftOAuthExchangeCode2 = new MicrosoftOAuthExchangeCode( + account.getMicrosoftOAuthToken().getRefreshToken(), new RedirectUrl("http://localhost:28562") + ); + atomicReference.set(doRequest(val2, microsoftOAuthExchangeCode2)); + } + } catch (Exception ex) { + arg2.getHeaders().add("Content-Type", "text/html"); + arg2.send(500, "" + ex); + close(); + return 0; + } + + arg2.getHeaders().add("Content-Type", "text/plain"); + arg2.send(200, "Received ms code: " + arg.getParams().get("code") + ". Go back to Alt Repository"); + close(); + return 0; + }, + "GET" + ); + server.start(); + return (cc.novoline.auth.minecraft.user.MinecraftUser) atomicReference.get(); +} + + public static MinecraftUser doRequest(MicrosoftOAuthCodeExchanger microsoftOAuthCodeExchanger, MicrosoftOAuthExchangeCode microsoftOAuthExchangeCode) throws IOException, MinecraftAuthenticationException { + XboxLiveAuthenticator xboxLiveAuthenticator = new XboxLiveAuthenticator(microsoftAuth); + MinecraftOAuthAuthenticate minecraftOAuthAuthenticate = new MinecraftOAuthAuthenticate( + microsoftOAuthCodeExchanger, + xboxLiveAuthenticator, + new XSTSAuthenticator(), + new MinecraftServicesAuthenticator(), + new GameOwnershipValidator(), + new MinecraftProfileRequester(), + new MinecraftProfileConverter() + ); + return minecraftOAuthAuthenticate.authenticate(microsoftOAuthExchangeCode); +} +} diff --git a/src/main/java/cc/novoline/auth/LoginFrame.java b/src/main/java/cc/novoline/auth/LoginFrame.java new file mode 100644 index 0000000..23762db --- /dev/null +++ b/src/main/java/cc/novoline/auth/LoginFrame.java @@ -0,0 +1,86 @@ +package cc.novoline.auth; + +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.io.IOException; +import java.net.CookieHandler; +import java.net.URI; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import javafx.application.Platform; +import javafx.embed.swing.JFXPanel; +import javafx.scene.Scene; +import javafx.beans.value.ObservableValue; +import javafx.scene.web.WebView; +import javax.swing.JFrame; + +public class LoginFrame extends JFrame { + private CompletableFuture future; + + public LoginFrame() { + this.setTitle("Novoline Authorization"); + this.setSize(750, 750); + this.setLocationRelativeTo(null); + this.setContentPane(new JFXPanel()); +} + + public CompletableFuture start(String text, String str) { + if (this.future != null) { + return this.future; + } + + this.future = new CompletableFuture<>(); + this.addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent text) { + } + }); + Platform.runLater(() -> { + try { + this.init(text, str); + } catch (IOException ex) { + ex.printStackTrace(); + } + }); + return this.future; +} + + public void init(String text, String str) throws IOException { + WebView webView = new WebView(); + JFXPanel jFXPanel = (JFXPanel)this.getContentPane(); + jFXPanel.setScene(new Scene(webView, this.getWidth(), this.getHeight())); + webView.getEngine().locationProperty().addListener(this::invokeCallback); + webView.getEngine().setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36"); + if (text.contains("live.com")) { + Map itemMap = new LinkedHashMap<>(); + itemMap.put("Set-Cookie", parseCookie(text)); + CookieHandler.getDefault().put(URI.create(str), itemMap); + } + + webView.getEngine().load(str); + this.setVisible(true); +} + + public static List parseCookie(String text) { + List itemList = new ArrayList<>(); + + for (String textStr : text.split("\n")) { + String[] stringArr = textStr.split("/\tFALSE\t")[1].split("\t"); + String textStr2 = stringArr[1]; + String textStr3 = stringArr[2]; + itemList.add(textStr2 + "=" + textStr3); + } + + return itemList; +} + + private void invokeCallback(ObservableValue observableValue, String text, String str) { + if (str.contains("access_token")) { + this.setVisible(false); + this.future.complete(str); + } +} +} diff --git a/src/main/java/cc/novoline/auth/OAuthApplication.java b/src/main/java/cc/novoline/auth/OAuthApplication.java new file mode 100644 index 0000000..ab34468 --- /dev/null +++ b/src/main/java/cc/novoline/auth/OAuthApplication.java @@ -0,0 +1,167 @@ +package cc.novoline.auth; + +public class OAuthApplication { + public static OAuthApplication NOVOLINE_APP_PARAMETERS = new OAuthApplication( + "1f2e7916-9ecf-4495-a87b-f9f54ae7b707", + "Xboxlive.signin offline_access", + "https://login.live.com/oauth20_authorize.srf", + "https://login.live.com/oauth20_token.srf", + "http://localhost:28562", + "https://login.microsoftonline.com/common/oauth2/nativeclient?error=access_denied" + ); + private final String clientId; + private final String scope; + private final boolean useWeirdXboxTokenPrefix = true; + private String basicURL; + private String tokenURL; + private String redirectURL; + private String backButtonURL; + + public String getClientId() { + return this.clientId; +} + + public String getScope() { + return this.scope; +} + + public boolean isUseWeirdXboxTokenPrefix() { + return true; +} + + public String getBasicURL() { + return this.basicURL; +} + + public String getTokenURL() { + return this.tokenURL; +} + + public String getRedirectURL() { + return this.redirectURL; +} + + public String getBackButtonURL() { + return this.backButtonURL; +} + + public void setBasicURL(String text) { + this.basicURL = text; +} + + public void setTokenURL(String text) { + this.tokenURL = text; +} + + public void setRedirectURL(String text) { + this.redirectURL = text; +} + + public void setBackButtonURL(String text) { + this.backButtonURL = text; +} + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + + if (!(obj instanceof OAuthApplication)) { + return false; + } + + OAuthApplication oAuthApplication = (OAuthApplication)obj; + if (!oAuthApplication.canEqual(this)) { + return false; + } + + String textStr = this.getClientId(); + String textStr2 = oAuthApplication.getClientId(); + if (textStr == null ? textStr2 == null : textStr.equals(textStr2)) { + String textStr3 = this.getScope(); + String textStr4 = oAuthApplication.getScope(); + if (textStr3 == null ? textStr4 == null : textStr3.equals(textStr4)) { + if (this.isUseWeirdXboxTokenPrefix() != oAuthApplication.isUseWeirdXboxTokenPrefix()) { + return false; + } + + String textStr5 = this.getBasicURL(); + String textStr6 = oAuthApplication.getBasicURL(); + if (textStr5 == null ? textStr6 == null : textStr5.equals(textStr6)) { + String textStr7 = this.getTokenURL(); + String textStr8 = oAuthApplication.getTokenURL(); + if (textStr7 == null ? textStr8 == null : textStr7.equals(textStr8)) { + String textStr9 = this.getRedirectURL(); + String textStr10 = oAuthApplication.getRedirectURL(); + if (textStr9 == null ? textStr10 == null : textStr9.equals(textStr10)) { + String textStr11 = this.getBackButtonURL(); + String textStr12 = oAuthApplication.getBackButtonURL(); + return textStr11 == null ? textStr12 == null : textStr11.equals(textStr12); + } else { + return false; + } + } else { + return false; + } + } else { + return false; + } + } else { + return false; + } + } else { + return false; + } +} + + public boolean canEqual(Object obj) { + return obj instanceof OAuthApplication; +} + + @Override + public int hashCode() { + int intVal = 1; + String textStr = this.getClientId(); + intVal = intVal * 59 + (textStr == null ? 43 : textStr.hashCode()); + String textStr2 = this.getScope(); + intVal = intVal * 59 + (textStr2 == null ? 43 : textStr2.hashCode()); + intVal = intVal * 59 + (this.isUseWeirdXboxTokenPrefix() ? 79 : 97); + String textStr3 = this.getBasicURL(); + intVal = intVal * 59 + (textStr3 == null ? 43 : textStr3.hashCode()); + String textStr4 = this.getTokenURL(); + intVal = intVal * 59 + (textStr4 == null ? 43 : textStr4.hashCode()); + String textStr5 = this.getRedirectURL(); + intVal = intVal * 59 + (textStr5 == null ? 43 : textStr5.hashCode()); + String textStr6 = this.getBackButtonURL(); + return intVal * 59 + (textStr6 == null ? 43 : textStr6.hashCode()); +} + + @Override + public String toString() { + return "OAuthApplication(clientId=" + + this.getClientId() + + ", scope=" + + this.getScope() + + ", useWeirdXboxTokenPrefix=" + + this.isUseWeirdXboxTokenPrefix() + + ", basicURL=" + + this.getBasicURL() + + ", tokenURL=" + + this.getTokenURL() + + ", redirectURL=" + + this.getRedirectURL() + + ", backButtonURL=" + + this.getBackButtonURL() + + ")"; +} + + public OAuthApplication(String text, String str, String value, String name, String text2, String text3) { + this.clientId = text; + this.scope = str; + this.basicURL = value; + this.tokenURL = name; + this.redirectURL = text2; + this.backButtonURL = text3; +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/MicrosoftOAuthCodeExchanger.java b/src/main/java/cc/novoline/auth/minecraft/MicrosoftOAuthCodeExchanger.java new file mode 100644 index 0000000..fb73fd1 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/MicrosoftOAuthCodeExchanger.java @@ -0,0 +1,28 @@ +package cc.novoline.auth.minecraft; + +import cc.novoline.auth.minecraft.user.InvalidResponseException; +import cc.novoline.auth.minecraft.user.MicrosoftOAuthExchangeCode; +import cc.novoline.auth.minecraft.user.MicrosoftOAuthToken; +import cc.novoline.auth.minecraft.user.Parser; +import cc.novoline.auth.minecraft.user.RequestAndParseStrategy; +import cc.novoline.auth.minecraft.user.Requester; +import cc.novoline.auth.minecraft.user.oauth.exchange.MicrosoftOAuthCodeExchangeException; +import java.io.IOException; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; + +public class MicrosoftOAuthCodeExchanger extends RequestAndParseStrategy { + private static final Logger LOGGER = LogManager.getLogger(MicrosoftOAuthCodeExchanger.class); + + public MicrosoftOAuthCodeExchanger(Requester requester, Parser parser) { + super(LOGGER, requester, parser); +} + + public MicrosoftOAuthToken exchangeMicrosoftOAuthCode(MicrosoftOAuthExchangeCode microsoftOAuthExchangeCode) throws MicrosoftOAuthCodeExchangeException, IOException { + try { + return this.requestAndParse(microsoftOAuthExchangeCode); + } catch (InvalidResponseException ex) { + throw new MicrosoftOAuthCodeExchangeException(ex); + } +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/auth/Account.java b/src/main/java/cc/novoline/auth/minecraft/auth/Account.java new file mode 100644 index 0000000..2e2342d --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/auth/Account.java @@ -0,0 +1,340 @@ +package cc.novoline.auth.minecraft.auth; + +import cc.novoline.auth.minecraft.user.MicrosoftOAuthToken; +import cc.novoline.auth.minecraft.user.mcsauth.MinecraftServicesToken; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Random; +import java.util.UUID; + +public class Account { + private String username; + private String userID; + private String displayName; + private String password; + private String accessToken; + private MicrosoftOAuthToken microsoftOAuthToken; + private MinecraftServicesToken minecraftServicesToken; + private String uuid; + private List userProperties; + private boolean premiumAccount; + private GameProfile[] profiles; + private GameProfile selectedProfile; + private User user; + + public Account() {} + + public Account(String text) { + this(); + this.setUsername(text); +} + + public Account(Map map) { + this(); + this.fillFromMap(map); +} + + public String getUsername() { + return this.username; +} + + public boolean hasUsername() { + return this.username != null; +} + + public void setUsername(String name) { + this.username = name; +} + + public String getUserID() { + return this.userID; +} + + public void setUserID(String text) { + this.userID = text; +} + + public String getDisplayName() { + return this.displayName == null ? this.username : this.displayName; +} + + public String getPassword() { + return this.password; +} + + public void setPassword(String text) { + this.password = text; +} + + public String getAccessToken() { + return Objects.nonNull(this.minecraftServicesToken) ? this.minecraftServicesToken.getAccessToken() : this.accessToken; +} + + public void setAccessToken(String text) { + if ("null".equals(text)) { + text = null; + } + + this.accessToken = text; +} + + public String getUUID() { + return this.uuid; +} + + public void setUUID(String text) { + this.uuid = text; +} + + public GameProfile[] getProfiles() { + return this.profiles; +} + + public void setProfiles(GameProfile[] gameProfileArray) { + this.profiles = gameProfileArray; +} + + public GameProfile getProfile() { + return this.selectedProfile != null ? this.selectedProfile : GameProfile.DEFAULT_PROFILE; +} + + public void setProfile(GameProfile gameProfile) { + this.selectedProfile = gameProfile; +} + + public void setDisplayName(String name) { + this.displayName = name; +} + + public User getUser() { + return this.user; +} + + public void setUser(User userIn) { + this.user = userIn; +} + + public Map getProperties() { + Map itemMap = new HashMap(); + List userPropertyList = new ArrayList<>(); + if (this.userProperties != null) { + for (Map itemMap2 : this.userProperties) { + userPropertyList.add(new UserProperty((String)itemMap2.get("name"), (String)itemMap2.get("value"))); + } + } + + if (this.user != null && this.user.getProperties() != null) { + for (Map itemMap3 : (List)this.user.getProperties()) { + userPropertyList.add(new UserProperty((String)itemMap3.get("name"), (String)itemMap3.get("value"))); + } + } + + for (UserProperty userProperty : userPropertyList) { + List itemList = new ArrayList(); + itemList.add(userProperty.getValue()); + itemMap.put(userProperty.getKey(), itemList); + } + + return itemMap; +} + + void setProperties(List list) { + this.userProperties = list; +} + + public boolean isFree() { + return false; +} + + Map createMap() { + Map itemMap = new HashMap(); + itemMap.put("username", this.username); + itemMap.put("userid", this.userID); + itemMap.put("uuid", UUIDTypeAdapter.toUUID(this.uuid)); + itemMap.put("displayName", this.displayName); + if (!this.isFree()) { + itemMap.put("accessToken", this.accessToken); + } + + if (this.userProperties != null) { + itemMap.put("userProperties", this.userProperties); + } + + return itemMap; +} + + void fillFromMap(Map map) { + if (map.containsKey("username")) { + this.setUsername(map.get("username").toString()); + } + + this.setUserID(map.containsKey("userid") ? map.get("userid").toString() : this.getUsername()); + this.setDisplayName(map.containsKey("displayName") ? map.get("displayName").toString() : this.getUsername()); + this.setProperties(map.containsKey("userProperties") ? (List)map.get("userProperties") : null); + this.setUUID(map.containsKey("uuid") ? UUIDTypeAdapter.toUUID(map.get("uuid").toString()) : null); + boolean flag = map.containsKey("accessToken"); + if (flag) { + this.setAccessToken(map.get("accessToken").toString()); + } +} + + public static Account createFreeAccountByUsername(String name) { + Account account = new Account(); + account.setUUID(UUIDTypeAdapter.fromUUID(UUID.randomUUID())); + account.setUsername(name); + account.setUserID(account.getUsername()); + account.setDisplayName(account.getUsername()); + return account; +} + + @Override + public String toString() { + return this.toDebugString(); +} + + public String toDebugString() { + Map itemMap = this.createMap(); + if (itemMap.containsKey("accessToken")) { + itemMap.remove("accessToken"); + itemMap.put("accessToken", "(not null)"); + } + + return "Account" + itemMap; +} + + public static Account randomAccount() { + return new Account("empty_manage " + new Random().nextLong()); +} + + public boolean isPremiumAccount() { + return this.premiumAccount; +} + + public void setPremiumAccount(boolean enabled) { + this.premiumAccount = enabled; +} + + public MicrosoftOAuthToken getMicrosoftOAuthToken() { + return this.microsoftOAuthToken; +} + + public void setMicrosoftOAuthToken(MicrosoftOAuthToken microsoftOAuthTokenIn) { + this.microsoftOAuthToken = microsoftOAuthTokenIn; +} + + public MinecraftServicesToken getMinecraftServicesToken() { + return this.minecraftServicesToken; +} + + public void setMinecraftServicesToken(MinecraftServicesToken minecraftServicesTokenIn) { + this.minecraftServicesToken = minecraftServicesTokenIn; +} + + public String getShortUUID() { + return UUIDTypeAdapter.toUUID(this.uuid); +} + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + + if (!(obj instanceof Account)) { + return false; + } + + Account account = (Account)obj; + if (!account.canEqual(this)) { + return false; + } + + Object obj2 = this.getUsername(); + Object obj3 = account.getUsername(); + if (obj2 == null) { + if (obj3 != null) { + return false; + } + } else if (!obj2.equals(obj3)) { + return false; + } + + Object obj4 = this.getUserID(); + Object obj5 = account.getUserID(); + if (obj4 == null) { + if (obj5 != null) { + return false; + } + } else if (!obj4.equals(obj5)) { + return false; + } + + Object obj6 = this.getDisplayName(); + Object obj7 = account.getDisplayName(); + if (obj6 == null) { + if (obj7 != null) { + return false; + } + } else if (!obj6.equals(obj7)) { + return false; + } + + Object obj8 = this.getPassword(); + Object obj9 = account.getPassword(); + if (obj8 == null ? obj9 == null : obj8.equals(obj9)) { + obj8 = this.getAccessToken(); + obj9 = account.getAccessToken(); + if (obj8 == null ? obj9 == null : obj8.equals(obj9)) { + obj8 = this.getMicrosoftOAuthToken(); + obj9 = account.getMicrosoftOAuthToken(); + if (obj8 == null) { + if (obj9 != null) { + return false; + } + } else if (!obj8.equals(obj9)) { + return false; + } + + Object obj10 = this.getMinecraftServicesToken(); + Object obj11 = account.getMinecraftServicesToken(); + if (obj10 == null ? obj11 == null : obj10.equals(obj11)) { + obj10 = this.getUUID(); + obj11 = account.getUUID(); + if (obj10 == null ? obj11 == null : obj10.equals(obj11)) { + obj10 = this.userProperties; + obj11 = account.userProperties; + if (obj10 == null) { + if (obj11 != null) { + return false; + } + } else if (!obj10.equals(obj11)) { + return false; + } + + return false; + } else { + return false; + } + } else { + return false; + } + } else { + return false; + } + } else { + return false; + } +} + + public boolean canEqual(Object obj) { + return obj instanceof Account; +} + + @Override + public int hashCode() { + return 1; +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/auth/GameProfile.java b/src/main/java/cc/novoline/auth/minecraft/auth/GameProfile.java new file mode 100644 index 0000000..15c3870 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/auth/GameProfile.java @@ -0,0 +1,53 @@ +package cc.novoline.auth.minecraft.auth; + +import org.apache.commons.lang3.StringUtils; + +public class GameProfile { + public static final GameProfile DEFAULT_PROFILE = new GameProfile("0", "(Default)"); + private final String id; + private final String name; + + private GameProfile(String text, String str) { + if (StringUtils.isBlank(text) && StringUtils.isBlank(str)) { + throw new IllegalArgumentException("Name and ID cannot both be blank"); + } + + this.id = text; + this.name = str; +} + + public String getId() { + return this.id; +} + + public String getName() { + return this.name; +} + + public boolean isComplete() { + return StringUtils.isNotBlank(this.getId()) && StringUtils.isNotBlank(this.getName()); +} + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj != null && this.getClass() == obj.getClass()) { + GameProfile gameProfile = (GameProfile)obj; + return this.id.equals(gameProfile.id) && this.name.equals(gameProfile.name); + } else { + return false; + } +} + + @Override + public int hashCode() { + int intVal = this.id.hashCode(); + return 31 * intVal + this.name.hashCode(); +} + + @Override + public String toString() { + return "GameProfile{id='" + this.id + '\'' + ", name='" + this.name + '\'' + '}'; +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/auth/UUIDTypeAdapter.java b/src/main/java/cc/novoline/auth/minecraft/auth/UUIDTypeAdapter.java new file mode 100644 index 0000000..454b9f7 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/auth/UUIDTypeAdapter.java @@ -0,0 +1,32 @@ +package cc.novoline.auth.minecraft.auth; + +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import java.io.IOException; +import java.util.UUID; + +public class UUIDTypeAdapter extends TypeAdapter { + public void write(JsonWriter jsonWriter, UUID uuid) throws IOException { + jsonWriter.value(fromUUID(uuid)); +} + + @Override + public void write(JsonWriter jsonWriter, Object obj) throws IOException {} + + public UUID read(JsonReader jsonReader) throws IOException { + return fromString(jsonReader.nextString()); +} + + public static String toUUID(String text) { + return text == null ? null : text.replace("-", ""); +} + + public static String fromUUID(UUID uuid) { + return toUUID(uuid.toString()); +} + + public static UUID fromString(String text) { + return UUID.fromString(text.replaceFirst("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})", "$1-$2-$3-$4-$5")); +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/auth/User.java b/src/main/java/cc/novoline/auth/minecraft/auth/User.java new file mode 100644 index 0000000..318553f --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/auth/User.java @@ -0,0 +1,16 @@ +package cc.novoline.auth.minecraft.auth; + +import java.util.List; + +public class User { + private String id; + private List properties; + + public String getID() { + return this.id; +} + + public List getProperties() { + return this.properties; +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/auth/UserProperty.java b/src/main/java/cc/novoline/auth/minecraft/auth/UserProperty.java new file mode 100644 index 0000000..3c0fc64 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/auth/UserProperty.java @@ -0,0 +1,24 @@ +package cc.novoline.auth.minecraft.auth; + +public class UserProperty { + private String name; + private String value; + + public UserProperty(String text, String str) { + this.name = text; + this.value = str; +} + + public String getKey() { + return this.name; +} + + public String getValue() { + return this.value; +} + + @Override + public String toString() { + return "Property{" + this.name + " = " + this.value + "}"; +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/exceptions/ParseException.java b/src/main/java/cc/novoline/auth/minecraft/exceptions/ParseException.java new file mode 100644 index 0000000..98e3f4f --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/exceptions/ParseException.java @@ -0,0 +1,16 @@ +package cc.novoline.auth.minecraft.exceptions; + +public class ParseException extends RuntimeException { + + public ParseException(String text) { + super(text); +} + + public ParseException(String text, Throwable throwable) { + super(text, throwable); +} + + public ParseException(Throwable throwable) { + super(throwable); +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/GsonParser.java b/src/main/java/cc/novoline/auth/minecraft/user/GsonParser.java new file mode 100644 index 0000000..ca02063 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/GsonParser.java @@ -0,0 +1,64 @@ +package cc.novoline.auth.minecraft.user; + +import cc.novoline.auth.minecraft.auth.UUIDTypeAdapter; +import cc.novoline.auth.minecraft.exceptions.ParseException; +import cc.novoline.auth.minecraft.user.preq.Validatable; +import com.google.gson.FieldNamingPolicy; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import java.lang.reflect.Type; +import java.util.UUID; +import org.apache.log4j.Logger; + +public class GsonParser implements Parser { + private final Gson gson; + private final Type type; + + public GsonParser(Gson gsonIn, Type typeIn) { + this.gson = gsonIn; + this.type = typeIn; +} + + public static GsonParser defaultParser(Type typeIn) { + return new GsonParser<>(new GsonBuilder().create(), typeIn); +} + + public static GsonParser withDashlessUUIDAdapter(Type typeIn) { + return new GsonParser<>(new GsonBuilder().registerTypeAdapter(UUID.class, new UUIDTypeAdapter()).create(), typeIn); +} + + public static GsonParser lowerCaseWithUnderscores(Type typeIn) { + return new GsonParser<>(new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create(), typeIn); +} + + public static GsonParser upperCamelCase(Type typeIn) { + return new GsonParser<>(new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.UPPER_CAMEL_CASE).create(), typeIn); +} + + public static GsonParser withDeserializer(Type typeIn, Object obj) { + return new GsonParser<>(new GsonBuilder().registerTypeAdapter(typeIn, obj).create(), typeIn); +} + + @Override + public V parseResponse(Logger logger, String text) throws ParseException { + logger.trace("Parsing response"); + + V v; + try { + v = this.gson.fromJson(text, this.type); + } catch (RuntimeException ex) { + throw new ParseException(ex); + } + + logger.trace("Validating response"); + + try { + v.validate(); + return v; + } catch (ParseException ex2) { + throw ex2; + } catch (RuntimeException ex3) { + throw new ParseException(ex3); + } +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/HttpClientRequester.java b/src/main/java/cc/novoline/auth/minecraft/user/HttpClientRequester.java new file mode 100644 index 0000000..7dbab21 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/HttpClientRequester.java @@ -0,0 +1,35 @@ +package cc.novoline.auth.minecraft.user; + +import cc.novoline.auth.minecraft.util.SSLFix; +import java.io.IOException; +import java.util.function.Function; +import org.apache.http.HttpResponse; +import org.apache.http.client.fluent.Request; +import org.apache.http.util.EntityUtils; +import org.apache.log4j.Logger; + +public class HttpClientRequester implements Requester { + private final Function requestFactory; + + public HttpClientRequester(Function function) { + this.requestFactory = function; +} + + @Override + public String makeRequest(Logger logger, A param) throws InvalidResponseException, IOException { + SSLFix.execute(); + Request request2 = this.requestFactory.apply(param); + logger.trace("Sending request: {}" + request2); + HttpResponse httpResponse = request2.execute().returnResponse(); + logger.trace("Reading response"); + String textStr = EntityUtils.toString(httpResponse.getEntity()); + logger.trace("Response: {}" + textStr); + int intVal = httpResponse.getStatusLine().getStatusCode(); + logger.trace("Status code: {}" + intVal); + if (intVal >= 200 && intVal <= 299) { + return textStr; + } else { + throw new InvalidStatusCodeException(intVal, textStr); + } +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/InvalidResponseException.java b/src/main/java/cc/novoline/auth/minecraft/user/InvalidResponseException.java new file mode 100644 index 0000000..f1789ed --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/InvalidResponseException.java @@ -0,0 +1,35 @@ +package cc.novoline.auth.minecraft.user; + +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; + +public class InvalidResponseException extends Exception { + private final String response; + + public InvalidResponseException(String text) { + super(text); + this.response = text; +} + + public InvalidResponseException(String text, String str) { + super(str); + this.response = text; +} + + public InvalidResponseException(String text, Throwable throwable) { + super(text, throwable); + this.response = text; +} + + public String getResponse() { + return this.response; +} + + public JsonObject getResponseAsJson() { + try { + return (JsonObject)new JsonParser().parse(this.response); + } catch (RuntimeException ex) { + return null; + } +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/InvalidStatusCodeException.java b/src/main/java/cc/novoline/auth/minecraft/user/InvalidStatusCodeException.java new file mode 100644 index 0000000..ccf0754 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/InvalidStatusCodeException.java @@ -0,0 +1,20 @@ +package cc.novoline.auth.minecraft.user; + +import org.apache.commons.lang3.StringUtils; + +public class InvalidStatusCodeException extends InvalidResponseException { + private final int statusCode; + + public InvalidStatusCodeException(int value, String text) { + super(text, format(value, text)); + this.statusCode = value; +} + + private static String format(int value, String text) { + return StringUtils.isEmpty(text) ? String.valueOf(value) : value + ": \"" + text + "\""; +} + + public int getStatusCode() { + return this.statusCode; +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/LoginCredentials.java b/src/main/java/cc/novoline/auth/minecraft/user/LoginCredentials.java new file mode 100644 index 0000000..be009a1 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/LoginCredentials.java @@ -0,0 +1,89 @@ +package cc.novoline.auth.minecraft.user; + +import cc.novoline.auth.minecraft.auth.UUIDTypeAdapter; +import cc.novoline.auth.minecraft.util.StringUtil; +import java.util.LinkedHashMap; +import java.util.Locale; +import java.util.UUID; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +public class LoginCredentials { + private final String username; + private final String session; + private final String accessToken; + private final String playerName; + private final String userType; + private final String profileName; + private final String properties; + private final UUID uuid; + + LoginCredentials(String text, String secondaryText, String extraText, String text2, UUID uUID, String text3, String text4) { + this.username = StringUtil.requireNotBlank(text, "username"); + this.accessToken = StringUtil.requireNotBlank(secondaryText, "accessToken"); + this.properties = StringUtils.isBlank(extraText) ? "{}" : extraText; + this.playerName = StringUtil.requireNotBlank(text2, "playerName"); + this.uuid = uUID; + this.userType = StringUtil.requireNotBlank(text3, "userType"); + this.profileName = StringUtil.requireNotBlank(text4, "profileName"); + this.session = String.format(Locale.ROOT, "token:%s:%s", secondaryText, UUIDTypeAdapter.fromUUID(uUID)); +} + + public String getUsername() { + return this.username; +} + + public String getSession() { + return this.session; +} + + public String getAccessToken() { + return this.accessToken; +} + + public String getPlayerName() { + return this.playerName; +} + + public String getUserType() { + return this.userType; +} + + public String getProfileName() { + return this.profileName; +} + + public String getProperties() { + return this.properties; +} + + public UUID getUuid() { + return this.uuid; +} + + public LinkedHashMap map() { + return new LoginCredentials.LoginCredentials$1(this); +} + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) + .append("session", this.session) + .append("accessToken", this.accessToken) + .append("playerName", this.playerName) + .append("userType", this.userType) + .append("profileName", this.profileName) + .append("properties", this.properties) + .append("uuid", this.uuid) + .build(); +} + + class LoginCredentials$1 extends LinkedHashMap { + final LoginCredentials this$0; + + LoginCredentials$1(LoginCredentials loginCredentials) { + this.this$0 = loginCredentials; + } + } +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/MicrosoftOAuthExchangeCode.java b/src/main/java/cc/novoline/auth/minecraft/user/MicrosoftOAuthExchangeCode.java new file mode 100644 index 0000000..b2838b9 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/MicrosoftOAuthExchangeCode.java @@ -0,0 +1,65 @@ +package cc.novoline.auth.minecraft.user; + +public class MicrosoftOAuthExchangeCode { + private final RedirectUrl redirectUrl; + private String code; + + public MicrosoftOAuthExchangeCode(String text, RedirectUrl redirectUrlIn) { + this.code = text; + this.redirectUrl = redirectUrlIn; +} + + public RedirectUrl getRedirectUrl() { + return this.redirectUrl; +} + + public String getCode() { + return this.code; +} + + public void setCode(String text) { + this.code = text; +} + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } else if (!(obj instanceof MicrosoftOAuthExchangeCode)) { + return false; + } else { + MicrosoftOAuthExchangeCode microsoftOAuthExchangeCode = (MicrosoftOAuthExchangeCode)obj; + if (!microsoftOAuthExchangeCode.canEqual(this)) { + return false; + } else { + RedirectUrl redirectUrl2 = this.getRedirectUrl(); + RedirectUrl redirectUrl3 = microsoftOAuthExchangeCode.getRedirectUrl(); + if (redirectUrl2 == null ? redirectUrl3 == null : redirectUrl2.equals(redirectUrl3)) { + String textStr = this.getCode(); + String textStr2 = microsoftOAuthExchangeCode.getCode(); + return textStr == null ? textStr2 == null : textStr.equals(textStr2); + } else { + return false; + } + } + } +} + + public boolean canEqual(Object obj) { + return obj instanceof MicrosoftOAuthExchangeCode; +} + + @Override + public int hashCode() { + int intVal = 1; + RedirectUrl redirectUrl2 = this.getRedirectUrl(); + intVal = intVal * 59 + (redirectUrl2 == null ? 43 : redirectUrl2.hashCode()); + String textStr = this.getCode(); + return intVal * 59 + (textStr == null ? 43 : textStr.hashCode()); +} + + @Override + public String toString() { + return "MicrosoftOAuthExchangeCode(redirectUrl=" + this.getRedirectUrl() + ", code=" + this.getCode() + ")"; +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/MicrosoftOAuthToken.java b/src/main/java/cc/novoline/auth/minecraft/user/MicrosoftOAuthToken.java new file mode 100644 index 0000000..ec76c63 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/MicrosoftOAuthToken.java @@ -0,0 +1,86 @@ +package cc.novoline.auth.minecraft.user; + +import cc.novoline.auth.minecraft.user.preq.Validatable; +import java.time.Instant; +import java.util.Objects; + +public class MicrosoftOAuthToken implements Validatable { + private final Instant createdAt; + private String accessToken; + private String refreshToken; + private int expiresIn; + + public MicrosoftOAuthToken(String text, String str, int value) { + this.accessToken = text; + this.refreshToken = str; + this.createdAt = Instant.now(); + this.expiresIn = value; +} + + public MicrosoftOAuthToken(String text, String str, Instant instant) { + this.accessToken = text; + this.refreshToken = str; + this.createdAt = instant.minusSeconds(3600L); + this.expiresIn = 3600; +} + + public MicrosoftOAuthToken() { + this.createdAt = Instant.now(); +} + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj != null && this.getClass() == obj.getClass()) { + MicrosoftOAuthToken microsoftOAuthToken = (MicrosoftOAuthToken)obj; + return this.expiresIn == microsoftOAuthToken.expiresIn && Objects.equals(this.accessToken, microsoftOAuthToken.accessToken) && Objects.equals(this.refreshToken, microsoftOAuthToken.refreshToken); + } else { + return false; + } +} + + @Override + public int hashCode() { + int intVal = this.accessToken != null ? this.accessToken.hashCode() : 0; + intVal = 31 * intVal + (this.refreshToken != null ? this.refreshToken.hashCode() : 0); + return 31 * intVal + this.expiresIn; +} + + public String getAccessToken() { + return this.accessToken; +} + + public String getRefreshToken() { + return this.refreshToken; +} + + public Instant calculateExpiryTime() { + return this.createdAt.plusSeconds(this.expiresIn); +} + + public boolean isExpired() { + return Instant.now().isAfter(this.calculateExpiryTime()); +} + + @Override + public String toString() { + return "MicrosoftOAuthToken{accessToken='" + + this.accessToken + + '\'' + + ", refreshToken='" + + this.refreshToken + + '\'' + + ", expiresIn=" + + this.expiresIn + + ", createdAt=" + + this.createdAt + + '}'; +} + + @Override + public void validate() { + Validatable.notNull(this.accessToken, "accessToken"); + Validatable.notNull(this.createdAt, "createdAt"); +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/MinecraftAuthenticationException.java b/src/main/java/cc/novoline/auth/minecraft/user/MinecraftAuthenticationException.java new file mode 100644 index 0000000..160be94 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/MinecraftAuthenticationException.java @@ -0,0 +1,19 @@ +package cc.novoline.auth.minecraft.user; + +public abstract class MinecraftAuthenticationException extends Exception { + public MinecraftAuthenticationException() {} + + public MinecraftAuthenticationException(String text) { + super(text); +} + + public MinecraftAuthenticationException(String text, Throwable throwable) { + super(text, throwable); +} + + public MinecraftAuthenticationException(Throwable throwable) { + super(throwable); +} + + public abstract String getShortKey(); +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/MinecraftOAuthAuthenticate.java b/src/main/java/cc/novoline/auth/minecraft/user/MinecraftOAuthAuthenticate.java new file mode 100644 index 0000000..726fb01 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/MinecraftOAuthAuthenticate.java @@ -0,0 +1,50 @@ +package cc.novoline.auth.minecraft.user; + +import cc.novoline.auth.minecraft.MicrosoftOAuthCodeExchanger; +import cc.novoline.auth.minecraft.user.gos.GameOwnershipValidator; +import cc.novoline.auth.minecraft.user.mcsauth.MinecraftServicesAuthenticator; +import cc.novoline.auth.minecraft.user.mcsauth.MinecraftServicesToken; +import cc.novoline.auth.minecraft.user.preq.MinecraftOAuthProfile; +import cc.novoline.auth.minecraft.user.preq.MinecraftProfileRequester; +import cc.novoline.auth.minecraft.user.xb.XboxServiceAuthenticationResponse; +import cc.novoline.auth.minecraft.user.xb.auth.XboxLiveAuthenticator; +import cc.novoline.auth.minecraft.user.xb.xsts.XSTSAuthenticator; +import java.io.IOException; + +public class MinecraftOAuthAuthenticate { + private final MicrosoftOAuthCodeExchanger microsoftOAuthCodeExchanger; + private final XboxLiveAuthenticator xboxLiveAuthenticator; + private final XSTSAuthenticator xstsAuthenticator; + private final MinecraftServicesAuthenticator minecraftServicesAuthenticator; + private final GameOwnershipValidator gameOwnershipValidator; + private final MinecraftProfileRequester minecraftProfileRequester; + private final MinecraftProfileConverter minecraftProfileConverter; + + public MinecraftOAuthAuthenticate( + MicrosoftOAuthCodeExchanger microsoftOAuthCodeExchangerIn, + XboxLiveAuthenticator xboxLiveAuthenticatorIn, + XSTSAuthenticator xSTSAuthenticator, + MinecraftServicesAuthenticator minecraftServicesAuthenticatorIn, + GameOwnershipValidator gameOwnershipValidatorIn, + MinecraftProfileRequester minecraftProfileRequesterIn, + MinecraftProfileConverter minecraftProfileConverterIn + ) { + this.microsoftOAuthCodeExchanger = microsoftOAuthCodeExchangerIn; + this.xboxLiveAuthenticator = xboxLiveAuthenticatorIn; + this.xstsAuthenticator = xSTSAuthenticator; + this.minecraftServicesAuthenticator = minecraftServicesAuthenticatorIn; + this.gameOwnershipValidator = gameOwnershipValidatorIn; + this.minecraftProfileRequester = minecraftProfileRequesterIn; + this.minecraftProfileConverter = minecraftProfileConverterIn; +} + + public MinecraftUser authenticate(MicrosoftOAuthExchangeCode microsoftOAuthExchangeCode) throws MinecraftAuthenticationException, IOException { + MicrosoftOAuthToken microsoftOAuthToken = this.microsoftOAuthCodeExchanger.exchangeMicrosoftOAuthCode(microsoftOAuthExchangeCode); + XboxServiceAuthenticationResponse val = this.xboxLiveAuthenticator.xboxLiveAuthenticate(microsoftOAuthToken.getAccessToken()); + XboxServiceAuthenticationResponse val2 = this.xstsAuthenticator.xstsAuthenticate(val.getToken()); + MinecraftServicesToken minecraftServicesToken = this.minecraftServicesAuthenticator.minecraftServicesAuthenticate(val2); + this.gameOwnershipValidator.checkGameOwnership(minecraftServicesToken); + MinecraftOAuthProfile minecraftOAuthProfile = this.minecraftProfileRequester.requestProfile(minecraftServicesToken); + return this.minecraftProfileConverter.convertToMinecraftUser(microsoftOAuthToken, minecraftServicesToken, minecraftOAuthProfile); +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/MinecraftProfileConversionException.java b/src/main/java/cc/novoline/auth/minecraft/user/MinecraftProfileConversionException.java new file mode 100644 index 0000000..0a70e64 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/MinecraftProfileConversionException.java @@ -0,0 +1,12 @@ +package cc.novoline.auth.minecraft.user; + +public class MinecraftProfileConversionException extends MinecraftAuthenticationException { + public MinecraftProfileConversionException(Throwable throwable) { + super(throwable); +} + + @Override + public String getShortKey() { + return "minecraft_profile_conversion"; +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/MinecraftProfileConverter.java b/src/main/java/cc/novoline/auth/minecraft/user/MinecraftProfileConverter.java new file mode 100644 index 0000000..d5d518b --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/MinecraftProfileConverter.java @@ -0,0 +1,14 @@ +package cc.novoline.auth.minecraft.user; + +import cc.novoline.auth.minecraft.user.mcsauth.MinecraftServicesToken; +import cc.novoline.auth.minecraft.user.preq.MinecraftOAuthProfile; + +public class MinecraftProfileConverter { + public MinecraftUser convertToMinecraftUser(MicrosoftOAuthToken microsoftOAuthToken, MinecraftServicesToken minecraftServicesToken, MinecraftOAuthProfile minecraftOAuthProfile) throws MinecraftProfileConversionException { + try { + return new MinecraftUser(minecraftOAuthProfile, microsoftOAuthToken, minecraftServicesToken); + } catch (RuntimeException ex) { + throw new MinecraftProfileConversionException(ex); + } +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/MinecraftUser.java b/src/main/java/cc/novoline/auth/minecraft/user/MinecraftUser.java new file mode 100644 index 0000000..e868443 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/MinecraftUser.java @@ -0,0 +1,82 @@ +package cc.novoline.auth.minecraft.user; + +import cc.novoline.auth.minecraft.user.mcsauth.MinecraftServicesToken; +import cc.novoline.auth.minecraft.user.preq.MinecraftOAuthProfile; +import java.util.Objects; +import java.util.UUID; + +public class MinecraftUser extends User { + public static final String TYPE = "minecraft"; + private MinecraftOAuthProfile profile; + private MicrosoftOAuthToken microsoftToken; + private MinecraftServicesToken minecraftToken; + + public MinecraftUser(MinecraftOAuthProfile minecraftOAuthProfile, MicrosoftOAuthToken microsoftOAuthToken, MinecraftServicesToken minecraftServicesToken) { + this.setPayload(minecraftOAuthProfile, microsoftOAuthToken, minecraftServicesToken); +} + + @Override + public String getUsername() { + return this.profile.getName(); +} + + @Override + public String getDisplayName() { + return this.profile.getName(); +} + + @Override + public UUID getUUID() { + return this.profile.getId(); +} + + public MicrosoftOAuthToken getMicrosoftToken() { + return this.microsoftToken; +} + + void setMicrosoftToken(MicrosoftOAuthToken microsoftOAuthToken) { + this.microsoftToken = Objects.requireNonNull(microsoftOAuthToken, "microsoftToken"); +} + + public MinecraftServicesToken getMinecraftToken() { + return this.minecraftToken; +} + + void setMinecraftToken(MinecraftServicesToken minecraftServicesToken) { + this.minecraftToken = Objects.requireNonNull(minecraftServicesToken, "minecraftToken"); +} + + void setPayload(MinecraftOAuthProfile minecraftOAuthProfile, MicrosoftOAuthToken microsoftOAuthToken, MinecraftServicesToken minecraftServicesToken) { + this.setProfile(minecraftOAuthProfile); + this.setMicrosoftToken(microsoftOAuthToken); + this.setMinecraftToken(minecraftServicesToken); +} + + void setProfile(MinecraftOAuthProfile minecraftOAuthProfile) { + this.profile = Objects.requireNonNull(minecraftOAuthProfile, "profile"); +} + + @Override + public String getType() { + return "minecraft"; +} + + @Override + public boolean equals(User user) { + return user != null && this.profile.getId().equals(((MinecraftUser)user).profile.getId()); +} + + @Override + public int hashCode() { + int intVal = this.profile.hashCode(); + intVal = 31 * intVal + this.microsoftToken.hashCode(); + return 31 * intVal + this.minecraftToken.hashCode(); +} + + @Override + public LoginCredentials getLoginCredentials() { + return new LoginCredentials( + this.profile.getName(), this.minecraftToken.getAccessToken(), "{}", this.profile.getName(), this.profile.getId(), "mojang", this.profile.getName() + ); +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/Parser.java b/src/main/java/cc/novoline/auth/minecraft/user/Parser.java new file mode 100644 index 0000000..4fec75a --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/Parser.java @@ -0,0 +1,9 @@ +package cc.novoline.auth.minecraft.user; + +import cc.novoline.auth.minecraft.exceptions.ParseException; +import cc.novoline.auth.minecraft.user.preq.Validatable; +import org.apache.log4j.Logger; + +public interface Parser { + V parseResponse(Logger logger, String text) throws ParseException; +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/RedirectUrl.java b/src/main/java/cc/novoline/auth/minecraft/user/RedirectUrl.java new file mode 100644 index 0000000..ff074b8 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/RedirectUrl.java @@ -0,0 +1,50 @@ +package cc.novoline.auth.minecraft.user; + +import java.net.MalformedURLException; +import java.net.URL; + +public class RedirectUrl { + private final URL url; + + public RedirectUrl(URL uRL) { + this.url = uRL; +} + + public RedirectUrl(String text) throws MalformedURLException { + this(new URL(text)); +} + + public static RedirectUrl of(String text) { + try { + return new RedirectUrl(text); + } catch (MalformedURLException ex) { + throw new Error("invalid url: " + text, ex); + } +} + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj != null && this.getClass() == obj.getClass()) { + RedirectUrl redirectUrl = (RedirectUrl)obj; + return this.url.equals(redirectUrl.url); + } else { + return false; + } +} + + @Override + public int hashCode() { + return this.url.hashCode(); +} + + public URL getUrl() { + return this.url; +} + + @Override + public String toString() { + return "RedirectUrl{uri=" + this.url + '}'; +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/RequestAndParseStrategy.java b/src/main/java/cc/novoline/auth/minecraft/user/RequestAndParseStrategy.java new file mode 100644 index 0000000..21995a5 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/RequestAndParseStrategy.java @@ -0,0 +1,29 @@ +package cc.novoline.auth.minecraft.user; + +import cc.novoline.auth.minecraft.exceptions.ParseException; +import cc.novoline.auth.minecraft.user.preq.Validatable; +import java.io.IOException; +import org.apache.log4j.Logger; + +public abstract class RequestAndParseStrategy { + private final Logger logger; + private final Requester requester; + private final Parser parser; + + public RequestAndParseStrategy(Logger logger2, Requester requesterIn, Parser parserIn) { + this.logger = logger2; + this.requester = requesterIn; + this.parser = parserIn; +} + + public V requestAndParse(A param) throws IOException, InvalidResponseException { + String textStr = this.requester.makeRequest(this.logger, param); + + try { + return this.parser.parseResponse(this.logger, textStr); + } catch (ParseException ex) { + ex.printStackTrace(); + throw new InvalidResponseException(textStr, ex); + } +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/Requester.java b/src/main/java/cc/novoline/auth/minecraft/user/Requester.java new file mode 100644 index 0000000..0c41733 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/Requester.java @@ -0,0 +1,8 @@ +package cc.novoline.auth.minecraft.user; + +import java.io.IOException; +import org.apache.log4j.Logger; + +public interface Requester { + String makeRequest(Logger logger, A param) throws InvalidResponseException, IOException; +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/User.java b/src/main/java/cc/novoline/auth/minecraft/user/User.java new file mode 100644 index 0000000..b1d28a4 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/User.java @@ -0,0 +1,45 @@ +package cc.novoline.auth.minecraft.user; + +import java.util.UUID; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +public abstract class User { + public abstract String getUsername(); + + public abstract String getDisplayName(); + + public abstract UUID getUUID(); + + public abstract String getType(); + + public abstract boolean equals(User user); + + @Override + public abstract int hashCode(); + + public abstract LoginCredentials getLoginCredentials(); + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof User)) { + return false; + } + + User user = (User)obj; + return this.getType().equals(user.getType()) && this.equals(user); +} + + public ToStringBuilder toStringBuilder() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) + .append("username", this.getUsername()) + .append("displayName", this.getDisplayName()) + .append("uuid", this.getUUID()) + .append("type", this.getType()); +} + + @Override + public final String toString() { + return this.toStringBuilder().build(); +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/gos/GameOwnershipValidationException.java b/src/main/java/cc/novoline/auth/minecraft/user/gos/GameOwnershipValidationException.java new file mode 100644 index 0000000..de0f429 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/gos/GameOwnershipValidationException.java @@ -0,0 +1,26 @@ +package cc.novoline.auth.minecraft.user.gos; + +import cc.novoline.auth.minecraft.user.MinecraftAuthenticationException; + +public class GameOwnershipValidationException extends MinecraftAuthenticationException { + private final boolean isKnownNotToOwn; + + public GameOwnershipValidationException(Throwable throwable) { + super(throwable); + this.isKnownNotToOwn = false; +} + + public GameOwnershipValidationException(String text) { + super(text); + this.isKnownNotToOwn = true; +} + + public boolean isKnownNotToOwn() { + return this.isKnownNotToOwn; +} + + @Override + public String getShortKey() { + return "game_ownership"; +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/gos/GameOwnershipValidator.java b/src/main/java/cc/novoline/auth/minecraft/user/gos/GameOwnershipValidator.java new file mode 100644 index 0000000..bc5e127 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/gos/GameOwnershipValidator.java @@ -0,0 +1,58 @@ +package cc.novoline.auth.minecraft.user.gos; + +import cc.novoline.auth.minecraft.user.GsonParser; +import cc.novoline.auth.minecraft.user.HttpClientRequester; +import cc.novoline.auth.minecraft.user.InvalidResponseException; +import cc.novoline.auth.minecraft.user.Parser; +import cc.novoline.auth.minecraft.user.RequestAndParseStrategy; +import cc.novoline.auth.minecraft.user.Requester; +import cc.novoline.auth.minecraft.user.mcsauth.MinecraftServicesToken; +import java.io.IOException; +import java.util.List; +import org.apache.http.client.fluent.Request; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; + +public class GameOwnershipValidator extends RequestAndParseStrategy { + private static final Logger LOGGER = LogManager.getLogger(GameOwnershipValidator.class); + + @SuppressWarnings({"rawtypes", "unchecked"}) + public GameOwnershipValidator() { + this( + new HttpClientRequester( + arg -> Request.Get("https://api.minecraftservices.com/entitlements/mcstore") + .addHeader("Authorization", "Bearer " + ((MinecraftServicesToken)arg).getAccessToken()) + ) + ); +} + + GameOwnershipValidator(Requester requesterArg) { + this(requesterArg, GsonParser.defaultParser(MinecraftUserGameOwnershipResponse.class)); +} + + GameOwnershipValidator(Requester requesterArg, Parser parserArg) { + super(LOGGER, requesterArg, parserArg); +} + + public void checkGameOwnership(MinecraftServicesToken minecraftServicesToken) throws GameOwnershipValidationException, IOException { + MinecraftUserGameOwnershipResponse val; + try { + val = this.requestAndParse(minecraftServicesToken); + } catch (InvalidResponseException ex) { + throw new GameOwnershipValidationException(ex); + } + + List itemList = val.getItems(); + if (itemList.isEmpty()) { + throw new GameOwnershipValidationException("no ownership found"); + } + + if (itemList.stream().noneMatch((MinecraftUserGameOwnershipResponse.Item item) -> "product_minecraft".equals(item.getName()))) { + throw new GameOwnershipValidationException("no \"product_minecraft\""); + } + + if (itemList.stream().noneMatch((MinecraftUserGameOwnershipResponse.Item item2) -> "game_minecraft".equals(item2.getName()))) { + throw new GameOwnershipValidationException("no \"game_minecraft\""); + } +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/gos/MinecraftUserGameOwnershipResponse.java b/src/main/java/cc/novoline/auth/minecraft/user/gos/MinecraftUserGameOwnershipResponse.java new file mode 100644 index 0000000..b5a20e5 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/gos/MinecraftUserGameOwnershipResponse.java @@ -0,0 +1,88 @@ +package cc.novoline.auth.minecraft.user.gos; + +import cc.novoline.auth.minecraft.user.preq.Validatable; +import java.util.List; +import java.util.Objects; + +public class MinecraftUserGameOwnershipResponse implements Validatable { + private List items; + + public MinecraftUserGameOwnershipResponse(List list) { + this.items = list; +} + + public MinecraftUserGameOwnershipResponse() {} + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj != null && this.getClass() == obj.getClass()) { + MinecraftUserGameOwnershipResponse val = (MinecraftUserGameOwnershipResponse)obj; + return Objects.equals(this.items, val.items); + } else { + return false; + } +} + + @Override + public int hashCode() { + return this.items != null ? this.items.hashCode() : 0; +} + + public List getItems() { + return this.items; +} + + @Override + public void validate() { + Validatable.notNull(this.items, "items"); + + for (MinecraftUserGameOwnershipResponse.Item item : this.items) { + item.validate(); + } +} + + @Override + public String toString() { + return "MinecraftUserGameOwnershipResponse{items=" + this.items + '}'; +} + + public static class Item implements Validatable { + private String name; + private String signature; + + public String getName() { + return this.name; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj != null && this.getClass() == obj.getClass()) { + MinecraftUserGameOwnershipResponse.Item item = (MinecraftUserGameOwnershipResponse.Item)obj; + return this.name.equals(item.name) && this.signature.equals(item.signature); + } else { + return false; + } + } + + @Override + public int hashCode() { + int intVal = this.name.hashCode(); + return 31 * intVal + this.signature.hashCode(); + } + + @Override + public String toString() { + return "Item{name='" + this.name + '\'' + ", signature='" + this.signature + '\'' + '}'; + } + + @Override + public void validate() { + Validatable.notEmpty(this.name, "name"); + Validatable.notEmpty(this.signature, "signature"); + } + } +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/mcsauth/MinecraftServicesAuthenticationException.java b/src/main/java/cc/novoline/auth/minecraft/user/mcsauth/MinecraftServicesAuthenticationException.java new file mode 100644 index 0000000..048d294 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/mcsauth/MinecraftServicesAuthenticationException.java @@ -0,0 +1,14 @@ +package cc.novoline.auth.minecraft.user.mcsauth; + +import cc.novoline.auth.minecraft.user.MinecraftAuthenticationException; + +public class MinecraftServicesAuthenticationException extends MinecraftAuthenticationException { + public MinecraftServicesAuthenticationException(Throwable throwable) { + super(throwable); +} + + @Override + public String getShortKey() { + return "minecraft_services_auth"; +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/mcsauth/MinecraftServicesAuthenticator.java b/src/main/java/cc/novoline/auth/minecraft/user/mcsauth/MinecraftServicesAuthenticator.java new file mode 100644 index 0000000..89d804a --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/mcsauth/MinecraftServicesAuthenticator.java @@ -0,0 +1,44 @@ +package cc.novoline.auth.minecraft.user.mcsauth; + +import cc.novoline.auth.minecraft.user.GsonParser; +import cc.novoline.auth.minecraft.user.HttpClientRequester; +import cc.novoline.auth.minecraft.user.InvalidResponseException; +import cc.novoline.auth.minecraft.user.Parser; +import cc.novoline.auth.minecraft.user.RequestAndParseStrategy; +import cc.novoline.auth.minecraft.user.Requester; +import cc.novoline.auth.minecraft.user.xb.XboxServiceAuthenticationResponse; +import java.io.IOException; +import java.util.Locale; +import org.apache.http.client.fluent.Request; +import org.apache.http.entity.ContentType; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; + +public class MinecraftServicesAuthenticator extends RequestAndParseStrategy { + private static final Logger LOGGER = LogManager.getLogger(MinecraftServicesAuthenticator.class); + + public MinecraftServicesAuthenticator() { + this( + new HttpClientRequester( + arg -> Request.Post("https://api.minecraftservices.com/authentication/login_with_xbox") + .bodyString(String.format(Locale.ROOT, "{\"identityToken\":\"XBL3.0 x=%s;%s\"}", ((XboxServiceAuthenticationResponse)arg).getUHS(), ((XboxServiceAuthenticationResponse)arg).getToken()), ContentType.APPLICATION_JSON) + ) + ); +} + + MinecraftServicesAuthenticator(Requester requesterArg) { + this(requesterArg, GsonParser.lowerCaseWithUnderscores(MinecraftServicesToken.class)); +} + + MinecraftServicesAuthenticator(Requester requesterArg, Parser parserArg) { + super(LOGGER, requesterArg, parserArg); +} + + public MinecraftServicesToken minecraftServicesAuthenticate(XboxServiceAuthenticationResponse xboxServiceAuthenticationResponse) throws MinecraftServicesAuthenticationException, IOException { + try { + return this.requestAndParse(xboxServiceAuthenticationResponse); + } catch (InvalidResponseException ex) { + throw new MinecraftServicesAuthenticationException(ex); + } +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/mcsauth/MinecraftServicesToken.java b/src/main/java/cc/novoline/auth/minecraft/user/mcsauth/MinecraftServicesToken.java new file mode 100644 index 0000000..2be86fb --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/mcsauth/MinecraftServicesToken.java @@ -0,0 +1,71 @@ +package cc.novoline.auth.minecraft.user.mcsauth; + +import cc.novoline.auth.minecraft.user.preq.Validatable; +import java.time.Instant; + +public class MinecraftServicesToken implements Validatable { + private final Instant createdAt; + private String accessToken; + private int expiresIn; + + public MinecraftServicesToken(String text, int value) { + this.accessToken = text; + this.createdAt = Instant.now(); + this.expiresIn = value; +} + + public MinecraftServicesToken(String text, Instant instant) { + this.accessToken = text; + this.createdAt = instant.minusSeconds(3600L); + this.expiresIn = 3600; +} + + public MinecraftServicesToken() { + this.createdAt = Instant.now(); +} + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj != null && this.getClass() == obj.getClass()) { + MinecraftServicesToken minecraftServicesToken = (MinecraftServicesToken)obj; + return this.expiresIn == minecraftServicesToken.expiresIn && this.accessToken.equals(minecraftServicesToken.accessToken); + } else { + return false; + } +} + + @Override + public int hashCode() { + int intVal = this.accessToken.hashCode(); + return 31 * intVal + this.expiresIn; +} + + public String getAccessToken() { + return this.accessToken; +} + + public int getExpiresIn() { + return this.expiresIn; +} + + public Instant calculateExpiryTime() { + return this.createdAt.plusSeconds(this.expiresIn); +} + + public boolean isExpired() { + return Instant.now().isAfter(this.calculateExpiryTime()); +} + + @Override + public String toString() { + return "MinecraftServicesToken{accessToken='" + this.accessToken + '\'' + ", expiresIn=" + this.expiresIn + '}'; +} + + @Override + public void validate() { + Validatable.notEmpty(this.accessToken, "accessToken"); + Validatable.notNegative(this.expiresIn, "expiresIn"); +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/oauth/exchange/MicrosoftOAuthCodeExchangeException.java b/src/main/java/cc/novoline/auth/minecraft/user/oauth/exchange/MicrosoftOAuthCodeExchangeException.java new file mode 100644 index 0000000..2b8a6b3 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/oauth/exchange/MicrosoftOAuthCodeExchangeException.java @@ -0,0 +1,14 @@ +package cc.novoline.auth.minecraft.user.oauth.exchange; + +import cc.novoline.auth.minecraft.user.MinecraftAuthenticationException; + +public class MicrosoftOAuthCodeExchangeException extends MinecraftAuthenticationException { + public MicrosoftOAuthCodeExchangeException(Throwable throwable) { + super(throwable); +} + + @Override + public String getShortKey() { + return "microsoft_oauth_code_exchange"; +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/oauth/exchange/MicrosoftOAuthCodeExchangerImpl.java b/src/main/java/cc/novoline/auth/minecraft/user/oauth/exchange/MicrosoftOAuthCodeExchangerImpl.java new file mode 100644 index 0000000..222c1af --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/oauth/exchange/MicrosoftOAuthCodeExchangerImpl.java @@ -0,0 +1,31 @@ +package cc.novoline.auth.minecraft.user.oauth.exchange; + +import cc.novoline.auth.minecraft.MicrosoftOAuthCodeExchanger; +import cc.novoline.auth.minecraft.user.GsonParser; +import cc.novoline.auth.minecraft.user.HttpClientRequester; +import cc.novoline.auth.minecraft.user.MicrosoftOAuthToken; +import org.apache.http.client.fluent.Form; +import org.apache.http.client.fluent.Request; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; + +public class MicrosoftOAuthCodeExchangerImpl extends MicrosoftOAuthCodeExchanger { + private static final Logger LOGGER = LogManager.getLogger(MicrosoftOAuthCodeExchangerImpl.class); + + public MicrosoftOAuthCodeExchangerImpl(String text, String str) { + super( + new HttpClientRequester( + var2x -> Request.Post(str) + .bodyForm( + Form.form() + .add("client_id", text) + .add("code", ((cc.novoline.auth.minecraft.user.MicrosoftOAuthExchangeCode)var2x).getCode()) + .add("grant_type", "authorization_code") + .add("redirect_uri", ((cc.novoline.auth.minecraft.user.MicrosoftOAuthExchangeCode)var2x).getRedirectUrl().getUrl().toString()) + .build() + ) + ), + GsonParser.lowerCaseWithUnderscores(MicrosoftOAuthToken.class) + ); +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/oauth/exchange/MicrosoftOAuthRefreshCodeExchangerIMpl.java b/src/main/java/cc/novoline/auth/minecraft/user/oauth/exchange/MicrosoftOAuthRefreshCodeExchangerIMpl.java new file mode 100644 index 0000000..abc4273 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/oauth/exchange/MicrosoftOAuthRefreshCodeExchangerIMpl.java @@ -0,0 +1,31 @@ +package cc.novoline.auth.minecraft.user.oauth.exchange; + +import cc.novoline.auth.minecraft.MicrosoftOAuthCodeExchanger; +import cc.novoline.auth.minecraft.user.GsonParser; +import cc.novoline.auth.minecraft.user.HttpClientRequester; +import cc.novoline.auth.minecraft.user.MicrosoftOAuthToken; +import org.apache.http.client.fluent.Form; +import org.apache.http.client.fluent.Request; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; + +public class MicrosoftOAuthRefreshCodeExchangerIMpl extends MicrosoftOAuthCodeExchanger { + private static final Logger LOGGER = LogManager.getLogger(MicrosoftOAuthRefreshCodeExchangerIMpl.class); + + public MicrosoftOAuthRefreshCodeExchangerIMpl(String text, String str) { + super( + new HttpClientRequester( + var2x -> Request.Post(str) + .bodyForm( + Form.form() + .add("client_id", text) + .add("refresh_token", ((cc.novoline.auth.minecraft.user.MicrosoftOAuthExchangeCode)var2x).getCode()) + .add("grant_type", "refresh_token") + .add("redirect_uri", ((cc.novoline.auth.minecraft.user.MicrosoftOAuthExchangeCode)var2x).getRedirectUrl().getUrl().toString()) + .build() + ) + ), + GsonParser.lowerCaseWithUnderscores(MicrosoftOAuthToken.class) + ); +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/preq/MinecraftOAuthProfile.java b/src/main/java/cc/novoline/auth/minecraft/user/preq/MinecraftOAuthProfile.java new file mode 100644 index 0000000..5b67255 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/preq/MinecraftOAuthProfile.java @@ -0,0 +1,53 @@ +package cc.novoline.auth.minecraft.user.preq; + +import java.util.Objects; +import java.util.UUID; + +public class MinecraftOAuthProfile implements Validatable { + private UUID id; + private String name; + + public MinecraftOAuthProfile(UUID uuid, String text) { + this.id = uuid; + this.name = text; +} + + public MinecraftOAuthProfile() {} + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj != null && this.getClass() == obj.getClass()) { + MinecraftOAuthProfile minecraftOAuthProfile = (MinecraftOAuthProfile)obj; + return Objects.equals(this.id, minecraftOAuthProfile.id) && Objects.equals(this.name, minecraftOAuthProfile.name); + } else { + return false; + } +} + + @Override + public int hashCode() { + int intVal = this.id != null ? this.id.hashCode() : 0; + return 31 * intVal + (this.name != null ? this.name.hashCode() : 0); +} + + public UUID getId() { + return this.id; +} + + public String getName() { + return this.name; +} + + @Override + public String toString() { + return "MinecraftOAuthProfile{id='" + this.id + '\'' + ", name='" + this.name + '\'' + '}'; +} + + @Override + public void validate() { + Validatable.notNull(this.id, "id"); + Validatable.notEmpty(this.name, "name"); +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/preq/MinecraftProfileRequestException.java b/src/main/java/cc/novoline/auth/minecraft/user/preq/MinecraftProfileRequestException.java new file mode 100644 index 0000000..7e5a5ce --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/preq/MinecraftProfileRequestException.java @@ -0,0 +1,14 @@ +package cc.novoline.auth.minecraft.user.preq; + +import cc.novoline.auth.minecraft.user.MinecraftAuthenticationException; + +public class MinecraftProfileRequestException extends MinecraftAuthenticationException { + public MinecraftProfileRequestException(Throwable throwable) { + super(throwable); +} + + @Override + public String getShortKey() { + return "minecraft_profile_request"; +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/preq/MinecraftProfileRequester.java b/src/main/java/cc/novoline/auth/minecraft/user/preq/MinecraftProfileRequester.java new file mode 100644 index 0000000..e6e62cd --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/preq/MinecraftProfileRequester.java @@ -0,0 +1,41 @@ +package cc.novoline.auth.minecraft.user.preq; + +import cc.novoline.auth.minecraft.user.GsonParser; +import cc.novoline.auth.minecraft.user.HttpClientRequester; +import cc.novoline.auth.minecraft.user.InvalidResponseException; +import cc.novoline.auth.minecraft.user.Parser; +import cc.novoline.auth.minecraft.user.RequestAndParseStrategy; +import cc.novoline.auth.minecraft.user.Requester; +import cc.novoline.auth.minecraft.user.mcsauth.MinecraftServicesToken; +import java.io.IOException; +import org.apache.http.client.fluent.Request; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; + +public class MinecraftProfileRequester extends RequestAndParseStrategy { + private static final Logger LOGGER = LogManager.getLogger(MinecraftProfileRequester.class); + + public MinecraftProfileRequester() { + this( + new HttpClientRequester( + arg -> Request.Get("https://api.minecraftservices.com/minecraft/profile").addHeader("Authorization", "Bearer " + ((MinecraftServicesToken)arg).getAccessToken()) + ) + ); +} + + MinecraftProfileRequester(Requester requesterArg) { + this(requesterArg, GsonParser.withDashlessUUIDAdapter(MinecraftOAuthProfile.class)); +} + + MinecraftProfileRequester(Requester requesterArg, Parser parserArg) { + super(LOGGER, requesterArg, parserArg); +} + + public MinecraftOAuthProfile requestProfile(MinecraftServicesToken minecraftServicesToken) throws MinecraftProfileRequestException, IOException { + try { + return this.requestAndParse(minecraftServicesToken); + } catch (InvalidResponseException ex) { + throw new MinecraftProfileRequestException(ex); + } +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/preq/Validatable.java b/src/main/java/cc/novoline/auth/minecraft/user/preq/Validatable.java new file mode 100644 index 0000000..47197c5 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/preq/Validatable.java @@ -0,0 +1,29 @@ +package cc.novoline.auth.minecraft.user.preq; + +import org.apache.commons.lang3.StringUtils; + +public interface Validatable { + static void notNull(Object obj, String text) { + if (obj == null) { + throw new NullPointerException(text); + } +} + + static void notEmpty(String text, String str) { + if (text == null) { + throw new NullPointerException(str); + } + + if (StringUtils.isEmpty(text)) { + throw new IllegalArgumentException("blank " + str); + } +} + + static void notNegative(int value, String text) { + if (value < 0) { + throw new IllegalArgumentException("negative " + text); + } +} + + void validate(); +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/xb/XboxServiceAuthStrategy.java b/src/main/java/cc/novoline/auth/minecraft/user/xb/XboxServiceAuthStrategy.java new file mode 100644 index 0000000..9a10b2e --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/xb/XboxServiceAuthStrategy.java @@ -0,0 +1,21 @@ +package cc.novoline.auth.minecraft.user.xb; + +import cc.novoline.auth.minecraft.user.GsonParser; +import cc.novoline.auth.minecraft.user.Parser; +import cc.novoline.auth.minecraft.user.RequestAndParseStrategy; +import cc.novoline.auth.minecraft.user.Requester; +import org.apache.log4j.Logger; + +public abstract class XboxServiceAuthStrategy extends RequestAndParseStrategy { + public XboxServiceAuthStrategy(Logger logger, Requester requester) { + this(logger, requester, createGsonParser()); +} + + public XboxServiceAuthStrategy(Logger logger, Requester requester, Parser parser) { + super(logger, requester, parser); +} + + public static GsonParser createGsonParser() { + return GsonParser.withDeserializer(XboxServiceAuthenticationResponse.class, new XboxServiceAuthenticationResponse.Deserializer()); +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/xb/XboxServiceAuthenticationResponse.java b/src/main/java/cc/novoline/auth/minecraft/user/xb/XboxServiceAuthenticationResponse.java new file mode 100644 index 0000000..5486db7 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/xb/XboxServiceAuthenticationResponse.java @@ -0,0 +1,67 @@ +package cc.novoline.auth.minecraft.user.xb; + +import cc.novoline.auth.minecraft.user.preq.Validatable; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import java.lang.reflect.Type; +import java.util.Objects; + +public class XboxServiceAuthenticationResponse implements Validatable { + private final String token; + private final String uhs; + + public XboxServiceAuthenticationResponse(String text, String str) { + this.token = text; + this.uhs = str; +} + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj != null && this.getClass() == obj.getClass()) { + XboxServiceAuthenticationResponse val = (XboxServiceAuthenticationResponse)obj; + return Objects.equals(this.token, val.token) && Objects.equals(this.uhs, val.uhs); + } else { + return false; + } +} + + @Override + public int hashCode() { + int intVal = this.token != null ? this.token.hashCode() : 0; + return 31 * intVal + (this.uhs != null ? this.uhs.hashCode() : 0); +} + + public String getToken() { + return this.token; +} + + public String getUHS() { + return this.uhs; +} + + @Override + public String toString() { + return "XboxServiceAuthenticationResponse{token='" + this.token + '\'' + ", uhs='" + this.uhs + '\'' + '}'; +} + + @Override + public void validate() { + Validatable.notEmpty(this.token, "token"); + Validatable.notEmpty(this.uhs, "uhs"); +} + + public static class Deserializer implements JsonDeserializer { + public XboxServiceAuthenticationResponse deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException { + JsonObject jsonObject = jsonElement.getAsJsonObject(); + return new XboxServiceAuthenticationResponse( + jsonObject.get("Token").getAsString(), + jsonObject.get("DisplayClaims").getAsJsonObject().get("xui").getAsJsonArray().get(0).getAsJsonObject().get("uhs").getAsString() + ); + } + } +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/xb/auth/XboxLiveAuthenticationException.java b/src/main/java/cc/novoline/auth/minecraft/user/xb/auth/XboxLiveAuthenticationException.java new file mode 100644 index 0000000..ab72549 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/xb/auth/XboxLiveAuthenticationException.java @@ -0,0 +1,14 @@ +package cc.novoline.auth.minecraft.user.xb.auth; + +import cc.novoline.auth.minecraft.user.MinecraftAuthenticationException; + +public class XboxLiveAuthenticationException extends MinecraftAuthenticationException { + public XboxLiveAuthenticationException(Throwable throwable) { + super(throwable); +} + + @Override + public String getShortKey() { + return "xbox_live_authentication"; +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/xb/auth/XboxLiveAuthenticator.java b/src/main/java/cc/novoline/auth/minecraft/user/xb/auth/XboxLiveAuthenticator.java new file mode 100644 index 0000000..337b68f --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/xb/auth/XboxLiveAuthenticator.java @@ -0,0 +1,52 @@ +package cc.novoline.auth.minecraft.user.xb.auth; + +import cc.novoline.auth.OAuthApplication; +import cc.novoline.auth.minecraft.user.HttpClientRequester; +import cc.novoline.auth.minecraft.user.InvalidResponseException; +import cc.novoline.auth.minecraft.user.MicrosoftOAuthToken; +import cc.novoline.auth.minecraft.user.Requester; +import cc.novoline.auth.minecraft.user.xb.XboxServiceAuthStrategy; +import cc.novoline.auth.minecraft.user.xb.XboxServiceAuthenticationResponse; +import java.io.IOException; +import java.util.Locale; +import org.apache.http.client.fluent.Request; +import org.apache.http.entity.ContentType; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; + +public class XboxLiveAuthenticator extends XboxServiceAuthStrategy { + private static final Logger LOGGER = LogManager.getLogger(XboxLiveAuthenticator.class); + + public XboxLiveAuthenticator(OAuthApplication oAuthApplication) { + super( + LOGGER, + new HttpClientRequester( + var1x -> Request.Post("https://user.auth.xboxlive.com/user/authenticate") + .bodyString( + String.format( + Locale.ROOT, + "{\"Properties\":{\"AuthMethod\":\"RPS\",\"SiteName\":\"user.auth.xboxlive.com\",\"RpsTicket\":\"%s\"},\"RelyingParty\":\"http://auth.xboxlive.com\",\"TokenType\":\"JWT\"}", + (oAuthApplication.isUseWeirdXboxTokenPrefix() ? "d=" : "") + var1x + ), + ContentType.APPLICATION_JSON + ) + ) + ); +} + + XboxLiveAuthenticator(Requester requesterArg) { + super(LOGGER, requesterArg); +} + + public XboxServiceAuthenticationResponse xboxLiveAuthenticate(String text) throws XboxLiveAuthenticationException, IOException { + try { + return this.requestAndParse(text); + } catch (InvalidResponseException ex) { + throw new XboxLiveAuthenticationException(ex); + } +} + + public XboxServiceAuthenticationResponse xboxLiveAuthenticate(MicrosoftOAuthToken microsoftOAuthToken) throws XboxLiveAuthenticationException, IOException { + return this.xboxLiveAuthenticate(microsoftOAuthToken.getAccessToken()); +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/xb/xsts/ChildAccountException.java b/src/main/java/cc/novoline/auth/minecraft/user/xb/xsts/ChildAccountException.java new file mode 100644 index 0000000..eb5b535 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/xb/xsts/ChildAccountException.java @@ -0,0 +1,8 @@ +package cc.novoline.auth.minecraft.user.xb.xsts; + +public class ChildAccountException extends XSTSAuthenticationException { + @Override + public String getShortKey() { + return super.getShortKey() + ".child_account"; +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/xb/xsts/NoXboxAccountException.java b/src/main/java/cc/novoline/auth/minecraft/user/xb/xsts/NoXboxAccountException.java new file mode 100644 index 0000000..9dc25c9 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/xb/xsts/NoXboxAccountException.java @@ -0,0 +1,8 @@ +package cc.novoline.auth.minecraft.user.xb.xsts; + +public class NoXboxAccountException extends XSTSAuthenticationException { + @Override + public String getShortKey() { + return super.getShortKey() + ".no_xbox_account"; +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/xb/xsts/XSTSAuthenticationException.java b/src/main/java/cc/novoline/auth/minecraft/user/xb/xsts/XSTSAuthenticationException.java new file mode 100644 index 0000000..3ee0a99 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/xb/xsts/XSTSAuthenticationException.java @@ -0,0 +1,16 @@ +package cc.novoline.auth.minecraft.user.xb.xsts; + +import cc.novoline.auth.minecraft.user.MinecraftAuthenticationException; + +public class XSTSAuthenticationException extends MinecraftAuthenticationException { + public XSTSAuthenticationException() {} + + public XSTSAuthenticationException(Throwable throwable) { + super(throwable); +} + + @Override + public String getShortKey() { + return "xsts_authentication"; +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/user/xb/xsts/XSTSAuthenticator.java b/src/main/java/cc/novoline/auth/minecraft/user/xb/xsts/XSTSAuthenticator.java new file mode 100644 index 0000000..f341832 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/user/xb/xsts/XSTSAuthenticator.java @@ -0,0 +1,77 @@ +package cc.novoline.auth.minecraft.user.xb.xsts; + +import cc.novoline.auth.minecraft.user.HttpClientRequester; +import cc.novoline.auth.minecraft.user.InvalidResponseException; +import cc.novoline.auth.minecraft.user.InvalidStatusCodeException; +import cc.novoline.auth.minecraft.user.Requester; +import cc.novoline.auth.minecraft.user.xb.XboxServiceAuthStrategy; +import cc.novoline.auth.minecraft.user.xb.XboxServiceAuthenticationResponse; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; +import java.io.IOException; +import java.util.Locale; +import org.apache.http.client.fluent.Request; +import org.apache.http.entity.ContentType; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; + +public class XSTSAuthenticator extends XboxServiceAuthStrategy { + private static final Logger LOGGER = LogManager.getLogger(XSTSAuthenticator.class); + + public XSTSAuthenticator() { + super( + LOGGER, + new HttpClientRequester( + arg -> Request.Post("https://xsts.auth.xboxlive.com/xsts/authorize") + .bodyString( + String.format( + Locale.ROOT, + "{\"Properties\":{\"SandboxId\":\"RETAIL\",\"UserTokens\":[\"%s\"]},\"RelyingParty\": \"rp://api.minecraftservices.com/\",\"TokenType\": \"JWT\"}", + arg + ), + ContentType.APPLICATION_JSON + ) + ) + ); +} + + XSTSAuthenticator(Requester requesterArg) { + super(LOGGER, requesterArg); +} + + private static XSTSAuthenticationException parseXErr(JsonObject jsonObject) { + if (jsonObject.has("XErr")) { + JsonElement jsonElement = jsonObject.get("XErr"); + if (jsonElement instanceof JsonPrimitive) { + String textStr = jsonElement.getAsString(); + switch (textStr) { + case "2148916233": + return new NoXboxAccountException(); + case "2148916238": + return new ChildAccountException(); + } + } + } + + return null; +} + + public XboxServiceAuthenticationResponse xstsAuthenticate(String text) throws XSTSAuthenticationException, IOException { + try { + return this.requestAndParse(text); + } catch (InvalidResponseException ex) { + if (ex instanceof InvalidStatusCodeException && ((InvalidStatusCodeException)ex).getStatusCode() == 401) { + JsonObject jsonObject = ex.getResponseAsJson(); + if (jsonObject != null) { + XSTSAuthenticationException ex2 = parseXErr(jsonObject); + if (ex2 != null) { + throw ex2; + } + } + } + + throw new XSTSAuthenticationException(ex); + } +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/util/SSLFix.java b/src/main/java/cc/novoline/auth/minecraft/util/SSLFix.java new file mode 100644 index 0000000..a0ff439 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/util/SSLFix.java @@ -0,0 +1,54 @@ +package cc.novoline.auth.minecraft.util; + +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSession; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; + +public class SSLFix { + public static void execute() { + TrustManager[] trustManagerArr = new TrustManager[]{new X509TrustManager() { + @Override + public X509Certificate[] getAcceptedIssuers() { + return null; + } + + @Override + public void checkClientTrusted(X509Certificate[] x509CertificateArr, String textStr) throws CertificateException { + } + + @Override + public void checkServerTrusted(X509Certificate[] x509CertificateArr2, String textStr2) throws CertificateException { + } + }}; + SSLContext sSLContext = null; + + try { + sSLContext = SSLContext.getInstance("SSL"); + } catch (NoSuchAlgorithmException ex) { + ex.printStackTrace(); + } + + try { + sSLContext.init(null, trustManagerArr, new SecureRandom()); + } catch (KeyManagementException ex2) { + ex2.printStackTrace(); + } + + HttpsURLConnection.setDefaultSSLSocketFactory(sSLContext.getSocketFactory()); + HostnameVerifier hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String textStr3, SSLSession sSLSession) { + return true; + } + }; + HttpsURLConnection.setDefaultHostnameVerifier(hostnameVerifier); +} +} diff --git a/src/main/java/cc/novoline/auth/minecraft/util/StringUtil.java b/src/main/java/cc/novoline/auth/minecraft/util/StringUtil.java new file mode 100644 index 0000000..489a070 --- /dev/null +++ b/src/main/java/cc/novoline/auth/minecraft/util/StringUtil.java @@ -0,0 +1,353 @@ +package cc.novoline.auth.minecraft.util; + +import cc.novoline.auth.minecraft.exceptions.ParseException; +import java.nio.ByteBuffer; +import java.nio.CharBuffer; +import java.nio.charset.Charset; +import java.nio.charset.CharsetDecoder; +import java.nio.charset.CharsetEncoder; +import java.util.List; +import java.util.Random; +import org.apache.commons.lang3.StringUtils; + +public class StringUtil { + public static final String LINK_PATTERN = "link"; + + public static String iconv(String text, String str, String value) { + Charset charset = Charset.forName(text); + Charset charset2 = Charset.forName(str); + CharsetDecoder charsetDecoder = charset.newDecoder(); + CharsetEncoder charsetEncoder = charset2.newEncoder(); + + try { + ByteBuffer byteBuffer = charsetEncoder.encode(CharBuffer.wrap(value)); + CharBuffer charBuffer = charsetDecoder.decode(byteBuffer); + return charBuffer.toString(); + } catch (Exception ex) { + ex.printStackTrace(); + return null; + } +} + + public static boolean parseBoolean(String text) throws ParseException { + if (text == null) { + throw new ParseException("String cannot be NULL!"); + } else if (text.equalsIgnoreCase("true")) { + return true; + } else if (text.equalsIgnoreCase("false")) { + return false; + } else { + throw new ParseException("Cannot parse value (" + text + ")!"); + } +} + + public static int countLines(String text) { + if (text != null && text.length() != 0) { + int intVal = 1; + int len = text.length(); + + for (int index = 0; index < len; index++) { + char ch = text.charAt(index); + if (ch == '\r') { + intVal++; + if (index + 1 < len && text.charAt(index + 1) == '\n') { + index++; + } + } else if (ch == '\n') { + intVal++; + } + } + + return intVal; + } else { + return 0; + } +} + + public static char lastChar(String text) { + if (text == null) { + throw new NullPointerException(); + } else { + int len = text.length(); + if (len == 0) { + return '\u0000'; + } else { + return len == 1 ? text.charAt(0) : text.charAt(len - 1); + } + } +} + + public static String randomizeWord(String text, boolean flag) { + if (text == null) { + return null; + } + + int len = text.length(); + if (len < 4) { + return text; + } + + boolean[] boolArr = new boolean[len]; + if (flag) { + boolArr[0] = true; + } + + boolean flag2 = !flag; + char[] charArr = text.toCharArray(); + + for (int index = len - 1; index > -1; index--) { + char ch = charArr[index]; + int intVal = Character.getType(ch); + boolean flag3 = intVal == 1 || intVal == 2; + boolArr[index] |= !flag3; + if (flag3 && !flag2) { + boolArr[index] = true; + flag2 = true; + } + } + + for (int index2 = 0; index2 < len; index2++) { + if (!boolArr[index2]) { + int intVal2 = index2; + int intVal3 = 0; + + while (intVal3 < 3) { + intVal3++; + intVal2 = new Random().nextInt(len); + if (!boolArr[intVal2]) { + intVal3 = 10; + break; + } + } + + if (intVal3 == 10) { + char ch2 = charArr[index2]; + char ch3 = charArr[intVal2]; + charArr[index2] = ch3; + charArr[intVal2] = ch2; + boolArr[index2] = true; + boolArr[intVal2] = true; + } + } + } + + return new String(charArr); +} + + public static String randomizeWord(String text) { + return randomizeWord(text, true); +} + + public static String randomize(String text, boolean flag) { + if (text == null) { + return null; + } + + if (text.isEmpty()) { + return text; + } + + String[] stringArr = text.split("\n"); + StringBuilder sb = new StringBuilder(); + boolean flag2 = true; + String[] stringArr2 = stringArr; + int len = stringArr.length; + + for (int index = 0; index < len; index++) { + String textStr = stringArr2[index]; + String[] stringArr3 = textStr.split(" "); + StringBuilder sb2 = new StringBuilder(); + boolean flag3 = true; + String[] stringArr4 = stringArr3; + int len2 = stringArr3.length; + + for (int index2 = 0; index2 < len2; index2++) { + String textStr2 = stringArr4[index2]; + if (flag3) { + flag3 = false; + } else { + sb2.append(' '); + } + + sb2.append(randomizeWord(textStr2)); + } + + if (flag2) { + flag2 = false; + } else { + sb.append('\n'); + } + + sb.append(sb2); + } + + return sb.toString(); +} + + public static String randomize(String text) { + return randomize(text, true); +} + + public static boolean isHTML(char[] charArray) { + if (charArray != null && charArray.length >= 6 && charArray[0] == '<' && charArray[5] == '>') { + String textStr = new String(charArray, 1, 4); + return textStr.equalsIgnoreCase("html"); + } else { + return false; + } +} + + public static String wrap(char[] charArray, int value, boolean flag, boolean enabled) { + if (charArray == null) { + throw new NullPointerException("sequence"); + } + + if (value < 1) { + throw new IllegalArgumentException("maxChars < 1"); + } + + enabled = enabled && isHTML(charArray); + String textStr = enabled ? "
" : "\n"; + StringBuilder sb = new StringBuilder(); + int len = charArray.length; + int intVal = value; + boolean flag2 = false; + boolean flag3 = false; + + for (int index = 0; index < len; index++) { + char ch = charArray[index]; + if (ch == '<' && enabled) { + flag2 = true; + flag3 = true; + } else if (flag2) { + if (ch == '>') { + flag2 = false; + } + + flag3 = true; + } + + if (flag3) { + flag3 = false; + sb.append(ch); + } else { + intVal--; + if (charArray[index] != '\n' && (intVal >= 1 || ch != ' ')) { + if (lookForward(charArray, index, textStr)) { + intVal = value; + } + + sb.append(ch); + if (intVal <= 0 && flag) { + intVal = value; + sb.append(textStr); + } + } else { + intVal = value; + sb.append(textStr); + } + } + } + + return sb.toString(); +} + + private static boolean lookForward(char[] charArray, int value, CharSequence charSequence) { + if (charArray == null) { + throw new NullPointerException("char array"); + } + + if (value < 0) { + throw new IllegalArgumentException("caret < 0"); + } + + if (value >= charArray.length) { + return false; + } + + int len = charSequence.length(); + int len2 = charArray.length - value; + if (len < len2) { + return false; + } + + for (int index = 0; index < len; index++) { + if (charArray[value + index] != charSequence.charAt(index)) { + return false; + } + } + + return true; +} + + public static String wrap(String text, int value, boolean flag, boolean enabled) { + return wrap(text.toCharArray(), value, flag, enabled); +} + + public static String wrap(char[] charArray, int value, boolean flag) { + return wrap(charArray, value, flag, true); +} + + public static String wrap(char[] charArray, int value) { + return wrap(charArray, value, false); +} + + public static String wrap(String text, int value) { + return wrap(text.toCharArray(), value); +} + + public static String cut(String text, int value) { + if (text == null) { + return null; + } + + int len = text.length(); + if (len <= value) { + return text; + } + + String[] stringArr = text.split(" "); + String textStr = ""; + int intVal = value + 1; + + for (int index = 0; index < stringArr.length; index++) { + String textStr2 = stringArr[index]; + int len2 = textStr2.length(); + if (len2 >= intVal) { + if (index == 0) { + textStr = textStr + " " + textStr2.substring(0, intVal - 1); + } + break; + } + + textStr = textStr + " " + textStr2; + intVal -= len2 + 1; + } + + return textStr.length() == 0 ? "" : textStr.substring(1) + "..."; +} + + public static String requireNotBlank(String text, String str) { + if (text == null) { + throw new NullPointerException(str); + } else if (StringUtils.isBlank(text)) { + throw new IllegalArgumentException(str); + } else { + return text; + } +} + + public static String getLink(String text) { + return "link".replaceAll("link", text); +} + + public static String convertListToString(String text, List list) { + StringBuilder sb = new StringBuilder(); + + for (String textStr : (List)list) { + sb.append(textStr).append(text); + } + + return sb.toString(); +} +} diff --git a/src/main/java/cc/novoline/commands/NovoCommand.java b/src/main/java/cc/novoline/commands/NovoCommand.java new file mode 100644 index 0000000..5eed29e --- /dev/null +++ b/src/main/java/cc/novoline/commands/NovoCommand.java @@ -0,0 +1,355 @@ +package cc.novoline.commands; + + +import cc.novoline.utils.messages.MessageMessage; +import cc.novoline.Novoline; +import cc.novoline.utils.lazy.LazySupplier; +import cc.novoline.utils.messages.ChatComponentBase; +import cc.novoline.utils.messages.FormattedMessage; +import cc.novoline.utils.messages.CommandUsageMessage; +import cc.novoline.utils.messages.TextMessage; +import cc.novoline.utils.notifications.NotificationManager; +import cc.novoline.utils.notifications.NotificationType; +import com.google.common.collect.Lists; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import java.io.IOException; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Locale; +import java.util.Set; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.function.Supplier; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import net.minecraft.command.NumberInvalidException; + + +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.command.CommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.network.Packet; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import org.apache.logging.log4j.Logger; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public abstract class NovoCommand extends CommandBase { + public LazySupplier mcSupplier; + public final List stringList; + public final String commandSummary; + public static final TextMessage PREFIX; + private static Object[] objectArray; + public static final IChatComponent EMPTY_COMPONENT = new ChatComponentText(""); + + static { + String textStr = "Novoline"; + EnumChatFormatting enumChatFormatting = EnumChatFormatting.LIGHT_PURPLE; + PREFIX = TextMessage.resolveTextMessage2(textStr, enumChatFormatting).a(" \u00bb ", EnumChatFormatting.GRAY); + resolveDouble((Object[])null); + } + public final LazySupplier lazySupplier; + public final String textValue; + public final Novoline novoline2; + + public void updateState(@Nullable TextMessage textMessage, boolean flag) { + EntityPlayerSP player; + Object obj; + label26: { + player = this.lazySupplier.get(); + Object obj2 = textMessage; + if (textMessage != null) { + if (flag) { + obj = textMessage.a(PREFIX); + break label26; + } + + obj = textMessage; + break label26; + } + + obj2 = EMPTY_COMPONENT; + + obj = obj2; + } + + player.addChatComponentMessage((IChatComponent)obj); +} + + public void applyString3(@Nullable String text) { + this.sendClientMessage(TextMessage.b(text)); +} + + public void sendPacket(Packet packet) { + Minecraft mcClient = this.mcSupplier.get(); + mcClient.getNetHandler().addToSendQueue(packet); +} + + @Override + public final void processCommand(ICommandSender sender, String[] args) throws CommandException { + String[] stringArr = args; + + try { + String[] stringArr2 = stringArr; + this.sendLines(stringArr2); + } catch (CommandException ex) { + Logger log = this.getLogger2(); + log.warn(ex); + throw ex; + } catch (Throwable ex2) { + Logger log2 = this.getLogger2(); + log2.warn(ex2); + ex2.printStackTrace(); + throw new CommandException("Unexpected error occurred while executing command", ex2); + } +} + + public double resolveDouble(String text) throws NumberInvalidException { + try { + return Double.parseDouble(text); + } catch (NumberFormatException ex) { + StringBuilder sb = new StringBuilder().append(text); + throw new NumberInvalidException(sb.append(" is not a valid number").toString()); + } +} + + public void updateState2(@NotNull String text, int value, @Nullable NotificationType notificationType) { + Novoline novolineInst = Novoline.getInstance(); + NotificationManager notifManager = novolineInst.getNotificationManager(); + notifManager.pop(text, value, notificationType); +} + + public Logger getLogger2() { + return Novoline.getLogger(); +} + + public NovoCommand(@NotNull Novoline novoline, @NotNull String text, @Nullable String str, @Nullable String value) { + this(novoline, text, str, value != null ? Collections.singleton(value) : null); +} + + @Override + public final int getRequiredPermissionLevel() { + return 0; +} + + @Override + public final boolean canCommandSenderUseCommand(ICommandSender sender) { + return true; +} + + public void applyString4(@NotNull String text) { + this.updateState3(text, 2000); +} + + @Nullable + public List resolveDouble(String[] args) { + return null; +} + + public void sendClientMessage(@Nullable TextMessage textMessage) { + this.updateState(textMessage, false); +} + + public static void resolveDouble(Object[] flowGuardArray) { + objectArray = flowGuardArray; +} + + public void updateState(@Nullable String text, boolean flag) { + this.updateState(TextMessage.b(text), flag); +} + + public void updateState(@NotNull String text, @Nullable NotificationType notificationType) { + this.updateState2(text, 2000, notificationType); +} + + public List updateState2(@NotNull Stream stream, @NotNull String text, boolean flag) { + if (flag) { + Locale locale = Locale.ROOT; + String lowerStr = text.toLowerCase(locale); + Function mapper = (String textStr) -> textStr.toLowerCase(Locale.ROOT); + Stream stream2 = stream.map(mapper); + Predicate predicate = (textStr2) -> textStr2.startsWith(lowerStr); + stream2 = stream2.filter(predicate); + Supplier supplier = ObjectArrayList::new; + Collector collector = Collectors.toCollection(supplier); + return (java.util.List) stream2.collect(collector); + } else { + Predicate predicate2 = ((java.util.function.Predicate) (textStr3) -> textStr3.startsWith(text)); + Stream stream3 = stream.filter(predicate2); + Supplier supplier2 = ObjectArrayList::new; + Collector collector2 = Collectors.toCollection(supplier2); + return (java.util.List) stream3.collect(collector2); + } +} + + private EntityPlayerSP lambdaImpl$new$0() { + return this.mcSupplier.get().thePlayer; +} + + public void applyString5(@NotNull String text) { + this.updateState2(text, 2000, NotificationType.INFO); +} + + public void applyString6(@NotNull String text) { + this.applyUpdate(text, 2000); +} + + public void updateState3(@NotNull String text, int value) { + this.updateState2(text, value, NotificationType.ERROR); +} + + public List updateState2(@NotNull Collection collection, @NotNull String text, boolean flag) { + return this.updateState2(collection.stream(), text, flag); +} + + public void performAction() { + EntityPlayerSP player = this.lazySupplier.get(); + ChatComponentBase chatComponentBase = MessageMessage.obtainMessageMessage(); + player.addChatComponentMessage(chatComponentBase); +} + + public void updateState(@NotNull String text, @NotNull String str) { + this.sendClientMessage(CommandUsageMessage.of(text, str)); +} + + public void applyUpdate(@NotNull String text, int value) { + this.updateState2(text, value, NotificationType.WARNING); +} + + public void updateState4(@NotNull String text, @NotNull String str, int value, NotificationType notificationType) { + NotificationManager notifManager = this.novoline2.getNotificationManager(); + notifManager.pop(text, str, value, notificationType); +} + + public NovoCommand(@NotNull Novoline novoline, @NotNull String text) { + this(novoline, text, null, (Iterable)null); +} + + public int calculateInt(String text) throws NumberInvalidException { + try { + return Integer.parseInt(text); + } catch (NumberFormatException ex) { + StringBuilder sb = new StringBuilder().append(text); + throw new NumberInvalidException(sb.append(" is not a valid number").toString()); + } +} + + public LazySupplier getMcSupplier() { + return this.mcSupplier; +} + + @Override + public final String getCommandName() { + return this.textValue; +} + + public NovoCommand(@NotNull Novoline novoline, @NotNull String text, @Nullable String str) { + this(novoline, text, null, str != null ? Collections.singleton(str) : null); +} + + @Override + public final List getCommandAliases() { + return this.stringList; +} + + public Novoline getNovoline() { + return this.novoline2; +} + + @Nullable + @Override + public final String getCommandUsage(ICommandSender sender) { + return null; +} + + public static Object[] obtainObjectArray() { + return objectArray; +} + + public void updateState(@Nullable String text, @NotNull EnumChatFormatting enumChatFormatting) { + TextMessage textMessage = TextMessage.b(text); + textMessage.resolveChatComponent(enumChatFormatting); + this.sendClientMessage(textMessage); +} + + public void updateState(@NotNull String text, int value) { + this.updateState2(text, value, NotificationType.INFO); +} + + @Nullable + @Override + public final List addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { + return this.resolveDouble(args); +} + + public NovoCommand(@NotNull Novoline novoline, @NotNull String text, @Nullable Iterable iterable) { + this(novoline, text, null, iterable); +} + + public NovoCommand(@NotNull Novoline novoline, @NotNull String text, @Nullable String str, @Nullable Iterable iterable) { + String textStr; + List itemList; + label19: { + this.mcSupplier = LazySupplier.resolveLazySupplier3(Minecraft::getMinecraft); + this.lazySupplier = LazySupplier.resolveLazySupplier3(this::lambdaImpl$new$0); + this.novoline2 = novoline; + textStr = ""; + this.textValue = text; + this.commandSummary = str; + Iterable iterable2 = iterable; + if (textStr != null) { + if (iterable == null) { + itemList = Collections.emptyList(); + break label19; + } + + iterable2 = iterable; + } + + itemList = Lists.newArrayList(iterable2); + } + + this.stringList = itemList; +} + + public void sendLines(String[] args) throws CommandException, IOException { + long longVal = 4046879720664L; + this.updateState2((char)(int)(longVal >>> 48), longVal << 16 >>> 16, args); +} + + public void updateState2(char ch, long time, String[] args) throws CommandException, IOException {} + + @Override + public final boolean isUsernameIndex(String[] args, int value) { + return false; +} + + public void updateState2(@NotNull String text, @NotNull String str, @NotNull CommandUsageMessage... formattedMessage3Array) { + this.updateState(FormattedMessage.resolveFormattedMessage(text, str, formattedMessage3Array), true); +} + + public void handleObject(@Nullable Object obj) { + String textStr; + label15: { + Object obj2 = obj; + if (obj == null) { + textStr = null; + break label15; + } + + obj2 = obj; + + textStr = obj2.toString(); + } + + this.applyString3(textStr); +} +} diff --git a/src/main/java/cc/novoline/commands/NovoCommandHandler.java b/src/main/java/cc/novoline/commands/NovoCommandHandler.java new file mode 100644 index 0000000..3a05d52 --- /dev/null +++ b/src/main/java/cc/novoline/commands/NovoCommandHandler.java @@ -0,0 +1,12 @@ +package cc.novoline.commands; + +import cc.novoline.Novoline; +import cc.novoline.commands.util.CommandPrefixHolder; +import net.minecraft.command.CommandHandler; +import org.jetbrains.annotations.NotNull; + +public class NovoCommandHandler extends CommandHandler { + public NovoCommandHandler(@NotNull Novoline novoline) { + super(CommandPrefixHolder.textValue); +} +} diff --git a/src/main/java/cc/novoline/commands/impl/AutoRegisterCommand.java b/src/main/java/cc/novoline/commands/impl/AutoRegisterCommand.java new file mode 100644 index 0000000..137c45d --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/AutoRegisterCommand.java @@ -0,0 +1,27 @@ +package cc.novoline.commands.impl; + +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import cc.novoline.utils.StringScrambler; +import java.io.IOException; +import java.util.List; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.command.CommandException; +import org.jetbrains.annotations.NotNull; + +public class AutoRegisterCommand extends NovoCommand { + public AutoRegisterCommand(@NotNull Novoline novoline, String text, List list) { + super(novoline, text, list); +} + + public void updateState2(char ch, long time, String[] args) throws CommandException, IOException { + List itemList = StringScrambler.resolveList("", 1, 8); + String textStr = (String)itemList.get(0); + EntityPlayerSP player = this.mcSupplier.get().thePlayer; + StringBuilder sb = new StringBuilder(); + sb = sb.append("/reg ").append(textStr); + sb = sb.append(" "); + String textStr2 = sb.append(textStr).toString(); + player.sendChatMessage(textStr2); +} +} diff --git a/src/main/java/cc/novoline/commands/impl/BindCommand.java b/src/main/java/cc/novoline/commands/impl/BindCommand.java new file mode 100644 index 0000000..ec834cc --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/BindCommand.java @@ -0,0 +1,201 @@ +package cc.novoline.commands.impl; +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.binds.KeyboardKeybind; +import cc.novoline.modules.binds.ModuleKeybind; +import cc.novoline.utils.messages.CommandUsageMessage; +import cc.novoline.utils.messages.TextMessage; +import cc.novoline.modules.configurations.holder.ModuleHolder; +import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; +import it.unimi.dsi.fastutil.objects.ObjectCollection; +import java.lang.reflect.Field; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Stream; +import cc.novoline.modules.ModuleArrayMap; +import cc.novoline.modules.ModuleManager; + + +import net.optifine.FieldReflectionAccess; +import cc.novoline.modules.binds.ModuleKeybindImpl; +import net.minecraft.util.EnumChatFormatting; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.lwjgl.input.Keyboard; + +public final class BindCommand extends NovoCommand { + private static final Map entryMap = new Object2ObjectOpenHashMap<>(); + + public void updateState(@NotNull AbstractModule module, ModuleKeybind moduleKeybind) { + module.handleModuleKeybind(moduleKeybind); + ModuleManager modManager = this.novoline2.getModuleManager(); + modManager.getBindManager().isReadyState(); +} + + public void updateState2(char ch, long time, String[] args) { + StringBuilder sb = null; + byte byteVal = (byte)(true ? 1 : 0); + String[] stringArr = args; + byte byteVal2 = byteVal; + if (time > 0L) { + if (byteVal != 0) { + if (args.length < 2) { + String textStr = "Binds help:"; + String textStr7 = ".bind"; + CommandUsageMessage[] commandUsageMessageArr = new CommandUsageMessage[1]; + commandUsageMessageArr[0] = CommandUsageMessage.of("(module) (key)", "sets keyBind to module"); + this.updateState2(textStr, textStr7, commandUsageMessageArr); + this.performAction(); + String textStr2 = "TIP: "; + EnumChatFormatting enumChatFormatting = EnumChatFormatting.GRAY; + this.sendClientMessage(TextMessage.resolveTextMessage2(textStr2, enumChatFormatting).a("Use ").a("\"none\"", EnumChatFormatting.YELLOW).a(" to unbind!")); + return; + } + + stringArr = args; + } + + byteVal2 = 0; + } + + String textStr3 = stringArr[byteVal2]; + String textStr4 = args[1]; + Locale locale = Locale.ROOT; + String textStr5 = textStr4.toUpperCase(locale); + Map itemMap = entryMap; + Integer intVal = (Integer)itemMap.getOrDefault(textStr5, null); + if (byteVal != 0) { + if (intVal != null) { + Novoline novolineInst = this.novoline2; + ModuleManager modManager = novolineInst.getModuleManager(); + AbstractModule mod = modManager.getByName(textStr3); + if (byteVal != 0) { + if (mod != null) { + label53: { + Object obj; + label52: { + int intVal2 = intVal; + if (byteVal != 0) { + if (intVal2 >= 0) { + int intVal3 = intVal; + obj = KeyboardKeybind.of(intVal3); + if (ch < 0) { + break label53; + } + + if (byteVal != 0) { + break label52; + } + } + + intVal2 = -intVal; + } + + obj = ModuleKeybindImpl.applyUpdate(intVal2); + } + + this.updateState(mod, (ModuleKeybind)obj); + } + + String textStr6; + label42: { + StringBuilder sb2 = new StringBuilder(); + textStr6 = "Module "; + StringBuilder sb3 = sb2.append(textStr6); + textStr6 = mod.getDisplayName(); + sb = sb3.append(textStr6); + if (time >= 0L) { + textStr6 = " was "; + if (byteVal == 0) { + break label42; + } + + sb = sb.append(textStr6); + } + + if (intVal != 0) { + StringBuilder sb5 = new StringBuilder().append("bound to "); + textStr6 = sb5.append(textStr5).toString(); + } else { + textStr6 = "unbound"; + } + } + + this.applyString5(sb.append(textStr6).toString()); + return; + } + + StringBuilder sb8 = new StringBuilder().append("Module ").append(textStr3); + this.applyString4(sb8.append(" not found!").toString()); + } + + return; + } + + this.applyString4("Key was not found!"); + } +} + + static { + Map itemMap = entryMap; + String textStr = "MOUSE4"; + Integer intVal = -4; + itemMap.put(textStr, intVal); + itemMap = entryMap; + textStr = "MOUSE3"; + intVal = -3; + itemMap.put(textStr, intVal); + + try { + BindCommand.$keepCatch(); + for (Field index : Keyboard.class.getFields()) { + String textStr2 = index.getName(); + if (textStr2.startsWith("KEY_")) { + FieldReflectionAccess.updateState(index, true); + itemMap = entryMap; + textStr = index.getName(); + textStr = textStr.substring(4); + Locale locale = Locale.ROOT; + textStr = textStr.toUpperCase(locale); + intVal = (Integer)FieldReflectionAccess.updateState(index, (Object)null); + int intVal2 = intVal; + Integer intVal3 = intVal2; + itemMap.put(textStr, intVal3); + } + } + } catch (IllegalAccessException ex) { + ex.printStackTrace(); + } + } + + + + public BindCommand(@NotNull Novoline novoline, String text, String str, List list) { + super(novoline, text, str, list); +} + + @Nullable + @Override + public List resolveDouble(@NotNull String[] args) { + switch (args.length) { + case 1: + ModuleManager modManager = this.novoline2.getModuleManager(); + ModuleArrayMap moduleArrayMap = modManager.getModules(); + ObjectCollection objectCollection = moduleArrayMap.values(); + Stream stream2 = objectCollection.stream(); + Function mapper = ((java.util.function.Function) ModuleHolder::getModule); + stream2 = stream2.map(mapper); + mapper = ((java.util.function.Function) AbstractModule::getName); + return this.updateState2(stream2.map(mapper), args[0], true); + case 2: + Map itemMap = entryMap; + return this.updateState2(itemMap.keySet(), args[1], true); + default: + return null; + } +} + private static void $keepCatch() throws E {} +} diff --git a/src/main/java/cc/novoline/commands/impl/ConfigAliasCommand.java b/src/main/java/cc/novoline/commands/impl/ConfigAliasCommand.java new file mode 100644 index 0000000..7bfb357 --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/ConfigAliasCommand.java @@ -0,0 +1,16 @@ +package cc.novoline.commands.impl; + +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import java.io.IOException; +import java.util.List; +import net.minecraft.command.CommandException; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class ConfigAliasCommand extends NovoCommand { + public ConfigAliasCommand(@NonNull Novoline novoline, String text, List list) { + super(novoline, text, list); +} + + public void updateState2(char ch, long time, String[] args) throws CommandException, IOException {} +} diff --git a/src/main/java/cc/novoline/commands/impl/ConfigCommand.java b/src/main/java/cc/novoline/commands/impl/ConfigCommand.java new file mode 100644 index 0000000..94ba727 --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/ConfigCommand.java @@ -0,0 +1,948 @@ +package cc.novoline.commands.impl; +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import cc.novoline.commands.util.ConfigCommandException; +import cc.novoline.commands.util.ConfigReadWriteException; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.ConfigManager; +import cc.novoline.utils.messages.CommandUsageMessage; +import cc.novoline.utils.messages.TextMessage; +import cc.novoline.utils.notifications.NotificationManager; +import cc.novoline.utils.notifications.NotificationType; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.List; +import java.util.function.Consumer; +import cc.novoline.modules.ModuleManager; +import ninja.leaping.configurate.objectmapping.ObjectMappingException; + + +import net.minecraft.util.EnumChatFormatting; +import org.apache.logging.log4j.Logger; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class ConfigCommand extends NovoCommand { + public static String textValue2 = ""; + + public static void executeConfigManager(@NonNull ConfigManager configManager, @NonNull String text) { + boolean flag = true; + boolean empty = text.trim().isEmpty(); + if (!flag) { + try { + ConfigCommand.$keepCatch(); + ConfigCommand.$keepCatch(); + ConfigCommand.$keepCatch(); + Novoline novolineInst = Novoline.getInstance(); + NotificationManager notifManager = novolineInst.getNotificationManager(); + StringBuilder sb = new StringBuilder(); + sb = sb.append("Saved config ").append(text); + String textStr = sb.append("!").toString(); + NotificationType notificationType = NotificationType.SUCCESS; + notifManager.pop(textStr, 2000, notificationType); + } catch (ConfigReadWriteException ex) { + Logger log = Novoline.getLogger(); + String textStr2 = "An I/O error occurred while reading config!"; + log.warn(textStr2, ex); + Novoline novolineInst2 = Novoline.getInstance(); + NotificationManager notifManager2 = novolineInst2.getNotificationManager(); + textStr2 = "Cannot read config!"; + NotificationType notificationType2 = NotificationType.ERROR; + notifManager2.pop(textStr2, 2000, notificationType2); + } catch (IOException ex2) { + Logger log2 = Novoline.getLogger(); + String textStr3 = "An I/O error occurred while saving config!"; + log2.warn(textStr3, ex2); + Novoline novolineInst3 = Novoline.getInstance(); + NotificationManager notifManager3 = novolineInst3.getNotificationManager(); + textStr3 = "Cannot save config!"; + NotificationType notificationType3 = NotificationType.ERROR; + notifManager3.pop(textStr3, 2000, notificationType3); + } catch (ObjectMappingException ex3) { + Logger log3 = Novoline.getLogger(); + String textStr4 = "An I/O error occurred while serializing config!"; + log3.warn(textStr4, ex3); + Novoline novolineInst4 = Novoline.getInstance(); + NotificationManager notifManager4 = novolineInst4.getNotificationManager(); + textStr4 = "Cannot save config!"; + NotificationType notificationType4 = NotificationType.ERROR; + notifManager4.pop(textStr4, 2000, notificationType4); + } catch (Throwable ex4) { + Logger log4 = Novoline.getLogger(); + String textStr5 = "An unexpected error occurred while saving config!"; + log4.warn(textStr5, ex4); + Novoline novolineInst5 = Novoline.getInstance(); + NotificationManager notifManager5 = novolineInst5.getNotificationManager(); + textStr5 = "Cannot save config!"; + NotificationType notificationType5 = NotificationType.ERROR; + notifManager5.pop(textStr5, 2000, notificationType5); + } + } else if (empty) { + Novoline novolineInst6 = Novoline.getInstance(); + NotificationManager notifManager6 = novolineInst6.getNotificationManager(); + String textStr6 = "Name may not be blank!"; + NotificationType notificationType6 = NotificationType.ERROR; + notifManager6.pop(textStr6, 2000, notificationType6); + } else { + label29: + try { + configManager.b(text); + break label29; + } catch (ConfigReadWriteException ex5) { + Logger log5 = Novoline.getLogger(); + String textStr7 = "An I/O error occurred while reading config!"; + log5.warn(textStr7, ex5); + Novoline novolineInst7 = Novoline.getInstance(); + NotificationManager notifManager7 = novolineInst7.getNotificationManager(); + textStr7 = "Cannot read config!"; + NotificationType notificationType7 = NotificationType.ERROR; + notifManager7.pop(textStr7, 2000, notificationType7); + } catch (IOException ex6) { + Logger log6 = Novoline.getLogger(); + String textStr8 = "An I/O error occurred while saving config!"; + log6.warn(textStr8, ex6); + Novoline novolineInst8 = Novoline.getInstance(); + NotificationManager notifManager8 = novolineInst8.getNotificationManager(); + textStr8 = "Cannot save config!"; + NotificationType notificationType8 = NotificationType.ERROR; + notifManager8.pop(textStr8, 2000, notificationType8); + } catch (ObjectMappingException ex7) { + Logger log7 = Novoline.getLogger(); + String textStr9 = "An I/O error occurred while serializing config!"; + log7.warn(textStr9, ex7); + Novoline novolineInst9 = Novoline.getInstance(); + NotificationManager notifManager9 = novolineInst9.getNotificationManager(); + textStr9 = "Cannot save config!"; + NotificationType notificationType9 = NotificationType.ERROR; + notifManager9.pop(textStr9, 2000, notificationType9); + } catch (Throwable ex8) { + Logger log8 = Novoline.getLogger(); + log8.warn("An unexpected error occurred while saving config!", ex8); + Novoline novolineInst10 = Novoline.getInstance(); + NotificationManager notifManager10 = novolineInst10.getNotificationManager(); + notifManager10.pop("Cannot save config!", 2000, NotificationType.ERROR); + } + } +} + + public void updateState2(char ch, long time, String[] args) { + java.lang.String[] stringArr; + byte byteVal = (byte)(false ? 1 : 0); + int intVal = byteVal; + if (time > 0L) { + if (byteVal != 0) { + return; + } + + intVal = args.length; + } + + if (intVal >= 1) { + ConfigManager cfgManager; + String lowerStr; + byte byteVal2; + label325: { + Novoline novolineInst = this.novoline2; + ModuleManager modManager = novolineInst.getModuleManager(); + cfgManager = modManager.getConfigManager(); + String textStr = args[0]; + lowerStr = textStr.toLowerCase(); + String textStr2 = lowerStr; + byte byteVal3 = -1; + intVal = textStr2.hashCode(); + label324: + if (byteVal == 0) { + label337: { + label321: { + label338: { + label319: { + label339: { + label317: { + label340: { + label315: { + label341: { + label313: { + label342: { + switch (intVal) { + case -1335458389: + break label339; + case 3237038: + break label342; + case 3322014: + break label338; + case 3327206: + break label341; + case 3522941: + break label340; + case 1427818632: + intVal = (textStr2.equals("download") ? 1 : 0); + if (byteVal != 0) { + break label324; + } + + if (intVal == 0) { + break label337; + } + + byteVal3 = 0; + byte byteVal4 = byteVal; + if (ch >= 0) { + if (byteVal == 0) { + break label337; + } + + byteVal4 = 1; + } + + case -838595071: + intVal = (textStr2.equals("upload") ? 1 : 0); + if (byteVal != 0) { + break label324; + } + + if (intVal == 0) { + break label337; + } + + byteVal3 = 1; + intVal = byteVal; + if (time <= 0L) { + break; + } + + if (byteVal == 0) { + break label337; + } + case -934610812: + intVal = (textStr2.equals("remove") ? 1 : 0); + break; + default: + break label337; + } + + if (byteVal != 0) { + break label324; + } + + if (intVal == 0) { + break label337; + } + + byteVal3 = 2; + intVal = byteVal; + if (time < 0L) { + break label313; + } + + if (byteVal == 0) { + break label337; + } + } + + intVal = (textStr2.equals("info") ? 1 : 0); + } + + if (byteVal != 0) { + break label324; + } + + if (intVal == 0) { + break label337; + } + + byteVal3 = 3; + intVal = byteVal; + if (ch < 0) { + break label315; + } + + if (byteVal == 0) { + break label337; + } + } + + intVal = (textStr2.equals("load") ? 1 : 0); + } + + if (byteVal != 0) { + break label324; + } + + if (intVal == 0) { + break label337; + } + + byteVal3 = 4; + intVal = byteVal; + if (ch < 0) { + break label317; + } + + if (byteVal == 0) { + break label337; + } + } + + intVal = (textStr2.equals("save") ? 1 : 0); + } + + if (byteVal != 0) { + break label324; + } + + if (intVal == 0) { + break label337; + } + + byteVal3 = 5; + intVal = byteVal; + if (ch < 0) { + break label319; + } + + if (byteVal == 0) { + break label337; + } + } + + intVal = (textStr2.equals("delete") ? 1 : 0); + } + + if (byteVal != 0) { + break label324; + } + + if (intVal == 0) { + break label337; + } + + byteVal3 = 6; + intVal = byteVal; + if (ch < 0) { + break label321; + } + + if (byteVal == 0) { + break label337; + } + } + + intVal = (textStr2.equals("list") ? 1 : 0); + } + + byteVal2 = byteVal; + if (ch < 0) { + break label325; + } + + if (byteVal != 0) { + break label324; + } + + if (intVal != 0) { + byteVal3 = 7; + } + } + + intVal = byteVal3; + } + + byteVal2 = byteVal; + } + + label235: { + label345: { + if (ch >= 0) { + if (byteVal2 == 0) { + switch (intVal) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + stringArr = args; + byteVal2 = byteVal; + if (ch < 0) { + break label235; + } + + if (byteVal != 0) { + break label345; + } + + intVal = args.length; + break; + case 7: + ; + List itemList = cfgManager.getConfigs(); + TextMessage textMessage = TextMessage.b("List of configs:"); + if (ch >= 0) { + List itemList2 = itemList; + if (byteVal == 0) { + if (itemList.isEmpty()) { + textMessage.a(" (empty)", EnumChatFormatting.RED); + } + + this.updateState(textMessage, true); + itemList2 = itemList; + } + + Consumer consumer = (String textStr8) -> { this.sendClientMessage(TextMessage.resolveTextMessage2("> ", EnumChatFormatting.GRAY).a(textStr8, EnumChatFormatting.GREEN)); }; + itemList2.forEach(consumer); + } + + return; + default: + StringBuilder sb = new StringBuilder(); + String textStr3 = "Unknown command: "; + StringBuilder sb2 = sb.append(textStr3); + textStr3 = args[0]; + this.applyString4(sb2.append(textStr3).toString()); + return; + } + } + + byteVal2 = 2; + } + + if (intVal < byteVal2) { + StringBuilder sb3 = new StringBuilder(); + String textStr4 = "Usage: .config "; + StringBuilder sb4 = sb3.append(textStr4); + StringBuilder sb5 = sb4.append(lowerStr); + textStr4 = " "; + this.updateState(sb5.append(textStr4).toString(), EnumChatFormatting.RED); + return; + } + + stringArr = args; + } + + byteVal2 = 1; + } + + String textStr7; + textStr7 = stringArr[byteVal2]; + String textStr5 = lowerStr; + byte byteVal5 = -1; + intVal = textStr5.hashCode(); + label222: + if (byteVal == 0) { + label347: { + label219: { + label348: { + label217: { + label349: { + label215: { + label350: { + label213: { + label351: { + switch (intVal) { + case -1335458389: + break label351; + case -934610812: + break label348; + case -838595071: + break label350; + case 3327206: + intVal = (textStr5.equals("load") ? 1 : 0); + if (byteVal != 0) { + break label222; + } + + if (intVal == 0) { + break label347; + } + + byteVal5 = 0; + intVal = byteVal; + if (time < 0L) { + break; + } + + if (byteVal == 0) { + break label347; + } + case 3522941: + intVal = (textStr5.equals("save") ? 1 : 0); + break; + case 1427818632: + break label349; + default: + break label347; + } + + if (byteVal != 0) { + break label222; + } + + if (intVal == 0) { + break label347; + } + + byteVal5 = 1; + intVal = byteVal; + if (time < 0L) { + break label213; + } + + if (byteVal == 0) { + break label347; + } + } + + intVal = (textStr5.equals("delete") ? 1 : 0); + } + + if (byteVal != 0) { + break label222; + } + + if (intVal == 0) { + break label347; + } + + byteVal5 = 2; + intVal = byteVal; + if (ch < 0) { + break label215; + } + + if (byteVal == 0) { + break label347; + } + } + + intVal = (textStr5.equals("upload") ? 1 : 0); + } + + if (byteVal != 0) { + break label222; + } + + if (intVal == 0) { + break label347; + } + + byteVal5 = 3; + intVal = byteVal; + if (time <= 0L) { + break label217; + } + + if (byteVal == 0) { + break label347; + } + } + + intVal = (textStr5.equals("download") ? 1 : 0); + } + + if (byteVal != 0) { + break label222; + } + + if (intVal == 0) { + break label347; + } + + byteVal5 = 4; + intVal = byteVal; + if (time < 0L) { + break label219; + } + + if (byteVal == 0) { + break label347; + } + } + + intVal = (textStr5.equals("remove") ? 1 : 0); + } + + if (time <= 0L || byteVal != 0) { + break label222; + } + + if (intVal != 0) { + byteVal5 = 5; + } + } + + intVal = byteVal5; + } + + switch (intVal) { + case 0: + updateState(cfgManager, textStr7); + return; + case 1: + executeConfigManager(cfgManager, textStr7); + return; + case 2: + updateState3(cfgManager, textStr7); + return; + case 3: + String textStr6 = resolveString(cfgManager, textStr7); + return; + case 4: + return; + case 5: + return; + } + } else { + CommandUsageMessage[] commandUsageMessageArr = new CommandUsageMessage[4]; + commandUsageMessageArr[0] = CommandUsageMessage.of("list", "shows all configs"); + commandUsageMessageArr[1] = CommandUsageMessage.of("load (name)", "loads a config"); + commandUsageMessageArr[2] = CommandUsageMessage.of("save (name)", "saves a config"); + commandUsageMessageArr[3] = CommandUsageMessage.of("delete (name)", "removes a config"); + this.updateState2("Configs help:", ".configs", commandUsageMessageArr); + } +} + + public ConfigCommand(@NonNull Novoline novoline, String text, String str, List list) { + super(novoline, text, str, list); +} + + public static void updateState2(@NonNull ConfigManager configManager, @NonNull String text, EnumModuleType[] enumModuleTypeArray) { + boolean flag = true; + String trimmedStr = text.trim(); + if (flag) { + if (trimmedStr.isEmpty()) { + Novoline novolineInst = Novoline.getInstance(); + NotificationManager notifManager = novolineInst.getNotificationManager(); + String textStr = "Name may not be blank!"; + NotificationType notificationType = NotificationType.ERROR; + notifManager.pop(textStr, 2000, notificationType); + return; + } + + try { + configManager.a(text, true, enumModuleTypeArray); + Novoline novolineInst2 = Novoline.getInstance(); + NotificationManager notifManager2 = novolineInst2.getNotificationManager(); + StringBuilder sb = new StringBuilder(); + sb = sb.append("Loaded config ").append(text); + String textStr2 = sb.append("!").toString(); + NotificationType notificationType2 = NotificationType.SUCCESS; + notifManager2.pop(textStr2, 2000, notificationType2); + trimmedStr = text; + } catch (FileNotFoundException ex) { + Novoline novolineInst3 = Novoline.getInstance(); + NotificationManager notifManager3 = novolineInst3.getNotificationManager(); + String textStr3 = "Config not found!"; + NotificationType notificationType3 = NotificationType.ERROR; + notifManager3.pop(textStr3, 2000, notificationType3); + return; + } catch (IOException ex5) { + Logger log = Novoline.getLogger(); + String textStr4 = "An I/O error occurred while reading config!"; + log.warn(textStr4, ex5); + Novoline novolineInst4 = Novoline.getInstance(); + NotificationManager notifManager4 = novolineInst4.getNotificationManager(); + textStr4 = "Cannot read config!"; + NotificationType notificationType4 = NotificationType.ERROR; + notifManager4.pop(textStr4, 2000, notificationType4); + return; + } catch (ObjectMappingException ex6) { + Logger log2 = Novoline.getLogger(); + String textStr5 = "An error occurred while deserializing config!"; + log2.warn(textStr5, ex6); + Novoline novolineInst5 = Novoline.getInstance(); + NotificationManager notifManager5 = novolineInst5.getNotificationManager(); + textStr5 = "Cannot load config!"; + NotificationType notificationType5 = NotificationType.ERROR; + notifManager5.pop(textStr5, 2000, notificationType5); + return; + } catch (ConfigCommandException ex2) { + Novoline novolineInst6 = Novoline.getInstance(); + NotificationManager notifManager6 = novolineInst6.getNotificationManager(); + String textStr6 = "Config is outdated!"; + NotificationType notificationType6 = NotificationType.ERROR; + notifManager6.pop(textStr6, 2000, notificationType6); + return; + } catch (Throwable ex7) { + Logger log3 = Novoline.getLogger(); + log3.warn("An unexpected error occurred while loading config!", ex7); + Novoline novolineInst7 = Novoline.getInstance(); + NotificationManager notifManager7 = novolineInst7.getNotificationManager(); + notifManager7.pop("Cannot load config!", 2000, NotificationType.ERROR); + return; + } + } + + try { + ConfigCommand.$keepCatch(); + ConfigCommand.$keepCatch(); + ConfigCommand.$keepCatch(); + textValue2 = trimmedStr; + } catch (FileNotFoundException ex3) { + Novoline novolineInst8 = Novoline.getInstance(); + NotificationManager notifManager8 = novolineInst8.getNotificationManager(); + String textStr7 = "Config not found!"; + NotificationType notificationType7 = NotificationType.ERROR; + notifManager8.pop(textStr7, 2000, notificationType7); + } catch (IOException ex8) { + Logger log4 = Novoline.getLogger(); + String textStr8 = "An I/O error occurred while reading config!"; + log4.warn(textStr8, ex8); + Novoline novolineInst9 = Novoline.getInstance(); + NotificationManager notifManager9 = novolineInst9.getNotificationManager(); + textStr8 = "Cannot read config!"; + NotificationType notificationType8 = NotificationType.ERROR; + notifManager9.pop(textStr8, 2000, notificationType8); + } catch (ObjectMappingException ex9) { + Logger log5 = Novoline.getLogger(); + String textStr9 = "An error occurred while deserializing config!"; + log5.warn(textStr9, ex9); + Novoline novolineInst10 = Novoline.getInstance(); + NotificationManager notifManager10 = novolineInst10.getNotificationManager(); + textStr9 = "Cannot load config!"; + NotificationType notificationType9 = NotificationType.ERROR; + notifManager10.pop(textStr9, 2000, notificationType9); + } catch (ConfigCommandException ex4) { + Novoline novolineInst11 = Novoline.getInstance(); + NotificationManager notifManager11 = novolineInst11.getNotificationManager(); + String textStr10 = "Config is outdated!"; + NotificationType notificationType10 = NotificationType.ERROR; + notifManager11.pop(textStr10, 2000, notificationType10); + } catch (Throwable ex10) { + Logger log6 = Novoline.getLogger(); + String textStr11 = "An unexpected error occurred while loading config!"; + log6.warn(textStr11, ex10); + Novoline novolineInst12 = Novoline.getInstance(); + NotificationManager notifManager12 = novolineInst12.getNotificationManager(); + textStr11 = "Cannot load config!"; + NotificationType notificationType11 = NotificationType.ERROR; + notifManager12.pop(textStr11, 2000, notificationType11); + } +} + + public static void updateState3(@NonNull ConfigManager configManager, @NonNull String text) { + boolean flag = false; + boolean empty = text.trim().isEmpty(); + if (flag) { + try { + ConfigCommand.$keepCatch(); + ConfigCommand.$keepCatch(); + Novoline novolineInst = Novoline.getInstance(); + NotificationManager notifManager = novolineInst.getNotificationManager(); + StringBuilder sb = new StringBuilder(); + sb = sb.append("Deleted config ").append(text); + String textStr = sb.append("!").toString(); + NotificationType notificationType = NotificationType.SUCCESS; + notifManager.pop(textStr, 2000, notificationType); + } catch (FileNotFoundException ex) { + Novoline novolineInst2 = Novoline.getInstance(); + NotificationManager notifManager2 = novolineInst2.getNotificationManager(); + String textStr2 = "Config not found!"; + NotificationType notificationType2 = NotificationType.ERROR; + notifManager2.pop(textStr2, 2000, notificationType2); + } catch (IOException ex3) { + Logger log = Novoline.getLogger(); + String textStr3 = "An I/O error occurred while deleting config!"; + log.error(textStr3, ex3); + Novoline novolineInst3 = Novoline.getInstance(); + NotificationManager notifManager3 = novolineInst3.getNotificationManager(); + textStr3 = "Cannot delete config!"; + NotificationType notificationType3 = NotificationType.ERROR; + notifManager3.pop(textStr3, 2000, notificationType3); + } catch (Throwable ex4) { + Logger log2 = Novoline.getLogger(); + String textStr4 = "An unexpected error occurred while deleting config!"; + log2.warn(textStr4, ex4); + Novoline novolineInst4 = Novoline.getInstance(); + NotificationManager notifManager4 = novolineInst4.getNotificationManager(); + textStr4 = "Cannot delete config!"; + NotificationType notificationType4 = NotificationType.ERROR; + notifManager4.pop(textStr4, 2000, notificationType4); + } + } else if (empty) { + Novoline novolineInst5 = Novoline.getInstance(); + NotificationManager notifManager5 = novolineInst5.getNotificationManager(); + String textStr5 = "Name may not be blank!"; + NotificationType notificationType5 = NotificationType.ERROR; + notifManager5.pop(textStr5, 2000, notificationType5); + } else { + label26: + try { + configManager.delete(text); + break label26; + } catch (FileNotFoundException ex2) { + Novoline novolineInst6 = Novoline.getInstance(); + NotificationManager notifManager6 = novolineInst6.getNotificationManager(); + String textStr6 = "Config not found!"; + NotificationType notificationType6 = NotificationType.ERROR; + notifManager6.pop(textStr6, 2000, notificationType6); + } catch (IOException ex5) { + Logger log3 = Novoline.getLogger(); + String textStr7 = "An I/O error occurred while deleting config!"; + log3.error(textStr7, ex5); + Novoline novolineInst7 = Novoline.getInstance(); + NotificationManager notifManager7 = novolineInst7.getNotificationManager(); + textStr7 = "Cannot delete config!"; + NotificationType notificationType7 = NotificationType.ERROR; + notifManager7.pop(textStr7, 2000, notificationType7); + } catch (Throwable ex6) { + Logger log4 = Novoline.getLogger(); + log4.warn("An unexpected error occurred while deleting config!", ex6); + Novoline novolineInst8 = Novoline.getInstance(); + NotificationManager notifManager8 = novolineInst8.getNotificationManager(); + notifManager8.pop("Cannot delete config!", 2000, NotificationType.ERROR); + } + } +} + + + + public static String resolveString(@NonNull ConfigManager configManager, @NonNull String text) { + boolean flag = false; + String trimmedStr = text.trim(); + if (!flag) { + if (trimmedStr.isEmpty()) { + Novoline novolineInst = Novoline.getInstance(); + NotificationManager notifManager = novolineInst.getNotificationManager(); + String textStr = "Name may not be blank!"; + NotificationType notificationType = NotificationType.ERROR; + notifManager.pop(textStr, 2000, notificationType); + return null; + } + + try { + return configManager.a(text); + } catch (IOException ex) { + Logger log = Novoline.getLogger(); + String textStr2 = "An I/O error occurred while saving config!"; + log.warn(textStr2, ex); + Novoline novolineInst2 = Novoline.getInstance(); + NotificationManager notifManager2 = novolineInst2.getNotificationManager(); + textStr2 = "Cannot save config!"; + NotificationType notificationType2 = NotificationType.ERROR; + notifManager2.pop(textStr2, 2000, notificationType2); + } catch (ObjectMappingException ex2) { + Logger log2 = Novoline.getLogger(); + log2.warn("An I/O error occurred while serializing config!", ex2); + Novoline novolineInst3 = Novoline.getInstance(); + NotificationManager notifManager3 = novolineInst3.getNotificationManager(); + notifManager3.pop("Cannot save config!", 2000, NotificationType.ERROR); + } + + return null; + } else { + return trimmedStr; + } +} + + public static void updateState(@NonNull ConfigManager configManager, @NonNull String text) { + String trimmedStr = text.trim(); + if (trimmedStr.isEmpty()) { + Novoline novolineInst = Novoline.getInstance(); + NotificationManager notifManager = novolineInst.getNotificationManager(); + String textStr = "Name may not be blank!"; + NotificationType notificationType = NotificationType.ERROR; + notifManager.pop(textStr, 2000, notificationType); + return; + } + + try { + configManager.a(text, true); + Novoline novolineInst2 = Novoline.getInstance(); + NotificationManager notifManager2 = novolineInst2.getNotificationManager(); + StringBuilder sb = new StringBuilder(); + sb = sb.append("Loaded config ").append(text); + String textStr2 = sb.append("!").toString(); + NotificationType notificationType2 = NotificationType.SUCCESS; + notifManager2.pop(textStr2, 2000, notificationType2); + trimmedStr = text; + } catch (FileNotFoundException ex) { + Novoline novolineInst3 = Novoline.getInstance(); + NotificationManager notifManager3 = novolineInst3.getNotificationManager(); + String textStr3 = "Config not found!"; + NotificationType notificationType3 = NotificationType.ERROR; + notifManager3.pop(textStr3, 2000, notificationType3); + return; + } catch (IOException ex5) { + Logger log = Novoline.getLogger(); + String textStr4 = "An I/O error occurred while reading config!"; + log.warn(textStr4, ex5); + Novoline novolineInst4 = Novoline.getInstance(); + NotificationManager notifManager4 = novolineInst4.getNotificationManager(); + textStr4 = "Cannot read config!"; + NotificationType notificationType4 = NotificationType.ERROR; + notifManager4.pop(textStr4, 2000, notificationType4); + return; + } catch (ObjectMappingException ex6) { + Logger log2 = Novoline.getLogger(); + String textStr5 = "An error occurred while deserializing config!"; + log2.warn(textStr5, ex6); + Novoline novolineInst5 = Novoline.getInstance(); + NotificationManager notifManager5 = novolineInst5.getNotificationManager(); + textStr5 = "Cannot load config!"; + NotificationType notificationType5 = NotificationType.ERROR; + notifManager5.pop(textStr5, 2000, notificationType5); + return; + } catch (ConfigCommandException ex2) { + Novoline novolineInst6 = Novoline.getInstance(); + NotificationManager notifManager6 = novolineInst6.getNotificationManager(); + String textStr6 = "Config is outdated!"; + NotificationType notificationType6 = NotificationType.ERROR; + notifManager6.pop(textStr6, 2000, notificationType6); + return; + } catch (Throwable ex7) { + Logger log3 = Novoline.getLogger(); + log3.warn("An unexpected error occurred while loading config!", ex7); + Novoline novolineInst7 = Novoline.getInstance(); + NotificationManager notifManager7 = novolineInst7.getNotificationManager(); + notifManager7.pop("Cannot load config!", 2000, NotificationType.ERROR); + return; + } + + try { + ConfigCommand.$keepCatch(); + ConfigCommand.$keepCatch(); + ConfigCommand.$keepCatch(); + textValue2 = trimmedStr; + } catch (FileNotFoundException ex3) { + Novoline novolineInst8 = Novoline.getInstance(); + NotificationManager notifManager8 = novolineInst8.getNotificationManager(); + String textStr7 = "Config not found!"; + NotificationType notificationType7 = NotificationType.ERROR; + notifManager8.pop(textStr7, 2000, notificationType7); + } catch (IOException ex8) { + Logger log4 = Novoline.getLogger(); + String textStr8 = "An I/O error occurred while reading config!"; + log4.warn(textStr8, ex8); + Novoline novolineInst9 = Novoline.getInstance(); + NotificationManager notifManager9 = novolineInst9.getNotificationManager(); + textStr8 = "Cannot read config!"; + NotificationType notificationType8 = NotificationType.ERROR; + notifManager9.pop(textStr8, 2000, notificationType8); + } catch (ObjectMappingException ex9) { + Logger log5 = Novoline.getLogger(); + String textStr9 = "An error occurred while deserializing config!"; + log5.warn(textStr9, ex9); + Novoline novolineInst10 = Novoline.getInstance(); + NotificationManager notifManager10 = novolineInst10.getNotificationManager(); + textStr9 = "Cannot load config!"; + NotificationType notificationType9 = NotificationType.ERROR; + notifManager10.pop(textStr9, 2000, notificationType9); + } catch (ConfigCommandException ex4) { + Novoline novolineInst11 = Novoline.getInstance(); + NotificationManager notifManager11 = novolineInst11.getNotificationManager(); + String textStr10 = "Config is outdated!"; + NotificationType notificationType10 = NotificationType.ERROR; + notifManager11.pop(textStr10, 2000, notificationType10); + } catch (Throwable ex10) { + Logger log6 = Novoline.getLogger(); + String textStr11 = "An unexpected error occurred while loading config!"; + log6.warn(textStr11, ex10); + Novoline novolineInst12 = Novoline.getInstance(); + NotificationManager notifManager12 = novolineInst12.getNotificationManager(); + textStr11 = "Cannot load config!"; + NotificationType notificationType11 = NotificationType.ERROR; + notifManager12.pop(textStr11, 2000, notificationType11); + } +} + private static void $keepCatch() throws E {} +} diff --git a/src/main/java/cc/novoline/commands/impl/DirectMessageCommand.java b/src/main/java/cc/novoline/commands/impl/DirectMessageCommand.java new file mode 100644 index 0000000..76a53e6 --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/DirectMessageCommand.java @@ -0,0 +1,34 @@ +package cc.novoline.commands.impl; +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import cc.novoline.utils.messages.CommandUsageMessage; +import java.util.List; + +import net.minecraft.command.CommandException; +import org.jetbrains.annotations.NotNull; + +public class DirectMessageCommand extends NovoCommand { + + + public void updateState2(char ch, long time, String[] args) throws CommandException { + byte byteVal = (byte)(true ? 1 : 0); + int intVal = byteVal; + if (time >= 0L) { + if (byteVal == 0) { + return; + } + + intVal = args.length; + } + + if (intVal < 2) { + CommandUsageMessage[] commandUsageMessageArr = new CommandUsageMessage[1]; + commandUsageMessageArr[0] = CommandUsageMessage.of("(username) (message)", "directly message a user"); + this.updateState2("Message help:", ".message / .dm / .msg / .m", commandUsageMessageArr); + } +} + + public DirectMessageCommand(@NotNull Novoline novoline, String text, String str, List list) { + super(novoline, text, str, list); +} +} diff --git a/src/main/java/cc/novoline/commands/impl/FontCommand.java b/src/main/java/cc/novoline/commands/impl/FontCommand.java new file mode 100644 index 0000000..4f4564c --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/FontCommand.java @@ -0,0 +1,38 @@ +package cc.novoline.commands.impl; +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import cc.novoline.modules.visual.HUD; +import cc.novoline.utils.messages.CommandUsageMessage; +import cc.novoline.modules.ModuleRegistry; +import java.io.IOException; + +import net.minecraft.command.CommandException; +import org.jetbrains.annotations.NotNull; + +public class FontCommand extends NovoCommand { + public FontCommand(@NotNull Novoline novoline, String text) { + super(novoline, text); +} + + public void updateState2(char ch, long time, String[] args) throws CommandException, IOException { + boolean flag = false; + if (time > 0L) { + if (args.length == 1) { + HUD hudMod = ModuleRegistry.HUD.getModule(); + String textStr2 = args[0]; + hudMod.createString(textStr2); + hudMod.performAction(); + if (ch < 0 || !flag) { + return; + } + } + + String textStr = "Usage"; + CommandUsageMessage[] commandUsageMessageArr = new CommandUsageMessage[1]; + commandUsageMessageArr[0] = CommandUsageMessage.of("", " (path to file)"); + this.updateState2(textStr, ".font", commandUsageMessageArr); + } +} + + +} diff --git a/src/main/java/cc/novoline/commands/impl/FriendCommand.java b/src/main/java/cc/novoline/commands/impl/FriendCommand.java new file mode 100644 index 0000000..f22926a --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/FriendCommand.java @@ -0,0 +1,623 @@ +package cc.novoline.commands.impl; +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import cc.novoline.commands.util.FriendRelationSwitchMap; +import cc.novoline.modules.PlayerManager; +import cc.novoline.modules.PlayerRelationType; +import cc.novoline.utils.messages.CommandUsageMessage; +import cc.novoline.utils.messages.TextMessage; +import com.mojang.authlib.GameProfile; +import java.io.IOException; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Map.Entry; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.stream.Stream; + +import cc.novoline.modules.configurations.holder.SavingModuleHolderSupport; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.util.EnumChatFormatting; +import org.apache.logging.log4j.Logger; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; + +public final class FriendCommand extends NovoCommand { + private boolean matchesString(String text) { + boolean flag = this.novoline2.getPlayerManager().checkString(text, PlayerRelationType.FRIEND); + flag = !flag; + + return flag; +} + + private static boolean matchesEntry(Entry entry) { + return true; +} + + public void updateState2(char ch, long time, String[] args) { + int intVal; + byte byteVal; + cc.novoline.modules.PlayerRelationType playerRelationType; + cc.novoline.modules.PlayerRelationType playerRelationType2; + int intVal2; + byte byteVal2; + String[] stringArr; + byte byteVal3; + label311: { + label334: { + byteVal2 = (byte)(true ? 1 : 0); + int len = args.length; + byte byteVal7 = 1; + if (byteVal2 != 0) { + if (len < 1) { + this.performStep(); + return; + } + + stringArr = args; + byteVal3 = byteVal2; + if (ch < 0) { + break label311; + } + + if (byteVal2 == 0) { + break label334; + } + + len = args.length; + byteVal7 = 1; + } + + if (len == byteVal7) { + String textStr; + textStr = args[0]; + String lowerStr = textStr.toLowerCase(); + byte byteVal4 = -1; + intVal = lowerStr.hashCode(); + label301: + if (byteVal2 != 0) { + label317: { + label298: { + label318: { + switch (intVal) { + case 108: + intVal = (lowerStr.equals("l") ? 1 : 0); + if (byteVal2 == 0) { + break label301; + } + + if (intVal == 0) { + break label317; + } + + byteVal4 = 0; + intVal = byteVal2; + if (ch < 0) { + break; + } + + if (byteVal2 != 0) { + break label317; + } + case 3322014: + intVal = (lowerStr.equals("list") ? 1 : 0); + break; + case 94746189: + break label318; + default: + break label317; + } + + if (byteVal2 == 0) { + break label301; + } + + if (intVal == 0) { + break label317; + } + + byteVal4 = 1; + intVal = byteVal2; + if (ch < 0) { + break label298; + } + + if (byteVal2 != 0) { + break label317; + } + } + + intVal = (lowerStr.equals("clear") ? 1 : 0); + } + + if (byteVal2 == 0) { + break label301; + } + + if (intVal != 0) { + byteVal4 = 2; + } + } + + intVal = byteVal4; + } + + label271: { + label320: { + switch (intVal) { + case 0: + case 1: + Novoline novolineInst = this.novoline2; + List itemList = novolineInst.getPlayerManager().evaluateCheck(PlayerRelationType.FRIEND); + TextMessage textMessage = TextMessage.b("Friends list:"); + List itemList2 = itemList; + if (byteVal2 != 0) { + if (itemList.isEmpty()) { + textMessage.appendPart(TextMessage.resolveTextMessage2(" (empty)", EnumChatFormatting.RED)); + } + + this.updateState(textMessage, true); + itemList2 = itemList; + } + + Iterator iter = itemList2.iterator(); + + label265: + while (true) { + if (!iter.hasNext()) { + break; + } + + String textStr2 = (String)iter.next(); + TextMessage textMessage2 = TextMessage.b(" - "); + this.sendClientMessage(textMessage2.appendPart(TextMessage.resolveTextMessage2(textStr2, EnumChatFormatting.GRAY))); + + while (true) { + byteVal = byteVal2; + if (time < 0L) { + break label271; + } + + if (byteVal2 == 0) { + break label320; + } + + if (byteVal2 != 0) { + break; + } + + if (ch >= 0) { + break label265; + } + } + } + + if (time >= 0L && byteVal2 != 0) { + break label320; + } + case 2: + if (ch >= 0) { + FriendCommand friendCommand = this; + if (byteVal2 != 0 && time > 0L) { + Novoline novolineInst2 = this.novoline2; + if (novolineInst2.getPlayerManager().evaluateCondition(PlayerRelationType.FRIEND, FriendCommand::matchesEntry)) { + this.applyString5("Friend list was cleared"); + if (byteVal2 != 0) { + break label320; + } + } + + friendCommand = this; + } + + friendCommand.applyString5("Friend list is empty"); + } + + if (byteVal2 != 0) { + break label320; + } + } + + label238: { + PlayerRelationType playerRelationType3; + label237: { + Novoline novolineInst3 = this.novoline2; + playerRelationType3 = novolineInst3.getPlayerManager().resolvePlayerRelationType(textStr); + byte byteVal5 = byteVal2; + if (ch >= 0) { + if (byteVal2 != 0) { + if (playerRelationType3 != null) { + playerRelationType = playerRelationType3; + playerRelationType2 = PlayerRelationType.TARGET; + if (time <= 0L || byteVal2 == 0 || time < 0L) { + break label238; + } + + if (playerRelationType3 != PlayerRelationType.TARGET) { + break label237; + } + } + + this.applyString(textStr); + } + + byteVal5 = byteVal2; + } + + if (byteVal5 != 0) { + break label320; + } + } + + playerRelationType = playerRelationType3; + playerRelationType2 = PlayerRelationType.FRIEND; + } + + if (playerRelationType == playerRelationType2) { + this.handleCommandArg(textStr); + } + } + + byteVal = byteVal2; + } + + if (byteVal != 0) { + return; + } + } + + try { + stringArr = args; + } catch (Exception ex) { + ex.printStackTrace(); + return; + } + } + + try { + byteVal3 = 0; + } catch (Exception ex2) { + ex2.printStackTrace(); + return; + } + } + + try { + String textStr3; + String textStr4 = stringArr[byteVal3]; + textStr3 = args[1]; + String lowerStr2 = textStr4.toLowerCase(); + byte byteVal6 = -1; + intVal2 = lowerStr2.hashCode(); + label161: + if (byteVal2 != 0) { + label327: { + label204: { + label328: { + label202: { + label329: { + label200: { + label330: { + switch (intVal2) { + case -1335458389: + break label330; + case 96417: + intVal2 = (lowerStr2.equals("add") ? 1 : 0); + if (byteVal2 == 0) { + break label161; + } + + if (intVal2 == 0) { + break label327; + } + + byteVal6 = 0; + intVal2 = byteVal2; + if (time <= 0L) { + break; + } + + if (byteVal2 != 0) { + break label327; + } + case -934610812: + intVal2 = (lowerStr2.equals("remove") ? 1 : 0); + break; + case 99339: + break label329; + case 112794: + break label328; + default: + break label327; + } + + if (byteVal2 == 0) { + break label161; + } + + if (intVal2 == 0) { + break label327; + } + + byteVal6 = 1; + intVal2 = byteVal2; + if (ch < 0) { + break label200; + } + + if (byteVal2 != 0) { + break label327; + } + } + + intVal2 = (lowerStr2.equals("delete") ? 1 : 0); + } + + if (byteVal2 == 0) { + break label161; + } + + if (intVal2 == 0) { + break label327; + } + + byteVal6 = 2; + intVal2 = byteVal2; + if (time <= 0L) { + break label202; + } + + if (byteVal2 != 0) { + break label327; + } + } + + intVal2 = (lowerStr2.equals("del") ? 1 : 0); + } + + if (byteVal2 == 0) { + break label161; + } + + if (intVal2 == 0) { + break label327; + } + + byteVal6 = 3; + intVal2 = byteVal2; + if (ch < 0) { + break label204; + } + + if (byteVal2 != 0) { + break label327; + } + } + + intVal2 = (lowerStr2.equals("rem") ? 1 : 0); + } + + if (time <= 0L || byteVal2 == 0) { + break label161; + } + + if (intVal2 != 0) { + byteVal6 = 4; + } + } + + intVal2 = byteVal6; + } + + label150: { + label149: { + if (ch >= 0) { + switch (intVal2) { + case 0: + this.applyString(textStr3); + intVal2 = byteVal2; + break; + case 1: + case 2: + case 3: + case 4: + break label149; + default: + break label150; + } + } + + if (intVal2 != 0) { + return; + } + } + + this.handleCommandArg(textStr3); + if (byteVal2 != 0) { + return; + } + } + + StringBuilder sb = new StringBuilder(); + String textStr5 = "Illegal command specified: "; + StringBuilder sb2 = sb.append(textStr5); + textStr5 = args[0]; + StringBuilder sb3 = sb2.append(textStr5); + textStr5 = "!"; + this.applyString4(sb3.append(textStr5).toString()); + } catch (Exception ex3) { + ex3.printStackTrace(); + } +} + + public void handleCommandArg(String text) { + SavingModuleHolderSupport.applyUpdate(text, "name"); + String lowerStr = text.toLowerCase(); + Novoline novolineInst = this.novoline2; + PlayerManager playerManager = novolineInst.getPlayerManager(); + PlayerManager playerManager2 = playerManager; + String textStr = lowerStr; + if (playerManager.resolvePlayerRelationType(lowerStr) != PlayerRelationType.FRIEND) { + StringBuilder sb2 = new StringBuilder().append(text); + this.applyString4(sb2.append(" is not friend!").toString()); + return; + } + + playerManager2 = playerManager; + textStr = lowerStr; + + boolean flag = playerManager2.evaluateCheck(textStr); + if (flag) { + StringBuilder sb3 = new StringBuilder(); + StringBuilder sb4 = sb3.append("Removed "); + StringBuilder sb5 = sb4.append(text); + this.applyString5(sb5.append(" from friends!").toString()); + + try { + playerManager.obtainPlayerManagerConfigisnotlHelper().a(); + return; + } catch (IOException ex) { + this.applyString4("Can't save to file"); + Logger log = playerManager.getLog(); + log.warn("An error occurred while saving friends list", ex); + return; + } + } + + StringBuilder sb6 = new StringBuilder(); + StringBuilder sb7 = sb6.append("Cannot remove "); + StringBuilder sb8 = sb7.append(text); + this.applyString4(sb8.append(" from friends!").toString()); +} + + public FriendCommand(@NonNull Novoline novoline, String text, String str, String value) { + super(novoline, text, str, value); +} + + @Override + public @Nullable List resolveDouble(String[] args) { + switch (args.length) { + case 1: + String[] stringArr = new String[]{"add", "remove", "list"}; + return this.updateState2(Stream.of(stringArr), args[0], true); + case 2: + String textStr = args[0]; + boolean flag = textStr.equalsIgnoreCase("add"); + if (flag) { + Collection collection = NetHandlerPlayClient.entryMap.values(); + Stream stream2 = collection.stream(); + Function mapper = ((java.util.function.Function) NetworkPlayerInfo::getGameProfile); + Stream stream3 = stream2.map(mapper); + mapper = ((java.util.function.Function) GameProfile::getName); + Stream stream4 = stream3.map(mapper); + Predicate predicate = this::matchesString; + return this.updateState2(stream4.filter(predicate), args[1], true); + } + + textStr = args[0]; + flag = textStr.equalsIgnoreCase("remove"); + + if (flag) { + Novoline novolineInst = this.novoline2; + return this.updateState2(novolineInst.getPlayerManager().evaluateCheck(PlayerRelationType.FRIEND), args[1], true); + } + + return null; + default: + return null; + } +} + + private void performStep() { + CommandUsageMessage[] commandUsageMessageArr = new CommandUsageMessage[3]; + commandUsageMessageArr[0] = CommandUsageMessage.of("add (name)", "adds friend"); + commandUsageMessageArr[1] = CommandUsageMessage.of("remove (name)", "removes friend"); + commandUsageMessageArr[2] = CommandUsageMessage.of("list", "shows friends"); + this.updateState2("Friends help:", ".friend", commandUsageMessageArr); +} + + public void applyString(String text) { + label52: { + boolean flag; + PlayerManager playerManager; + int intVal; + label49: { + SavingModuleHolderSupport.applyUpdate(text, "name"); + String lowerStr = text.toLowerCase(); + Novoline novolineInst = this.novoline2; + playerManager = novolineInst.getPlayerManager(); + PlayerRelationType playerRelationType = playerManager.resolvePlayerRelationType(lowerStr); + flag = false; + if (playerRelationType != null) { + intVal = FriendRelationSwitchMap.SWITCH_MAP[playerRelationType.ordinal()]; + if (flag) { + break label49; + } + + switch (intVal) { + case 1: + if (playerManager.removeType(lowerStr, PlayerRelationType.TARGET)) { + StringBuilder sb3 = new StringBuilder().append("Removed ").append(text); + this.applyString6(sb3.append(" from targets!").toString()); + if (!flag) { + break; + } + } + + StringBuilder sb4 = new StringBuilder(); + String textStr = "Cannot remove "; + StringBuilder sb5 = sb4.append(textStr); + StringBuilder sb6 = sb5.append(text); + textStr = " from targets!"; + this.applyString6(sb6.append(textStr).toString()); + if (!flag) { + break; + } + case 2: + break label52; + } + } + + intVal = (playerManager.evaluateCondition(lowerStr, PlayerRelationType.FRIEND) ? 1 : 0); + } + + int intVal2 = intVal; + if (!flag) { + if (intVal2 != 0) { + StringBuilder sb7 = new StringBuilder(); + String textStr2 = "Added "; + sb7 = sb7.append(textStr2).append(text); + textStr2 = " to friends!"; + this.applyString5(sb7.append(textStr2).toString()); + + try { + playerManager.obtainPlayerManagerConfigisnotlHelper().a(); + return; + } catch (IOException ex) { + this.applyString4("Can't save to file"); + Logger log = playerManager.getLog(); + log.warn("An error occurred while saving friends list", ex); + if (!flag) { + return; + } + } + } + + StringBuilder sb8 = new StringBuilder(); + String textStr3 = "Cannot add "; + sb8 = sb8.append(textStr3).append(text); + textStr3 = " to friends!"; + this.applyString4(sb8.append(textStr3).toString()); + } + + return; + } + + StringBuilder sb9 = new StringBuilder().append(text); + this.applyString4(sb9.append(" is friend already!").toString()); +} + + +} diff --git a/src/main/java/cc/novoline/commands/impl/HelpCommand.java b/src/main/java/cc/novoline/commands/impl/HelpCommand.java new file mode 100644 index 0000000..742bdef --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/HelpCommand.java @@ -0,0 +1,23 @@ +package cc.novoline.commands.impl; + +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import cc.novoline.events.EventManager; +import cc.novoline.modules.misc.uhc.HypixelAutoRewards; +import java.io.IOException; +import net.minecraft.client.Minecraft; +import net.minecraft.command.CommandException; +import org.jetbrains.annotations.NotNull; + +public class HelpCommand extends NovoCommand { + @Override + public void sendLines(String[] args) throws CommandException, IOException { + Object obj = this.mcSupplier.get(); + Minecraft mcClient = (Minecraft)obj; + EventManager.register(new HypixelAutoRewards(mcClient)); +} + + public HelpCommand(@NotNull Novoline novoline, String text) { + super(novoline, text); +} +} diff --git a/src/main/java/cc/novoline/commands/impl/HideCommand.java b/src/main/java/cc/novoline/commands/impl/HideCommand.java new file mode 100644 index 0000000..331d2c1 --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/HideCommand.java @@ -0,0 +1,88 @@ +package cc.novoline.commands.impl; +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.visual.HUD; +import cc.novoline.modules.ModuleRegistry; +import java.util.List; +import cc.novoline.modules.ModuleManager; + +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class HideCommand extends NovoCommand { + public HideCommand(@NonNull Novoline novoline, String text, String str, List list) { + super(novoline, text, str, list); +} + + public void updateState2(char ch, long time, String[] args) { + HideCommand hideCommand; + String textStr; + label46: { + label49: { + byte byteVal = (byte)(true ? 1 : 0); + String[] stringArr = args; + byte byteVal2 = byteVal; + if (ch >= 0) { + if (byteVal != 0) { + if (args.length != 1) { + break label49; + } + + stringArr = args; + } + + byteVal2 = 0; + } + + String textStr2 = stringArr[byteVal2]; + Novoline novolineInst = this.novoline2; + ModuleManager modManager = novolineInst.getModuleManager(); + AbstractModule mod = modManager.getByName(textStr2); + AbstractModule mod2 = mod; + if (byteVal != 0) { + if (mod == null) { + StringBuilder sb = new StringBuilder(); + String textStr3 = "Module "; + StringBuilder sb2 = sb.append(textStr3); + StringBuilder sb3 = sb2.append(textStr2); + textStr3 = " was not found!"; + this.applyString4(sb3.append(textStr3).toString()); + return; + } + + ModuleRegistry modEntry = ModuleRegistry.HUD; + mod2 = modEntry.getModule(); + } + + HUD hudMod = (HUD)mod2; + boolean flag = mod.isHidden(); + if (byteVal != 0) { + flag = !flag; + } + + mod.setHidden(flag); + hudMod.performAction(); + hideCommand = this; + StringBuilder sb4 = new StringBuilder(); + String textStr4 = mod.isHidden() ? "Hidden" : "Shown"; + StringBuilder sb5 = sb4.append(textStr4); + StringBuilder sb6 = sb5.append(" "); + textStr4 = mod.getName(); + textStr = sb6.append(textStr4).toString(); + if (time < 0L) { + break label46; + } + + this.applyString5(textStr); + if (byteVal != 0) { + return; + } + } + + hideCommand = this; + textStr = "Use .hide to hide a module!"; + } + + hideCommand.applyString4(textStr); +} +} diff --git a/src/main/java/cc/novoline/commands/impl/IgnCommand.java b/src/main/java/cc/novoline/commands/impl/IgnCommand.java new file mode 100644 index 0000000..9df44cf --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/IgnCommand.java @@ -0,0 +1,48 @@ +package cc.novoline.commands.impl; +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import java.awt.Toolkit; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.StringSelection; +import java.io.IOException; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.command.CommandException; +import org.jetbrains.annotations.NotNull; + +public class IgnCommand extends NovoCommand { + public IgnCommand(@NotNull Novoline novoline, String text) { + super(novoline, text); +} + + + + public void updateState2(char ch, long time, String[] args) throws CommandException, IOException { + label21: { + boolean flag = true; + boolean flag2 = flag; + if (ch >= 0) { + if (flag) { + if (args.length == 0) { + break label21; + } + + this.updateState("Usage", ".ign"); + } + + flag2 = flag; + } + + if (flag2) { + return; + } + } + + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + StringSelection stringSelection = new StringSelection(player.getName()); + Clipboard clipboard2 = Toolkit.getDefaultToolkit().getSystemClipboard(); + clipboard2.setContents(stringSelection, stringSelection); + this.applyString3("Copied ign to your clipboard!"); +} +} diff --git a/src/main/java/cc/novoline/commands/impl/IrcChatCommand.java b/src/main/java/cc/novoline/commands/impl/IrcChatCommand.java new file mode 100644 index 0000000..aca4ced --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/IrcChatCommand.java @@ -0,0 +1,52 @@ +package cc.novoline.commands.impl; +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import cc.novoline.irc.NovolineWebSocket; +import cc.novoline.irc.packet.BroadcastCloudPacket; +import cc.novoline.utils.messages.CommandUsageMessage; +import java.util.List; + +import net.minecraft.command.CommandException; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class IrcChatCommand extends NovoCommand { + public IrcChatCommand(@NonNull Novoline novoline, String message, String text, List list) { + super(novoline, message, text, list); +} + + public void updateState2(char ch, long time, String[] args) throws CommandException { + byte byteVal = (byte)(false ? 1 : 0); + int intVal = byteVal; + if (ch >= 0) { + if (byteVal != 0) { + return; + } + + intVal = args.length; + } + + if (intVal >= 1) { + Novoline novolineInst = this.novoline2; + NovolineWebSocket novolineWebSocket = novolineInst.getWebSocket(); + if (byteVal == 0) { + if (novolineWebSocket == null) { + return; + } + + Novoline novolineInst2 = this.novoline2; + novolineWebSocket = novolineInst2.getWebSocket(); + } + + BroadcastCloudPacket packet = new BroadcastCloudPacket(String.join(" ", args)); + novolineWebSocket.applyUpdate(packet); + } else { + CommandUsageMessage[] commandUsageMessageArr = new CommandUsageMessage[1]; + String textStr = this.commandSummary; + commandUsageMessageArr[0] = CommandUsageMessage.of("(message)", textStr); + this.updateState2("Command help", ".chat (.c)", commandUsageMessageArr); + this.performAction(); + } +} + + +} diff --git a/src/main/java/cc/novoline/commands/impl/KickCommand.java b/src/main/java/cc/novoline/commands/impl/KickCommand.java new file mode 100644 index 0000000..835d091 --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/KickCommand.java @@ -0,0 +1,30 @@ +package cc.novoline.commands.impl; + +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import java.io.IOException; +import net.minecraft.command.CommandException; +import net.skidunion.security.ProtectionSession; +import org.jetbrains.annotations.NotNull; + +public class KickCommand extends NovoCommand { + public KickCommand(@NotNull Novoline novoline, String text, String str, String value) { + super(novoline, text, str, value); +} + + + + public void updateState2(char ch, long time, String[] args) throws CommandException, IOException { + int intVal = Integer.parseInt(ProtectionSession.c); + byte byteVal = 2; + if (intVal > 2) { + return; + } + + intVal = args.length; + + if (intVal != 1) { + this.updateState("kick", "\u0435\u0431\u043b\u0430\u043d \u043d\u0438\u043a\u043d\u0435\u0439\u043c \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c"); + } +} +} diff --git a/src/main/java/cc/novoline/commands/impl/KillsultsCommand.java b/src/main/java/cc/novoline/commands/impl/KillsultsCommand.java new file mode 100644 index 0000000..6c228ff --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/KillsultsCommand.java @@ -0,0 +1,16 @@ +package cc.novoline.commands.impl; + +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import java.io.IOException; +import java.util.List; +import net.minecraft.command.CommandException; +import org.jetbrains.annotations.NotNull; + +public class KillsultsCommand extends NovoCommand { + public KillsultsCommand(@NotNull Novoline novoline, String text, List list) { + super(novoline, text, list); +} + + public void updateState2(char ch, long time, String[] args) throws CommandException, IOException {} +} diff --git a/src/main/java/cc/novoline/commands/impl/NameHistoryCommand.java b/src/main/java/cc/novoline/commands/impl/NameHistoryCommand.java new file mode 100644 index 0000000..7ac4be7 --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/NameHistoryCommand.java @@ -0,0 +1,258 @@ +package cc.novoline.commands.impl; +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import cc.novoline.commands.util.JsonSchemaUtil; +import cc.novoline.commands.util.NameHistoryTypeToken; +import cc.novoline.commands.util.NameHistoryRecord; +import cc.novoline.commands.util.PlayerNameCache; +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import java.io.IOException; +import java.net.HttpURLConnection; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ForkJoinPool; +import java.util.concurrent.TimeUnit; + +import cc.novoline.modules.configurations.holder.SavingModuleHolderSupport; +import net.minecraft.util.EnumChatFormatting; +import org.apache.logging.log4j.Logger; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class NameHistoryCommand extends NovoCommand { + private final Cache cacheField; + private final SimpleDateFormat simpleDateFormatField; + + private PlayerNameCache mapString(String text) throws Exception { + HttpURLConnection httpURLConnection = JsonSchemaUtil.resolveHttpURLConnection(new StringBuilder().append("https://api.mojang.com/users/profiles/minecraft/").append(text).toString()); + JsonElement jsonElement = JsonSchemaUtil.resolveJsonElement(httpURLConnection, ((java.util.function.Consumer) (httpURLConnection2) -> this.invokeCallback2(text, httpURLConnection2)), JsonElement.class); + JsonElement jsonElement2 = jsonElement; + if (jsonElement == null) { + return null; + } + + JsonObject jsonObject = jsonElement.getAsJsonObject(); + jsonElement = jsonObject.get("id"); + jsonElement2 = jsonElement; + + if (jsonElement2 == null) { + throw new RuntimeException("Mojang API schema has been changed!"); + } + + jsonElement2 = jsonElement; + + if (!jsonElement2.isJsonPrimitive()) { + throw new RuntimeException("Mojang API schema has been changed!"); + } + + jsonElement2 = jsonElement; + + String textStr = jsonElement2.getAsString(); + StringBuilder sb3 = new StringBuilder().append("https://api.mojang.com/user/profiles/").append(textStr); + httpURLConnection = JsonSchemaUtil.resolveHttpURLConnection(sb3.append("/names").toString()); + JsonArray jsonArray = JsonSchemaUtil.resolveJsonElement(httpURLConnection, this::handleHttpURLConnection, JsonArray.class); + return new PlayerNameCache(JsonSchemaUtil.getGson().fromJson(jsonArray, new NameHistoryTypeToken(this).getType()), null); +} + + + + private @NonNull String resolveString(@NonNull PlayerNameCache playerNameCache) { + boolean flag; + List itemList; + Object obj; + label40: { + itemList = playerNameCache.getNameHistoryRecordList(); + flag = true; + int intVal = (itemList.isEmpty() ? 1 : 0); + if (flag) { + if (intVal != 0) { + throw new RuntimeException(); + } + + obj = itemList; + if (!flag) { + break label40; + } + + intVal = itemList.size(); + } + + if (intVal == 1) { + StringBuilder sb = new StringBuilder(); + StringBuilder sb2 = sb.append("\n "); + EnumChatFormatting enumChatFormatting = EnumChatFormatting.GOLD; + StringBuilder sb3 = sb2.append(enumChatFormatting); + EnumChatFormatting enumChatFormatting2 = EnumChatFormatting.BOLD; + StringBuilder sb4 = sb3.append(enumChatFormatting2); + String textStr3 = ((NameHistoryRecord)itemList.get(0)).getTextValue(); + StringBuilder sb5 = sb4.append(textStr3); + return sb5.append("\n").toString(); + } + + obj = itemList.get(0); + } + + NameHistoryRecord nameHistoryRecord = (NameHistoryRecord)obj; + StringBuilder sb6 = new StringBuilder(); + String textStr = "\n "; + sb6 = sb6.append(textStr); + textStr = EnumChatFormatting.GOLD.toString(); + sb6 = sb6.append(textStr); + EnumChatFormatting enumChatFormatting3 = EnumChatFormatting.BOLD; + sb6 = sb6.append(enumChatFormatting3); + textStr = nameHistoryRecord.getTextValue(); + sb6 = sb6.append(textStr); + EnumChatFormatting enumChatFormatting4 = EnumChatFormatting.GOLD; + sb6 = sb6.append(enumChatFormatting4); + textStr = " (Original name)\n"; + String textStr2 = sb6.append(textStr).toString(); + StringBuilder sb7 = new StringBuilder(textStr2); + int intVal2 = 1; + + while (true) { + if (intVal2 < itemList.size() - 1) { + int intVal3 = intVal2++; + nameHistoryRecord = (NameHistoryRecord)itemList.get(intVal3); + textStr = " "; + sb6 = sb7.append(textStr); + EnumChatFormatting enumChatFormatting5 = EnumChatFormatting.GOLD; + sb6 = sb6.append(enumChatFormatting5); + textStr = " - "; + sb6 = sb6.append(textStr); + textStr = nameHistoryRecord.getTextValue(); + sb6 = sb6.append(textStr); + textStr = " ("; + sb6 = sb6.append(textStr); + textStr = this.resolveString2(nameHistoryRecord.getLongValue()); + sb6 = sb6.append(textStr); + textStr = ")\n"; + sb6.append(textStr); + if (!flag) { + break; + } + + if (flag) { + continue; + } + } + + nameHistoryRecord = (NameHistoryRecord)itemList.get(intVal2); + textStr = " "; + sb6 = sb7.append(textStr); + EnumChatFormatting enumChatFormatting6 = EnumChatFormatting.GOLD; + sb6 = sb6.append(enumChatFormatting6); + textStr = " - "; + sb6 = sb6.append(textStr); + textStr = nameHistoryRecord.getTextValue(); + sb6 = sb6.append(textStr); + textStr = " ("; + sb6 = sb6.append(textStr); + textStr = this.resolveString2(nameHistoryRecord.getLongValue()); + sb6 = sb6.append(textStr); + textStr = ")"; + sb6.append(textStr); + break; + } + + return sb7.toString(); +} + + public NameHistoryCommand(@NonNull Novoline novoline, String name, String text) { + super(novoline, name, text); + CacheBuilder cacheBuilder = CacheBuilder.newBuilder(); + TimeUnit timeUnit = TimeUnit.MINUTES; + cacheBuilder = cacheBuilder.expireAfterAccess(5L, timeUnit); + this.cacheField = cacheBuilder.build(); + this.simpleDateFormatField = new SimpleDateFormat("dd.MM.yyyy"); +} + + private void handleHttpURLConnection(HttpURLConnection httpURLConnection) { + StringBuilder sb = new StringBuilder().append(EnumChatFormatting.RED); + this.applyString3(sb.append("Mojang API schema has been changed. Let the developers know!").toString()); +} + + public void updateState2(char ch, long time, String[] args) { + byte byteVal = (byte)(true ? 1 : 0); + String[] stringArr = args; + byte byteVal2 = byteVal; + if (ch >= 0) { + if (byteVal != 0) { + if (args.length < 1) { + this.applyString4("Use .name (name)"); + return; + } + + stringArr = args; + } + + byteVal2 = 0; + } + + String textStr = stringArr[byteVal2]; + this.updateHelper(textStr, 0); +} + + public PlayerNameCache resolvePlayerNameCache(@NonNull String text) throws ExecutionException { + SavingModuleHolderSupport.applyUpdate(text, "name"); + return (cc.novoline.commands.util.PlayerNameCache) this.cacheField.get(text.toLowerCase(), ((java.util.concurrent.Callable) () -> this.mapString(text))); +} + + private @NonNull String resolveString2(long time) { + return this.simpleDateFormatField.format(new Date(time)); +} + + private void invokeCallback(String text, int value) { + try { + PlayerNameCache playerNameCache = this.resolvePlayerNameCache(text); + if (playerNameCache == null) { + return; + } + + try { + this.applyString3(this.resolveString(playerNameCache)); + } catch (Throwable ex) { + label29: { + if (value >= 1) { + break label29; + } + + this.updateHelper(text, value + 1); + + return; + } + + StringBuilder sb = new StringBuilder().append(EnumChatFormatting.RED).append("Could not find name ").append(text); + this.applyString3(sb.append("!").toString()); + } + } catch (Throwable ex2) { + Logger log = this.getLogger2(); + log.warn("An error occurred while trying to reach Mojang API!", ex2); + } +} + + public void updateHelper(String text, int value) { + ForkJoinPool.commonPool().execute(((java.lang.Runnable) () -> this.invokeCallback(text, value))); +} + + private void invokeCallback2(String text, HttpURLConnection httpURLConnection) { + try { + StringBuilder sb = new StringBuilder(); + EnumChatFormatting enumChatFormatting = EnumChatFormatting.RED; + sb = sb.append(enumChatFormatting).append("Could not find name "); + sb = sb.append(text).append("! ("); + int intVal = httpURLConnection.getResponseCode(); + sb = sb.append(intVal); + this.applyString3(sb.append(")").toString()); + } catch (IOException ex) { + StringBuilder sb2 = new StringBuilder().append(EnumChatFormatting.RED).append("Could not find name ").append(text); + this.applyString3(sb2.append("!").toString()); + Logger log = this.getLogger2(); + log.warn("An I/O error occurred while trying to get response code!", ex); + } +} +} diff --git a/src/main/java/cc/novoline/commands/impl/PanicCommand.java b/src/main/java/cc/novoline/commands/impl/PanicCommand.java new file mode 100644 index 0000000..3e529af --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/PanicCommand.java @@ -0,0 +1,156 @@ +package cc.novoline.commands.impl; +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.combat.AntiBot; +import cc.novoline.modules.exploits.Disabler; +import cc.novoline.modules.configurations.holder.ModuleHolder; +import it.unimi.dsi.fastutil.objects.ObjectCollection; +import it.unimi.dsi.fastutil.objects.ObjectIterator; +import cc.novoline.modules.ModuleManager; + +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class PanicCommand extends NovoCommand { + public PanicCommand(@NonNull Novoline novoline, String text, String str, String value) { + super(novoline, text, str, value); +} + + public void updateState2(char ch, long time, String[] args) { + byte byteVal; + int len; + label138: { + byteVal = (byte)(false ? 1 : 0); + len = args.length; + byte byteVal5 = byteVal; + if (ch >= 0) { + if (byteVal != 0) { + break label138; + } + + byteVal5 = 1; + } + + if (len > byteVal5) { + this.applyString4("Use .panic or .panic (module type)"); + return; + } + + len = args.length; + } + + if (len == 0) { + Novoline novolineInst = this.novoline2; + ModuleManager modManager = novolineInst.getModuleManager(); + ObjectCollection objectCollection = modManager.getModules().values(); + ObjectIterator objectIterator = objectCollection.iterator(); + + do { + if (!objectIterator.hasNext()) { + break; + } + + ModuleHolder modHolder = (ModuleHolder)objectIterator.next(); + AbstractModule mod = modHolder.getModule(); + byte byteVal2 = byteVal; + if (ch >= 0) { + if (byteVal != 0) { + return; + } + + byteVal2 = (byte)(mod.isEnabled() ? 1 : 0); + } + + byte byteVal3 = byteVal; + if (ch >= 0) { + if (byteVal == 0) { + if (byteVal2 == 0) { + continue; + } + + byteVal2 = (byte)(mod instanceof AntiBot ? 1 : 0); + } + + byteVal3 = byteVal; + } + + if (time > 0L) { + if (byteVal3 == 0) { + if (byteVal2 != 0) { + continue; + } + + byteVal2 = (byte)(mod instanceof Disabler ? 1 : 0); + } + + byteVal3 = byteVal; + } + + if (byteVal3 == 0 && byteVal2 == 0) { + mod.toggle(); + } + } while (byteVal == 0); + + if (ch < 0 || byteVal == 0) { + return; + } + } + + Novoline novolineInst2 = this.novoline2; + ModuleManager modManager2 = novolineInst2.getModuleManager(); + ObjectCollection objectCollection2 = modManager2.getModules().values(); + ObjectIterator objectIterator2 = objectCollection2.iterator(); + + do { + if (!objectIterator2.hasNext()) { + break; + } + + ModuleHolder modHolder2 = (ModuleHolder)objectIterator2.next(); + AbstractModule mod2 = modHolder2.getModule(); + boolean enabled = mod2.isEnabled(); + byte byteVal4 = byteVal; + if (ch >= 0) { + if (byteVal == 0) { + if (!enabled) { + continue; + } + + enabled = mod2 instanceof AntiBot; + } + + byteVal4 = byteVal; + } + + if (ch >= 0) { + if (byteVal4 == 0) { + if (enabled) { + continue; + } + + enabled = mod2 instanceof Disabler; + } + + byteVal4 = byteVal; + } + + if (time >= 0L) { + if (byteVal4 == 0) { + if (enabled) { + continue; + } + + String textStr = mod2.getCategory().toString(); + String textStr2 = args[0]; + enabled = textStr.equalsIgnoreCase(textStr2); + } + + byteVal4 = byteVal; + } + + if (byteVal4 == 0 && enabled) { + mod2.toggle(); + } + } while (byteVal == 0); +} +} diff --git a/src/main/java/cc/novoline/commands/impl/PitBountyCommand.java b/src/main/java/cc/novoline/commands/impl/PitBountyCommand.java new file mode 100644 index 0000000..a424fa4 --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/PitBountyCommand.java @@ -0,0 +1,350 @@ +package cc.novoline.commands.impl; +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import cc.novoline.events.EventManager; +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.PlayerManager; +import cc.novoline.modules.PlayerRelationType; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.utils.tasks.TaskManager; +import cc.novoline.utils.tasks.TaskStage; +import cc.novoline.utils.tasks.impl.RandomOrbTask; +import com.mojang.authlib.GameProfile; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; +import java.util.UUID; +import net.minecraft.network.play.client.C01PacketChatMessage; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiIngame; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.command.CommandException; +import net.minecraft.entity.Entity; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.util.EnumChatFormatting; +import org.jetbrains.annotations.NotNull; + +public class PitBountyCommand extends NovoCommand { + private TimerUtil timer = new TimerUtil(); + private int stateTicks; + private Minecraft mcClient; + private boolean stateFlag; + private int stateTicks2; + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + boolean flag = true; + if (event.getState() == State.PRE) { + TimerUtil timerUtil = this.timer; + if (flag && timerUtil.delay(1000L)) { + timerUtil = this.timer; + timerUtil.reset(); + Minecraft mcClient2 = this.mcClient; + mcClient2.getNetHandler().addToSendQueue(new C01PacketChatMessage("/play pit")); + this.isStateReady(); + } + } +} + + private boolean isStateReady() { + java.lang.String textStr; + java.lang.String textStr2; + int intVal4 = (true ? 1 : 0); + List itemList = this.mcClient.ingameGUI.getTabList().obtainList(); + Iterator iter = itemList.iterator(); + boolean flag = (intVal4 != 0); + + while (true) { + if (!iter.hasNext()) { + break; + } + + NetworkPlayerInfo networkPlayerInfo; + int intVal; + label85: { + label93: { + networkPlayerInfo = (NetworkPlayerInfo)iter.next(); + NetworkPlayerInfo networkPlayerInfo2 = networkPlayerInfo; + if (flag) { + if (networkPlayerInfo == null) { + break label93; + } + + networkPlayerInfo2 = networkPlayerInfo; + } + + label94: { + ScorePlayerTeam scorePlayerTeam = networkPlayerInfo2.getPlayerTeam(); + GameProfile gameProfile = networkPlayerInfo.getGameProfile(); + String nameStr = ScorePlayerTeam.formatPlayerName(scorePlayerTeam, gameProfile.getName()); + String[] stringArr = nameStr.split(" "); + String textStr3 = stringArr[stringArr.length - 1]; + boolean flag2 = textStr3.endsWith("g"); + if (flag) { + if (!flag2) { + break label93; + } + + textStr = textStr3; + textStr2 = "\u00a7"; + if (!flag) { + break label94; + } + + flag2 = textStr3.contains(textStr2); + } + + if (!flag2) { + break label93; + } + + textStr = textStr3; + textStr2 = "g"; + } + + String textStr4 = textStr.replace(textStr2, ""); + long longVal = textStr4.chars().filter((int intVal5) -> intVal5 == 167).count(); + int intVal2 = (int)(longVal * 2L); + textStr4 = textStr4.substring(intVal2); + intVal = Integer.parseInt(textStr4); + intVal4 = intVal; + int ticks = this.stateTicks; + if (flag) { + if (intVal < this.stateTicks) { + break label93; + } + + intVal4 = intVal; + if (!flag) { + break label85; + } + + ticks = this.stateTicks2; + } + + if (intVal4 <= ticks) { + intVal4 = (this.resolveDouble(networkPlayerInfo) ? 1 : 0); + break label85; + } + } + + if (flag) { + continue; + } + break; + } + + if (flag) { + if (intVal4 != 0) { + boolean flag3 = this.matchesNetworkPlayerInfo(networkPlayerInfo); + if (!flag) { + return flag3; + } + + if (!flag3) { + return true; + } + } + + String textStr5 = "Found a bountied player!"; + StringBuilder sb = new StringBuilder(); + sb = sb.append("Found "); + EnumChatFormatting enumChatFormatting = EnumChatFormatting.GOLD; + sb = sb.append(enumChatFormatting).append(intVal); + sb = sb.append("g"); + EnumChatFormatting enumChatFormatting2 = EnumChatFormatting.RESET; + sb = sb.append(enumChatFormatting2).append(" on "); + GameProfile gameProfile2 = networkPlayerInfo.getGameProfile(); + String nameStr3 = gameProfile2.getName(); + sb = sb.append(nameStr3); + nameStr3 = "!"; + this.updateState4(textStr5, sb.append(nameStr3).toString(), 5000, NotificationType.INFO); + Novoline novolineInst = this.novoline2; + PlayerManager playerManager = novolineInst.getPlayerManager(); + GameProfile gameProfile3 = networkPlayerInfo.getGameProfile(); + playerManager.evaluateCondition(gameProfile3.getName(), PlayerRelationType.TARGET); + StringBuilder sb3 = new StringBuilder().append("Added "); + GameProfile gameProfile4 = networkPlayerInfo.getGameProfile(); + String nameStr2 = gameProfile4.getName(); + StringBuilder sb4 = sb3.append(nameStr2); + this.applyString5(sb4.append(" to targets!").toString()); + intVal4 = 0; + } + + int intVal3 = intVal4; + + while (intVal3 < 20) { + Novoline novolineInst2 = this.novoline2; + TaskManager taskManager = novolineInst2.getTaskManager(); + RandomOrbTask randomOrbTask = new RandomOrbTask(this, 100 * intVal3, TaskStage.TICK); + taskManager.applyFutureTask(randomOrbTask); + intVal3++; + if (!flag) { + return true; + } + + if (!flag) { + break; + } + } + + EventManager.unregister(this); + return true; + } + + return false; +} + + private boolean matchesNetworkPlayerInfo(NetworkPlayerInfo networkPlayerInfo) { + List itemList = this.mcClient.theWorld.getLoadedEntityList(); + Iterator iter = itemList.iterator(); + boolean flag = false; + + do { + if (!iter.hasNext()) { + break; + } + + Entity entity = (Entity)iter.next(); + UUID uUID = entity.getUUID2(); + GameProfile gameProfile = networkPlayerInfo.getGameProfile(); + if (uUID == gameProfile.getId()) { + double posY2 = this.mcClient.thePlayer.posY - entity.posY; + int intVal = (Math.abs(posY2) > 5.0) ? 1 : 0; + + return ((((intVal & 1)) != 0)); + } + } while (!flag); + + return false; +} + + public PitBountyCommand(@NotNull Novoline novoline, String text, String str, List list) { + super(novoline, text, str, list); + this.mcClient = Minecraft.getMinecraft(); +} + + + + public void updateState2(char ch, long time, String[] args) throws CommandException, IOException { + int len; + cc.novoline.commands.impl.PitBountyCommand pitBountyCommand; + boolean flag; + String textStr; + String[] stringArr = null; + label68: { + String textStr2; + label71: { + label66: { + flag = true; + len = args.length; + boolean flag2 = flag; + if (ch >= 0) { + if (flag) { + if (len == 0) { + this.updateState("Find Bounty", ".fb -"); + return; + } + + len = args.length; + } + + if (time < 0L) { + break label66; + } + + flag2 = flag; + } + + if (flag2) { + if (len != 1) { + this.updateState("Find Bounty", ".fb -"); + return; + } + + textStr = null; + if (ch < 0) { + break label68; + } + + textStr = args[0]; + textStr2 = "stop"; + if (!flag) { + break label71; + } + + len = (textStr.equalsIgnoreCase(textStr2) ? 1 : 0); + } + } + + if (len != 0) { + EventManager.unregister(this); + return; + } + + textStr = args[0]; + textStr2 = "-"; + } + + stringArr = textStr.split(textStr2); + } + + label74: { + + this.stateTicks = Integer.parseInt(stringArr[0]); + this.stateTicks2 = Integer.parseInt(stringArr[1]); + int ticks = this.stateTicks; + if (time > 0L && flag) { + if (this.stateTicks > this.stateTicks2) { + this.updateState("Find Bounty", "The minimum amount is greater than the maximum amount!"); + return; + } + + this.applyString5("Trying to find the bounty."); + TimerUtil timerUtil = this.timer; + timerUtil.reset(); + pitBountyCommand = this; + if (!flag) { + break label74; + } + + ticks = (this.isStateReady() ? 1 : 0); + } + + if (ticks != 0) { + return; + } + + this.applyString5("Swapping servers..."); + pitBountyCommand = this; + } + + EventManager.register(pitBountyCommand); +} + + private boolean resolveDouble(NetworkPlayerInfo networkPlayerInfo) { + List itemList = this.mcClient.theWorld.getLoadedEntityList(); + Iterator iter = itemList.iterator(); + boolean flag = true; + + do { + if (!iter.hasNext()) { + break; + } + + Entity entity = (Entity)iter.next(); + UUID uUID = entity.getUUID2(); + GameProfile gameProfile = networkPlayerInfo.getGameProfile(); + if (uUID == gameProfile.getId()) { + return true; + } + } while (flag); + + return false; +} +} diff --git a/src/main/java/cc/novoline/commands/impl/RenameCommand.java b/src/main/java/cc/novoline/commands/impl/RenameCommand.java new file mode 100644 index 0000000..103b013 --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/RenameCommand.java @@ -0,0 +1,220 @@ +package cc.novoline.commands.impl; +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.visual.HUD; +import cc.novoline.utils.messages.CommandUsageMessage; +import cc.novoline.modules.ModuleRegistry; +import java.util.Iterator; +import java.util.List; +import cc.novoline.modules.ModuleManager; + + +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class RenameCommand extends NovoCommand { + public void updateState2(char ch, long time, String[] args) { + cc.novoline.commands.impl.RenameCommand renameCommand; + cc.novoline.modules.AbstractModule mod; + boolean flag; + label130: { + boolean flag2; + label131: { + flag2 = false; + int len2 = args.length; + byte byteVal = 1; + if (!flag2) { + label122: { + if (len2 == 1) { + String textStr = args[0]; + len2 = (textStr.equalsIgnoreCase("reset") ? 1 : 0); + if (flag2) { + break label122; + } + + if (len2 != 0) { + EnumModuleType[] modCategoryArr = EnumModuleType.values(); + int len = modCategoryArr.length; + int intVal = 0; + + while (intVal < len) { + EnumModuleType modCategory = modCategoryArr[intVal]; + if (flag2) { + break label131; + } + + Novoline novolineInst = this.novoline2; + ModuleManager modManager = novolineInst.getModuleManager(); + List itemList = modManager.getModules().getByCategory(modCategory); + Iterator iter = itemList.iterator(); + + label113: { + while (true) { + if (iter.hasNext()) { + AbstractModule mod2 = (AbstractModule)iter.next(); + String displayName = mod2.getRawDisplayName(); + mod2.applyUpdate2(displayName); + this.applyString5("all module names reseted"); + flag = flag2; + if (ch < 0) { + break label113; + } + + if (flag2) { + break; + } + + if (!flag2) { + continue; + } + } + + if (ch >= 0) { + intVal++; + } + break; + } + + flag = flag2; + } + + if (flag) { + break; + } + } + + ModuleRegistry modEntry = ModuleRegistry.HUD; + HUD hudMod = modEntry.getModule(); + hudMod.performAction(); + flag = flag2; + if (time <= 0L) { + break label130; + } + + if (!flag2) { + break label131; + } + } + } + + len2 = args.length; + } + + byteVal = 2; + } + + label90: { + label89: + if (len2 == byteVal) { + renameCommand = this; + if (flag2) { + break label90; + } + + Novoline novolineInst2 = this.novoline2; + ModuleManager modManager2 = novolineInst2.getModuleManager(); + String textStr2 = args[0]; + AbstractModule mod3 = modManager2.getByName(textStr2); + if (time > 0L) { + if (mod3 == null) { + break label89; + } + + Novoline novolineInst3 = this.novoline2; + ModuleManager modManager3 = novolineInst3.getModuleManager(); + String textStr3 = args[0]; + mod3 = modManager3.getByName(textStr3); + } + + label81: { + label80: { + AbstractModule mod4 = mod3; + String textStr4 = args[1]; + if (ch >= 0) { + String textStr5 = "reset"; + if (!flag2) { + label75: { + boolean flag3 = textStr4.equalsIgnoreCase(textStr5); + if (ch >= 0) { + if (!flag3) { + break label75; + } + + mod = mod4; + if (ch < 0) { + break label81; + } + + String displayName2 = mod4.getRawDisplayName(); + mod4.applyUpdate2(displayName2); + StringBuilder sb = new StringBuilder(); + String textStr10 = args[0]; + StringBuilder sb2 = sb.append(textStr10); + textStr10 = " name reseted"; + this.applyString5(sb2.append(textStr10).toString()); + flag3 = flag2; + } + + if (!flag3) { + break label80; + } + } + + String textStr6 = args[1]; + textStr4 = textStr6.replace("_", " "); + textStr5 = "&"; + } + + textStr4 = textStr4.replace(textStr5, "\u00a7"); + } + + String textStr7 = textStr4; + mod4.applyUpdate2(textStr7); + StringBuilder sb3 = new StringBuilder(); + String textStr8 = args[0]; + StringBuilder sb4 = sb3.append(textStr8); + textStr8 = " renamed to "; + StringBuilder sb5 = sb4.append(textStr8); + this.applyString5(sb5.append(textStr7).toString()); + } + + ModuleRegistry modEntry2 = ModuleRegistry.HUD; + mod = modEntry2.getModule(); + } + + HUD hudMod2 = (HUD)mod; + hudMod2.performAction(); + if (!flag2) { + break label131; + } + } + + renameCommand = this; + } + + String textStr9 = "Rename help:"; + String textStr11 = ".rename"; + CommandUsageMessage[] commandUsageMessageArr = new CommandUsageMessage[3]; + commandUsageMessageArr[0] = CommandUsageMessage.of("(module name) (new name)", "rename module"); + commandUsageMessageArr[1] = CommandUsageMessage.of("(module name) reset", "resets module name"); + commandUsageMessageArr[2] = CommandUsageMessage.of("reset", "resets names for all modules"); + renameCommand.updateState2(textStr9, textStr11, commandUsageMessageArr); + } + + if (((Object[])null) == null) { + return; + } + + flag = flag2; + } + + if (time > 0L) { + flag = !flag; + } +} + + public RenameCommand(@NonNull Novoline novoline, String name, String text, List list) { + super(novoline, name, text, list); +} +} diff --git a/src/main/java/cc/novoline/commands/impl/ReplyCommand.java b/src/main/java/cc/novoline/commands/impl/ReplyCommand.java new file mode 100644 index 0000000..f5ff486 --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/ReplyCommand.java @@ -0,0 +1,14 @@ +package cc.novoline.commands.impl; + +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import net.minecraft.command.CommandException; +import org.jetbrains.annotations.NotNull; + +public final class ReplyCommand extends NovoCommand { + public ReplyCommand(@NotNull Novoline novoline) { + super(novoline, "reply", "Replies to the last messaged user", "r"); +} + + public void updateState2(char ch, long time, String[] args) throws CommandException {} +} diff --git a/src/main/java/cc/novoline/commands/impl/ReportCommand.java b/src/main/java/cc/novoline/commands/impl/ReportCommand.java new file mode 100644 index 0000000..948cf87 --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/ReportCommand.java @@ -0,0 +1,62 @@ +package cc.novoline.commands.impl; +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import cc.novoline.utils.ServerUtils; +import cc.novoline.utils.messages.CommandUsageMessage; +import cc.novoline.utils.notifications.NotificationManager; +import cc.novoline.utils.notifications.NotificationType; +import java.io.IOException; +import java.util.List; +import net.minecraft.network.play.client.C01PacketChatMessage; + +import net.minecraft.client.Minecraft; +import net.minecraft.command.CommandException; +import org.jetbrains.annotations.NotNull; + +public class ReportCommand extends NovoCommand { + public ReportCommand(@NotNull Novoline novoline, String text, List list) { + super(novoline, text, list); +} + + + + public void updateState2(char ch, long time, String[] args) throws CommandException, IOException { + String textStr = ""; + label29: + if (ServerUtils.isHypixel()) { + Minecraft mcClient = Minecraft.getMinecraft(); + int intVal = (mcClient.isSingleplayer() ? 1 : 0); + if (time > 0L && textStr != null) { + if (intVal != 0) { + break label29; + } + + intVal = args.length; + } + + if (intVal < 1) { + String textStr2 = "Command help"; + CommandUsageMessage[] commandUsageMessageArr = new CommandUsageMessage[1]; + commandUsageMessageArr[0] = CommandUsageMessage.of("(name)", "report player by all online users"); + this.updateState2(textStr2, ".report (.wdr)", commandUsageMessageArr); + this.performAction(); + return; + } + + StringBuilder sb = new StringBuilder(); + StringBuilder sb2 = sb.append("/report "); + String textStr5 = args[0]; + StringBuilder sb3 = sb2.append(textStr5); + String textStr3 = sb3.append(" killaura fly speed").toString(); + mcClient = this.getMcSupplier().get(); + mcClient.getNetHandler().sendPacketNoEvent(new C01PacketChatMessage(textStr3)); + return; + } + + Novoline novolineInst = this.novoline2; + NotificationManager notifManager = novolineInst.getNotificationManager(); + String textStr4 = "Report command works only on Hypixel"; + NotificationType notificationType = NotificationType.WARNING; + notifManager.pop(textStr4, 4000, notificationType); +} +} diff --git a/src/main/java/cc/novoline/commands/impl/SayCommand.java b/src/main/java/cc/novoline/commands/impl/SayCommand.java new file mode 100644 index 0000000..535d581 --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/SayCommand.java @@ -0,0 +1,28 @@ +package cc.novoline.commands.impl; +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import cc.novoline.commands.util.SayUsageHolder; +import java.io.IOException; + +import net.minecraft.command.CommandException; +import org.jetbrains.annotations.NotNull; + +public class SayCommand extends NovoCommand { + public void updateState2(char ch, long time, String[] args) throws CommandException, IOException { + boolean flag = true; + StringBuilder sb = new StringBuilder(); + int intVal = 1; + while (intVal < args.length) { + sb.append(args[intVal]); + sb.append(SayUsageHolder.textValue); + intVal++; + if (flag) { + break; + } + } +} + + public SayCommand(@NotNull Novoline novoline, String text, String str, String value) { + super(novoline, text, str, value); +} +} diff --git a/src/main/java/cc/novoline/commands/impl/ScriptCommand.java b/src/main/java/cc/novoline/commands/impl/ScriptCommand.java new file mode 100644 index 0000000..2d5da5c --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/ScriptCommand.java @@ -0,0 +1,295 @@ +package cc.novoline.commands.impl; +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import cc.novoline.script.Script; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; + +import net.minecraft.command.CommandException; +import org.jetbrains.annotations.NotNull; + +public class ScriptCommand extends NovoCommand { + public ScriptCommand(@NotNull Novoline novoline, String text, String str, List list) { + super(novoline, text, str, list); +} + + public void updateState2(char ch, long time, String[] args) throws CommandException, IOException { + int intVal; + byte byteVal; + int intVal2; + cc.novoline.script.Script script2; + label212: { + byte byteVal2; + String[] stringArr; + byte byteVal3; + label194: { + label199: { + byteVal2 = (byte)(false ? 1 : 0); + int len = args.length; + byte byteVal6 = 1; + if (byteVal2 == 0) { + if (len == 1) { + String textStr = args[0]; + byte byteVal4 = (byte)(textStr.equalsIgnoreCase("refresh") ? 1 : 0); + if (time > 0L) { + if (byteVal4 != 0) { + Novoline novolineInst = this.novoline2; + novolineInst.getScriptManager().a(this.novoline2); + this.applyString3("Refreshed the scripts successfully"); + if (byteVal2 == 0) { + return; + } + } + + this.updateState("Script", ".script refresh - refreshes all scripts"); + byteVal4 = byteVal2; + } + + if (byteVal4 == 0) { + return; + } + } + + stringArr = args; + byteVal3 = byteVal2; + if (time <= 0L) { + break label194; + } + + if (byteVal2 != 0) { + break label199; + } + + len = args.length; + byteVal6 = 2; + } + + if (len != byteVal6) { + break label212; + } + + stringArr = args; + } + + byteVal3 = 0; + } + + String textStr2; + String textStr3 = stringArr[byteVal3]; + textStr2 = args[1]; + String textStr4 = textStr3; + byte byteVal5 = -1; + intVal = textStr4.hashCode(); + label156: + if (byteVal2 == 0) { + label202: { + label177: { + label203: { + switch (intVal) { + case -1335458389: + break label203; + case 3327206: + intVal = (textStr4.equals("load") ? 1 : 0); + if (byteVal2 != 0) { + break label156; + } + + if (intVal == 0) { + break label202; + } + + byteVal5 = 0; + intVal = byteVal2; + if (ch < 0) { + break; + } + + if (byteVal2 == 0) { + break label202; + } + case -840442113: + intVal = (textStr4.equals("unload") ? 1 : 0); + break; + default: + break label202; + } + + if (byteVal2 != 0) { + break label156; + } + + if (intVal == 0) { + break label202; + } + + byteVal5 = 1; + intVal = byteVal2; + if (ch < 0) { + break label177; + } + + if (byteVal2 == 0) { + break label202; + } + } + + intVal = (textStr4.equals("delete") ? 1 : 0); + } + + if (time < 0L || byteVal2 != 0) { + break label156; + } + + if (intVal != 0) { + byteVal5 = 2; + } + } + + intVal = byteVal5; + } + + label205: { + label146: { + label206: { + label144: { + if (ch >= 0) { + switch (intVal) { + case 0: + Novoline novolineInst2 = this.novoline2; + novolineInst2.getScriptManager().b(textStr2); + StringBuilder sb2 = new StringBuilder().append("Successfully unloaded script "); + this.applyString3(sb2.append(textStr2).toString()); + intVal = byteVal2; + break; + case 1: + break label144; + case 2: + break label206; + default: + break label146; + } + } + + if (intVal == 0) { + break label146; + } + } + + Novoline novolineInst3 = this.novoline2; + List itemList = novolineInst3.getScriptManager().a(); + Iterator iter = itemList.iterator(); + + do { + if (!iter.hasNext()) { + break; + } + + Script script3 = (Script)iter.next(); + byteVal = byteVal2; + if (ch < 0) { + break label205; + } + + if (byteVal2 != 0) { + break label146; + } + + label130: { + label208: { + label128: { + label209: { + String textStr5 = script3.g(); + intVal2 = (textStr5.equalsIgnoreCase(textStr2) ? 1 : 0); + if (byteVal2 == 0) { + if (ch < 0) { + continue; + } + + if (intVal2 == 0) { + break label130; + } + + script2 = script3; + byteVal3 = byteVal2; + if (time < 0L) { + break label128; + } + + if (byteVal2 != 0) { + break label209; + } + + intVal2 = (script3.c() ? 1 : 0); + } + + if (intVal2 == 0) { + break label208; + } + + script2 = script3; + } + + byteVal3 = 0; + } + + script2.c((boolean)((byteVal3) != 0)); + StringBuilder sb4 = new StringBuilder().append("Successfully unloaded script "); + this.applyString3(sb4.append(textStr2).toString()); + intVal2 = byteVal2; + if (time <= 0L) { + continue; + } + + if (byteVal2 == 0) { + break label130; + } + } + + this.applyString3("This script is not loaded!"); + } + + intVal2 = byteVal2; + } while (intVal2 == 0); + + if (ch < 0) { + break label146; + } + + byteVal = byteVal2; + if (ch < 0) { + break label205; + } + + if (byteVal2 == 0) { + break label146; + } + } + + Novoline novolineInst4 = this.novoline2; + novolineInst4.getScriptManager().c(textStr2); + StringBuilder sb5 = new StringBuilder(); + String textStr6 = "Removed script "; + StringBuilder sb6 = sb5.append(textStr6); + StringBuilder sb7 = sb6.append(textStr2); + textStr6 = " successfuly"; + this.applyString3(sb7.append(textStr6).toString()); + } + + if (time <= 0L) { + return; + } + + byteVal = byteVal2; + } + + if (byteVal == 0) { + return; + } + } + + this.updateState("Script", "Usage: load/unload/delete , refresh (all)"); +} + + +} diff --git a/src/main/java/cc/novoline/commands/impl/SpectateCommand.java b/src/main/java/cc/novoline/commands/impl/SpectateCommand.java new file mode 100644 index 0000000..085baf0 --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/SpectateCommand.java @@ -0,0 +1,136 @@ +package cc.novoline.commands.impl; +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.command.CommandException; +import net.minecraft.entity.player.EntityPlayer; +import org.jetbrains.annotations.NotNull; + +public class SpectateCommand extends NovoCommand { + + + public void updateState2(char ch, long time, String[] args) throws CommandException, IOException { + net.minecraft.entity.player.EntityPlayer player2; + int intVal; + byte byteVal; + label91: { + byte byteVal2 = (byte)(false ? 1 : 0); + int len = args.length; + if (ch >= 0 && byteVal2 == 0) { + if (len != 1) { + break label91; + } + + String textStr = args[0]; + len = (textStr.equalsIgnoreCase("stop") ? 1 : 0); + } + + label81: { + if (ch >= 0) { + if (len == 0) { + break label81; + } + + Minecraft mcClient = Minecraft.getMinecraft(); + EntityPlayerSP player3 = Minecraft.getMinecraft().thePlayer; + mcClient.setRenderViewEntity(player3); + len = byteVal2; + } + + if (len == 0) { + return; + } + } + + EntityPlayer player4 = null; + WorldClient world = Minecraft.getMinecraft().theWorld; + List itemList = world.getPlayerEntities(); + Iterator iter = itemList.iterator(); + + label92: { + label93: { + while (true) { + if (iter.hasNext()) { + EntityPlayer player5 = (EntityPlayer)iter.next(); + player2 = player5; + if (time < 0L || byteVal2 != 0) { + break; + } + + label67: { + label66: { + if (byteVal2 == 0) { + String nameStr = player5.getName(); + String textStr2 = args[0]; + intVal = (nameStr.equalsIgnoreCase(textStr2) ? 1 : 0); + if (ch < 0) { + break label67; + } + + if (intVal == 0) { + break label66; + } + + player2 = player5; + } + + player4 = player2; + } + + intVal = byteVal2; + } + + if (intVal == 0) { + continue; + } + } + + if (time <= 0L) { + break label93; + } + + player2 = player4; + break; + } + + if (player2 != null) { + Minecraft mcClient2 = Minecraft.getMinecraft(); + mcClient2.setRenderViewEntity(player4); + byteVal = byteVal2; + if (ch < 0) { + break label92; + } + + if (byteVal2 == 0) { + break label93; + } + } + + this.applyString3("Player not found, did you spell the name right?"); + } + + if (ch < 0) { + return; + } + + byteVal = byteVal2; + } + + if (byteVal == 0) { + return; + } + } + + this.updateState("Spectate", ".spectate "); +} + + public SpectateCommand(@NotNull Novoline novoline, String text, String str, List list) { + super(novoline, text, str, list); +} +} diff --git a/src/main/java/cc/novoline/commands/impl/TargetCommand.java b/src/main/java/cc/novoline/commands/impl/TargetCommand.java new file mode 100644 index 0000000..2e56326 --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/TargetCommand.java @@ -0,0 +1,674 @@ +package cc.novoline.commands.impl; +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import cc.novoline.commands.util.TargetRelationSwitchMap; +import cc.novoline.modules.PlayerManager; +import cc.novoline.modules.PlayerRelationType; +import cc.novoline.utils.messages.CommandUsageMessage; +import cc.novoline.utils.messages.TextMessage; +import com.mojang.authlib.GameProfile; +import java.io.IOException; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Map.Entry; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.stream.Stream; + +import cc.novoline.modules.configurations.holder.SavingModuleHolderSupport; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.util.EnumChatFormatting; +import org.apache.logging.log4j.Logger; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; + +public final class TargetCommand extends NovoCommand { + public void updateState2(char ch, long time, String[] args) { + int intVal; + byte byteVal; + cc.novoline.modules.PlayerRelationType playerRelationType; + int intVal2; + byte byteVal2; + String[] stringArr; + byte byteVal3; + label349: { + label373: { + byteVal2 = (byte)(true ? 1 : 0); + int len = args.length; + byte byteVal7 = 1; + if (byteVal2 != 0) { + if (len < 1) { + String textStr = "Targets help:"; + String textStr7 = ".target"; + CommandUsageMessage[] commandUsageMessageArr = new CommandUsageMessage[3]; + commandUsageMessageArr[0] = CommandUsageMessage.of("add (name)", "adds target"); + commandUsageMessageArr[1] = CommandUsageMessage.of("remove (name)", "removes target"); + commandUsageMessageArr[2] = CommandUsageMessage.of("list", "shows targets"); + this.updateState2(textStr, textStr7, commandUsageMessageArr); + return; + } + + stringArr = args; + byteVal3 = byteVal2; + if (ch < 0) { + break label349; + } + + if (byteVal2 == 0) { + break label373; + } + + len = args.length; + byteVal7 = 1; + } + + if (len == byteVal7) { + String textStr2; + textStr2 = args[0]; + String lowerStr = textStr2.toLowerCase(); + byte byteVal4 = -1; + intVal = lowerStr.hashCode(); + label339: + if (byteVal2 != 0) { + label355: { + label336: { + label356: { + switch (intVal) { + case 3322014: + intVal = (lowerStr.equals("list") ? 1 : 0); + if (byteVal2 == 0) { + break label339; + } + + if (intVal == 0) { + break label355; + } + + byteVal4 = 0; + intVal = byteVal2; + if (time < 0L) { + break; + } + + if (byteVal2 != 0) { + break label355; + } + case 108: + intVal = (lowerStr.equals("l") ? 1 : 0); + break; + case 94746189: + break label356; + default: + break label355; + } + + if (byteVal2 == 0) { + break label339; + } + + if (intVal == 0) { + break label355; + } + + byteVal4 = 1; + intVal = byteVal2; + if (time <= 0L) { + break label336; + } + + if (byteVal2 != 0) { + break label355; + } + } + + intVal = (lowerStr.equals("clear") ? 1 : 0); + } + + if (byteVal2 == 0) { + break label339; + } + + if (intVal != 0) { + byteVal4 = 2; + } + } + + intVal = byteVal4; + } + + label309: { + label358: { + switch (intVal) { + case 0: + case 1: + Novoline novolineInst = this.novoline2; + List itemList = novolineInst.getPlayerManager().evaluateCheck(PlayerRelationType.TARGET); + TextMessage textMessage = TextMessage.b("Targets list:"); + List itemList2 = itemList; + if (byteVal2 != 0) { + if (itemList.isEmpty()) { + textMessage.appendPart(TextMessage.resolveTextMessage2(" (empty)", EnumChatFormatting.RED)); + } + + this.updateState(textMessage, true); + itemList2 = itemList; + } + + Iterator iter = itemList2.iterator(); + + label303: + while (true) { + if (!iter.hasNext()) { + break; + } + + String textStr3 = (String)iter.next(); + TextMessage textMessage2 = TextMessage.b(" - "); + this.sendClientMessage(textMessage2.appendPart(TextMessage.resolveTextMessage2(textStr3, EnumChatFormatting.GRAY))); + + while (true) { + byteVal = byteVal2; + if (ch < 0) { + break label309; + } + + if (byteVal2 == 0) { + break label358; + } + + if (byteVal2 != 0) { + break; + } + + if (time >= 0L) { + break label303; + } + } + } + + if (ch >= 0 && byteVal2 != 0) { + break label358; + } + case 2: + if (ch >= 0) { + TargetCommand targetCommand = this; + if (byteVal2 != 0 && time > 0L) { + Novoline novolineInst2 = this.novoline2; + if (novolineInst2.getPlayerManager().evaluateCondition(PlayerRelationType.TARGET, TargetCommand::matchesEntry2)) { + this.applyString5("Target list was cleared"); + if (byteVal2 != 0) { + break label358; + } + } + + targetCommand = this; + } + + targetCommand.applyString5("Target list is empty"); + } + + if (byteVal2 != 0) { + break label358; + } + } + + label276: { + PlayerRelationType playerRelationType2; + label275: { + Novoline novolineInst3 = this.novoline2; + playerRelationType2 = novolineInst3.getPlayerManager().resolvePlayerRelationType(textStr2); + byte byteVal5 = byteVal2; + if (ch >= 0) { + if (byteVal2 != 0) { + if (playerRelationType2 != PlayerRelationType.FRIEND) { + playerRelationType = playerRelationType2; + if (time < 0L || byteVal2 == 0 || ch < 0) { + break label276; + } + + if (playerRelationType2 != null) { + break label275; + } + } + + this.handleCommandArg(textStr2); + } + + byteVal5 = byteVal2; + } + + if (byteVal5 != 0) { + break label358; + } + } + + playerRelationType = playerRelationType2; + } + + if (playerRelationType == PlayerRelationType.TARGET) { + this.applyString2(textStr2); + } + } + + byteVal = byteVal2; + } + + if (byteVal != 0) { + return; + } + } + + try { + stringArr = args; + } catch (Exception ex) { + ex.printStackTrace(); + return; + } + } + + try { + byteVal3 = 0; + } catch (Exception ex2) { + ex2.printStackTrace(); + return; + } + } + + try { + label245: { + String textStr4; + label244: { + label243: { + label363: { + label364: { + label365: { + String textStr5 = stringArr[byteVal3]; + textStr4 = args[1]; + String lowerStr2 = textStr5.toLowerCase(); + byte byteVal6 = -1; + intVal2 = lowerStr2.hashCode(); + label239: + if (byteVal2 != 0) { + label366: { + label236: { + label367: { + label234: { + label368: { + label232: { + label369: { + label230: { + label370: { + switch (intVal2) { + case -1335458389: + break label369; + case -934610812: + break label370; + case 99339: + break label368; + case 112794: + break label367; + case 94746189: + intVal2 = (lowerStr2.equals("clear") ? 1 : 0); + if (byteVal2 == 0) { + break label239; + } + + if (intVal2 == 0) { + break label366; + } + + byteVal6 = 0; + intVal2 = byteVal2; + if (ch < 0) { + break; + } + + if (byteVal2 != 0) { + break label366; + } + case 96417: + intVal2 = (lowerStr2.equals("add") ? 1 : 0); + break; + default: + break label366; + } + + if (byteVal2 == 0) { + break label239; + } + + if (intVal2 == 0) { + break label366; + } + + byteVal6 = 1; + intVal2 = byteVal2; + if (ch < 0) { + break label230; + } + + if (byteVal2 != 0) { + break label366; + } + } + + intVal2 = (lowerStr2.equals("remove") ? 1 : 0); + } + + if (byteVal2 == 0) { + break label239; + } + + if (intVal2 == 0) { + break label366; + } + + byteVal6 = 2; + intVal2 = byteVal2; + if (ch < 0) { + break label232; + } + + if (byteVal2 != 0) { + break label366; + } + } + + intVal2 = (lowerStr2.equals("delete") ? 1 : 0); + } + + if (byteVal2 == 0) { + break label239; + } + + if (intVal2 == 0) { + break label366; + } + + byteVal6 = 3; + intVal2 = byteVal2; + if (ch < 0) { + break label234; + } + + if (byteVal2 != 0) { + break label366; + } + } + + intVal2 = (lowerStr2.equals("del") ? 1 : 0); + } + + if (byteVal2 == 0) { + break label239; + } + + if (intVal2 == 0) { + break label366; + } + + byteVal6 = 4; + intVal2 = byteVal2; + if (ch < 0) { + break label236; + } + + if (byteVal2 != 0) { + break label366; + } + } + + intVal2 = (lowerStr2.equals("rem") ? 1 : 0); + } + + byteVal3 = byteVal2; + if (time <= 0L) { + break label365; + } + + if (byteVal2 == 0) { + break label239; + } + + if (intVal2 != 0) { + byteVal6 = 5; + } + } + + intVal2 = byteVal6; + } + + if (ch < 0) { + break label364; + } + + byteVal3 = byteVal2; + } + + if (byteVal3 != 0) { + switch (intVal2) { + case 0: + Novoline novolineInst4 = this.novoline2; + novolineInst4.getPlayerManager().evaluateCondition(PlayerRelationType.TARGET, TargetCommand::matchesEntry); + break; + case 1: + break label363; + case 2: + case 3: + case 4: + case 5: + break label244; + default: + break label245; + } + } + + intVal2 = byteVal2; + } + + if (time <= 0L) { + break label243; + } + + if (intVal2 != 0) { + return; + } + } + + this.handleCommandArg(textStr4); + intVal2 = byteVal2; + } + + if (intVal2 != 0) { + return; + } + } + + this.applyString2(textStr4); + if (byteVal2 != 0) { + return; + } + } + + StringBuilder sb = new StringBuilder(); + String textStr6 = "Illegal command specified: "; + StringBuilder sb2 = sb.append(textStr6); + textStr6 = args[0]; + StringBuilder sb3 = sb2.append(textStr6); + textStr6 = "!"; + this.applyString4(sb3.append(textStr6).toString()); + } catch (Exception ex3) { + ex3.printStackTrace(); + } +} + + + + public void handleCommandArg(String text) { + boolean flag; + PlayerManager playerManager; + int intVal; + label37: { + SavingModuleHolderSupport.applyUpdate(text, "name"); + flag = false; + String lowerStr = text.toLowerCase(); + Novoline novolineInst = this.novoline2; + playerManager = novolineInst.getPlayerManager(); + PlayerRelationType playerRelationType = playerManager.resolvePlayerRelationType(lowerStr); + if (playerRelationType != null) { + intVal = TargetRelationSwitchMap.SWITCH_MAP[playerRelationType.ordinal()]; + if (flag) { + break label37; + } + + switch (intVal) { + case 1: + StringBuilder sb = new StringBuilder(); + sb = sb.append(text); + this.applyString4(sb.append(" is friend").toString()); + return; + case 2: + StringBuilder sb2 = new StringBuilder().append(text); + this.applyString4(sb2.append(" is target already!").toString()); + return; + } + } + + intVal = (playerManager.evaluateCondition(lowerStr, PlayerRelationType.TARGET) ? 1 : 0); + } + + int intVal2 = intVal; + if (!flag) { + if (intVal2 != 0) { + StringBuilder sb3 = new StringBuilder(); + String textStr = "Added "; + sb3 = sb3.append(textStr).append(text); + textStr = " to targets!"; + this.applyString5(sb3.append(textStr).toString()); + + try { + playerManager.obtainPlayerManagerConfigisnotlHelper().a(); + return; + } catch (IOException ex) { + this.applyString4("Can't save to file"); + Logger log = playerManager.getLog(); + log.warn("An error occurred while saving targets list", ex); + if (!flag) { + return; + } + } + } + + StringBuilder sb4 = new StringBuilder(); + String textStr2 = "Cannot add "; + sb4 = sb4.append(textStr2).append(text); + textStr2 = " to targets!"; + this.applyString4(sb4.append(textStr2).toString()); + } +} + + @Override + public @Nullable List resolveDouble(String[] args) { + switch (args.length) { + case 1: + String[] stringArr = new String[]{"add", "remove", "list"}; + return this.updateState2(Stream.of(stringArr), args[0], true); + case 2: + PlayerManager playerManager = this.novoline2.getPlayerManager(); + String textStr = args[0]; + boolean flag = textStr.equalsIgnoreCase("add"); + if (flag) { + Collection collection = NetHandlerPlayClient.entryMap.values(); + Stream stream2 = collection.stream(); + Function mapper = ((java.util.function.Function) NetworkPlayerInfo::getGameProfile); + Stream stream3 = stream2.map(mapper); + mapper = ((java.util.function.Function) GameProfile::getName); + Stream stream4 = stream3.map(mapper); + Predicate predicate = ((java.util.function.Predicate) (($a0) -> TargetCommand.invokeCallback(playerManager, ((String) $a0)))); + return this.updateState2(stream4.filter(predicate), args[1], true); + } + + String textStr2 = args[0]; + flag = textStr2.equalsIgnoreCase("remove"); + + if (flag) { + return this.updateState2(playerManager.evaluateCheck(PlayerRelationType.TARGET), args[1], true); + } + + return null; + default: + return null; + } +} + + public void applyString2(String text) { + SavingModuleHolderSupport.applyUpdate(text, "name"); + String lowerStr = text.toLowerCase(); + Novoline novolineInst = this.novoline2; + PlayerManager playerManager = novolineInst.getPlayerManager(); + PlayerManager playerManager2 = playerManager; + String textStr = lowerStr; + if (playerManager.resolvePlayerRelationType(lowerStr) != PlayerRelationType.TARGET) { + StringBuilder sb2 = new StringBuilder().append(text); + this.applyString4(sb2.append(" is not target!").toString()); + return; + } + + playerManager2 = playerManager; + textStr = lowerStr; + + boolean flag = playerManager2.evaluateCheck(textStr); + if (flag) { + StringBuilder sb3 = new StringBuilder(); + StringBuilder sb4 = sb3.append("Removed "); + StringBuilder sb5 = sb4.append(text); + this.applyString5(sb5.append(" from targets!").toString()); + + try { + playerManager.obtainPlayerManagerConfigisnotlHelper().a(); + return; + } catch (IOException ex) { + this.applyString4("Can't save to file"); + Logger log = playerManager.getLog(); + log.warn("An error occurred while saving targets list", ex); + return; + } + } + + StringBuilder sb6 = new StringBuilder(); + StringBuilder sb7 = sb6.append("Cannot remove "); + StringBuilder sb8 = sb7.append(text); + this.applyString4(sb8.append(" from targets!").toString()); +} + + private static boolean matchesEntry(Entry entry) { + return true; +} + + private static boolean invokeCallback(PlayerManager playerManager, String text) { + PlayerRelationType playerRelationType = playerManager.resolvePlayerRelationType(text); + boolean flag = true; + PlayerRelationType playerRelationType2 = playerRelationType; + PlayerRelationType playerRelationType3 = PlayerRelationType.TARGET; + if (flag) { + if (playerRelationType == PlayerRelationType.TARGET) { + return false; + } + + playerRelationType2 = playerRelationType; + playerRelationType3 = PlayerRelationType.FRIEND; + } + + return playerRelationType2 != playerRelationType3; +} + + private static boolean matchesEntry2(Entry entry) { + return true; +} + + public TargetCommand(@NonNull Novoline novoline, String text, List list) { + super(novoline, text, list); +} +} diff --git a/src/main/java/cc/novoline/commands/impl/TeleportCommand.java b/src/main/java/cc/novoline/commands/impl/TeleportCommand.java new file mode 100644 index 0000000..64dd943 --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/TeleportCommand.java @@ -0,0 +1,576 @@ +package cc.novoline.commands.impl; +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import cc.novoline.events.EventManager; +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.LoadWorldEvent; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.MoveEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.utils.HypixelLobbyType; +import cc.novoline.utils.ServerUtils; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.messages.CommandUsageMessage; +import cc.novoline.utils.notifications.NotificationManager; +import cc.novoline.utils.notifications.NotificationType; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraft.network.play.client.C06PacketPlayerPosLook; + +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.util.MathHelper; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.IChatComponent; +import org.jetbrains.annotations.NotNull; + +public class TeleportCommand extends NovoCommand { + private String cachedText; + private double cachedValue; + private TimerUtil timer; + private double cachedValue2; + private int stateTicks; + private double cachedValue3; + private TeleportMode teleportModeField = TeleportMode.WAIT; + + public TeleportCommand(@NotNull Novoline novoline, String text, String str, String value) { + super(novoline, text, str, value); +} + + @EventTarget + public void onPacket(PacketEvent event) { + int intVal; + boolean flag = true; + PacketEvent packetEvent = event; + if (flag) { + if (event.getState() != State.INCOMING) { + return; + } + + packetEvent = event; + } + + boolean flag2 = packetEvent.getPacket() instanceof S02PacketChat; + if (flag) { + if (flag2) { + S02PacketChat chatPacket = (S02PacketChat)event.getPacket(); + IChatComponent chatComp = chatPacket.getChatComponent(); + String msgText = chatComp.getFormattedText(); + String textStr = msgText; + byte byteVal = -1; + intVal = textStr.hashCode(); + label85: + if (flag) { + switch (intVal) { + case 506901630: + intVal = (textStr.equals("\u00a7cWoah there, slow down!\u00a7r") ? 1 : 0); + if (!flag) { + break label85; + } + + if (intVal == 0) { + break; + } + + byteVal = 0; + if (flag) { + break; + } + case 1708764411: + intVal = (textStr.equals("\u00a7cA kick occurred in your connection, so you were put in the UHC Champions lobby!\u00a7r") ? 1 : 0); + if (!flag) { + break label85; + } + + if (intVal == 0) { + break; + } + + byteVal = 1; + if (flag) { + break; + } + case 1027147741: + intVal = (textStr.equals("\u00a7rIllegal characters in chat\u00a7r") ? 1 : 0); + if (!flag) { + break label85; + } + + if (intVal != 0) { + byteVal = 2; + } + } + + intVal = byteVal; + } + + switch (intVal) { + case 0: + this.sendPacket(new C01PacketChatMessage("\u00a7")); + if (flag) { + break; + } + case 1: + ; + event.setCancelled(true); + if (flag) { + break; + } + case 2: + ; + event.setCancelled(true); + } + + if (flag) { + return; + } + } + + flag2 = event.getPacket() instanceof S08PacketPlayerPosLook; + } + + if (flag) { + if (!flag2) { + return; + } + + HypixelLobbyType lobbyType = HypixelLobbyType.UHC; + flag2 = ServerUtils.serverIs(lobbyType); + } + + if (flag2 && this.teleportModeField == TeleportMode.TP) { + label49: { + S08PacketPlayerPosLook playerPosLookPacket; + label48: { + playerPosLookPacket = (S08PacketPlayerPosLook)event.getPacket(); + double doubleVal = playerPosLookPacket.getX(); + int intVal2 = MathHelper.floor_double(doubleVal); + double doubleVal3 = this.cachedValue2; + int intVal3 = MathHelper.floor_double(doubleVal3); + if (flag) { + if (intVal2 != intVal3) { + break label48; + } + + double doubleVal2 = playerPosLookPacket.getZ(); + intVal2 = MathHelper.floor_double(doubleVal2); + doubleVal3 = this.cachedValue3; + intVal3 = MathHelper.floor_double(doubleVal3); + } + + if (intVal2 == intVal3) { + this.sendPacket(new C06PacketPlayerPosLook(this.cachedValue2, this.cachedValue, this.cachedValue3, playerPosLookPacket.getYaw(), playerPosLookPacket.getYaw(), false)); + if (flag) { + break label49; + } + } + } + + this.sendPacket(new C06PacketPlayerPosLook(playerPosLookPacket.getX(), playerPosLookPacket.getY(), playerPosLookPacket.getZ(), playerPosLookPacket.getYaw(), playerPosLookPacket.getYaw(), false)); + } + + event.setCancelled(true); + this.stateTicks++; + } +} + + @EventTarget + public void onLoadWorld(LoadWorldEvent event) {} + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + cc.novoline.commands.impl.TeleportCommand teleportCommand; + Object obj; + boolean flag = true; + Object obj2 = event.getState(); + if (flag) { + if (obj2 != cc.novoline.events.type.State.PRE) { + return; + } + + obj2 = this.mcSupplier.get(); + } + + label97: { + EntityPlayerSP player; + label106: { + player = ((Minecraft)obj2).thePlayer; + TeleportMode teleportMode = this.teleportModeField; + TeleportMode teleportMode2 = TeleportMode.WAIT; + if (flag) { + if (this.teleportModeField == TeleportMode.WAIT) { + player.sendChatMessage("/hub"); + this.teleportModeField = TeleportMode.RECONNECT; + if (flag) { + break label106; + } + } + + teleportMode = this.teleportModeField; + teleportMode2 = TeleportMode.RECONNECT; + } + + if (flag) { + label86: + if (teleportMode == teleportMode2) { + EntityPlayerSP player2 = player; + if (flag) { + if (player.ticksExisted != 1) { + break label86; + } + + player2 = player; + } + + player2.sendChatMessage("/rejoin"); + this.teleportModeField = TeleportMode.TP; + TimerUtil timerUtil = this.timer; + timerUtil.reset(); + if (flag) { + break label106; + } + } + + teleportCommand = this; + if (!flag) { + break label97; + } + + teleportMode = this.teleportModeField; + teleportMode2 = TeleportMode.TP; + } + + label78: + if (teleportMode == teleportMode2) { + HypixelLobbyType lobbyType = HypixelLobbyType.UHC; + int intVal = (ServerUtils.serverIs(lobbyType) ? 1 : 0); + if (flag) { + if (intVal == 0) { + break label78; + } + + intVal = this.stateTicks; + } + + label110: { + label111: { + if (flag) { + if (intVal != 0) { + TimerUtil timerUtil2 = this.timer; + timerUtil2.reset(); + } + + obj = this.timer; + if (!flag) { + break label111; + } + + intVal = (((TimerUtil)obj).delay(800L) ? 1 : 0); + } + + if (intVal != 0) { + this.mcSupplier.get().renderGlobal.performStep2(); + EventManager.unregister(this); + if (flag) { + break label110; + } + } + + obj = this.mcSupplier.get(); + } + + WorldClient world = ((Minecraft)obj).theWorld; + label63: + if (this.cachedText != null) { + String textStr = this.cachedText; + EntityPlayer player3 = world.applyFlag(textStr); + if (flag) { + if (player3 == null) { + break label63; + } + + String textStr2 = this.cachedText; + player3 = world.applyFlag(textStr2); + } + + EntityPlayer player4 = player3; + this.cachedValue2 = player4.posX; + this.cachedValue3 = player4.posZ; + } + + if (player.ticksExisted == 1) { + this.sendPacket(new C06PacketPlayerPosLook(this.cachedValue2, this.cachedValue, this.cachedValue3, player.rotationYaw, player.rotationPitch, false)); + this.sendPacket(new C03PacketPlayer(false)); + } + + event.setCancelled(true); + } + + teleportCommand = this; + if (!flag) { + break label97; + } + + KeyBinding keyBinding = this.mcSupplier.get().gameSettings.keyBindUseItem; + if (keyBinding.isKeyDown()) { + EventManager.unregister(this); + } + } + } + + player.cameraPitch = 0.0F; + player.cameraYaw = 0.0F; + teleportCommand = this; + } + + teleportCommand.stateTicks = 0; +} + + @EventTarget + public void onMove(MoveEvent event) { + event.setMoveSpeed(0.0); + event.setY(0.0); +} + + public void updateState2(char ch, long time, String[] args) { + double posX2; + double posZ2; + double posX3; + double posY2; + double posZ3; + byte byteVal = (byte)(true ? 1 : 0); + int intVal = byteVal; + if (ch >= 0) { + if (byteVal == 0) { + return; + } + + intVal = args.length; + } + + label158: { + byte byteVal2 = 1; + if (ch >= 0) { + if (intVal < 1) { + break label158; + } + + intVal = args.length; + byteVal2 = byteVal; + } + + if (time > 0L) { + if (byteVal2 != 0) { + if (intVal > 3) { + break label158; + } + + intVal = (ServerUtils.isHypixel() ? 1 : 0); + } + + byteVal2 = byteVal; + } + + label175: { + if (ch >= 0) { + if (byteVal2 != 0) { + if (intVal == 0) { + break label175; + } + + HypixelLobbyType lobbyType = HypixelLobbyType.UHC; + intVal = (ServerUtils.serverIs(lobbyType) ? 1 : 0); + } + + byteVal2 = byteVal; + } + + if (byteVal2 != 0) { + if (intVal == 0) { + break label175; + } + + this.cachedText = null; + if (byteVal == 0) { + return; + } + + intVal = args.length; + } + + label176: { + switch (intVal) { + case 1: + WorldClient world = this.mcSupplier.get().theWorld; + String textStr = args[0]; + EntityPlayer player2 = world.applyFlag(textStr); + if (byteVal == 0) { + return; + } + + EntityPlayer player3 = player2; + if (ch >= 0) { + if (player2 == null) { + break label176; + } + + player3 = player2; + } + + if (player3 == this.mcSupplier.get().thePlayer) { + break label176; + } + + this.cachedText = player2.getName(); + this.cachedValue2 = player2.posX; + this.cachedValue3 = player2.posZ; + this.cachedValue = 100.0; + if (time < 0L) { + return; + } + + if (byteVal != 0) { + break; + } + case 2: + label127: { + String textStr2 = args[0]; + if (byteVal != 0) { + if (textStr2.equals("~")) { + posX2 = this.mcSupplier.get().thePlayer.posX; + break label127; + } + + textStr2 = args[0]; + } + + posX2 = Double.parseDouble(textStr2); + } + + label121: { + this.cachedValue2 = posX2; + this.cachedValue = 100.0; + String textStr3 = args[1]; + if (byteVal != 0) { + if (textStr3.equals("~")) { + posZ2 = this.mcSupplier.get().thePlayer.posZ; + break label121; + } + + textStr3 = args[1]; + } + + posZ2 = Double.parseDouble(textStr3); + } + + this.cachedValue3 = posZ2; + if (ch < 0) { + return; + } + + if (byteVal != 0) { + break; + } + case 3: + label102: { + String textStr4 = args[0]; + if (byteVal != 0) { + if (textStr4.equals("~")) { + posX3 = this.mcSupplier.get().thePlayer.posX; + break label102; + } + + textStr4 = args[0]; + } + + posX3 = Double.parseDouble(textStr4); + } + + label96: { + this.cachedValue2 = posX3; + String textStr5 = args[1]; + if (byteVal != 0) { + if (textStr5.equals("~")) { + posY2 = this.mcSupplier.get().thePlayer.posY; + break label96; + } + + textStr5 = args[1]; + } + + posY2 = Double.parseDouble(textStr5); + } + + label90: { + this.cachedValue = posY2; + String textStr6 = args[2]; + if (byteVal != 0) { + if (textStr6.equals("~")) { + posZ3 = this.mcSupplier.get().thePlayer.posZ; + break label90; + } + + textStr6 = args[2]; + } + + posZ3 = Double.parseDouble(textStr6); + } + + this.cachedValue3 = posZ3; + } + + Novoline novolineInst = this.novoline2; + NotificationManager notifManager = novolineInst.getNotificationManager(); + String textStr7 = "UHC Teleport"; + String textStr12 = "Try To Teleport to %.0f,%.0f,%.0f"; + Object[] objArr = new Object[3]; + double doubleVal = this.cachedValue2; + objArr[0] = doubleVal; + doubleVal = this.cachedValue; + objArr[1] = doubleVal; + doubleVal = this.cachedValue3; + objArr[2] = doubleVal; + textStr12 = String.format(textStr12, objArr); + notifManager.pop(textStr7, textStr12, 6500, NotificationType.INFO); + EventManager.register(this); + this.timer = new TimerUtil(); + this.teleportModeField = TeleportMode.WAIT; + return; + } + + Novoline novolineInst2 = this.novoline2; + NotificationManager notifManager2 = novolineInst2.getNotificationManager(); + String textStr8 = "UHC Teleport"; + StringBuilder sb = new StringBuilder(); + String textStr9 = "Player "; + sb = sb.append(textStr9); + textStr9 = args[0]; + sb = sb.append(textStr9); + textStr9 = " not found!"; + String textStr13 = sb.append(textStr9).toString(); + NotificationType notificationType = NotificationType.ERROR; + notifManager2.pop(textStr8, textStr13, 2500, notificationType); + return; + } + + Novoline novolineInst3 = this.novoline2; + NotificationManager notifManager3 = novolineInst3.getNotificationManager(); + String textStr10 = "UHC Teleport"; + String textStr14 = "You have to be in Hypixel UHC"; + NotificationType notificationType2 = NotificationType.ERROR; + notifManager3.pop(textStr10, textStr14, 3500, notificationType2); + return; + } + + String textStr11 = "Teleport help:"; + String textStr15 = ".tp"; + CommandUsageMessage[] commandUsageMessageArr = new CommandUsageMessage[1]; + commandUsageMessageArr[0] = CommandUsageMessage.of(", , ", "Hypixel UHC Teleport"); + this.updateState2(textStr11, textStr15, commandUsageMessageArr); +} +} diff --git a/src/main/java/cc/novoline/commands/impl/TeleportMode.java b/src/main/java/cc/novoline/commands/impl/TeleportMode.java new file mode 100644 index 0000000..13ece1a --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/TeleportMode.java @@ -0,0 +1,9 @@ +package cc.novoline.commands.impl; + +public enum TeleportMode { + WAIT, + RECONNECT, + TP; + + private static final TeleportMode[] teleportModeArray = new TeleportMode[]{TeleportMode.WAIT, TeleportMode.RECONNECT, TeleportMode.TP}; +} diff --git a/src/main/java/cc/novoline/commands/impl/ToggleCommand.java b/src/main/java/cc/novoline/commands/impl/ToggleCommand.java new file mode 100644 index 0000000..da07579 --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/ToggleCommand.java @@ -0,0 +1,112 @@ +package cc.novoline.commands.impl; +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.configurations.holder.ModuleHolder; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import it.unimi.dsi.fastutil.objects.ObjectCollection; +import java.util.List; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.function.Supplier; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import cc.novoline.modules.ModuleManager; + +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class ToggleCommand extends NovoCommand { + public ToggleCommand(@NonNull Novoline novoline, String text, String str, String value) { + super(novoline, text, str, value); +} + + public void updateState2(char ch, long time, String[] args) { + boolean flag = true; + String[] stringArr = args; + if (flag) { + if (args.length < 1) { + this.applyString4("Use .toggle (module)"); + return; + } + + stringArr = args; + } + + String[] stringArr2 = stringArr; + int len = stringArr2.length; + int intVal = 0; + + while (intVal < len) { + String textStr = stringArr2[intVal]; + boolean flag2 = flag; + if (ch >= 0) { + if (flag) { + label48: + if (textStr != null) { + AbstractModule mod; + label46: { + Novoline novolineInst = Novoline.getInstance(); + ModuleManager modManager = novolineInst.getModuleManager(); + mod = modManager.getByName(textStr); + boolean flag3 = flag; + if (time > 0L) { + if (flag) { + if (mod != null) { + break label46; + } + + StringBuilder sb = new StringBuilder(); + sb = sb.append("Module ").append(textStr); + this.applyString4(sb.append(" was not found!").toString()); + } + + flag3 = flag; + } + + if (flag3) { + break label48; + } + } + + StringBuilder sb2 = new StringBuilder(); + String textStr2 = mod.toggle() ? "Enabled" : "Disabled"; + sb2 = sb2.append(textStr2); + textStr2 = " "; + sb2 = sb2.append(textStr2); + textStr2 = mod.getName(); + this.applyString5(sb2.append(textStr2).toString()); + } + + intVal++; + } + + flag2 = flag; + } + + if (!flag2) { + break; + } + } +} + + @Override + public @NonNull List resolveDouble(@NonNull String[] args) { + String lowerStr = args[args.length - 1].toLowerCase(); + Novoline novolineInst = this.novoline2; + ModuleManager modManager = novolineInst.getModuleManager(); + ObjectCollection objectCollection = modManager.getModules().values(); + Stream stream2 = objectCollection.stream(); + Function mapper = ((java.util.function.Function) ModuleHolder::getModule); + Stream stream3 = stream2.map(mapper); + mapper = ((java.util.function.Function) AbstractModule::getName); + Stream stream4 = stream3.map(mapper); + mapper = ((java.util.function.Function) String::toLowerCase); + Stream stream5 = stream4.map(mapper); + Predicate predicate = ((java.util.function.Predicate) (($a0) -> ((String) $a0).startsWith(lowerStr))); + Stream stream6 = stream5.filter(predicate); + Supplier supplier = ObjectArrayList::new; + Collector collector = Collectors.toCollection(supplier); + return (java.util.List) stream6.collect(collector); +} +} diff --git a/src/main/java/cc/novoline/commands/impl/VClipCommand.java b/src/main/java/cc/novoline/commands/impl/VClipCommand.java new file mode 100644 index 0000000..de74104 --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/VClipCommand.java @@ -0,0 +1,39 @@ +package cc.novoline.commands.impl; +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.command.CommandException; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class VClipCommand extends NovoCommand { + public VClipCommand(@NonNull Novoline novoline, String text, String str) { + super(novoline, text, str); +} + + public void updateState2(char ch, long time, String[] args) throws CommandException { + byte byteVal = (byte)(false ? 1 : 0); + int intVal = byteVal; + if (ch >= 0) { + if (byteVal != 0) { + return; + } + + intVal = args.length; + } + + if (intVal == 1) { + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + double doubleVal = this.resolveDouble(args[0]); + double posX2 = player.posX; + double posY2 = player.posY + doubleVal; + double posZ2 = player.posZ; + player.setPositionAndUpdate(posX2, posY2, posZ2); + } else { + this.applyString4("Use .vclip (height)"); + } +} + + +} diff --git a/src/main/java/cc/novoline/commands/impl/WaypointCommand.java b/src/main/java/cc/novoline/commands/impl/WaypointCommand.java new file mode 100644 index 0000000..9469f3a --- /dev/null +++ b/src/main/java/cc/novoline/commands/impl/WaypointCommand.java @@ -0,0 +1,439 @@ +package cc.novoline.commands.impl; +import cc.novoline.Novoline; +import cc.novoline.commands.NovoCommand; +import cc.novoline.modules.configurations.util.WaypointEntry; +import cc.novoline.modules.visual.Waypoints; +import cc.novoline.utils.messages.CommandUsageMessage; +import cc.novoline.utils.notifications.NotificationManager; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.modules.ModuleRegistry; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; + +import org.apache.logging.log4j.Logger; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class WaypointCommand extends NovoCommand { + public WaypointCommand(@NonNull Novoline novoline, String text, String str, List list) { + super(novoline, text, str, list); +} + + public void updateState2(char ch, long time, String[] args) { + int intVal; + cc.novoline.modules.visual.Waypoints waypoints2; + byte byteVal; + java.util.List waypointEntryList; + int intVal5 = (true ? 1 : 0); + Waypoints waypoints3 = ModuleRegistry.WAYPOINTS.getModule(); + byte byteVal2 = (byte)intVal5; + String[] stringArr = args; + byte byteVal3 = byteVal2; + if (ch >= 0) { + if (byteVal2 != 0) { + if (args.length == 0) { + this.performStep(); + return; + } + + stringArr = args; + } + + byteVal3 = 0; + } + + label275: { + String textStr = stringArr[byteVal3]; + String lowerStr = textStr.toLowerCase(); + byte byteVal4 = -1; + intVal5 = lowerStr.hashCode(); + label274: + if (byteVal2 != 0) { + label279: { + label271: { + label280: { + label269: { + label281: { + label267: { + label282: { + label265: { + label283: { + switch (intVal5) { + case -1335458389: + break label283; + case 96417: + intVal5 = (lowerStr.equals("add") ? 1 : 0); + if (byteVal2 == 0) { + break label274; + } + + if (intVal5 == 0) { + break label279; + } + + byteVal4 = 0; + intVal5 = byteVal2; + if (time < 0L) { + break; + } + + if (byteVal2 != 0) { + break label279; + } + case -934610812: + intVal5 = (lowerStr.equals("remove") ? 1 : 0); + break; + case 99339: + break label282; + case 3322014: + break label280; + case 94746189: + break label281; + default: + break label279; + } + + if (byteVal2 == 0) { + break label274; + } + + if (intVal5 == 0) { + break label279; + } + + byteVal4 = 1; + intVal5 = byteVal2; + if (ch < 0) { + break label265; + } + + if (byteVal2 != 0) { + break label279; + } + } + + intVal5 = (lowerStr.equals("delete") ? 1 : 0); + } + + if (byteVal2 == 0) { + break label274; + } + + if (intVal5 == 0) { + break label279; + } + + byteVal4 = 2; + intVal5 = byteVal2; + if (ch < 0) { + break label267; + } + + if (byteVal2 != 0) { + break label279; + } + } + + intVal5 = (lowerStr.equals("del") ? 1 : 0); + } + + if (byteVal2 == 0) { + break label274; + } + + if (intVal5 == 0) { + break label279; + } + + byteVal4 = 3; + intVal5 = byteVal2; + if (ch < 0) { + break label269; + } + + if (byteVal2 != 0) { + break label279; + } + } + + intVal5 = (lowerStr.equals("clear") ? 1 : 0); + } + + if (byteVal2 == 0) { + break label274; + } + + if (intVal5 == 0) { + break label279; + } + + byteVal4 = 4; + intVal5 = byteVal2; + if (time < 0L) { + break label271; + } + + if (byteVal2 != 0) { + break label279; + } + } + + intVal5 = (lowerStr.equals("list") ? 1 : 0); + } + + intVal = byteVal2; + if (ch < 0) { + break label275; + } + + if (byteVal2 == 0) { + break label274; + } + + if (intVal5 != 0) { + byteVal4 = 5; + } + } + + intVal5 = byteVal4; + } + + intVal = byteVal2; + } + + label286: { + label287: { + label288: { + label289: { + label199: { + label290: { + if (time >= 0L) { + if (intVal != 0) { + switch (intVal5) { + case 0: + intVal5 = args.length; + break; + case 1: + case 2: + case 3: + break label290; + case 4: + break label289; + case 5: + break label288; + default: + return; + } + } + + intVal = 5; + } + + if (intVal5 != intVal) { + this.performStep(); + return; + } + + waypoints3.handleWaypointEntry(WaypointEntry.resolveWaypointEntry(args[4], Integer.parseInt(args[1]), Integer.parseInt(args[2]), Integer.parseInt(args[3]))); + + try { + waypoints3.getPlayerManagerConfigisnotlHelper().a(); + StringBuilder sb = new StringBuilder(); + String textStr2 = "Waypoint "; + StringBuilder sb2 = sb.append(textStr2); + textStr2 = args[4]; + StringBuilder sb3 = sb2.append(textStr2); + textStr2 = " was added successfully!"; + this.updateState(sb3.append(textStr2).toString(), 5000); + return; + } catch (IOException ex) { + this.applyString4("Can't save to file"); + Logger log = waypoints3.getLogger(); + log.warn("An error occurred while saving waypoints list", ex); + intVal5 = byteVal2; + if (time < 0L) { + break label199; + } + + if (byteVal2 != 0) { + return; + } + } + } + + intVal5 = args.length; + } + + label181: { + label180: { + label179: { + label291: { + if (byteVal2 != 0) { + if (intVal5 != 2) { + this.performStep(); + return; + } + + if (time < 0L) { + return; + } + + waypoints2 = waypoints3; + if (byteVal2 == 0) { + break label291; + } + + intVal5 = (waypoints3.evaluateFlag9(args[1]) ? 1 : 0); + } + + if (intVal5 == 0) { + break label180; + } + + StringBuilder sb4 = new StringBuilder(); + StringBuilder sb5 = sb4.append("Removed "); + String textStr6 = args[1]; + StringBuilder sb6 = sb5.append(textStr6); + this.updateState(sb6.append(" waypoint!").toString(), 5000); + + try { + WaypointCommand.$keepCatch(); + waypoints2 = waypoints3; + } catch (IOException ex2) { + Novoline novolineInst = Novoline.getInstance(); + NotificationManager notifManager = novolineInst.getNotificationManager(); + String textStr3 = "Can't save to file"; + NotificationType notificationType = NotificationType.ERROR; + notifManager.pop(textStr3, notificationType); + Logger log2 = waypoints3.getLogger(); + log2.warn("An error occurred while saving waypoints list", ex2); + byteVal = byteVal2; + if (ch < 0) { + break label181; + } + break label179; + } + } + + try { + waypoints2.getPlayerManagerConfigisnotlHelper().a(); + return; + } catch (IOException ex3) { + Novoline novolineInst2 = Novoline.getInstance(); + NotificationManager notifManager2 = novolineInst2.getNotificationManager(); + String textStr4 = "Can't save to file"; + NotificationType notificationType2 = NotificationType.ERROR; + notifManager2.pop(textStr4, notificationType2); + Logger log3 = waypoints3.getLogger(); + log3.warn("An error occurred while saving waypoints list", ex3); + byteVal = byteVal2; + if (ch < 0) { + break label181; + } + } + } + + if (byteVal != 0) { + return; + } + } + + this.updateState3("Waypoint doesn't exist!", 5000); + byteVal = byteVal2; + } + + if (byteVal != 0) { + return; + } + } + + label293: { + int len = args.length; + if (ch >= 0 && byteVal2 != 0) { + if (len != 1) { + this.performStep(); + return; + } + + waypointEntryList = waypoints3.getListValue7(); + if (time <= 0L || byteVal2 == 0) { + break label293; + } + + len = (waypointEntryList.isEmpty() ? 1 : 0); + } + + if (len != 0) { + return; + } + + waypointEntryList = waypoints3.getListValue7(); + } + + waypointEntryList.clear(); + intVal5 = byteVal2; + if (time <= 0L) { + break label287; + } + + if (byteVal2 != 0) { + return; + } + } + + if (ch < 0) { + break label286; + } + + intVal5 = args.length; + } + + if (intVal5 != 1) { + this.performStep(); + return; + } + + this.applyString3("Waypoints:"); + } + + List itemList = waypoints3.getListValue7(); + Iterator iter = itemList.iterator(); + + do { + if (!iter.hasNext()) { + break; + } + + WaypointEntry waypointEntry = (WaypointEntry)iter.next(); + StringBuilder sb7 = new StringBuilder(); + String textStr5 = " - name: \u00a73"; + StringBuilder sb8 = sb7.append(textStr5); + textStr5 = waypointEntry.getCachedText(); + StringBuilder sb9 = sb8.append(textStr5); + textStr5 = "\u00a7r, coordinates: \u00a78X:\u00a7r "; + StringBuilder sb10 = sb9.append(textStr5); + int intVal2 = waypointEntry.getStateTicks2(); + StringBuilder sb11 = sb10.append(intVal2); + textStr5 = " \u00a78Y:\u00a7r "; + StringBuilder sb12 = sb11.append(textStr5); + int intVal3 = waypointEntry.getStateTicks(); + StringBuilder sb13 = sb12.append(intVal3); + textStr5 = " \u00a78Z:\u00a7r "; + StringBuilder sb14 = sb13.append(textStr5); + int intVal4 = waypointEntry.getIntValue(); + this.applyString3(sb14.append(intVal4).toString()); + } while (byteVal2 != 0); +} + + + + private void performStep() { + CommandUsageMessage[] commandUsageMessageArr = new CommandUsageMessage[4]; + commandUsageMessageArr[0] = CommandUsageMessage.of("add (x) (y) (z) (name)", "add waypoint"); + commandUsageMessageArr[1] = CommandUsageMessage.of("remove (name)", "removes waypoint"); + commandUsageMessageArr[2] = CommandUsageMessage.of("clear", "remove all waypoints"); + commandUsageMessageArr[3] = CommandUsageMessage.of("list", "show waypoints list"); + this.updateState2("Waypoints help:", ".waypoint", commandUsageMessageArr); +} + private static void $keepCatch() throws E {} +} diff --git a/src/main/java/cc/novoline/commands/util/CommandPrefixHolder.java b/src/main/java/cc/novoline/commands/util/CommandPrefixHolder.java new file mode 100644 index 0000000..d326033 --- /dev/null +++ b/src/main/java/cc/novoline/commands/util/CommandPrefixHolder.java @@ -0,0 +1,13 @@ +package cc.novoline.commands.util; + +public class CommandPrefixHolder { + public static String textValue; + + public static void handleAction() { + textValue = "."; +} + + static { + handleAction(); + } +} diff --git a/src/main/java/cc/novoline/commands/util/ConfigCommandException.java b/src/main/java/cc/novoline/commands/util/ConfigCommandException.java new file mode 100644 index 0000000..763bf20 --- /dev/null +++ b/src/main/java/cc/novoline/commands/util/ConfigCommandException.java @@ -0,0 +1,16 @@ +package cc.novoline.commands.util; +public final class ConfigCommandException extends IllegalArgumentException { +public ConfigCommandException(String text) { + super(text); +} + + public ConfigCommandException() {} + + public ConfigCommandException(Throwable throwable) { + super(throwable); +} + + public ConfigCommandException(String text, Throwable throwable) { + super(text, throwable); +} +} diff --git a/src/main/java/cc/novoline/commands/util/ConfigReadWriteException.java b/src/main/java/cc/novoline/commands/util/ConfigReadWriteException.java new file mode 100644 index 0000000..278d7b0 --- /dev/null +++ b/src/main/java/cc/novoline/commands/util/ConfigReadWriteException.java @@ -0,0 +1,19 @@ +package cc.novoline.commands.util; + +import java.io.IOException; + +public final class ConfigReadWriteException extends IOException { + public ConfigReadWriteException(Throwable throwable) { + super(throwable); +} + + public ConfigReadWriteException() {} + + public ConfigReadWriteException(String text, Throwable throwable) { + super(text, throwable); +} + + public ConfigReadWriteException(String text) { + super(text); +} +} diff --git a/src/main/java/cc/novoline/commands/util/FriendRelationSwitchMap.java b/src/main/java/cc/novoline/commands/util/FriendRelationSwitchMap.java new file mode 100644 index 0000000..b6e7bfe --- /dev/null +++ b/src/main/java/cc/novoline/commands/util/FriendRelationSwitchMap.java @@ -0,0 +1,19 @@ +package cc.novoline.commands.util; + +import cc.novoline.modules.PlayerRelationType; + +public class FriendRelationSwitchMap { + public static final int[] SWITCH_MAP = new int[PlayerRelationType.values().length]; + + static { + try { + SWITCH_MAP[PlayerRelationType.TARGET.ordinal()] = 1; + } catch (NoSuchFieldError noSuchFieldError) { + } + + try { + SWITCH_MAP[PlayerRelationType.FRIEND.ordinal()] = 2; + } catch (NoSuchFieldError noSuchFieldError2) { + } + } +} diff --git a/src/main/java/cc/novoline/commands/util/JsonSchemaUtil.java b/src/main/java/cc/novoline/commands/util/JsonSchemaUtil.java new file mode 100644 index 0000000..48ffca4 --- /dev/null +++ b/src/main/java/cc/novoline/commands/util/JsonSchemaUtil.java @@ -0,0 +1,96 @@ +package cc.novoline.commands.util; + +import com.google.gson.FieldNamingPolicy; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.function.Consumer; +import cc.novoline.modules.configurations.holder.SavingModuleHolderSupport; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; + +public final class JsonSchemaUtil { + private static final Gson gson2 = new GsonBuilder() + .disableHtmlEscaping() + .serializeNulls() + .excludeFieldsWithoutExposeAnnotation() + .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) + .create(); + private static final JsonParser jsonParser = new JsonParser(); + + public static @Nullable T resolveJsonElement( + @NonNull HttpURLConnection httpURLConnection, @Nullable Consumer consumer, @NonNull Class param + ) throws IOException { + httpURLConnection.connect(); + + JsonElement jsonElement; + try { + label83: { + label72: { + int intVal = httpURLConnection.getResponseCode(); + short shortVal = 200; + if (intVal < 200) { + break label72; + } + + intVal = httpURLConnection.getResponseCode(); + + if (intVal <= 299) { + jsonElement = jsonParser.parse(new InputStreamReader(httpURLConnection.getInputStream())); + break label83; + } + } + + Consumer consumer2 = consumer; + if (consumer == null) { + return null; + } + + consumer2 = consumer; + + consumer2.accept(httpURLConnection); + return null; + } + } finally { + httpURLConnection.disconnect(); + } + + if (!param.isInstance(jsonElement)) { + throw new RuntimeException("API schema has been changed!"); + } else { + return (T)jsonElement; + } +} + + private JsonSchemaUtil() { + throw new UnsupportedOperationException("This is a utility class and cannot be instantiated"); +} + + public static @NonNull HttpURLConnection resolveHttpURLConnection(String text) throws IOException { + SavingModuleHolderSupport.applyUpdate(text, "URL"); + URL uRL = new URL(text); + HttpURLConnection httpURLConnection = (HttpURLConnection)uRL.openConnection(); + httpURLConnection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36 OPR/65.0.3467.62"); + httpURLConnection.setRequestProperty("Content-Type", "application/json"); + httpURLConnection.setConnectTimeout(15000); + httpURLConnection.setRequestMethod("GET"); + httpURLConnection.setDoOutput(true); + + return httpURLConnection; +} + + public static JsonParser getJsonParser() { + return jsonParser; +} + + public static Gson getGson() { + return gson2; +} + + +} diff --git a/src/main/java/cc/novoline/commands/util/NameHistoryRecord.java b/src/main/java/cc/novoline/commands/util/NameHistoryRecord.java new file mode 100644 index 0000000..44284d7 --- /dev/null +++ b/src/main/java/cc/novoline/commands/util/NameHistoryRecord.java @@ -0,0 +1,32 @@ +package cc.novoline.commands.util; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class NameHistoryRecord { + @Expose + @SerializedName("changedToAt") + private final long a; + @Expose + @SerializedName("name") + private final String b; + + public long getLongValue() { + return this.a; +} + + public String getTextValue() { + return this.b; +} + + public boolean isStateReady() { + int intVal = ((this.a == 0L) ? 1 : 0); + + return ((((intVal & 1)) != 0)); +} + + public NameHistoryRecord(String name, long time) { + this.b = name; + this.a = time; +} +} diff --git a/src/main/java/cc/novoline/commands/util/NameHistoryTypeToken.java b/src/main/java/cc/novoline/commands/util/NameHistoryTypeToken.java new file mode 100644 index 0000000..bc49036 --- /dev/null +++ b/src/main/java/cc/novoline/commands/util/NameHistoryTypeToken.java @@ -0,0 +1,13 @@ +package cc.novoline.commands.util; + +import cc.novoline.commands.impl.NameHistoryCommand; +import com.google.gson.reflect.TypeToken; +import java.util.List; + +public class NameHistoryTypeToken extends TypeToken> { + final NameHistoryCommand nameHistoryCommandField; + + public NameHistoryTypeToken(NameHistoryCommand nameHistoryCommand) { + this.nameHistoryCommandField = nameHistoryCommand; +} +} diff --git a/src/main/java/cc/novoline/commands/util/PlayerNameCache.java b/src/main/java/cc/novoline/commands/util/PlayerNameCache.java new file mode 100644 index 0000000..26d9a35 --- /dev/null +++ b/src/main/java/cc/novoline/commands/util/PlayerNameCache.java @@ -0,0 +1,73 @@ +package cc.novoline.commands.util; +import java.util.List; +import java.util.Objects; + +import cc.novoline.modules.configurations.holder.SavingModuleHolderSupport; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class PlayerNameCache { + private final List nameHistoryRecordList; + + public NameHistoryRecord getNameHistoryRecord() { + List itemList = this.nameHistoryRecordList; + int size2 = this.nameHistoryRecordList.size() - 1; + return (NameHistoryRecord)itemList.get(size2); +} + + public List getNameHistoryRecordList() { + return this.nameHistoryRecordList; +} + + @Override + public String toString() { + StringBuilder sb = new StringBuilder().append("Player{names="); + List itemList = this.nameHistoryRecordList; + sb = sb.append(itemList); + return sb.append('}').toString(); +} + + @Override + public int hashCode() { + Object[] objArr = new Object[]{this.nameHistoryRecordList}; + return Objects.hash(objArr); +} + + private PlayerNameCache(@NonNull List list) { + SavingModuleHolderSupport.applyUpdate(list, "names"); + this.nameHistoryRecordList = list; +} + + public PlayerNameCache(List list, NameHistoryTypeToken nameHistoryTypeToken) { + this(list); +} + + @Override + public boolean equals(Object obj) { + boolean flag = true; + Object obj2 = this; + if (flag) { + if (this == obj) { + return true; + } + + obj2 = obj; + } + + if (flag) { + if (!(obj2 instanceof PlayerNameCache)) { + return false; + } + + obj2 = obj; + } + + PlayerNameCache playerNameCache = (PlayerNameCache)obj2; + List itemList = this.nameHistoryRecordList; + List itemList2 = playerNameCache.nameHistoryRecordList; + return Objects.equals(itemList, itemList2); +} + + private static @NonNull PlayerNameCache resolvePlayerNameCache(@NonNull List list) { + return new PlayerNameCache(list); +} +} diff --git a/src/main/java/cc/novoline/commands/util/SayUsageHolder.java b/src/main/java/cc/novoline/commands/util/SayUsageHolder.java new file mode 100644 index 0000000..dbc6b98 --- /dev/null +++ b/src/main/java/cc/novoline/commands/util/SayUsageHolder.java @@ -0,0 +1,13 @@ +package cc.novoline.commands.util; + +public class SayUsageHolder { + public static String textValue; + + public static void handleAction() { + textValue = " "; +} + + static { + handleAction(); + } +} diff --git a/src/main/java/cc/novoline/commands/util/TargetRelationSwitchMap.java b/src/main/java/cc/novoline/commands/util/TargetRelationSwitchMap.java new file mode 100644 index 0000000..3e47f22 --- /dev/null +++ b/src/main/java/cc/novoline/commands/util/TargetRelationSwitchMap.java @@ -0,0 +1,19 @@ +package cc.novoline.commands.util; + +import cc.novoline.modules.PlayerRelationType; + +public class TargetRelationSwitchMap { + public static final int[] SWITCH_MAP = new int[PlayerRelationType.values().length]; + + static { + try { + SWITCH_MAP[PlayerRelationType.FRIEND.ordinal()] = 1; + } catch (NoSuchFieldError noSuchFieldError) { + } + + try { + SWITCH_MAP[PlayerRelationType.TARGET.ordinal()] = 2; + } catch (NoSuchFieldError noSuchFieldError2) { + } + } +} diff --git a/src/main/java/cc/novoline/commands/util/WeakRefUtil.java b/src/main/java/cc/novoline/commands/util/WeakRefUtil.java new file mode 100644 index 0000000..5801030 --- /dev/null +++ b/src/main/java/cc/novoline/commands/util/WeakRefUtil.java @@ -0,0 +1,16 @@ +package cc.novoline.commands.util; + +import java.lang.ref.WeakReference; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class WeakRefUtil { + private static final @NonNull WeakReference weakReference = new WeakReference(null); + + private WeakRefUtil() { + throw new UnsupportedOperationException("This is a utility class and cannot be instantiated"); +} + + public static WeakReference getWeakReference() { + return (WeakReference)weakReference; +} +} diff --git a/src/main/java/cc/novoline/events/Cancellable.java b/src/main/java/cc/novoline/events/Cancellable.java new file mode 100644 index 0000000..fe53bcd --- /dev/null +++ b/src/main/java/cc/novoline/events/Cancellable.java @@ -0,0 +1,7 @@ +package cc.novoline.events; + +public interface Cancellable { + void setCancelled(boolean cancelled); + + boolean isCancelled(); +} diff --git a/src/main/java/cc/novoline/events/CancellableEvent.java b/src/main/java/cc/novoline/events/CancellableEvent.java new file mode 100644 index 0000000..75573e8 --- /dev/null +++ b/src/main/java/cc/novoline/events/CancellableEvent.java @@ -0,0 +1,19 @@ +package cc.novoline.events; + +import net.skidunion.security.SkidUnionAnnotation; + +public abstract class CancellableEvent implements Event, Cancellable { +private boolean stateFlag; + + @SkidUnionAnnotation + @Override + public void setCancelled(boolean cancelled) { + this.stateFlag = cancelled; +} + + @SkidUnionAnnotation + @Override + public boolean isCancelled() { + return this.stateFlag; +} +} diff --git a/src/main/java/cc/novoline/events/Event.java b/src/main/java/cc/novoline/events/Event.java new file mode 100644 index 0000000..c5f8355 --- /dev/null +++ b/src/main/java/cc/novoline/events/Event.java @@ -0,0 +1,4 @@ +package cc.novoline.events; + +public interface Event { +} diff --git a/src/main/java/cc/novoline/events/EventManager.java b/src/main/java/cc/novoline/events/EventManager.java new file mode 100644 index 0000000..7058891 --- /dev/null +++ b/src/main/java/cc/novoline/events/EventManager.java @@ -0,0 +1,217 @@ +package cc.novoline.events; +import cc.novoline.utils.reflect.ReflectiveOps; +import cc.novoline.utils.helper.EventSubscriberList; +import cc.novoline.utils.helper.EventPriorityUtil; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.function.Predicate; + + +/** Registration and synchronous event dispatch restored from the 6.99 class. */ +public final class EventManager { + private static int b; + private static final Map, List> listeners = new HashMap<>(); + + private EventManager() {} + + public static void register(Object listener) { + int dispatchGuard = c(); + for (Method method : listener.getClass().getDeclaredMethods()) { + if (dispatchGuard == 0 || !isInvalidHandler(method)) { + addListener(method, listener); + } + + } + } + + public static void register(Object listener, Class eventType) { + int registrationGuard = b(); + for (Method method : listener.getClass().getDeclaredMethods()) { + if (registrationGuard != 0) { + addListener(method, eventType); + break; + } + if (!isInvalidHandler(method, eventType)) addListener(method, listener); + } + if (((Object[])null) != null) b(registrationGuard + 1); + } + + @SuppressWarnings("unchecked") + private static void addListener(Method method, Object listener) { + int dispatchGuard = c(); + Class eventType = (Class) method.getParameterTypes()[0]; + EventTarget annotation = (EventTarget) method.getAnnotation(EventTarget.class); + MethodData methodData = new MethodData(listener, method, annotation.value()); + boolean alreadyAccessible = methodData.getMethod().isAccessible(); + boolean hasList = alreadyAccessible; + if (!alreadyAccessible) methodData.getMethod().setAccessible(true); + hasList = listeners.containsKey(eventType); + if (hasList) { + List current = listeners.get(eventType); + boolean alreadyRegistered = current.contains(methodData); + if (alreadyRegistered) return; + current = listeners.get(eventType); + current.add(methodData); + sortListeners(eventType); + if (dispatchGuard != 0) return; + } + List first = new EventSubscriberList(methodData); + listeners.put(eventType, first); + } + + private static boolean isInvalidHandler(Method method) { + int dispatchGuard = c(); + int parameterCount = method.getParameterTypes().length; + // In the alternate branch, 6.99 feeds the count to a JVM boolean return. + if (dispatchGuard == 0) return (parameterCount & 1) != 0; + return parameterCount != 1 || !method.isAnnotationPresent(EventTarget.class); + } + + private static boolean isInvalidHandler(Method method, Class eventType) { + boolean invalid = isInvalidHandler(method); + + return invalid || !method.getParameterTypes()[0].equals(eventType); + } + + public static Event call(Event event) { + int dispatchGuard = c(); + Class eventType = event.getClass(); + List handlers = listeners.get(eventType); + if (handlers == null) return event; + + if (dispatchGuard == 0 || event instanceof EventStoppable) { + EventStoppable stoppable = (EventStoppable) event; + Iterator iterator = handlers.iterator(); + while (hasNext(iterator)) { + invokeListener(next(iterator), event); + + if (stoppable.isStateFlag()) break; + } + if (dispatchGuard != 0) return event; + } + + Iterator iterator = handlers.iterator(); + while (hasNext(iterator)) { + invokeListener(next(iterator), event); + if (dispatchGuard == 0) break; + } + return event; + } + + private static void invokeListener(MethodData handler, Event event) { + try { + invokeReflectively(handler, event); + } catch (IllegalAccessException | InvocationTargetException | IllegalArgumentException ignored) { + // A failing listener does not stop dispatch to the remaining listeners. + } + } + + // The dependency wrapper can propagate reflection exceptions without declaring them. + private static void invokeReflectively(MethodData handler, Event event) + throws IllegalAccessException, InvocationTargetException { + ReflectiveOps.invokeMethod(handler.getMethod(), handler.getSource(), new Object[] {event}); + } + + public static void unregister(Object listener) { + Collection> lists = listeners.values(); + Iterator> iterator = lists.iterator(); + while (hasNext(iterator)) { + List handlers = next(iterator); + Predicate owned = handler -> handler.getSource().equals(listener); + handlers.removeIf(owned); + + } + cleanup(true); + } + + public static void unregister(Object listener, Class eventType) { + int dispatchGuard = c(); + boolean present = listeners.containsKey(eventType); + if (dispatchGuard == 0) { + cleanup(present); + } else if (present) { + List handlers = listeners.get(eventType); + Predicate owned = handler -> handler.getSource().equals(listener); + handlers.removeIf(owned); + cleanup(true); + } + } + + public static void removeEvent(Class eventType) { + int registrationGuard = b(); + Iterator, List>> iterator = entries(); + while (hasNext(iterator)) { + Map.Entry, List> entry = next(iterator); + if (!entry.getKey().equals(eventType)) continue; + if (registrationGuard != 0) { + // The alternate bytecode path rejoins at CHECKCAST Class with the iterator. + ((Class) (Object) iterator).equals(eventType); + } else { + remove(iterator); + return; + } + } + } + + public static void cleanup(boolean emptyOnly) { + int registrationGuard = b(); + Iterator, List>> iterator = entries(); + while (hasNext(iterator)) { + boolean shouldRemove = registrationGuard == 0 || emptyOnly; + if (registrationGuard == 0 && emptyOnly) { + Map.Entry, List> entry = next(iterator); + List handlers = entry.getValue(); + shouldRemove = handlers.isEmpty(); + } + if (shouldRemove) { + remove(iterator); + + } + } + } + + private static void sortListeners(Class eventType) { + List sorted = new CopyOnWriteArrayList<>(); + for (byte priority : EventPriorityUtil.fieldVal) { + List handlers = listeners.get(eventType); + Iterator iterator = handlers.iterator(); + + while (hasNext(iterator)) { + MethodData handler = next(iterator); + if (handler.getPriority() == priority) { + sorted.add(handler); + } + } + } + listeners.put(eventType, sorted); + } + + private static Iterator, List>> entries() { + Set, List>> entries = listeners.entrySet(); + return entries.iterator(); + } + + private static boolean hasNext(Iterator iterator) { + return iterator.hasNext(); + } + + private static T next(Iterator iterator) { + return iterator.next(); + } + + private static void remove(Iterator iterator) { + iterator.remove(); + } + + public static int b() { return b; } + public static void b(int value) { b = value; } + public static int c() { return b() == 0 ? 106 : 0; } +} diff --git a/src/main/java/cc/novoline/events/EventStoppable.java b/src/main/java/cc/novoline/events/EventStoppable.java new file mode 100644 index 0000000..0bab5cf --- /dev/null +++ b/src/main/java/cc/novoline/events/EventStoppable.java @@ -0,0 +1,15 @@ +package cc.novoline.events; + +public abstract class EventStoppable implements Event { + private boolean stateFlag; + + public EventStoppable() {} + + public boolean isStateFlag() { + return this.stateFlag; +} + + public void updateHelper() { + this.stateFlag = true; +} +} diff --git a/src/main/java/cc/novoline/events/EventTarget.java b/src/main/java/cc/novoline/events/EventTarget.java new file mode 100644 index 0000000..106ed0d --- /dev/null +++ b/src/main/java/cc/novoline/events/EventTarget.java @@ -0,0 +1,14 @@ +package cc.novoline.events; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Documented +@Target(value={ElementType.METHOD}) +@Retention(value=RetentionPolicy.RUNTIME) +public @interface EventTarget { + public byte value() default 2; +} diff --git a/src/main/java/cc/novoline/events/MethodData.java b/src/main/java/cc/novoline/events/MethodData.java new file mode 100644 index 0000000..5e0935a --- /dev/null +++ b/src/main/java/cc/novoline/events/MethodData.java @@ -0,0 +1,29 @@ +package cc.novoline.events; + + +import java.lang.reflect.Method; + + +public final class MethodData { + private final Method method; + private final byte priority; + private final Object source; + + public byte getPriority() { + return this.priority; +} + + public Object getSource() { + return this.source; +} + + public MethodData(Object object, Method method, byte by) { + this.source = object; + this.method = method; + this.priority = by; +} + + public Method getMethod() { + return this.method; +} +} diff --git a/src/main/java/cc/novoline/events/State.java b/src/main/java/cc/novoline/events/State.java new file mode 100644 index 0000000..ae92f22 --- /dev/null +++ b/src/main/java/cc/novoline/events/State.java @@ -0,0 +1,21 @@ +package cc.novoline.events; +public enum State { + INCOMING, + OUTGOING; + + private static Object[] b; + + static { + Object[] objArr = new Object[4]; + b(objArr); + } + private static final State[] stateArray = new State[]{State.INCOMING, OUTGOING}; + + public static Object[] b() { + return b; +} + + public static void b(Object[] flowGuardArray) { + b = flowGuardArray; +} +} diff --git a/src/main/java/cc/novoline/events/events/BindKeyEvent.java b/src/main/java/cc/novoline/events/events/BindKeyEvent.java new file mode 100644 index 0000000..23502d9 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/BindKeyEvent.java @@ -0,0 +1,28 @@ +package cc.novoline.events.events; + +import cc.novoline.events.Event; +import cc.novoline.modules.AbstractModule; + +public class BindKeyEvent implements Event { + private final String cachedText; + private final int stateTicks; + private final AbstractModule abstractModuleField; + + public AbstractModule getAbstractModule() { + return this.abstractModuleField; +} + + public BindKeyEvent(AbstractModule module, int keyCode, String key) { + this.abstractModuleField = module; + this.stateTicks = keyCode; + this.cachedText = key; +} + + public String getCachedText() { + return this.cachedText; +} + + public int getStateTicks() { + return this.stateTicks; +} +} diff --git a/src/main/java/cc/novoline/events/events/BlockBoundingBoxEvent.java b/src/main/java/cc/novoline/events/events/BlockBoundingBoxEvent.java new file mode 100644 index 0000000..907a73c --- /dev/null +++ b/src/main/java/cc/novoline/events/events/BlockBoundingBoxEvent.java @@ -0,0 +1,44 @@ +package cc.novoline.events.events; + +import cc.novoline.events.CancellableEvent; +import net.minecraft.block.Block; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; + +public class BlockBoundingBoxEvent extends CancellableEvent { + private AxisAlignedBB axisAlignedBBField; + private Block blockField; + private BlockPos targetPos; + + public AxisAlignedBB getAxisAlignedBBA() { + return this.axisAlignedBBField; +} + + public void processHelper(AxisAlignedBB box) { + this.axisAlignedBBField = box; +} + + public void processHelper(Block block) { + this.blockField = block; +} + + public Block getBlockB() { + return this.blockField; +} + + public void processHelper(BlockPos pos) { + this.targetPos = pos; +} + + public BlockBoundingBoxEvent(Block block, BlockPos pos, AxisAlignedBB box) { + this.blockField = block; + this.targetPos = pos; + this.axisAlignedBBField = box; +} + + public BlockPos getTargetPos2() { + return this.targetPos; +} + + public net.minecraft.util.BlockPos getTargetPos() { return this.getTargetPos2(); } +} diff --git a/src/main/java/cc/novoline/events/events/BlockRenderEvent.java b/src/main/java/cc/novoline/events/events/BlockRenderEvent.java new file mode 100644 index 0000000..748ecce --- /dev/null +++ b/src/main/java/cc/novoline/events/events/BlockRenderEvent.java @@ -0,0 +1,25 @@ +package cc.novoline.events.events; + +import cc.novoline.events.Event; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.BlockPos; + +public class BlockRenderEvent implements Event { + private final IBlockState iBlockStateField; + private final BlockPos targetPos; + + public IBlockState getIBlockStateField() { + return this.iBlockStateField; +} + + public BlockPos getTargetPos2() { + return this.targetPos; +} + + public BlockRenderEvent(IBlockState state, BlockPos pos) { + this.iBlockStateField = state; + this.targetPos = pos; +} + + public net.minecraft.util.BlockPos getTargetPos() { return this.getTargetPos2(); } +} diff --git a/src/main/java/cc/novoline/events/events/ByteSignalEvent.java b/src/main/java/cc/novoline/events/events/ByteSignalEvent.java new file mode 100644 index 0000000..08c96b3 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/ByteSignalEvent.java @@ -0,0 +1,17 @@ +package cc.novoline.events.events; +import cc.novoline.events.CancellableEvent; +import cc.novoline.events.Event; +import cc.novoline.utils.helper.IByteSignalEventAccess; + + +public abstract class ByteSignalEvent implements Event, IByteSignalEventAccess { + private final byte byteValue; + + public byte getByteValue() { + return this.byteValue; +} + + public ByteSignalEvent(byte value) { + this.byteValue = value; +} +} diff --git a/src/main/java/cc/novoline/events/events/ClickMouseEvent.java b/src/main/java/cc/novoline/events/events/ClickMouseEvent.java new file mode 100644 index 0000000..ff75262 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/ClickMouseEvent.java @@ -0,0 +1,6 @@ +package cc.novoline.events.events; + +import cc.novoline.events.Event; + +public class ClickMouseEvent implements Event { +} diff --git a/src/main/java/cc/novoline/events/events/CollideWithBlockEvent.java b/src/main/java/cc/novoline/events/events/CollideWithBlockEvent.java new file mode 100644 index 0000000..f14b528 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/CollideWithBlockEvent.java @@ -0,0 +1,52 @@ +package cc.novoline.events.events; + +import cc.novoline.events.CancellableEvent; +import cc.novoline.events.EventManager; +import net.minecraft.block.Block; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.skidunion.security.SkidUnionAnnotation; + +public class CollideWithBlockEvent extends CancellableEvent { + private Block blockField; + private AxisAlignedBB axisAlignedBBField; + private BlockPos targetPos; + + public CollideWithBlockEvent(Block block, BlockPos pos, AxisAlignedBB box) { + BlockBoundingBoxEvent blockBoundingBoxEvent = new BlockBoundingBoxEvent(block, pos, box); + EventManager.call(blockBoundingBoxEvent); + this.blockField = blockBoundingBoxEvent.getBlockB(); + this.targetPos = blockBoundingBoxEvent.getTargetPos(); + this.axisAlignedBBField = blockBoundingBoxEvent.getAxisAlignedBBA(); +} + + @SkidUnionAnnotation + public void setBoundingBox(AxisAlignedBB box) { + this.axisAlignedBBField = box; +} + + @SkidUnionAnnotation + public AxisAlignedBB getBoundingBox() { + return this.axisAlignedBBField; +} + + @SkidUnionAnnotation + public Block getBlock() { + return this.blockField; +} + + @SkidUnionAnnotation + public BlockPos getPos() { + return this.targetPos; +} + + @SkidUnionAnnotation + public void setBlockPos(BlockPos pos) { + this.targetPos = pos; +} + + @SkidUnionAnnotation + public void setBlock(Block block) { + this.blockField = block; +} +} diff --git a/src/main/java/cc/novoline/events/events/DisconnectEvent.java b/src/main/java/cc/novoline/events/events/DisconnectEvent.java new file mode 100644 index 0000000..6926644 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/DisconnectEvent.java @@ -0,0 +1,6 @@ +package cc.novoline.events.events; + +import cc.novoline.events.Event; + +public class DisconnectEvent implements Event { +} diff --git a/src/main/java/cc/novoline/events/events/DisplayChestGuiEvent.java b/src/main/java/cc/novoline/events/events/DisplayChestGuiEvent.java new file mode 100644 index 0000000..e1425f5 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/DisplayChestGuiEvent.java @@ -0,0 +1,15 @@ +package cc.novoline.events.events; + +import cc.novoline.events.Event; + +public class DisplayChestGuiEvent implements Event { + String textValue; + + public DisplayChestGuiEvent(String text) { + this.textValue = text; +} + + public String getTextValue() { + return this.textValue; +} +} diff --git a/src/main/java/cc/novoline/events/events/EntityTickEvent.java b/src/main/java/cc/novoline/events/events/EntityTickEvent.java new file mode 100644 index 0000000..8e8687d --- /dev/null +++ b/src/main/java/cc/novoline/events/events/EntityTickEvent.java @@ -0,0 +1,18 @@ +package cc.novoline.events.events; + +import cc.novoline.events.Event; +import net.minecraft.entity.Entity; + +public class EntityTickEvent implements Event { + private final Entity trackedEntity; + + public Entity getTrackedEntity2() { + return this.trackedEntity; +} + + public EntityTickEvent(Entity entity) { + this.trackedEntity = entity; +} + + public net.minecraft.entity.Entity getTrackedEntity() { return this.getTrackedEntity2(); } +} diff --git a/src/main/java/cc/novoline/events/events/FallDistanceEvent.java b/src/main/java/cc/novoline/events/events/FallDistanceEvent.java new file mode 100644 index 0000000..fa48483 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/FallDistanceEvent.java @@ -0,0 +1,19 @@ +package cc.novoline.events.events; + +import cc.novoline.events.Event; + +public class FallDistanceEvent implements Event { + private float cachedAngle; + + public float getCachedAngle() { + return this.cachedAngle; +} + + public FallDistanceEvent(float value) { + this.cachedAngle = value; +} + + public void setCachedAngle(float value) { + this.cachedAngle = value; +} +} diff --git a/src/main/java/cc/novoline/events/events/InsideBlockRenderEvent.java b/src/main/java/cc/novoline/events/events/InsideBlockRenderEvent.java new file mode 100644 index 0000000..684e34a --- /dev/null +++ b/src/main/java/cc/novoline/events/events/InsideBlockRenderEvent.java @@ -0,0 +1,6 @@ +package cc.novoline.events.events; + +import cc.novoline.events.CancellableEvent; + +public class InsideBlockRenderEvent extends CancellableEvent { +} diff --git a/src/main/java/cc/novoline/events/events/JumpEvent.java b/src/main/java/cc/novoline/events/events/JumpEvent.java new file mode 100644 index 0000000..2035a0a --- /dev/null +++ b/src/main/java/cc/novoline/events/events/JumpEvent.java @@ -0,0 +1,29 @@ +package cc.novoline.events.events; + +import cc.novoline.events.CancellableEvent; + +public class JumpEvent extends CancellableEvent { + private boolean stateFlag; + private double cachedValue; + + public void applyUpdate(double value) { + this.cachedValue = value; +} + + public boolean isStateFlag2() { + return this.stateFlag; +} + + public double getDoubleValue() { + return this.cachedValue; +} + + public JumpEvent(double value, boolean flag) { + this.cachedValue = value; + this.stateFlag = flag; +} + + public void applyUpdate(boolean flag) { + this.stateFlag = flag; +} +} diff --git a/src/main/java/cc/novoline/events/events/KeyPressEvent.java b/src/main/java/cc/novoline/events/events/KeyPressEvent.java new file mode 100644 index 0000000..b104dab --- /dev/null +++ b/src/main/java/cc/novoline/events/events/KeyPressEvent.java @@ -0,0 +1,15 @@ +package cc.novoline.events.events; + +import cc.novoline.events.CancellableEvent; + +public class KeyPressEvent extends CancellableEvent { + private int key; + + public KeyPressEvent(int keyCode) { + this.key = keyCode; +} + + public int getKey() { + return this.key; +} +} diff --git a/src/main/java/cc/novoline/events/events/LoadWorldEvent.java b/src/main/java/cc/novoline/events/events/LoadWorldEvent.java new file mode 100644 index 0000000..67c51d9 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/LoadWorldEvent.java @@ -0,0 +1,6 @@ +package cc.novoline.events.events; + +import cc.novoline.events.Event; + +public class LoadWorldEvent implements Event { +} diff --git a/src/main/java/cc/novoline/events/events/MiddleClickEvent.java b/src/main/java/cc/novoline/events/events/MiddleClickEvent.java new file mode 100644 index 0000000..7dafec9 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/MiddleClickEvent.java @@ -0,0 +1,15 @@ +package cc.novoline.events.events; + +import cc.novoline.events.Event; + +public class MiddleClickEvent implements Event { + private int stateTicks; + + public MiddleClickEvent(int value) { + this.stateTicks = value; +} + + public int getStateTicks() { + return this.stateTicks; +} +} diff --git a/src/main/java/cc/novoline/events/events/ModuleStateEvent.java b/src/main/java/cc/novoline/events/events/ModuleStateEvent.java new file mode 100644 index 0000000..0fecf5d --- /dev/null +++ b/src/main/java/cc/novoline/events/events/ModuleStateEvent.java @@ -0,0 +1,6 @@ +package cc.novoline.events.events; + +import cc.novoline.events.Event; + +public class ModuleStateEvent implements Event { +} diff --git a/src/main/java/cc/novoline/events/events/MotionUpdateEvent.java b/src/main/java/cc/novoline/events/events/MotionUpdateEvent.java new file mode 100644 index 0000000..b4f904f --- /dev/null +++ b/src/main/java/cc/novoline/events/events/MotionUpdateEvent.java @@ -0,0 +1,156 @@ +package cc.novoline.events.events; + + +import cc.novoline.events.CancellableEvent; +import cc.novoline.events.EventManager; +import cc.novoline.events.type.State; +import net.minecraft.network.play.client.C04PacketPlayerPosition; +import net.minecraft.network.play.client.C06PacketPlayerPosLook; +import net.minecraft.network.play.client.C05PacketPlayerLook; + +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.client.entity.EntityPlayerSP; + +public class MotionUpdateEvent extends CancellableEvent { + private double cachedValue; + private float cachedAngle; +private State state; + private float cachedAngle2; + private double cachedValue2; + private double cachedValue3; + private EntityPlayerSP player; + private boolean onGround; + + public void applyUpdate2(double value) { + this.cachedValue = value; +} + + public void setState(State stateIn) { + this.state = stateIn; +} + + public double getCachedValue3() { + return this.cachedValue3; +} + + public void setCachedValue3(double value) { + this.cachedValue3 = value; +} + + public State getState() { + return this.state; +} + + public MotionUpdateEvent(EntityPlayerSP clientPlayer, double value, double amount, double offset, float factor, float angle, boolean flag, State stateIn) { + ScriptUpdateEvent scriptUpdateEvent = new ScriptUpdateEvent(value, amount, offset, factor, angle, flag, stateIn); + EventManager.call(scriptUpdateEvent); + this.cachedValue3 = scriptUpdateEvent.getX(); + this.cachedValue2 = scriptUpdateEvent.getY(); + this.cachedValue = scriptUpdateEvent.getZ(); + this.cachedAngle = scriptUpdateEvent.getYaw(); + this.cachedAngle2 = scriptUpdateEvent.getPitch(); + this.onGround = scriptUpdateEvent.isOnGround(); + this.state = scriptUpdateEvent.getState(); + this.player = clientPlayer; +} + + public boolean isOnGround() { + return this.onGround; +} + + public double getCachedValue2() { + return this.cachedValue2; +} + + public float getFloatValue() { + return this.cachedAngle; +} + + public void processHelper(float value) { + this.cachedAngle2 = value; +} + + public float getCachedAngle2() { + return this.cachedAngle2; +} + + public void setOnGround(boolean enabled) { + this.onGround = enabled; +} + + public MotionUpdateEvent(EntityPlayerSP clientPlayer, State stateIn) { + ScriptUpdateEvent scriptUpdateEvent = new ScriptUpdateEvent(this.cachedValue3, this.cachedValue2, this.cachedValue, this.cachedAngle, this.cachedAngle2, this.onGround, stateIn); + EventManager.call(scriptUpdateEvent); + this.cachedValue3 = clientPlayer.posX; + this.cachedValue2 = clientPlayer.getAxisAlignedBB().minY; + this.cachedValue = clientPlayer.posZ; + this.cachedAngle = clientPlayer.rotationYaw; + this.cachedAngle2 = clientPlayer.rotationPitch; + this.onGround = clientPlayer.onGround; + this.state = scriptUpdateEvent.getState(); + this.player = clientPlayer; +} + + public void applyUpdate2(float value) { + this.cachedAngle = value; +} + + public void processHelper(double value) { + this.cachedValue2 = value; +} + + public double getCachedValue() { + return this.cachedValue; +} + + public C03PacketPlayer getAhB() { + EntityPlayerSP player2 = this.player; + boolean flag = player2.matchesMotionUpdateEvent(this); + if (flag) { + player2 = this.player; + if (player2.applyInt5(this)) { + return new C06PacketPlayerPosLook(this.cachedValue3, this.cachedValue2, this.cachedValue, this.cachedAngle, this.cachedAngle2, this.onGround); + } + + return new C04PacketPlayerPosition(this.cachedValue3, this.cachedValue2, this.cachedValue, this.onGround); + } + + player2 = this.player; + flag = player2.applyInt5(this); + + return flag ? new C05PacketPlayerLook(this.cachedAngle, this.cachedAngle2, this.onGround) : new C03PacketPlayer(this.onGround); +} + + public double getX() { + return this.cachedValue3; +} + public void setX(double x) { + this.cachedValue3 = x; +} + public double getY() { + return this.cachedValue2; +} + public void setY(double y) { + this.cachedValue2 = y; +} + public double getZ() { + return this.cachedValue; +} + public void setZ(double z) { + this.cachedValue = z; +} + public float getYaw() { + return this.cachedAngle; +} + public void setYaw(float yaw) { + this.cachedAngle = yaw; +} + public float getPitch() { + return this.cachedAngle2; +} + public void setPitch(float pitch) { + this.cachedAngle2 = pitch; +} + + public C03PacketPlayer toPlayerPacket() { return this.getAhB(); } +} diff --git a/src/main/java/cc/novoline/events/events/MoveEvent.java b/src/main/java/cc/novoline/events/events/MoveEvent.java new file mode 100644 index 0000000..04b076e --- /dev/null +++ b/src/main/java/cc/novoline/events/events/MoveEvent.java @@ -0,0 +1,129 @@ +package cc.novoline.events.events; + +import cc.novoline.events.events.script.ScriptMoveEvent; + +import cc.novoline.events.Event; +import cc.novoline.events.EventManager; +import net.minecraft.util.MathHelper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; + +public class MoveEvent implements Event { + private double cachedValue; + private double cachedValue2; + private double cachedValue3; + + public void updateHelper(double value) { + Minecraft mcClient = Minecraft.getMinecraft(); + EntityPlayerSP player = mcClient.thePlayer; + double doubleVal = player.getFloat2(); + EntityPlayerSP player2 = mcClient.thePlayer; + if (player2.isMoving()) { + double angleRad = Math.toRadians(doubleVal); + this.setCachedValue2(-(MathHelper.sin(angleRad) * value)); + angleRad = Math.toRadians(doubleVal); + this.setCachedValue(MathHelper.cos(angleRad) * value); + return; + } + + this.setCachedValue2(0.0); + + this.setCachedValue(0.0); +} + + public void updateHelper2(float value, double amount) { + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + if (player.isMoving()) { + double doubleVal = value; + doubleVal = Math.toRadians(doubleVal); + this.setCachedValue2(player.motionX = -(MathHelper.sin(doubleVal) * amount)); + doubleVal = value; + doubleVal = Math.toRadians(doubleVal); + this.setCachedValue(player.motionZ = MathHelper.cos(doubleVal) * amount); + return; + } + + this.setCachedValue2(0.0); + + this.setCachedValue(0.0); +} + + public double getCachedValue() { + return this.cachedValue; +} + + public void applyDouble(double value) { + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + + if (player.isMoving()) { + double doubleVal = player.getFloat2(); + doubleVal = Math.toRadians(doubleVal); + this.setCachedValue2(player.motionX = -(MathHelper.sin(doubleVal) * value)); + doubleVal = player.getFloat2(); + doubleVal = Math.toRadians(doubleVal); + this.setCachedValue(player.motionZ = MathHelper.cos(doubleVal) * value); + return; + } + + this.setCachedValue2(0.0); + + + this.setCachedValue(0.0); +} + + public void handleFloat(float value, double amount) { + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + if (player.isMoving()) { + double doubleVal = value; + doubleVal = Math.toRadians(doubleVal); + this.setCachedValue2(-(MathHelper.sin(doubleVal) * amount)); + doubleVal = value; + doubleVal = Math.toRadians(doubleVal); + this.setCachedValue(MathHelper.cos(doubleVal) * amount); + return; + } + + this.setCachedValue2(0.0); + + this.setCachedValue(0.0); +} + + public void setCachedValue(double value) { + this.cachedValue = value; +} + + public MoveEvent(double x, double y, double z) { + ScriptMoveEvent scriptMoveEvent = new ScriptMoveEvent(x, y, z); + EventManager.call(scriptMoveEvent); + this.cachedValue2 = scriptMoveEvent.getX(); + this.cachedValue3 = scriptMoveEvent.getY(); + this.cachedValue = scriptMoveEvent.getZ(); +} + + public void setCachedValue32(double value) { + this.cachedValue3 = value; +} + + public double getCachedValue2() { + return this.cachedValue2; +} + + public void setCachedValue2(double value) { + this.cachedValue2 = value; +} + + public double getCachedValue32() { + return this.cachedValue3; +} + + public double getX() { return this.getCachedValue2(); } + public double getY() { return this.getCachedValue32(); } + public double getZ() { return this.getCachedValue(); } + public void setX(double x) { this.setCachedValue2(x); } + public void setY(double y) { this.setCachedValue32(y); } + public void setZ(double z) { this.setCachedValue(z); } + public void setMoveSpeed(double speed) { this.updateHelper(speed); } + public void setMoveSpeedMotion(double speed) { this.applyDouble(speed); } + public void setMoveSpeedYaw(float yaw, double speed) { this.handleFloat(yaw, speed); } + public void setMoveSpeedYawMotion(float yaw, double speed) { this.updateHelper2(yaw, speed); } +} diff --git a/src/main/java/cc/novoline/events/events/MoveInputEvent.java b/src/main/java/cc/novoline/events/events/MoveInputEvent.java new file mode 100644 index 0000000..b90984c --- /dev/null +++ b/src/main/java/cc/novoline/events/events/MoveInputEvent.java @@ -0,0 +1,19 @@ +package cc.novoline.events.events; + +import cc.novoline.events.Event; + +public class MoveInputEvent implements Event { + private boolean stateFlag; + + public MoveInputEvent(boolean flag) { + this.stateFlag = flag; +} + + public boolean isStateFlag3() { + return this.stateFlag; +} + + public void setStateFlag(boolean flag) { + this.stateFlag = flag; +} +} diff --git a/src/main/java/cc/novoline/events/events/PacketEvent.java b/src/main/java/cc/novoline/events/events/PacketEvent.java new file mode 100644 index 0000000..aeaeba0 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/PacketEvent.java @@ -0,0 +1,72 @@ +package cc.novoline.events.events; + +import cc.novoline.events.events.script.ScriptPacketEvent; + +import cc.novoline.events.CancellableEvent; +import cc.novoline.events.EventManager; +import cc.novoline.events.State; +import net.minecraft.client.Minecraft; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.network.Packet; + +public class PacketEvent extends CancellableEvent { + private Packet packet; + private final State state; + private static int d; + + public static int e() { + int intVal = d(); + return intVal == 0 ? 50 : 0; +} + + public void setPacket(Packet packet2) { + this.packet = packet2; +} + + public static void applyUpdate3(int value) { + d = value; +} + + public void applyUpdate3(Packet packet2) { + NetHandlerPlayClient netHandler = Minecraft.getMinecraft().getNetHandler(); + netHandler.sendPacketNoEvent(packet2); + this.setCancelled(true); +} + + static { + if (e() == 0) { + applyUpdate3(92); + } + } + + public PacketEvent(Packet packet2, State stateIn) { + ScriptPacketEvent scriptPacketEvent = new ScriptPacketEvent(packet2, stateIn); + EventManager.call(scriptPacketEvent); + + if (scriptPacketEvent.isCancelled()) { + this.setCancelled(true); + } + + this.state = scriptPacketEvent.getStateB(); + this.packet = scriptPacketEvent.getPacket().getPacket(); + +} + + public static int d() { + return d; +} + + public Packet getPacket() { + return this.packet; +} + + public void performStep() { + NetHandlerPlayClient netHandler = Minecraft.getMinecraft().getNetHandler(); + netHandler.sendPacketNoEvent(this.packet); + this.setCancelled(true); +} + + public State getState() { + return this.state; +} +} diff --git a/src/main/java/cc/novoline/events/events/PlayerUpdateEvent.java b/src/main/java/cc/novoline/events/events/PlayerUpdateEvent.java new file mode 100644 index 0000000..a4c497e --- /dev/null +++ b/src/main/java/cc/novoline/events/events/PlayerUpdateEvent.java @@ -0,0 +1,6 @@ +package cc.novoline.events.events; + +import cc.novoline.events.Event; + +public class PlayerUpdateEvent implements Event { +} diff --git a/src/main/java/cc/novoline/events/events/PostTickEvent.java b/src/main/java/cc/novoline/events/events/PostTickEvent.java new file mode 100644 index 0000000..4afe9ab --- /dev/null +++ b/src/main/java/cc/novoline/events/events/PostTickEvent.java @@ -0,0 +1,6 @@ +package cc.novoline.events.events; + +import cc.novoline.events.Event; + +public class PostTickEvent implements Event { +} diff --git a/src/main/java/cc/novoline/events/events/PropertyChangeEvent.java b/src/main/java/cc/novoline/events/events/PropertyChangeEvent.java new file mode 100644 index 0000000..355de57 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/PropertyChangeEvent.java @@ -0,0 +1,22 @@ +package cc.novoline.events.events; + +import cc.novoline.events.Event; +import cc.novoline.modules.configurations.property.AbstractProperty; + +public class PropertyChangeEvent implements Event { + private final AbstractProperty abstractPropertyField; + private final String cachedText; + + public AbstractProperty getAbstractPropertyField() { + return this.abstractPropertyField; +} + + public PropertyChangeEvent(AbstractProperty property, String text) { + this.abstractPropertyField = property; + this.cachedText = text; +} + + public String getCachedText() { + return this.cachedText; +} +} diff --git a/src/main/java/cc/novoline/events/events/PushBlockEvent.java b/src/main/java/cc/novoline/events/events/PushBlockEvent.java new file mode 100644 index 0000000..b8799db --- /dev/null +++ b/src/main/java/cc/novoline/events/events/PushBlockEvent.java @@ -0,0 +1,6 @@ +package cc.novoline.events.events; + +import cc.novoline.events.CancellableEvent; + +public class PushBlockEvent extends CancellableEvent { +} diff --git a/src/main/java/cc/novoline/events/events/Render2DEvent.java b/src/main/java/cc/novoline/events/events/Render2DEvent.java new file mode 100644 index 0000000..cd7a8d4 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/Render2DEvent.java @@ -0,0 +1,28 @@ +package cc.novoline.events.events; + +import cc.novoline.events.events.script.ScriptRender2DEvent; + +import cc.novoline.events.Event; +import cc.novoline.events.EventManager; +import net.minecraft.client.gui.ScaledResolution; + +public class Render2DEvent +implements Event { + private final ScaledResolution resolution; + private final float partialTicks; + + public Render2DEvent(ScaledResolution scaledResolution, float f) { + ScriptRender2DEvent a7B2 = new ScriptRender2DEvent(scaledResolution, f); + EventManager.call(a7B2); + this.resolution = a7B2.getResolution(); + this.partialTicks = a7B2.getPartialTicks(); +} + + public float getPartialTicks() { + return this.partialTicks; +} + + public ScaledResolution getResolution() { + return this.resolution; +} +} diff --git a/src/main/java/cc/novoline/events/events/Render3DEvent.java b/src/main/java/cc/novoline/events/events/Render3DEvent.java new file mode 100644 index 0000000..9ca43fc --- /dev/null +++ b/src/main/java/cc/novoline/events/events/Render3DEvent.java @@ -0,0 +1,19 @@ +package cc.novoline.events.events; + +import cc.novoline.events.Event; +import cc.novoline.events.EventManager; +import cc.novoline.events.events.script.ScriptRender3DEvent; + +public class Render3DEvent implements Event { + private final float partialTicks; + + public Render3DEvent(float ticks) { + ScriptRender3DEvent scriptRender3DEvent = new ScriptRender3DEvent(ticks); + EventManager.call(scriptRender3DEvent); + this.partialTicks = scriptRender3DEvent.getPartialTicks(); +} + + public float getPartialTicks() { + return this.partialTicks; +} +} diff --git a/src/main/java/cc/novoline/events/events/RenderEntityEvent.java b/src/main/java/cc/novoline/events/events/RenderEntityEvent.java new file mode 100644 index 0000000..92b5264 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/RenderEntityEvent.java @@ -0,0 +1,54 @@ +package cc.novoline.events.events; + +import cc.novoline.events.CancellableEvent; +import cc.novoline.events.type.RenderEntityState; +import net.minecraft.client.renderer.entity.RendererLivingEntity; +import net.minecraft.entity.Entity; + +public class RenderEntityEvent extends CancellableEvent { + private double cachedValue; + private double cachedValue2; + private double cachedValue3; + private RenderEntityState renderEntityStateField; + private boolean stateFlag; + private RendererLivingEntity rendererLivingEntityField; + private Entity trackedEntity; + + public RenderEntityEvent(RendererLivingEntity rendererLivingEntity, Entity entity, double value, double amount, double offset, RenderEntityState renderEntityState) { + this.trackedEntity = entity; + this.renderEntityStateField = renderEntityState; + this.cachedValue2 = value; + this.cachedValue3 = amount; + this.cachedValue = offset; + this.rendererLivingEntityField = rendererLivingEntity; +} + + public RenderEntityEvent(Entity entity, RenderEntityState renderEntityState) { + this.trackedEntity = entity; + this.renderEntityStateField = renderEntityState; +} + + public Entity getEntityB() { + return this.trackedEntity; +} + + public double getCachedValue4() { + return this.cachedValue; +} + + public RendererLivingEntity getRendererLivingEntity() { + return this.rendererLivingEntityField; +} + + public RenderEntityState getRenderEntityState() { + return this.renderEntityStateField; +} + + public double getCachedValue33() { + return this.cachedValue3; +} + + public double getDoubleValue2() { + return this.cachedValue2; +} +} diff --git a/src/main/java/cc/novoline/events/events/RenderGuiEvent.java b/src/main/java/cc/novoline/events/events/RenderGuiEvent.java new file mode 100644 index 0000000..39bace6 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/RenderGuiEvent.java @@ -0,0 +1,76 @@ +package cc.novoline.events.events; + +import cc.novoline.events.type.GuiState; + +import cc.novoline.events.Event; +import net.minecraft.client.gui.GuiScreen; + +public class RenderGuiEvent implements Event { + private GuiScreen guiScreenField; + private GuiState guiStateField; + private int stateTicks; + private int stateTicks2; + private int stateTicks3; + + public int getStateTicks3() { + return this.stateTicks3; +} + + public RenderGuiEvent(GuiScreen screen, int value, int index) { + this.guiScreenField = screen; + this.stateTicks = value; + this.stateTicks2 = index; + this.guiStateField = GuiState.RENDER; +} + + public RenderGuiEvent(GuiScreen screen, int value) { + this.guiScreenField = screen; + this.stateTicks3 = value; + this.guiStateField = GuiState.RELEASE; +} + + public GuiScreen getGuiScreenField() { + return this.guiScreenField; +} + + public int getStateTicks2() { + return this.stateTicks2; +} + + public RenderGuiEvent(GuiScreen screen, int value, int index, int count) { + this.guiScreenField = screen; + this.stateTicks = value; + this.stateTicks2 = index; + this.stateTicks3 = count; + this.guiStateField = GuiState.CLICK; +} + + public GuiState getGuiStateField() { + return this.guiStateField; +} + + public RenderGuiEvent(GuiScreen screen, long time) { + this.guiScreenField = screen; + this.guiStateField = time == 0L ? GuiState.CLOSE : GuiState.INITIAL; +} + + public int getStateTicks() { + return this.stateTicks; +} + + public GuiScreen getGuiScreen() { + return this.getGuiScreenField(); +} + public GuiState getState() { + return this.getGuiStateField(); +} + public int getMouseX() { + return this.getStateTicks(); +} + public int getMouseY() { + return this.getStateTicks2(); +} + public int getMouseButton() { + return this.getStateTicks3(); +} +} diff --git a/src/main/java/cc/novoline/events/events/RenderNameTagEvent.java b/src/main/java/cc/novoline/events/events/RenderNameTagEvent.java new file mode 100644 index 0000000..3d2921f --- /dev/null +++ b/src/main/java/cc/novoline/events/events/RenderNameTagEvent.java @@ -0,0 +1,16 @@ +package cc.novoline.events.events; + +import cc.novoline.events.CancellableEvent; +import net.minecraft.entity.Entity; + +public class RenderNameTagEvent extends CancellableEvent { + final Entity entityField; + + public Entity getEntityA() { + return this.entityField; +} + + public RenderNameTagEvent(Entity entity) { + this.entityField = entity; +} +} diff --git a/src/main/java/cc/novoline/events/events/RightClickEvent.java b/src/main/java/cc/novoline/events/events/RightClickEvent.java new file mode 100644 index 0000000..4a14787 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/RightClickEvent.java @@ -0,0 +1,6 @@ +package cc.novoline.events.events; + +import cc.novoline.events.CancellableEvent; + +public class RightClickEvent extends CancellableEvent { +} diff --git a/src/main/java/cc/novoline/events/events/ScoreboardRenderEvent.java b/src/main/java/cc/novoline/events/events/ScoreboardRenderEvent.java new file mode 100644 index 0000000..57253fd --- /dev/null +++ b/src/main/java/cc/novoline/events/events/ScoreboardRenderEvent.java @@ -0,0 +1,28 @@ +package cc.novoline.events.events; + +import cc.novoline.events.Event; +import net.minecraft.scoreboard.ScoreObjective; + +public class ScoreboardRenderEvent implements Event { + private String cachedText; + private ScoreObjective scoreObjectiveField; + private int stateTicks; + + public String getCachedText() { + return this.cachedText; +} + + public ScoreboardRenderEvent(ScoreObjective scoreObjective, int value, String text) { + this.stateTicks = value; + this.cachedText = text; + this.scoreObjectiveField = scoreObjective; +} + + public ScoreObjective getScoreObjectiveField() { + return this.scoreObjectiveField; +} + + public int getStateTicks() { + return this.stateTicks; +} +} diff --git a/src/main/java/cc/novoline/events/events/ScriptUpdateEvent.java b/src/main/java/cc/novoline/events/events/ScriptUpdateEvent.java new file mode 100644 index 0000000..e7bfd72 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/ScriptUpdateEvent.java @@ -0,0 +1,100 @@ +package cc.novoline.events.events; + + +import cc.novoline.events.Event; +import cc.novoline.events.type.State; +import net.skidunion.security.SkidUnionAnnotation; + +public class ScriptUpdateEvent implements Event { + private double cachedValue; + private boolean stateFlag; + private float cachedAngle; + private float cachedAngle2; + private double cachedValue2; + private State stateField; + private double cachedValue3; + + @SkidUnionAnnotation + public void setOnGround(boolean onGround) { + this.stateFlag = onGround; +} + + @SkidUnionAnnotation + public boolean isOnGround() { + return this.stateFlag; +} + + @SkidUnionAnnotation + public void setX(double value) { + this.cachedValue2 = value; +} + + @SkidUnionAnnotation + public double getX() { + return this.cachedValue2; +} + + @SkidUnionAnnotation + public void setPitch(float pitch) { + this.cachedAngle = pitch; +} + + @SkidUnionAnnotation + public void setState(State state) { + this.stateField = state; +} + + @SkidUnionAnnotation + public void setYaw(float yaw) { + this.cachedAngle2 = yaw; +} + + @SkidUnionAnnotation + public double getZ() { + return this.cachedValue3; +} + + public ScriptUpdateEvent(State state) { + this.stateField = state; +} + + @SkidUnionAnnotation + public double getY() { + return this.cachedValue; +} + + @SkidUnionAnnotation + public void setZ(double value) { + this.cachedValue3 = value; +} + + @SkidUnionAnnotation + public State getState() { + return this.stateField; +} + + public ScriptUpdateEvent(double value, double amount, double offset, float factor, float angle, boolean flag, State state) { + this.cachedValue2 = value; + this.cachedValue = amount; + this.cachedValue3 = offset; + this.cachedAngle2 = factor; + this.cachedAngle = angle; + this.stateFlag = flag; + this.stateField = state; +} + + @SkidUnionAnnotation + public float getPitch() { + return this.cachedAngle; +} + + @SkidUnionAnnotation + public void setY(double value) { + this.cachedValue = value; +} + + @SkidUnionAnnotation + public float getYaw() { + return this.cachedAngle2; +} +} diff --git a/src/main/java/cc/novoline/events/events/SettingEvent.java b/src/main/java/cc/novoline/events/events/SettingEvent.java new file mode 100644 index 0000000..3427ca1 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/SettingEvent.java @@ -0,0 +1,118 @@ +package cc.novoline.events.events; + +import cc.novoline.gui.screen.setting.SettingType; + +import cc.novoline.events.Event; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.configurations.property.AbstractNumberProperty; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; + +public class SettingEvent +implements Event { + private AbstractNumberProperty abstractNumberPropertyField; + private ListProperty listPropertyField; + private final SettingType settingTypeField; + private BooleanProperty booleanPropertyField; + private final AbstractModule abstractModuleField; + private StringProperty stringPropertyField; + private String cachedText; + private final String cachedText2; + + public SettingEvent(AbstractModule abstractModule, String string, AbstractNumberProperty abstractNumberProperty) { + this.abstractModuleField = abstractModule; + this.cachedText2 = string; + this.settingTypeField = SettingType.SLIDER; + this.abstractNumberPropertyField = abstractNumberProperty; +} + + public SettingEvent(AbstractModule abstractModule, String string, StringProperty stringProperty) { + this.abstractModuleField = abstractModule; + this.cachedText2 = string; + this.settingTypeField = SettingType.COMBOBOX; + this.stringPropertyField = stringProperty; +} + + public SettingType getSettingTypeField() { + return this.settingTypeField; +} + + public StringProperty getStringPropertyField() { + return this.stringPropertyField; +} + + public String getCachedText2() { + return this.cachedText2; +} + + public SettingEvent(AbstractModule abstractModule, String string, BooleanProperty booleanProperty) { + this.abstractModuleField = abstractModule; + this.cachedText2 = string; + this.settingTypeField = SettingType.CHECKBOX; + this.booleanPropertyField = booleanProperty; +} + + public String getCachedText() { + return this.cachedText; +} + + public AbstractNumberProperty getAbstractNumberPropertyField() { + return this.abstractNumberPropertyField; +} + + public SettingEvent(AbstractModule abstractModule, String string) { + this.abstractModuleField = abstractModule; + this.cachedText2 = string; + this.settingTypeField = SettingType.COLOR_PICKER; +} + + public BooleanProperty getBooleanPropertyField() { + return this.booleanPropertyField; +} + + public ListProperty getListPropertyField() { + return this.listPropertyField; +} + + public SettingEvent(AbstractModule abstractModule, String string, String string2, BooleanProperty booleanProperty) { + this.abstractModuleField = abstractModule; + this.cachedText2 = string; + this.cachedText = string2; + this.settingTypeField = SettingType.CHECKBOX; + this.booleanPropertyField = booleanProperty; +} + + public SettingEvent(AbstractModule abstractModule, String string, ListProperty listProperty) { + this.abstractModuleField = abstractModule; + this.cachedText2 = string; + this.settingTypeField = SettingType.SELECTBOX; + this.listPropertyField = listProperty; +} + + public AbstractModule getAbstractModuleField() { + return this.abstractModuleField; +} + + public AbstractModule getModule() { + return this.getAbstractModuleField(); +} + public String getSettingName() { + return this.getCachedText2(); +} + public SettingType getSettingType() { + return this.getSettingTypeField(); +} + public BooleanProperty getBooleanProperty() { + return this.getBooleanPropertyField(); +} + public StringProperty getStringProperty() { + return this.getStringPropertyField(); +} + public AbstractNumberProperty getNumberProperty() { + return this.getAbstractNumberPropertyField(); +} + public ListProperty getListProperty() { + return this.getListPropertyField(); +} +} diff --git a/src/main/java/cc/novoline/events/events/ShaderEvent.java b/src/main/java/cc/novoline/events/events/ShaderEvent.java new file mode 100644 index 0000000..fc83664 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/ShaderEvent.java @@ -0,0 +1,6 @@ +package cc.novoline.events.events; + +import cc.novoline.events.Event; + +public class ShaderEvent implements Event { +} diff --git a/src/main/java/cc/novoline/events/events/ShaderRender2DEvent.java b/src/main/java/cc/novoline/events/events/ShaderRender2DEvent.java new file mode 100644 index 0000000..450e9fa --- /dev/null +++ b/src/main/java/cc/novoline/events/events/ShaderRender2DEvent.java @@ -0,0 +1,24 @@ +package cc.novoline.events.events; + +import cc.novoline.events.Event; +import net.minecraft.client.gui.ScaledResolution; + +public class ShaderRender2DEvent implements Event { + private final ScaledResolution scaledRes; + private final float cachedAngle; + + public ScaledResolution getScaledRes2() { + return this.scaledRes; +} + + public float getCachedAngle() { + return this.cachedAngle; +} + + public ShaderRender2DEvent(ScaledResolution scaledResolution, float partialTicks) { + this.scaledRes = scaledResolution; + this.cachedAngle = partialTicks; +} + + public net.minecraft.client.gui.ScaledResolution getScaledRes() { return this.getScaledRes2(); } +} diff --git a/src/main/java/cc/novoline/events/events/SlowdownEvent.java b/src/main/java/cc/novoline/events/events/SlowdownEvent.java new file mode 100644 index 0000000..3cd5a4b --- /dev/null +++ b/src/main/java/cc/novoline/events/events/SlowdownEvent.java @@ -0,0 +1,6 @@ +package cc.novoline.events.events; + +import cc.novoline.events.CancellableEvent; + +public class SlowdownEvent extends CancellableEvent { +} diff --git a/src/main/java/cc/novoline/events/events/SneakEvent.java b/src/main/java/cc/novoline/events/events/SneakEvent.java new file mode 100644 index 0000000..8b9c094 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/SneakEvent.java @@ -0,0 +1,6 @@ +package cc.novoline.events.events; + +import cc.novoline.events.CancellableEvent; + +public class SneakEvent extends CancellableEvent { +} diff --git a/src/main/java/cc/novoline/events/events/SoundPlayEvent.java b/src/main/java/cc/novoline/events/events/SoundPlayEvent.java new file mode 100644 index 0000000..3795153 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/SoundPlayEvent.java @@ -0,0 +1,15 @@ +package cc.novoline.events.events; + +import cc.novoline.events.CancellableEvent; + +public class SoundPlayEvent extends CancellableEvent { + private String cachedText; + + public SoundPlayEvent(String text) { + this.cachedText = text; +} + + public String getStringValue() { + return this.cachedText; +} +} diff --git a/src/main/java/cc/novoline/events/events/SpawnCheckEvent.java b/src/main/java/cc/novoline/events/events/SpawnCheckEvent.java new file mode 100644 index 0000000..6c3482e --- /dev/null +++ b/src/main/java/cc/novoline/events/events/SpawnCheckEvent.java @@ -0,0 +1,26 @@ +package cc.novoline.events.events; + +import cc.novoline.utils.ListAction; + +import cc.novoline.events.Event; +import net.minecraft.entity.Entity; + +public class SpawnCheckEvent implements Event { + private final ListAction listActionField; + private final Entity trackedEntity; + + public ListAction getListAction() { + return this.listActionField; +} + + public SpawnCheckEvent(Entity entity, ListAction listAction) { + this.trackedEntity = entity; + this.listActionField = listAction; +} + + public Entity getTrackedEntity3() { + return this.trackedEntity; +} + + public net.minecraft.entity.Entity getTrackedEntity() { return this.getTrackedEntity3(); } +} diff --git a/src/main/java/cc/novoline/events/events/StepConfirmEvent.java b/src/main/java/cc/novoline/events/events/StepConfirmEvent.java new file mode 100644 index 0000000..e4778ee --- /dev/null +++ b/src/main/java/cc/novoline/events/events/StepConfirmEvent.java @@ -0,0 +1,16 @@ +package cc.novoline.events.events; + +import cc.novoline.events.CancellableEvent; +import cc.novoline.events.type.StepState; + +public class StepConfirmEvent extends CancellableEvent { + private StepState stepStateField; + + public StepState getZnA() { + return this.stepStateField; +} + + public StepConfirmEvent(StepState stepState) { + this.stepStateField = stepState; +} +} diff --git a/src/main/java/cc/novoline/events/events/StrafeEvent.java b/src/main/java/cc/novoline/events/events/StrafeEvent.java new file mode 100644 index 0000000..53f1f08 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/StrafeEvent.java @@ -0,0 +1,39 @@ +package cc.novoline.events.events; + +import cc.novoline.events.CancellableEvent; + +public class StrafeEvent extends CancellableEvent { + private float cachedAngle; + private float cachedAngle2; + private float cachedAngle3; + + public float getCachedAngle2() { + return this.cachedAngle; +} + + public void applyUpdate4(float value) { + this.cachedAngle2 = value; +} + + public StrafeEvent(float x, float y, float z) { + this.cachedAngle = x; + this.cachedAngle3 = y; + this.cachedAngle2 = z; +} + + public void setCachedAngle(float value) { + this.cachedAngle = value; +} + + public float getFloatValue2() { + return this.cachedAngle3; +} + + public void setCachedAngle3(float value) { + this.cachedAngle3 = value; +} + + public float getFloatValue3() { + return this.cachedAngle2; +} +} diff --git a/src/main/java/cc/novoline/events/events/TickEndEvent.java b/src/main/java/cc/novoline/events/events/TickEndEvent.java new file mode 100644 index 0000000..2599259 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/TickEndEvent.java @@ -0,0 +1,6 @@ +package cc.novoline.events.events; + +import cc.novoline.events.Event; + +public class TickEndEvent implements Event { +} diff --git a/src/main/java/cc/novoline/events/events/TickUpdateEvent.java b/src/main/java/cc/novoline/events/events/TickUpdateEvent.java new file mode 100644 index 0000000..502eec6 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/TickUpdateEvent.java @@ -0,0 +1,6 @@ +package cc.novoline.events.events; + +import cc.novoline.events.Event; + +public class TickUpdateEvent implements Event { +} diff --git a/src/main/java/cc/novoline/events/events/ToggleStateEvent.java b/src/main/java/cc/novoline/events/events/ToggleStateEvent.java new file mode 100644 index 0000000..4f42b88 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/ToggleStateEvent.java @@ -0,0 +1,15 @@ +package cc.novoline.events.events; + +import cc.novoline.events.Event; + +public class ToggleStateEvent implements Event { + private final boolean stateFlag; + + public ToggleStateEvent(boolean flag) { + this.stateFlag = flag; +} + + public boolean isStateFlag() { + return this.stateFlag; +} +} diff --git a/src/main/java/cc/novoline/events/events/UpdateModelEvent.java b/src/main/java/cc/novoline/events/events/UpdateModelEvent.java new file mode 100644 index 0000000..3722f4b --- /dev/null +++ b/src/main/java/cc/novoline/events/events/UpdateModelEvent.java @@ -0,0 +1,25 @@ +package cc.novoline.events.events; + +import cc.novoline.events.Event; +import cc.novoline.utils.bends.ModelBendsPlayerBase; +import net.minecraft.entity.Entity; + +public class UpdateModelEvent implements Event { + private ModelBendsPlayerBase modelBendsPlayerBaseField; + private Entity trackedEntity; + + public UpdateModelEvent(Entity entity, ModelBendsPlayerBase modelBendsPlayerBase) { + this.modelBendsPlayerBaseField = modelBendsPlayerBase; + this.trackedEntity = entity; +} + + public ModelBendsPlayerBase getModelBendsPlayerBase() { + return this.modelBendsPlayerBaseField; +} + + public Entity getTrackedEntity4() { + return this.trackedEntity; +} + + public net.minecraft.entity.Entity getTrackedEntity() { return this.getTrackedEntity4(); } +} diff --git a/src/main/java/cc/novoline/events/events/WindowClickEvent.java b/src/main/java/cc/novoline/events/events/WindowClickEvent.java new file mode 100644 index 0000000..90ee511 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/WindowClickEvent.java @@ -0,0 +1,26 @@ +package cc.novoline.events.events; + +import cc.novoline.events.CancellableEvent; +import net.minecraft.client.multiplayer.PlayerControllerMPMode; +import net.minecraft.network.play.client.C0EPacketClickWindow; + +public class WindowClickEvent extends CancellableEvent { + private PlayerControllerMPMode playerControllerMPModeField; + private C0EPacketClickWindow c0EPacketClickWindowField; + + public C0EPacketClickWindow getWwB() { + return this.c0EPacketClickWindowField; +} + + public PlayerControllerMPMode getGrA() { + return this.playerControllerMPModeField; +} + + public WindowClickEvent(C0EPacketClickWindow packet, PlayerControllerMPMode playerControllerMPMode) { + this.c0EPacketClickWindowField = packet; + this.playerControllerMPModeField = playerControllerMPMode; +} + + public C0EPacketClickWindow getPacket() { return this.getWwB(); } + public PlayerControllerMPMode getMode() { return this.getGrA(); } +} diff --git a/src/main/java/cc/novoline/events/events/script/ScriptMoveEvent.java b/src/main/java/cc/novoline/events/events/script/ScriptMoveEvent.java new file mode 100644 index 0000000..e491fbc --- /dev/null +++ b/src/main/java/cc/novoline/events/events/script/ScriptMoveEvent.java @@ -0,0 +1,120 @@ +package cc.novoline.events.events.script; +import cc.novoline.events.Event; +import net.minecraft.util.MovementInput; + +import net.minecraft.util.MathHelper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.skidunion.security.SkidUnionAnnotation; + +public class ScriptMoveEvent implements Event { + private double cachedValue; + private double cachedValue2; + private double cachedValue3; + + @SkidUnionAnnotation + public double getZ() { + return this.cachedValue; +} + + @SkidUnionAnnotation + public void setY(double value) { + this.cachedValue2 = value; +} + + @SkidUnionAnnotation + public void setX(double value) { + this.cachedValue3 = value; +} + + public ScriptMoveEvent(double x, double y, double z) { + this.cachedValue3 = x; + this.cachedValue2 = y; + this.cachedValue = z; +} + + @SkidUnionAnnotation + public void setZ(double value) { + this.cachedValue = value; +} + + @SkidUnionAnnotation + public double getY() { + return this.cachedValue2; +} + + @SkidUnionAnnotation + public double getX() { + return this.cachedValue3; +} + + @SkidUnionAnnotation + public void setMoveSpeed(double speed) { + int intVal; + int intVal2; + double doubleVal; + double doubleVal2; + double doubleVal3; + double doubleVal4; + label71: { + Minecraft mcClient = Minecraft.getMinecraft(); + MovementInput movementInput = mcClient.thePlayer.getMovementInput(); + doubleVal = movementInput.getMoveForward(); + doubleVal2 = movementInput.getMoveStrafe(); + doubleVal3 = mcClient.thePlayer.rotationYaw; + if (doubleVal == 0.0) { + doubleVal4 = 90.0; + break label71; + } + + doubleVal4 = doubleVal; + + doubleVal4 = (doubleVal < 0.0) ? -45.0 : 45.0; + } + + double doubleVal5; + doubleVal5 = doubleVal4; + double doubleVal6; + intVal = (doubleVal6 = doubleVal - 0.0) == 0.0 ? 0 : (doubleVal6 < 0.0 ? -1 : 1); + label63: { + if (intVal == 0) { + if (doubleVal2 == 0.0) { + intVal = 0; + break label63; + } + } + + intVal = 1; + } + + int intVal3 = intVal; + double doubleVal7 = doubleVal; + doubleVal7 = doubleVal < 0.0 ? 180.0 : 0.0; + + label75: { + doubleVal3 += doubleVal7; + if (doubleVal2 < 0.0) { + doubleVal3 += doubleVal5; + break label75; + + } + + if (doubleVal2 > 0.0) { + doubleVal3 -= doubleVal5; + } + } + + intVal2 = intVal3; + + if (intVal2 != 0) { + doubleVal7 = Math.toRadians(doubleVal3); + this.setX(-(MathHelper.sin(doubleVal7) * speed)); + doubleVal7 = Math.toRadians(doubleVal3); + this.setZ(MathHelper.cos(doubleVal7) * speed); + return; + } + + this.setX(0.0); + this.setZ(0.0); +} +} diff --git a/src/main/java/cc/novoline/events/events/script/ScriptPacketEvent.java b/src/main/java/cc/novoline/events/events/script/ScriptPacketEvent.java new file mode 100644 index 0000000..c0a4941 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/script/ScriptPacketEvent.java @@ -0,0 +1,693 @@ +package cc.novoline.events.events.script; + +import cc.novoline.events.CancellableEvent; +import cc.novoline.events.Event; +import cc.novoline.events.State; +import cc.novoline.script.packet.ScriptC00PacketKeepAlive; +import cc.novoline.script.packet.ScriptC01PacketChatMessage; +import cc.novoline.script.packet.ScriptC02PacketUseEntity; +import cc.novoline.script.packet.ScriptC03PacketPlayer; +import cc.novoline.script.packet.ScriptC04PacketPlayerPosition; +import cc.novoline.script.packet.ScriptC05PacketPlayerLook; +import cc.novoline.script.packet.ScriptC06PacketPlayerPosLook; +import cc.novoline.script.packet.ScriptC0CPacketInput; +import cc.novoline.script.packet.ScriptC0EPacketClickWindow; +import cc.novoline.script.packet.ScriptC0FPacketConfirmTransaction; +import cc.novoline.script.packet.ScriptC13PacketPlayerAbilities; +import cc.novoline.script.packet.ScriptC18PacketSpectate; +import cc.novoline.script.packet.ScriptPacket; +import cc.novoline.script.packet.ScriptS08PacketPlayerPosLook; +import cc.novoline.script.util.RawScriptPacket; +import java.util.UUID; +import net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraft.network.play.client.C00PacketKeepAlive; +import net.minecraft.network.play.client.C04PacketPlayerPosition; +import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.network.play.client.C06PacketPlayerPosLook; +import net.minecraft.network.play.client.C05PacketPlayerLook; +import net.minecraft.network.play.client.C18PacketSpectate; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.client.C0CPacketInput; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.network.play.client.C0APacketAnimation; +import net.minecraft.network.play.client.C13PacketPlayerAbilities; +import net.minecraft.network.play.client.C0FPacketConfirmTransaction; +import net.minecraft.network.play.client.C0EPacketClickWindow; +import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.network.Packet; +import net.minecraft.network.play.client.C02PacketUseEntity$Action; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.Vec3; +import net.skidunion.security.SkidUnionAnnotation; + +public class ScriptPacketEvent extends CancellableEvent implements Event { + private final State stateField; + private static String[] e; + private Packet packetField; + + public static String[] getStringArrayValue() { + return e; +} + + public ScriptPacketEvent(Packet packet, State state) { + this.stateField = state; + this.packetField = packet; +} + + @SkidUnionAnnotation + public ScriptPacket getPacket() { + String[] stringArr = getStringArrayValue(); + boolean flag = this.packetField instanceof C04PacketPlayerPosition; + if (flag) { + return new ScriptC04PacketPlayerPosition((C04PacketPlayerPosition)this.packetField); + } + + flag = this.packetField instanceof C05PacketPlayerLook; + + if (flag) { + return new ScriptC05PacketPlayerLook((C05PacketPlayerLook)this.packetField); + } + + flag = this.packetField instanceof C06PacketPlayerPosLook; + + if (flag) { + return new ScriptC06PacketPlayerPosLook((C06PacketPlayerPosLook)this.packetField); + } + + flag = this.packetField instanceof C03PacketPlayer; + + if (flag) { + return new ScriptC03PacketPlayer((C03PacketPlayer)this.packetField); + } + + flag = this.packetField instanceof C0FPacketConfirmTransaction; + + if (flag) { + return new ScriptC0FPacketConfirmTransaction((C0FPacketConfirmTransaction)this.packetField); + } + + flag = this.packetField instanceof C02PacketUseEntity; + + if (flag) { + return new ScriptC02PacketUseEntity((C02PacketUseEntity)this.packetField); + } + + flag = this.packetField instanceof C00PacketKeepAlive; + + if (flag) { + return new ScriptC00PacketKeepAlive((C00PacketKeepAlive)this.packetField); + } + + flag = this.packetField instanceof C13PacketPlayerAbilities; + + if (flag) { + return new ScriptC13PacketPlayerAbilities((C13PacketPlayerAbilities)this.packetField); + } + + flag = this.packetField instanceof C0CPacketInput; + + if (stringArr == null) { + if (flag) { + return new ScriptC0CPacketInput((C0CPacketInput)this.packetField); + } + + flag = this.packetField instanceof C0EPacketClickWindow; + } + + if (stringArr == null) { + if (flag) { + return new ScriptC0EPacketClickWindow((C0EPacketClickWindow)this.packetField); + } + + flag = this.packetField instanceof C18PacketSpectate; + } + + if (stringArr == null) { + if (flag) { + return new ScriptC18PacketSpectate((C18PacketSpectate)this.packetField); + } + + flag = this.packetField instanceof S08PacketPlayerPosLook; + } + + if (stringArr == null) { + if (flag) { + return new ScriptS08PacketPlayerPosLook((S08PacketPlayerPosLook)this.packetField); + } + + flag = this.packetField instanceof C01PacketChatMessage; + } + + return (ScriptPacket)(flag ? new ScriptC01PacketChatMessage((C01PacketChatMessage)this.packetField) : new RawScriptPacket(this)); +} + + @SkidUnionAnnotation + public void setPacket(String text, Object... objectArray) { + int intVal; + java.lang.Object obj; + java.lang.Object obj2; + String[] stringArr = getStringArrayValue(); + Minecraft mcClient = Minecraft.getMinecraft(); + String[] stringArr2 = stringArr; + if (this.getStateB() == State.OUTGOING) { + String textStr = text; + byte byteVal = -1; + intVal = textStr.hashCode(); + + switch (intVal) { + case 1546828: + intVal = (textStr.equals("0x04") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 0; + if (stringArr2 == null) { + break; + } + case 1546846: + intVal = (textStr.equals("0x0F") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 1; + if (stringArr2 == null) { + break; + } + case 1546830: + intVal = (textStr.equals("0x06") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 2; + if (stringArr2 == null) { + break; + } + case 1546829: + intVal = (textStr.equals("0x05") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 3; + if (stringArr2 == null) { + break; + } + case 1546827: + intVal = (textStr.equals("0x03") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 4; + if (stringArr2 == null) { + break; + } + case 1546826: + intVal = (textStr.equals("0x02") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 5; + if (stringArr2 == null) { + break; + } + case 1546825: + intVal = (textStr.equals("0x01") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 6; + if (stringArr2 == null) { + break; + } + case 1546832: + intVal = (textStr.equals("0x08") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 7; + if (stringArr2 == null) { + break; + } + case 1546831: + intVal = (textStr.equals("0x07") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 8; + if (stringArr2 == null) { + break; + } + case 1546833: + intVal = (textStr.equals("0x09") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 9; + if (stringArr2 == null) { + break; + } + case 1546841: + intVal = (textStr.equals("0x0A") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 10; + if (stringArr2 == null) { + break; + } + case 1546842: + intVal = (textStr.equals("0x0B") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 11; + if (stringArr2 == null) { + break; + } + case 1546858: + intVal = (textStr.equals("0x13") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 12; + if (stringArr2 == null) { + break; + } + case 1546863: + intVal = (textStr.equals("0x18") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 13; + if (stringArr2 == null) { + break; + } + case 1546845: + intVal = (textStr.equals("0x0E") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 14; + if (stringArr2 == null) { + break; + } + case 1546843: + intVal = (textStr.equals("0x0C") ? 1 : 0); + + if (intVal != 0) { + byteVal = 15; + } + case 1546834: + case 1546835: + case 1546836: + case 1546837: + case 1546838: + case 1546839: + case 1546840: + case 1546844: + case 1546847: + case 1546848: + case 1546849: + case 1546850: + case 1546851: + case 1546852: + case 1546853: + case 1546854: + case 1546855: + case 1546856: + case 1546857: + case 1546859: + case 1546860: + case 1546861: + case 1546862: + } + + intVal = byteVal; + + label222: { + label328: { + label220: { + label329: { + label218: { + label330: { + label331: { + label332: { + label214: { + label333: { + label334: { + label211: { + switch (intVal) { + case 0: + Double doubleVal = (Double)objectArray[0]; + double doubleVal2 = doubleVal; + Double doubleVal3 = (Double)objectArray[1]; + double doubleVal9 = doubleVal3; + Double doubleVal4 = (Double)objectArray[2]; + double doubleVal10 = doubleVal4; + Boolean flag = (Boolean)objectArray[3]; + boolean flag11 = flag; + this.packetField = new C04PacketPlayerPosition(doubleVal2, doubleVal9, doubleVal10, flag11); + if (stringArr2 == null) { + return; + } + case 1: + switch (objectArray.length) { + case 0: + this.packetField = new C0FPacketConfirmTransaction(); + if (stringArr2 == null) { + break; + } + case 3: + Integer intVal2 = (Integer)objectArray[0]; + int intVal3 = intVal2; + short shortVal = (Short)objectArray[1]; + Boolean flag2 = (Boolean)objectArray[2]; + boolean flag12 = flag2; + this.packetField = new C0FPacketConfirmTransaction(intVal3, shortVal, flag12); + } + + if (stringArr2 == null) { + return; + } + case 2: + Double doubleVal5 = (Double)objectArray[0]; + double doubleVal6 = doubleVal5; + Double doubleVal7 = (Double)objectArray[1]; + double doubleVal11 = doubleVal7; + Double doubleVal8 = (Double)objectArray[2]; + double doubleVal12 = doubleVal8; + Float floatVal = (Float)objectArray[4]; + float floatVal15 = floatVal; + Float floatVal2 = (Float)objectArray[5]; + float floatVal16 = floatVal2; + Boolean flag3 = (Boolean)objectArray[6]; + boolean flag13 = flag3; + this.packetField = new C06PacketPlayerPosLook(doubleVal6, doubleVal11, doubleVal12, floatVal15, floatVal16, flag13); + if (stringArr2 == null) { + return; + } + case 3: + break; + case 4: + break label211; + case 5: + break label334; + case 6: + break label333; + case 7: + break label214; + case 8: + break label332; + case 9: + break label331; + case 10: + break label330; + case 11: + break label218; + case 12: + break label329; + case 13: + break label220; + case 14: + break label328; + case 15: + break label222; + default: + return; + } + + Float floatVal3 = (Float)objectArray[0]; + float floatVal4 = floatVal3; + Float floatVal5 = (Float)objectArray[1]; + float floatVal17 = floatVal5; + Boolean flag4 = (Boolean)objectArray[2]; + boolean flag14 = flag4; + this.packetField = new C05PacketPlayerLook(floatVal4, floatVal17, flag14); + + return; + + } + + int len = objectArray.length; + + if (len == 0) { + this.packetField = new C03PacketPlayer(); + return; + } + + len = objectArray.length; + + + if (len != 1) { + return; + } + + Boolean flag15 = (Boolean)objectArray[0]; + this.packetField = new C03PacketPlayer(flag15); + + return; + + } + + Entity entity = (Entity)objectArray[0]; + Object obj3 = objectArray[1]; + + if (obj3 instanceof C02PacketUseEntity$Action) { + this.packetField = new C02PacketUseEntity(entity, (C02PacketUseEntity$Action)objectArray[1]); + return; + } + + obj3 = objectArray[1]; + + + Vec3 vec = (Vec3)obj3; + this.packetField = new C02PacketUseEntity(entity, vec); + + return; + + } + + this.packetField = new C01PacketChatMessage((String)objectArray[0]); + + return; + + } + + switch (objectArray.length) { + case 0: + this.packetField = new C08PacketPlayerBlockPlacement(); + if (stringArr2 == null) { + break; + } + case 1: + this.packetField = new C08PacketPlayerBlockPlacement((ItemStack)objectArray[0]); + if (stringArr2 == null) { + break; + } + case 6: + BlockPos pos = (BlockPos)objectArray[0]; + Integer intVal4 = (Integer)objectArray[1]; + int intVal11 = intVal4; + ItemStack stack = (ItemStack)objectArray[2]; + Float floatVal6 = (Float)objectArray[3]; + float floatVal18 = floatVal6; + Float floatVal7 = (Float)objectArray[4]; + float floatVal19 = floatVal7; + Float floatVal8 = (Float)objectArray[5]; + float floatVal20 = floatVal8; + this.packetField = new C08PacketPlayerBlockPlacement(pos, intVal11, stack, floatVal18, floatVal19, floatVal20); + } + + + return; + + } + + int len2 = objectArray.length; + + if (len2 == 0) { + this.packetField = new C07PacketPlayerDigging(); + return; + } + + obj = objectArray; + + len2 = objectArray.length; + + + if (len2 != 3) { + return; + } + + obj = objectArray[0]; + + net.minecraft.network.play.client.C07PacketPlayerDigging$Action playerDigging$ActionPacket = (net.minecraft.network.play.client.C07PacketPlayerDigging$Action)obj; + BlockPos pos2 = (BlockPos)objectArray[1]; + EnumFacing facing = (EnumFacing)objectArray[2]; + this.packetField = new C07PacketPlayerDigging(playerDigging$ActionPacket, pos2, facing); + + return; + + } + + int len3 = objectArray.length; + + if (len3 == 0) { + this.packetField = new C09PacketHeldItemChange(); + return; + } + + len3 = objectArray.length; + + + if (len3 != 1) { + return; + } + + Integer intVal5 = (Integer)objectArray[0]; + this.packetField = new C09PacketHeldItemChange(intVal5); + + return; + + } + + this.packetField = new C0APacketAnimation(); + + return; + + } + + int len4 = objectArray.length; + + if (len4 == 0) { + this.packetField = new C0BPacketEntityAction(); + return; + } + + obj2 = objectArray; + + len4 = objectArray.length; + + + if (len4 != 1) { + return; + } + + obj2 = objectArray[0]; + + Entity entity2 = (Entity)obj2; + this.packetField = new C0BPacketEntityAction(entity2, (net.minecraft.network.play.client.C0BPacketEntityAction$Action)objectArray[1]); + + return; + + } + + Float floatVal9 = (Float)objectArray[0]; + float floatVal10 = floatVal9; + Float floatVal11 = (Float)objectArray[1]; + float floatVal21 = floatVal11; + Boolean flag5 = (Boolean)objectArray[2]; + boolean flag16 = flag5; + Boolean flag6 = (Boolean)objectArray[3]; + boolean flag17 = flag6; + Boolean flag7 = (Boolean)objectArray[4]; + boolean flag18 = flag7; + Boolean flag8 = (Boolean)objectArray[5]; + boolean flag19 = flag8; + this.packetField = new C13PacketPlayerAbilities(floatVal10, floatVal21, flag16, flag17, flag18, flag19); + + return; + + } + + if (objectArray.length == 0) { + this.packetField = new C18PacketSpectate(); + return; + } + + this.packetField = new C18PacketSpectate((UUID)objectArray[0]); + + return; + + } + + Integer intVal6 = (Integer)objectArray[0]; + int intVal7 = intVal6; + Integer intVal8 = (Integer)objectArray[1]; + int intVal12 = intVal8; + Integer intVal9 = (Integer)objectArray[2]; + int intVal13 = intVal9; + Integer intVal10 = (Integer)objectArray[3]; + int intVal14 = intVal10; + ItemStack stack2 = (ItemStack)objectArray[4]; + short shortVal2 = (Short)objectArray[5]; + this.packetField = new C0EPacketClickWindow(intVal7, intVal12, intVal13, intVal14, stack2, shortVal2); + + return; + + } + + Float floatVal12 = (Float)objectArray[0]; + float floatVal13 = floatVal12; + Float floatVal14 = (Float)objectArray[1]; + float floatVal22 = floatVal14; + Boolean flag9 = (Boolean)objectArray[2]; + boolean flag20 = flag9; + Boolean flag10 = (Boolean)objectArray[3]; + boolean flag21 = flag10; + this.packetField = new C0CPacketInput(floatVal13, floatVal22, flag20, flag21); + } +} + + public State getStateB() { + return this.stateField; +} + + public static void processStringArray(String[] args) { + e = args; +} + + static { + if (getStringArrayValue() != null) { + processStringArray(new String[5]); + } + } + + public net.minecraft.network.Packet getPacketField() { return this.packetField; } +} diff --git a/src/main/java/cc/novoline/events/events/script/ScriptRender2DEvent.java b/src/main/java/cc/novoline/events/events/script/ScriptRender2DEvent.java new file mode 100644 index 0000000..4941f82 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/script/ScriptRender2DEvent.java @@ -0,0 +1,25 @@ +package cc.novoline.events.events.script; + +import cc.novoline.events.Event; +import net.minecraft.client.gui.ScaledResolution; +import net.skidunion.security.SkidUnionAnnotation; + +public class ScriptRender2DEvent implements Event { + private final ScaledResolution scaledRes; + private final float cachedAngle; + + @SkidUnionAnnotation + public float getPartialTicks() { + return this.cachedAngle; +} + + public ScriptRender2DEvent(ScaledResolution scaledResolution, float partialTicks) { + this.scaledRes = scaledResolution; + this.cachedAngle = partialTicks; +} + + @SkidUnionAnnotation + public ScaledResolution getResolution() { + return this.scaledRes; +} +} diff --git a/src/main/java/cc/novoline/events/events/script/ScriptRender3DEvent.java b/src/main/java/cc/novoline/events/events/script/ScriptRender3DEvent.java new file mode 100644 index 0000000..c184081 --- /dev/null +++ b/src/main/java/cc/novoline/events/events/script/ScriptRender3DEvent.java @@ -0,0 +1,17 @@ +package cc.novoline.events.events.script; + +import cc.novoline.events.Event; +import net.skidunion.security.SkidUnionAnnotation; + +public class ScriptRender3DEvent implements Event { + private final float partialTicks; + + public ScriptRender3DEvent(float ticks) { + this.partialTicks = ticks; +} + + @SkidUnionAnnotation + public float getPartialTicks() { + return this.partialTicks; +} +} diff --git a/src/main/java/cc/novoline/events/type/GuiState.java b/src/main/java/cc/novoline/events/type/GuiState.java new file mode 100644 index 0000000..3237ade --- /dev/null +++ b/src/main/java/cc/novoline/events/type/GuiState.java @@ -0,0 +1,11 @@ +package cc.novoline.events.type; + +public enum GuiState { + CLICK, + RENDER, + RELEASE, + INITIAL, + CLOSE; + + private static final GuiState[] guiStateArray = new GuiState[]{GuiState.CLICK, RENDER, RELEASE, INITIAL, CLOSE}; +} diff --git a/src/main/java/cc/novoline/events/type/RenderEntityState.java b/src/main/java/cc/novoline/events/type/RenderEntityState.java new file mode 100644 index 0000000..439fb02 --- /dev/null +++ b/src/main/java/cc/novoline/events/type/RenderEntityState.java @@ -0,0 +1,8 @@ +package cc.novoline.events.type; + +public enum RenderEntityState { + PRE, + POST; + + private static final RenderEntityState[] renderEntityStateArray = new RenderEntityState[]{RenderEntityState.PRE, POST}; +} diff --git a/src/main/java/cc/novoline/events/type/State.java b/src/main/java/cc/novoline/events/type/State.java new file mode 100644 index 0000000..56ad102 --- /dev/null +++ b/src/main/java/cc/novoline/events/type/State.java @@ -0,0 +1,26 @@ +package cc.novoline.events.type; + +public enum State { + PRE, + POST; + + private static boolean b; + + static { + b(true); + } + private static final State[] stateArray = new State[]{PRE, State.POST}; + + public static boolean a() { + boolean flag = b(); + return !flag; +} + + public static boolean b() { + return b; +} + + public static void b(boolean flag) { + b = flag; +} +} diff --git a/src/main/java/cc/novoline/events/type/StepState.java b/src/main/java/cc/novoline/events/type/StepState.java new file mode 100644 index 0000000..61305b3 --- /dev/null +++ b/src/main/java/cc/novoline/events/type/StepState.java @@ -0,0 +1,8 @@ +package cc.novoline.events.type; + +public enum StepState { + PROCESS, + CONFIRM; + + private static final StepState[] stepStateArray = new StepState[]{PROCESS, StepState.CONFIRM}; +} diff --git a/src/main/java/cc/novoline/gui/alt/AltAccountEntry.java b/src/main/java/cc/novoline/gui/alt/AltAccountEntry.java new file mode 100644 index 0000000..c1a4521 --- /dev/null +++ b/src/main/java/cc/novoline/gui/alt/AltAccountEntry.java @@ -0,0 +1,750 @@ +package cc.novoline.gui.alt; + + +import net.minecraft.client.gui.Gui; +import net.minecraft.util.IMinecraftI; +import cc.novoline.Novoline; +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.gui.widget.AltRepositoryPanel; +import cc.novoline.gui.widget.AnimatedCheckWidget; +import cc.novoline.utils.EntityFakePlayer; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontFamilyPROFILES; +import cc.novoline.utils.notifications.NotificationManager; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.utils.shader.RoundedRectShader; +import cc.novoline.utils.shader.RoundedTextureShader; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.minecraft.MinecraftProfileTexture; +import com.mojang.authlib.minecraft.MinecraftSessionService; +import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type; +import com.mojang.authlib.properties.PropertyMap; +import fr.litarvan.openauth.microsoft.MicrosoftAuthResult; +import fr.litarvan.openauth.microsoft.MicrosoftAuthenticationException; +import fr.litarvan.openauth.microsoft.MicrosoftAuthenticator; +import fr.litarvan.openauth.microsoft.model.response.MinecraftProfile; +import java.awt.Color; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.Callable; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ForkJoinPool; +import java.util.function.Consumer; + + +import cc.novoline.utils.fonts.api.FontFamily; +import cc.novoline.utils.fonts.holders.FontFamilyPOSTERAMA; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import novo.cookie.CookieAuthenticator; +import org.jetbrains.annotations.NotNull; +import org.lwjgl.opengl.GL11; + +public class AltAccountEntry { + private String cachedText = null; + private float cachedAngle; + private AltAccountType altAccountTypeField; + private String cachedText2; + private AltRepositoryGUI altRepositoryGUIField; + private CookieAuthenticator cookieAuthenticatorField; + private boolean stateFlag; + private String cachedText3; + private String cachedText4; + private String cachedText5; +private long lastTimestamp; + private EntityFakePlayer entityFakePlayerField; + private String cachedText6; + private String cachedText7; + private String textValue; + + public AltAccountType getAltAccountTypeField() { + return this.altAccountTypeField; +} + + private boolean evaluateCheck(float value, float amount, AltRepositoryPanel altRepositoryPanel) { + if (value <= this.computeDouble(altRepositoryPanel)) { + return false; + } + + if (value >= (this.computeDouble(altRepositoryPanel) + 205.0)) { + return false; + } + + if (amount <= this.createAltAccountEntry(altRepositoryPanel)) { + return false; + } + + return amount < (this.createAltAccountEntry(altRepositoryPanel) + this.getFloatValue2()); +} + + private void evaluateCheck(@NotNull EntityFakePlayer entityFakePlayer, float value, float amount) { + Minecraft mcClient = Minecraft.getMinecraft(); + Gui.renderStep(value, amount, 8.0F, 8.0F, 8, 8, 23.0, 23.0, 64.0F, 64.0F); +} + + public void performAction() { + Minecraft mcClient = Minecraft.getMinecraft(); + GameProfile gameProfile = mcClient.session.getGameProfile(); + String textStr = gameProfile.getId().toString(); + this.textValue = textStr.replace("-", ""); + this.createList(mcClient.session.getGameProfile(), true); + Novoline novolineInst = Novoline.getInstance(); + AltRepositoryGUI altRepositoryGUI = novolineInst.getAltRepositoryGUI(); + altRepositoryGUI.performAction(); +} + + public void renderPanel(float value, float amount, AltRepositoryPanel altRepositoryPanel) { + java.lang.String msgText; + label75: { + AltAccountEntry altAccountEntry; + + label73: { + AltAccountEntry altAccountEntry2 = this; + float floatVal = value; + float floatVal2 = amount; + + if (!this.evaluateCheck(value, amount, altRepositoryPanel)) { + altAccountEntry = this; + + if (!this.stateFlag) { + break label73; + } + } + + altAccountEntry2 = this; + floatVal = this.cachedAngle; + floatVal2 = (1.0F - this.cachedAngle) * 0.02F; + + + altAccountEntry2.cachedAngle = floatVal + floatVal2; + + break label75; + + } + + altAccountEntry = this; + + altAccountEntry.cachedAngle = altAccountEntry.cachedAngle - this.cachedAngle * 0.02F; + } + + AltAccountEntry altAccountEntry3; + + label60: { + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal2 = this.computeDouble(altRepositoryPanel); + double doubleVal3 = this.createAltAccountEntry(altRepositoryPanel); + double doubleVal4 = this.getFloatValue2(); + double doubleVal5 = this.getFloatValue2() / 4.0F; + Color awtColor = new Color(25, 25, 25); + Color awtColor2 = new Color(15, 15, 15); + double doubleVal6 = this.cachedAngle; + Color awtColor3 = new Color(RenderUtils.interpolateColor(awtColor, awtColor2, doubleVal6)); + double[] doubleArr = altRepositoryPanel.getDoubleArrayValue(); + roundedTextureShader.applyUpdate2(doubleVal2, doubleVal3, 205.0, doubleVal4, doubleVal5, 3.0, awtColor3, doubleArr, true); + AltAccountEntry altAccountEntry4 = this; + + if (this.altAccountTypeField != AltAccountType.MICROSOFT) { + altAccountEntry3 = this; + + if (this.altAccountTypeField != AltAccountType.COOKIE) { + break label60; + } + } + + altAccountEntry4 = this; + + + double doubleVal = altAccountEntry4.computeDouble(altRepositoryPanel) + 191.0; + doubleVal2 = this.createAltAccountEntry(altRepositoryPanel) + 3.0; + double[] doubleArr2 = altRepositoryPanel.getDoubleArrayValue(); + RenderUtils.drawElement10(doubleVal, doubleVal2, 4.0F, 2.0F, doubleArr2); + } + + altAccountEntry3 = this; + + label50: { + + + if (altAccountEntry3.cookieAuthenticatorField != null) { + CookieAuthenticator cookieAuthenticator = this.cookieAuthenticatorField; + msgText = cookieAuthenticator.getErrorMessage(); + + if (msgText != null) { + Novoline novolineInst = Novoline.getInstance(); + NotificationManager notifManager = novolineInst.getNotificationManager(); + String textStr = "Cookie Login"; + CookieAuthenticator cookieAuthenticator2 = this.cookieAuthenticatorField; + String msgText2 = cookieAuthenticator2.getErrorMessage(); + notifManager.pop(textStr, msgText2, NotificationType.ERROR); + CookieAuthenticator cookieAuthenticator3 = this.cookieAuthenticatorField; + cookieAuthenticator3.setErrorMessage(null); + } + } + + altAccountEntry3 = this; + + + msgText = altAccountEntry3.cachedText; + + if (msgText == null) { + break label50; + } + + Novoline novolineInst2 = Novoline.getInstance(); + NotificationManager notifManager2 = novolineInst2.getNotificationManager(); + String textStr2 = "Cookie Login"; + String textStr3 = this.cachedText; + NotificationType notificationType = NotificationType.INFO; + notifManager2.pop(textStr2, textStr3, notificationType); + altAccountEntry3 = this; + + altAccountEntry3.cachedText = null; + } +} + + public double computeDouble(AltRepositoryPanel altRepositoryPanel) { + AltRepositoryGUI altRepositoryGUI = altRepositoryPanel.getParent(); + double doubleVal = altRepositoryGUI.getCachedValue3() - 200.0; + AltRepositoryGUI altRepositoryGUI2 = altRepositoryPanel.getParent(); + return doubleVal - altRepositoryGUI2.getScrollOffset() - 5.0; +} + + public boolean isStateFlag() { + return this.stateFlag; +} + + public List createList(FontRenderer font, String text) { + int width; + ArrayList itemList = new ArrayList(); + StringBuilder sb = new StringBuilder(); + float floatVal = 0.0F; + char[] charArr = text.toCharArray(); + int len = charArr.length; + int intVal = 0; + + while (true) { + if (intVal < len) { + char ch = charArr[intVal]; + StringBuilder sb2 = new StringBuilder().append(ch); + String textStr7 = ""; + String textStr = sb2.append(textStr7).toString(); + float floatVal2; + width = (floatVal2 = floatVal + font.stringWidth(textStr) - 140.0F) == 0.0F ? 0 : (floatVal2 < 0.0F ? -1 : 1); + + label35: { + label34: { + if (width < 0) { + break label34; + } + + StringBuilder sb3 = new StringBuilder(); + String textStr2 = sb.toString(); + sb3 = sb3.append(textStr2); + String textStr3 = sb3.append(ch).toString(); + itemList.add(textStr3); + + sb = new StringBuilder(ch); + floatVal = 0.0F; + break label35; + } + + sb.append(ch); + } + + sb2 = new StringBuilder(); + sb2 = sb2.append(ch); + textStr7 = ""; + String textStr4 = sb2.append(textStr7).toString(); + floatVal += font.stringWidth(textStr4); + intVal++; + continue; + } + + String textStr5 = sb.toString(); + width = (textStr5.isEmpty() ? 1 : 0); + break; + } + + if (width == 0) { + String textStr6 = sb.toString(); + itemList.add(textStr6); + } + + int size2 = itemList.size(); + int intVal2 = Math.max(0, size2); + return itemList.subList(0, intVal2); +} + + public AltAccountEntry createAltAccountEntry(AltAccountType altAccountType) { + this.altAccountTypeField = altAccountType; + return this; +} + + public double createAltAccountEntry(AltRepositoryPanel altRepositoryPanel) { + cc.novoline.gui.alt.AltAccountEntry altAccountEntry; + float floatVal = 0.0F; + AltRepositoryGUI altRepositoryGUI = this.altRepositoryGUIField; + Iterator iter = altRepositoryGUI.getIterator6FunctionHelper2().iterator(); + + while (true) { + label24: + if (iter.hasNext()) { + AltAccountEntry altAccountEntry2 = (AltAccountEntry)iter.next(); + altAccountEntry = altAccountEntry2; + + if (altAccountEntry2 == this) { + break label24; + } + + floatVal += altAccountEntry2.getFloatValue2() + 5.0F; + + continue; + } + + altAccountEntry = this; + break; + } + + AltRepositoryGUI altRepositoryGUI2 = altAccountEntry.altRepositoryGUIField; + double doubleVal = altRepositoryGUI2.getCachedValue4() + 12.0 + floatVal; + AnimatedCheckWidget animatedCheckWidget = altRepositoryPanel.getVjD(); + return doubleVal - animatedCheckWidget.getFloatValue(); +} + + private void invokeCallback(Minecraft minecraft, JsonObject jsonObject) { + JsonElement jsonElement = jsonObject.get("username"); + String textStr = jsonElement.getAsString(); + JsonElement jsonElement2 = jsonObject.get("uuid"); + String textStr2 = jsonElement2.getAsString(); + JsonElement jsonElement3 = jsonObject.get("token"); + minecraft.session = new AltAccountTokenHelper(textStr, textStr2, jsonElement3.getAsString(), "mojang"); + StringBuilder sb = new StringBuilder(); + sb = sb.append("Logged in as "); + String textStr3 = minecraft.session.getCachedText(); + this.cachedText = sb.append(textStr3).toString(); +} + + private void invokeCallback2(double value, double amount, float partialTicks) { + TextureManager texManager = Minecraft.getMinecraft().getTextureManager(); + ResourceLocation resLoc = this.entityFakePlayerField.getResourceLocation(); + texManager.bindTexture(resLoc); + Gui.renderStep(value - 2.5, amount - 4.0, 8.0F, 8.0F, 8, 8, partialTicks + 5.0F, partialTicks + 5.0F, 64.0F, 64.0F); +} + + public String getCachedText5() { + return this.cachedText5; +} + + public AltAccountEntry createAltAccountEntry2(String text) { + this.cachedText4 = text; + return this; +} + + public AltAccountEntry createAltAccountEntry(String text) { + this.cachedText5 = text; + return this; +} + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb = sb.append("AltEntity{, customName='"); + String textStr = this.cachedText5; + sb = sb.append(textStr).append('\''); + sb = sb.append(", description='"); + textStr = this.cachedText2; + sb = sb.append(textStr).append('\''); + sb = sb.append(", store="); + AltAccountType altAccountType = this.altAccountTypeField; + sb = sb.append(altAccountType).append(", username='"); + textStr = this.cachedText4; + sb = sb.append(textStr).append('\''); + sb = sb.append(", refreshToken='"); + textStr = this.cachedText3; + sb = sb.append(textStr).append('\''); + return sb.append('}').toString(); +} + + public AltAccountEntry resolveAltAccountEntry2(String text) { + this.cachedText7 = text; + return this; +} + + public static AltAccountEntry createList(AltRepositoryGUI altRepositoryGUI, NBTTagCompound nbt) { + AltAccountEntry altAccountEntry = new AltAccountEntry(altRepositoryGUI); + boolean flag = nbt.checkString("custom_name"); + if (flag) { + altAccountEntry = altAccountEntry.createAltAccountEntry(nbt.getString("custom_name")); + } + + flag = nbt.checkString("description"); + + if (flag) { + altAccountEntry = altAccountEntry.withCachedText2(nbt.getString("description")); + } + + flag = nbt.checkString("cookie"); + + if (flag) { + altAccountEntry = altAccountEntry.resolveAltAccountEntry2(nbt.getString("cookie")); + } + + flag = nbt.checkString("refresh_token"); + + if (flag) { + altAccountEntry = altAccountEntry.withCachedText3(nbt.getString("refresh_token")); + } + + flag = nbt.checkString("uuid"); + + if (flag) { + altAccountEntry = altAccountEntry.resolveAltAccountEntry(nbt.getString("uuid")); + } + + String textStr = "username"; + AltAccountEntry altAccountEntry2 = altAccountEntry.createAltAccountEntry2(nbt.getString(textStr)); + textStr = "store"; + return altAccountEntry2.createAltAccountEntry(AltAccountType.valueOf(nbt.getString(textStr))); +} + + + + public float getFloatValue2() { + if (this.cachedText2 != null) { + FontFamily fontFam = FontFamilyPOSTERAMA.FAMILY; + List itemList = this.createList(fontFam.ofSize(19), this.cachedText2); + return 25 + itemList.size() * 10; + } else { + return 30.0F; + } +} + + void updateHelper2() throws MicrosoftAuthenticationException { + Minecraft mcClient; + label23: { + label22: { + mcClient = Minecraft.getMinecraft(); + + switch (AltAccountTypeSwitchMap.SWITCH_MAP[this.altAccountTypeField.ordinal()]) { + case 1: + String textStr2 = this.cachedText4; + mcClient.session = new AltAccountTokenHelper(textStr2, UUID.randomUUID().toString(), "gastgay", "minecraft"); + this.performAction(); + Novoline novolineInst = Novoline.getInstance(); + NotificationManager notifManager = novolineInst.getNotificationManager(); + StringBuilder sb = new StringBuilder(); + sb = sb.append("Username: "); + textStr2 = mcClient.session.getCachedText(); + String textStr3 = sb.append(textStr2).toString(); + NotificationType notificationType = NotificationType.INFO; + notifManager.pop("Cracked Login", textStr3, notificationType); + break; + case 2: + break label22; + case 3: + break label23; + default: + return; + } + + + + return; + + } + + this.getCompletableFuture().whenCompleteAsync($lambdaCapture$0(this, mcClient)); + + return; + + } + + this.cookieAuthenticatorField = new CookieAuthenticator(); + CookieAuthenticator cookieAuthenticator = this.cookieAuthenticatorField; + String textStr = this.cachedText7; + Consumer consumer = $lambdaCapture$1(this, mcClient); + cookieAuthenticator.authenticateAsync(textStr, consumer); +} + + private CompletableFuture getCompletableFuture() { + return CompletableFuture.supplyAsync(this::supplyMicrosoftAuthResult, ForkJoinPool.commonPool()); +} + + private MicrosoftAuthResult supplyMicrosoftAuthResult() { + MicrosoftAuthenticator microsoftAuthenticator = new MicrosoftAuthenticator(); + MicrosoftAuthResult microsoftAuthResult = null; + + try { + microsoftAuthResult = microsoftAuthenticator.loginWithRefreshToken(this.cachedText3); + } catch (MicrosoftAuthenticationException ex) { + } + + return microsoftAuthResult; +} + + private ResourceLocation invokeCallback3(Minecraft minecraft, MinecraftProfileTexture minecraftProfileTexture, GameProfile gameProfile) throws Exception { + return minecraft.getSkinManager().updateState(minecraftProfileTexture, Type.SKIN, ((IMinecraftI) (($a0, $a1, $a2) -> { this.createList(gameProfile, ((net.minecraft.util.ResourceLocation) $a1)); }))); +} + + public AltAccountEntry withCachedText2(String text) { + this.cachedText2 = text; + return this; +} + + public String getCachedText4() { + return this.cachedText4; +} + + public AltAccountEntry(AltRepositoryGUI altRepositoryGUI) { + this.altRepositoryGUIField = altRepositoryGUI; + this.entityFakePlayerField = new EntityFakePlayer(new GameProfile(UUID.randomUUID(), this.cachedText4), null); +} + + private void invokeCallback4(Minecraft minecraft, MicrosoftAuthResult microsoftAuthResult, Throwable throwable) { + if (microsoftAuthResult == null) { + return; + } + + MinecraftProfile minecraftProfile = microsoftAuthResult.getProfile(); + String nameStr = minecraftProfile.getName(); + MinecraftProfile minecraftProfile2 = microsoftAuthResult.getProfile(); + minecraft.session = new AltAccountTokenHelper(nameStr, minecraftProfile2.getId(), microsoftAuthResult.getAccessToken(), "minecraft"); + Novoline novolineInst = Novoline.getInstance(); + NotificationManager notifManager = novolineInst.getNotificationManager(); + StringBuilder sb = new StringBuilder().append("Logged in as "); + minecraftProfile = microsoftAuthResult.getProfile(); + String nameStr2 = minecraftProfile.getName(); + String textStr = sb.append(nameStr2).toString(); + NotificationType notificationType = NotificationType.INFO; + notifManager.pop("Microsoft Login", textStr, notificationType); + + this.performAction(); +} + + public NBTBase getNBTBase() { + NBTTagCompound nbtTag = new NBTTagCompound(); + String textStr = this.cachedText5; + if (this.cachedText5 != null) { + nbtTag.setString("custom_name", this.cachedText5); + } + + textStr = this.cachedText2; + + if (textStr != null) { + String textStr2 = "description"; + String textStr8 = this.cachedText2; + nbtTag.setString(textStr2, textStr8); + } + + textStr = this.cachedText4; + + if (textStr != null) { + String textStr3 = "username"; + String textStr9 = this.cachedText4; + nbtTag.setString(textStr3, textStr9); + } + + textStr = this.cachedText3; + + if (textStr != null) { + String textStr4 = "refresh_token"; + String textStr10 = this.cachedText3; + nbtTag.setString(textStr4, textStr10); + } + + textStr = this.cachedText7; + + if (textStr != null) { + String textStr5 = "cookie"; + String textStr11 = this.cachedText7; + nbtTag.setString(textStr5, textStr11); + } + + textStr = this.textValue; + + if (textStr != null) { + String textStr6 = "uuid"; + String textStr12 = this.textValue; + nbtTag.setString(textStr6, textStr12); + } + + String textStr7 = "store"; + String textStr13 = this.altAccountTypeField.toString(); + nbtTag.setString(textStr7, textStr13); + return nbtTag; +} + + public String getCachedText2() { + return this.cachedText2; +} + + public void handleFloat(float value, float amount, int index, AltRepositoryPanel altRepositoryPanel) { + int intVal = (this.evaluateCheck(value, amount, altRepositoryPanel) ? 1 : 0); + if (intVal == 0) { + return; + } + + intVal = index; + + if (intVal != 0) { + return; + } + + if (System.currentTimeMillis() - this.lastTimestamp - 250L < 0L) { + try { + this.updateHelper2(); + } catch (MicrosoftAuthenticationException ex) { + ex.printStackTrace(); + } + } + + boolean flag = !this.stateFlag; + + this.stateFlag = flag; + this.lastTimestamp = System.currentTimeMillis(); +} + + public void createList(GameProfile gameProfile, ResourceLocation location) { + Minecraft mcClient = Minecraft.getMinecraft(); + this.entityFakePlayerField = new EntityFakePlayer(gameProfile, location); + mcClient.getRenderManager().cacheActiveRenderInfo(this.entityFakePlayerField.worldObj, mcClient.fontRendererObj, this.entityFakePlayerField, this.entityFakePlayerField, mcClient.gameSettings, 0.0F); +} + + public void createList(GameProfile gameProfile, boolean flag) { + Minecraft mcClient; + this.createList(gameProfile, null); + mcClient = Minecraft.getMinecraft(); + PropertyMap propertyMap = gameProfile.getProperties(); + propertyMap.clear(); + label18: { + if (flag) { + PropertyMap propertyMap2 = gameProfile.getProperties(); + propertyMap = mcClient.obtainPropertyMap(); + propertyMap2.putAll(propertyMap); + break label18; + } + + PropertyMap propertyMap3 = gameProfile.getProperties(); + GameProfile gameProfile2 = new AltAccountTokenHelper("pidor", this.textValue, "", "minecraft").getGameProfile(); + propertyMap = mcClient.applyFlag(gameProfile2); + propertyMap3.putAll(propertyMap); + } + + MinecraftSessionService minecraftSessionService = mcClient.getSessionService(); + Map itemMap = minecraftSessionService.getTextures(gameProfile, false); + Type type = Type.SKIN; + MinecraftProfileTexture minecraftProfileTexture = (MinecraftProfileTexture)itemMap.get(type); + if (minecraftProfileTexture != null) { + Callable callable = $lambdaCapture$3(this, mcClient, minecraftProfileTexture, gameProfile); + mcClient.addScheduledTask(callable); + } +} + + public void createAltAccountEntry2(AltRepositoryPanel altRepositoryPanel) { + cc.novoline.gui.alt.AltAccountType altAccountType; + cc.novoline.gui.alt.AltAccountType altAccountType2; + FontFamily fontFam = FontFamilyPOSTERAMA.FAMILY; + FontRenderer font = fontFam.ofSize(23); + String textStr2 = this.cachedText5; + double doubleVal2 = this.computeDouble(altRepositoryPanel) + 33.0; + double doubleVal3 = this.createAltAccountEntry(altRepositoryPanel) + 3.0; + int intVal = (Minecraft.getMinecraft().session.getCachedText().equals(this.cachedText4) ? 1 : 0); + if (intVal != 0) { + Color awtColor = new Color(0, 123, 234); + intVal = awtColor.getRGB(); + } else { + intVal = -1; + } + + font.drawString(textStr2, doubleVal2, doubleVal3, intVal, true); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + double doubleVal = this.computeDouble(altRepositoryPanel) + 3.0; + double doubleVal4 = this.createAltAccountEntry(altRepositoryPanel) + 2.5; + float floatVal = 25.0F; + RoundedRectShader.getRoundedRectShader().drawElement(doubleVal, doubleVal4, floatVal, floatVal, floatVal, 1.5, 1.0F, new float[]{0.0F, 0.0F, 1920.0F, 1080.0F}, ((Runnable) (() -> this.invokeCallback2(doubleVal, doubleVal4, floatVal)))); + AltAccountEntry altAccountEntry = this; + if (this.cachedText2 != null) { + double doubleVal5 = this.createAltAccountEntry(altRepositoryPanel) + 20.0; + FontFamily fontFam2 = FontFamilyPOSTERAMA.FAMILY; + List itemList = this.createList(fontFam2.ofSize(19), this.cachedText2); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + String textStr = (String)iter.next(); + fontFam = FontFamilyPOSTERAMA.FAMILY; + FontRenderer font2 = fontFam.ofSize(19); + StringBuilder sb = new StringBuilder(); + EnumChatFormatting enumChatFormatting = EnumChatFormatting.ITALIC; + StringBuilder sb2 = sb.append(enumChatFormatting); + textStr2 = sb2.append(textStr).toString(); + doubleVal2 = this.computeDouble(altRepositoryPanel) + 33.0; + Color awtColor2 = new Color(160, 160, 160); + intVal = awtColor2.getRGB(); + font2.drawString(textStr2, doubleVal2, doubleVal5, intVal, true); + doubleVal5 += 10.0; + + } + } + + altAccountEntry = this; + + altAccountType = altAccountEntry.altAccountTypeField; + altAccountType2 = AltAccountType.COOKIE; + + if (altAccountEntry.altAccountTypeField == AltAccountType.COOKIE) { + fontFam = FontFamilyPROFILES.FAMILY; + FontRenderer font3 = fontFam.ofSize(35); + textStr2 = "C"; + doubleVal2 = this.computeDouble(altRepositoryPanel) + 173.0; + doubleVal3 = this.createAltAccountEntry(altRepositoryPanel) + 3.5; + Color awtColor3 = new Color(250, 177, 83); + intVal = awtColor3.getRGB(); + font3.drawString(textStr2, doubleVal2, doubleVal3, intVal, true); + return; + } + + altAccountType = this.altAccountTypeField; + altAccountType2 = AltAccountType.CRACKED; + + if (altAccountType == altAccountType2) { + fontFam = FontFamilyPROFILES.FAMILY; + FontRenderer font4 = fontFam.ofSize(40); + textStr2 = "D"; + doubleVal2 = this.computeDouble(altRepositoryPanel) + 189.5; + doubleVal3 = this.createAltAccountEntry(altRepositoryPanel) + 3.5; + Color awtColor4 = new Color(172, 82, 220); + Color awtColor5 = awtColor4.darker(); + intVal = awtColor5.getRGB(); + font4.drawString(textStr2, doubleVal2, doubleVal3, intVal, true); + } +} + + public AltAccountEntry resolveAltAccountEntry(String text) { + this.textValue = text; + this.createList(Minecraft.getMinecraft().session.getGameProfile(), false); + return this; +} + + public AltAccountEntry withCachedText3(String text) { + this.cachedText3 = text; + return this; +} + + private static java.util.function.BiConsumer $lambdaCapture$0(AltAccountEntry $c0, net.minecraft.client.Minecraft $c1) { return ($a0, $a1) -> $c0.invokeCallback4($c1, ((fr.litarvan.openauth.microsoft.MicrosoftAuthResult) $a0), ((Throwable) $a1)); } + private static java.util.function.Consumer $lambdaCapture$1(AltAccountEntry $c0, net.minecraft.client.Minecraft $c1) { return ($a0) -> $c0.invokeCallback($c1, ((com.google.gson.JsonObject) $a0)); } + private static java.util.concurrent.Callable $lambdaCapture$3(AltAccountEntry $c0, net.minecraft.client.Minecraft $c1, com.mojang.authlib.minecraft.MinecraftProfileTexture $c2, com.mojang.authlib.GameProfile $c3) { return () -> $c0.invokeCallback3($c1, $c2, $c3); } +} diff --git a/src/main/java/cc/novoline/gui/alt/AltAccountTokenHelper.java b/src/main/java/cc/novoline/gui/alt/AltAccountTokenHelper.java new file mode 100644 index 0000000..ba648f4 --- /dev/null +++ b/src/main/java/cc/novoline/gui/alt/AltAccountTokenHelper.java @@ -0,0 +1,55 @@ +package cc.novoline.gui.alt; + +import com.mojang.authlib.GameProfile; +import com.mojang.util.UUIDTypeAdapter; +import java.util.UUID; +import net.minecraft.util.Session$Type; + +public class AltAccountTokenHelper { + private final Session$Type session$TypeField; + private final String cachedText; + private final String cachedText2; + private final String cachedText3; + + public String getCachedText2() { + return this.cachedText2; +} + + public String getTextValue() { + StringBuilder sb = new StringBuilder(); + sb = sb.append("token:"); + String textStr = this.cachedText2; + sb = sb.append(textStr).append(":"); + textStr = this.cachedText3; + return sb.append(textStr).toString(); +} + + public AltAccountTokenHelper(String text, String str, String value, String name) { + this.cachedText = text; + this.cachedText3 = str; + this.cachedText2 = value; + this.session$TypeField = Session$Type.setSessionType(name); +} + + public Session$Type getType() { + return this.session$TypeField; +} + + public GameProfile getGameProfile() { + try { + String textStr = this.getCachedText3(); + UUID uUID = UUIDTypeAdapter.fromString(textStr); + return new GameProfile(uUID, this.cachedText); + } catch (IllegalArgumentException ex) { + return new GameProfile(null, this.cachedText); + } +} + + public String getCachedText3() { + return this.cachedText3; +} + + public String getCachedText() { + return this.cachedText; +} +} diff --git a/src/main/java/cc/novoline/gui/alt/AltAccountType.java b/src/main/java/cc/novoline/gui/alt/AltAccountType.java new file mode 100644 index 0000000..c8ad2e1 --- /dev/null +++ b/src/main/java/cc/novoline/gui/alt/AltAccountType.java @@ -0,0 +1,7 @@ +package cc.novoline.gui.alt; + +public enum AltAccountType { + CRACKED, + MICROSOFT, + COOKIE; +} diff --git a/src/main/java/cc/novoline/gui/alt/AltAccountTypeSwitchMap.java b/src/main/java/cc/novoline/gui/alt/AltAccountTypeSwitchMap.java new file mode 100644 index 0000000..fe6beba --- /dev/null +++ b/src/main/java/cc/novoline/gui/alt/AltAccountTypeSwitchMap.java @@ -0,0 +1,22 @@ +package cc.novoline.gui.alt; + +public class AltAccountTypeSwitchMap { + static final int[] SWITCH_MAP = new int[AltAccountType.values().length]; + + static { + try { + SWITCH_MAP[AltAccountType.CRACKED.ordinal()] = 1; + } catch (NoSuchFieldError noSuchFieldError) { + } + + try { + SWITCH_MAP[AltAccountType.MICROSOFT.ordinal()] = 2; + } catch (NoSuchFieldError noSuchFieldError2) { + } + + try { + SWITCH_MAP[AltAccountType.COOKIE.ordinal()] = 3; + } catch (NoSuchFieldError noSuchFieldError3) { + } + } +} diff --git a/src/main/java/cc/novoline/gui/alt/AltActionButton.java b/src/main/java/cc/novoline/gui/alt/AltActionButton.java new file mode 100644 index 0000000..049ebe4 --- /dev/null +++ b/src/main/java/cc/novoline/gui/alt/AltActionButton.java @@ -0,0 +1,191 @@ +package cc.novoline.gui.alt; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.shader.RoundedTextureShader; +import java.awt.Color; +import cc.novoline.viaversion.GuiMultiplayerViaHelper; + +import cc.novoline.utils.fonts.api.FontFamily; +import cc.novoline.utils.fonts.holders.FontFamilyPOSTERAMA; +import net.minecraft.client.audio.SoundSupport; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.SoundHandler; +import net.minecraft.util.ResourceLocation; + +public class AltActionButton { + private double cachedValue; + private double doubleValue; + private boolean stateFlag; + private String cachedText; + private int stateTicks; + private double cachedValue2; + private double cachedValue3; + private int stateTicks2; + + public void applyUpdate(float value, float amount) { + this.doubleValue = value; + this.cachedValue3 = amount; +} + + public void renderPanel(Minecraft minecraft, int value, int index, float amount) { + int intVal; + label51: { + label54: { + if (value < this.doubleValue) { + break label54; + } + + if (index < this.cachedValue3) { + break label54; + } + + if (value >= (this.doubleValue + this.cachedValue2)) { + break label54; + } + + if (index < (this.cachedValue3 + this.cachedValue)) { + intVal = 1; + break label51; + } + } + + intVal = 0; + } + + label30: { + this.stateFlag = (boolean)((intVal) != 0); + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal5 = (float)this.doubleValue; + double doubleVal = (float)this.cachedValue3; + double doubleVal2 = this.cachedValue2; + double doubleVal3 = this.cachedValue; + double doubleVal4 = amount; + Color awtColor3 = new Color(this.stateTicks); + roundedTextureShader.drawRoundedRect(doubleVal5, doubleVal, doubleVal2, doubleVal3, doubleVal4, 3.5, awtColor3, false); + AltActionButton altActionButton = this; + + if (!this.stateFlag) { + break label30; + } + + altActionButton = this; + + + Color awtColor = new Color(this.stateTicks2); + Color awtColor2 = awtColor.brighter(); + altActionButton.stateTicks2 = awtColor2.getRGB(); + } + + FontFamily fontFam = FontFamilyPOSTERAMA.FAMILY; + FontRenderer font = fontFam.ofSize(20); + String textStr = this.cachedText; + double doubleVal6 = (float)this.doubleValue + this.cachedValue2 / 2.0; + String textStr2 = this.cachedText; + doubleVal6 = doubleVal6 - font.stringWidth(textStr2) / 2 + 2.0; + double doubleVal7 = (float)this.cachedValue3 + this.cachedValue / 2.0; + doubleVal7 -= font.getHeight() / 2; + int ticks = this.stateTicks2; + font.drawString(textStr, doubleVal6, doubleVal7, ticks, 1.5F); +} + + public void applyUpdate2(int value) { + this.stateTicks = value; +} + + public void handleGuiAction(double value) { + this.doubleValue = value; +} + + public AltActionButton(int value, int index, int count, int amount, String text) { + this.stateTicks2 = Color.WHITE.getRGB(); + this.doubleValue = value; + this.cachedValue3 = index; + this.cachedValue2 = count; + this.cachedValue = amount; + this.cachedText = text; +} + + public boolean applyUpdate(int value, int index) { + if (value < this.doubleValue) { + return false; + } + + if (index < this.cachedValue3) { + return false; + } + + if (value >= (this.doubleValue + this.cachedValue2)) { + return false; + } + + return index < (this.cachedValue3 + this.cachedValue); +} + + public void handleGuiAction(int value) { + this.stateTicks2 = value; +} + + public void performAction() { + SoundHandler soundHandler = Minecraft.getMinecraft().getSoundHandler(); + SoundSupport soundSupport = SoundSupport.resolveSoundSupport3(new ResourceLocation("gui.button.press"), 1.0F); + soundHandler.playSound(soundSupport); +} + + public void renderElement(Minecraft minecraft, int value, int index, float amount, Color color, Color color2) { + int intVal; + label41: { + label44: { + if (value < this.doubleValue) { + break label44; + } + + if (index < this.cachedValue3) { + break label44; + } + + if (value >= (this.doubleValue + this.cachedValue2)) { + break label44; + } + + if (index < (this.cachedValue3 + this.cachedValue)) { + intVal = 1; + break label41; + } + } + + intVal = 0; + } + + this.stateFlag = (boolean)((intVal) != 0); + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal = (float)this.doubleValue; + double doubleVal2 = (float)this.cachedValue3; + double doubleVal3 = this.cachedValue2; + double doubleVal4 = this.cachedValue; + double doubleVal5 = amount; + roundedTextureShader.drawRoundedRect(doubleVal, doubleVal2, doubleVal3, doubleVal4, doubleVal5, 4.0, color, false); + if (this.stateFlag) { + color2 = color2.brighter(); + } + + FontFamily fontFam = FontFamilyPOSTERAMA.FAMILY; + FontRenderer font = fontFam.ofSize(20); + String textStr = this.cachedText; + doubleVal2 = (float)this.doubleValue + this.cachedValue2 / 2.0; + doubleVal3 = (float)this.cachedValue3 + this.cachedValue / 2.0; + doubleVal3 -= font.getHeight() / 2; + int color3 = color2.getRGB(); + font.drawCenteredString(textStr, doubleVal2, doubleVal3, color3, true); +} + + public String getCachedText() { + return this.cachedText; +} + + public void applyUpdate2(double value) { + this.cachedValue3 = value; +} + + public void applyUpdate2(String text) { + this.cachedText = text; +} +} diff --git a/src/main/java/cc/novoline/gui/alt/AltSortMode.java b/src/main/java/cc/novoline/gui/alt/AltSortMode.java new file mode 100644 index 0000000..47d4158 --- /dev/null +++ b/src/main/java/cc/novoline/gui/alt/AltSortMode.java @@ -0,0 +1,19 @@ +package cc.novoline.gui.alt; + + +public enum AltSortMode { + MOST_RECENT("Most Recent"), + AVERAGE_BAN_TIME("AVG Playtime"), + SELF_ONLY("Self Only"), + ALL("All"); + + private final String cachedText; + + public String getCachedText() { + return this.cachedText; +} + + AltSortMode(String text) { + this.cachedText = text; +} +} diff --git a/src/main/java/cc/novoline/gui/alt/AltToastNotification.java b/src/main/java/cc/novoline/gui/alt/AltToastNotification.java new file mode 100644 index 0000000..1df7f0b --- /dev/null +++ b/src/main/java/cc/novoline/gui/alt/AltToastNotification.java @@ -0,0 +1,200 @@ +package cc.novoline.gui.alt; + +import cc.novoline.gui.screen.login.GuiLogin; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontFamilyPOPPIN; +import cc.novoline.utils.shader.RoundedTextureShader; +import java.awt.Color; +import cc.novoline.utils.fonts.api.FontFamily; +import org.apache.commons.lang3.StringUtils; + +public class AltToastNotification { + private boolean stateFlag; + private double doubleValue; + private double cachedValue; + private TimerUtil timer; + private static boolean f; + private String cachedText; + private double cachedValue2; + final GuiLogin guiLoginField; + private double cachedValue3; + + public static String createString(AltToastNotification altToastNotification, String text) { + return altToastNotification.cachedText = text; +} + + public void createString(float value, float amount) { + this.cachedValue = value; + this.cachedValue3 = amount; +} + + public boolean createString(int value, int index) { + if (value < this.cachedValue) { + return false; + } + + if (value > (this.cachedValue + this.doubleValue)) { + return false; + } + + if (index < this.cachedValue3) { + return false; + } + + return index <= (this.cachedValue3 + this.cachedValue2); +} + + static { + if (!c()) { + b(true); + } + } + + public void renderPanel() { + cc.novoline.utils.TimerUtil timerUtil; + label44: { + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal = this.cachedValue; + double doubleVal2 = this.cachedValue3; + double doubleVal3 = this.doubleValue; + double doubleVal4 = this.cachedValue2; + Color awtColor = new Color(18, 18, 18); + roundedTextureShader.drawRoundedRect(doubleVal, doubleVal2, doubleVal3, doubleVal4, 12.0, 3.0, awtColor, false); + FontFamily fontFam = FontFamilyPOPPIN.FAMILY; + FontRenderer font = fontFam.ofSize(16); + String textStr = "User-ID"; + doubleVal = this.cachedValue + 4.0; + doubleVal2 = this.cachedValue3 + 2.0; + font.drawString(textStr, doubleVal, doubleVal2, 16777215, true); + FontFamily fontFam2 = FontFamilyPOPPIN.FAMILY; + FontRenderer font2 = fontFam2.ofSize(20); + String textStr2 = this.cachedText; + doubleVal = this.cachedValue + 4.0; + doubleVal2 = this.cachedValue3 + this.cachedValue2 / 2.0; + font2.drawString(textStr2, doubleVal, doubleVal2, 16777215, true); + boolean flag2 = this.stateFlag; + if (!this.stateFlag) { + break label44; + } + + TimerUtil timerUtil2 = this.timer; + flag2 = timerUtil2.delay(400L); + + + if (!flag2) { + String textStr3 = "|"; + doubleVal = this.cachedValue + 4.0; + String textStr4 = this.cachedText; + doubleVal += font2.stringWidth(textStr4); + doubleVal2 = this.cachedValue3 + this.cachedValue2 / 2.0; + font2.drawString(textStr3, doubleVal, doubleVal2, 16777215, true); + break label44; + } + + timerUtil = this.timer; + + flag2 = timerUtil.delay(800L); + + + if (!flag2) { + break label44; + } + + timerUtil = this.timer; + + timerUtil.reset(); + } +} + + public void createString(char ch, int value) { + int intVal = (this.stateFlag ? 1 : 0); + + if (!this.stateFlag) { + return; + } + + intVal = value; + + + byte byteVal = 1; + if (intVal == 1) { + this.stateFlag = false; + return; + } + + intVal = value; + + if (intVal == 14) { + String textStr = this.cachedText; + intVal = (textStr.isEmpty() ? 1 : 0); + + if (intVal == 0) { + String textStr2 = this.cachedText; + int len = this.cachedText.length() - 1; + this.cachedText = textStr2.substring(0, len); + return; + } + } + + String textStr3 = String.valueOf(ch); + intVal = (StringUtils.isNumeric(textStr3) ? 1 : 0); + + if (intVal == 0) { + return; + } + + String textStr4 = this.cachedText; + intVal = textStr4.length(); + + if (intVal < 4) { + StringBuilder sb = new StringBuilder().append(this.cachedText); + this.cachedText = sb.append(ch).toString(); + } +} + + public static boolean matchesAltToastNotification(AltToastNotification altToastNotification) { + return altToastNotification.stateFlag; +} + + public static boolean b() { + return f; +} + + public static boolean c() { + boolean flag = b(); + return !flag; +} + + public AltToastNotification(GuiLogin guiLogin, double value, double amount, double offset, double dist) { + this.guiLoginField = guiLogin; + this.cachedValue = value; + this.cachedValue3 = amount; + this.doubleValue = offset; + this.cachedValue2 = dist; + this.timer = new TimerUtil(); + this.stateFlag = false; + this.cachedText = ""; +} + + public static void b(boolean flag) { + f = flag; +} + + public static boolean createString(AltToastNotification altToastNotification, boolean flag) { + return altToastNotification.stateFlag = flag; +} + + public static String resolveString(AltToastNotification altToastNotification) { + return altToastNotification.cachedText; +} + + public void renderPanel2(int value, int index) { + boolean flag = !this.stateFlag; + + this.stateFlag = flag; +} + + public boolean getStateFlag() { return this.stateFlag; } + public String getCachedText() { return this.cachedText; } +} diff --git a/src/main/java/cc/novoline/gui/alt/JavaFXPanelBridge.java b/src/main/java/cc/novoline/gui/alt/JavaFXPanelBridge.java new file mode 100644 index 0000000..40624ae --- /dev/null +++ b/src/main/java/cc/novoline/gui/alt/JavaFXPanelBridge.java @@ -0,0 +1,26 @@ +package cc.novoline.gui.alt; +import javafx.embed.swing.JFXPanel; +import javafx.scene.Scene; + + +public class JavaFXPanelBridge { + private static Object[] b; + + static { + if (b() != null) { + b(new Object[1]); + } + } + + public static Object[] b() { + return b; +} + + public static void b(Object[] flowGuardArray) { + b = flowGuardArray; +} + + public static void executeJFXPanel(JFXPanel jFXPanel, Scene scene) { + jFXPanel.setScene(scene); +} +} diff --git a/src/main/java/cc/novoline/gui/alt/JavaFXPlatformBridge.java b/src/main/java/cc/novoline/gui/alt/JavaFXPlatformBridge.java new file mode 100644 index 0000000..c12c1bb --- /dev/null +++ b/src/main/java/cc/novoline/gui/alt/JavaFXPlatformBridge.java @@ -0,0 +1,9 @@ +package cc.novoline.gui.alt; + +import javafx.application.Platform; + +public class JavaFXPlatformBridge { +public static void processRunnable(Runnable runnable) { + Platform.runLater(runnable); +} +} diff --git a/src/main/java/cc/novoline/gui/alt/JavaFXPropertyBridge.java b/src/main/java/cc/novoline/gui/alt/JavaFXPropertyBridge.java new file mode 100644 index 0000000..d98f731 --- /dev/null +++ b/src/main/java/cc/novoline/gui/alt/JavaFXPropertyBridge.java @@ -0,0 +1,31 @@ +package cc.novoline.gui.alt; + +import javafx.beans.property.ReadOnlyStringProperty; +import javafx.beans.value.ChangeListener; + +public class JavaFXPropertyBridge { + private static boolean b; + + public static boolean b() { + return b; +} + + public static boolean c() { + boolean flag = b(); + return !flag; +} + + public static void executeReadOnlyStringProperty(ReadOnlyStringProperty property, ChangeListener changeListener) { + property.addListener(changeListener); +} + + static { + if (!c()) { + b(true); + } + } + + public static void b(boolean flag) { + b = flag; +} +} diff --git a/src/main/java/cc/novoline/gui/alt/JavaFXWebEngineBridge.java b/src/main/java/cc/novoline/gui/alt/JavaFXWebEngineBridge.java new file mode 100644 index 0000000..a1c5f82 --- /dev/null +++ b/src/main/java/cc/novoline/gui/alt/JavaFXWebEngineBridge.java @@ -0,0 +1,18 @@ +package cc.novoline.gui.alt; + +import javafx.beans.property.ReadOnlyStringProperty; +import javafx.scene.web.WebEngine; + +public class JavaFXWebEngineBridge { + public static ReadOnlyStringProperty resolveReadOnlyStringProperty(WebEngine webEngine) { + return webEngine.locationProperty(); +} + + public static void executeWebEngine(WebEngine webEngine, String text) { + webEngine.setUserAgent(text); +} + + public static void executeWebEngine2(WebEngine webEngine, String text) { + webEngine.load(text); +} +} diff --git a/src/main/java/cc/novoline/gui/alt/JavaFXWebViewBridge.java b/src/main/java/cc/novoline/gui/alt/JavaFXWebViewBridge.java new file mode 100644 index 0000000..6ef3295 --- /dev/null +++ b/src/main/java/cc/novoline/gui/alt/JavaFXWebViewBridge.java @@ -0,0 +1,31 @@ +package cc.novoline.gui.alt; + +import javafx.scene.web.WebEngine; +import javafx.scene.web.WebView; + +public class JavaFXWebViewBridge { + private static boolean b; + + public static boolean c() { + boolean flag = b(); + return !flag; +} + + public static WebEngine resolveReadOnlyStringProperty(WebView webView) { + return webView.getEngine(); +} + + public static void b(boolean flag) { + b = flag; +} + + static { + if (!b()) { + b(true); + } + } + + public static boolean b() { + return b; +} +} diff --git a/src/main/java/cc/novoline/gui/alt/MicrosoftLoginWindow.java b/src/main/java/cc/novoline/gui/alt/MicrosoftLoginWindow.java new file mode 100644 index 0000000..c78cc43 --- /dev/null +++ b/src/main/java/cc/novoline/gui/alt/MicrosoftLoginWindow.java @@ -0,0 +1,130 @@ +package cc.novoline.gui.alt; + +import cc.novoline.utils.TimerUtil; +import java.io.IOException; +import java.net.CookieHandler; +import java.net.CookieManager; +import java.net.CookiePolicy; +import java.net.URI; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import javafx.beans.value.ObservableValue; +import javafx.embed.swing.JFXPanel; +import javafx.scene.Scene; +import javafx.scene.web.WebView; +import javax.swing.JFrame; + +public class MicrosoftLoginWindow extends JFrame { + private CompletableFuture completableFutureField; + private String cachedText; + + public List getList() { + java.util.ArrayList itemList; + ArrayList itemList2 = new ArrayList(); + String textStr = this.cachedText; + + if (this.cachedText == null) { + return itemList2; + } + + textStr = this.cachedText; + + + String textStr3 = "live.com"; + if (!textStr.contains(textStr3)) { + return itemList2; + } + + textStr = this.cachedText; + textStr3 = "\n"; + + String[] stringArr = textStr.split(textStr3); + int len = stringArr.length; + int intVal2 = 0; + + while (true) { + if (intVal2 < len) { + String textStr2 = stringArr[intVal2]; + String[] stringArr2 = textStr2.split("\t"); + itemList = itemList2; + + StringBuilder sb = new StringBuilder(); + String textStr4 = stringArr2[5]; + StringBuilder sb2 = sb.append(textStr4); + StringBuilder sb3 = sb2.append("="); + textStr4 = stringArr2[6]; + textStr3 = sb3.append(textStr4).toString(); + itemList2.add(textStr3); + intVal2++; + continue; + } + + itemList = itemList2; + break; + } + + return itemList; +} + + private void invokeCallback(ObservableValue observableValue, String text, String str) { + if (str.contains("access_token")) { + this.setVisible(false); + this.completableFutureField.complete(str); + } +} + + public void updateHelper(String text) throws IOException { + WebView webView = new WebView(); + JFXPanel jFXPanel = (JFXPanel)this.getContentPane(); + JavaFXPanelBridge.executeJFXPanel(jFXPanel, new Scene(webView, this.getWidth(), this.getHeight())); + CookieHandler.setDefault(new CookieManager(null, CookiePolicy.ACCEPT_ALL)); + JavaFXPropertyBridge.executeReadOnlyStringProperty(JavaFXWebEngineBridge.resolveReadOnlyStringProperty(JavaFXWebViewBridge.resolveReadOnlyStringProperty(webView)), (javafx.beans.value.ChangeListener) this::invokeCallback); + JavaFXWebEngineBridge.executeWebEngine(JavaFXWebViewBridge.resolveReadOnlyStringProperty(webView), "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36"); + URI uRI = URI.create(text); + LinkedHashMap itemMap = new LinkedHashMap(); + + try { + this.getList(); + } catch (Exception ex) { + ex.printStackTrace(); + } + + List itemList = this.getList(); + itemMap.put("Set-Cookie", itemList); + CookieHandler.getDefault().put(uRI, itemMap); + JavaFXWebEngineBridge.executeWebEngine2(JavaFXWebViewBridge.resolveReadOnlyStringProperty(webView), text); + this.setVisible(true); +} + + public MicrosoftLoginWindow(String text) { + this.cachedText = text; + this.setTitle("Novoline Authorization"); + this.setSize(750, 750); + this.setLocationRelativeTo(null); + this.setContentPane(new JFXPanel()); +} + + public CompletableFuture resolveCompletableFuture(String text) { + CompletableFuture completableFuture = this.completableFutureField; + if (this.completableFutureField != null) { + return this.completableFutureField; + } + + this.completableFutureField = new CompletableFuture<>(); + this.addWindowListener(new MicrosoftLoginWindowAdapter(this)); + JavaFXPlatformBridge.processRunnable(((java.lang.Runnable) () -> this.handleString(text))); + completableFuture = this.completableFutureField; + + return completableFuture; +} + + private void handleString(String text) { + try { + this.updateHelper(text); + } catch (IOException ex) { + ex.printStackTrace(); + } +} +} diff --git a/src/main/java/cc/novoline/gui/alt/MicrosoftLoginWindowAdapter.java b/src/main/java/cc/novoline/gui/alt/MicrosoftLoginWindowAdapter.java new file mode 100644 index 0000000..7d872e6 --- /dev/null +++ b/src/main/java/cc/novoline/gui/alt/MicrosoftLoginWindowAdapter.java @@ -0,0 +1,15 @@ +package cc.novoline.gui.alt; + +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +public class MicrosoftLoginWindowAdapter extends WindowAdapter { + final MicrosoftLoginWindow microsoftLoginWindowField; + + @Override + public void windowClosing(WindowEvent event) {} + + MicrosoftLoginWindowAdapter(MicrosoftLoginWindow microsoftLoginWindow) { + this.microsoftLoginWindowField = microsoftLoginWindow; +} +} diff --git a/src/main/java/cc/novoline/gui/alt/MicrosoftOAuthServer.java b/src/main/java/cc/novoline/gui/alt/MicrosoftOAuthServer.java new file mode 100644 index 0000000..b929cac --- /dev/null +++ b/src/main/java/cc/novoline/gui/alt/MicrosoftOAuthServer.java @@ -0,0 +1,292 @@ +package cc.novoline.gui.alt; + + +import cc.novoline.Novoline; +import cc.novoline.auth.OAuthApplication; +import cc.novoline.auth.minecraft.MicrosoftOAuthCodeExchanger; +import cc.novoline.auth.minecraft.auth.Account; +import cc.novoline.auth.minecraft.user.MicrosoftOAuthExchangeCode; +import cc.novoline.auth.minecraft.user.MinecraftAuthenticationException; +import cc.novoline.auth.minecraft.user.MinecraftOAuthAuthenticate; +import cc.novoline.auth.minecraft.user.MinecraftProfileConverter; +import cc.novoline.auth.minecraft.user.MinecraftUser; +import cc.novoline.auth.minecraft.user.RedirectUrl; +import cc.novoline.auth.minecraft.user.gos.GameOwnershipValidator; +import cc.novoline.auth.minecraft.user.mcsauth.MinecraftServicesAuthenticator; +import cc.novoline.auth.minecraft.user.mcsauth.MinecraftServicesToken; +import cc.novoline.auth.minecraft.user.oauth.exchange.MicrosoftOAuthCodeExchangerImpl; +import cc.novoline.auth.minecraft.user.oauth.exchange.MicrosoftOAuthRefreshCodeExchangerIMpl; +import cc.novoline.auth.minecraft.user.preq.MinecraftProfileRequester; +import cc.novoline.auth.minecraft.user.xb.auth.XboxLiveAuthenticator; +import cc.novoline.auth.minecraft.user.xb.xsts.XSTSAuthenticator; +import cc.novoline.gui.widget.AltRepositoryPanel; +import cc.novoline.gui.widget.AuthenticatedAsWidget; +import cc.novoline.gui.widget.GradientLabelWidget; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.utils.tasks.TaskManager; +import cc.novoline.utils.tasks.TaskStage; +import cc.novoline.utils.tasks.impl.ScheduledTask; +import java.awt.Desktop; +import java.awt.datatransfer.UnsupportedFlavorException; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URLDecoder; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Map; +import java.util.Objects; + +import net.freeutils.httpserver.HTTPServer; +import net.freeutils.httpserver.HTTPServer.Request; +import net.freeutils.httpserver.HTTPServer.Response; +import net.freeutils.httpserver.HTTPServer.VirtualHost; +import net.minecraft.client.Minecraft; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; + +public class MicrosoftOAuthServer { + private final String cachedText = "https://login.live.com/oauth20_authorize.srf?client_id=1f2e7916-9ecf-4495-a87b-f9f54ae7b707&prompt=select_account&cobrandid=8058f65d-ce06-4c30-9559-473c9275a65d&response_type=code&scope=Xboxlive.signin%20offline_access&redirect_uri=http://localhost:28562"; + private final VirtualHost virtualHostField; + private final OAuthApplication oAuthApplicationField = OAuthApplication.NOVOLINE_APP_PARAMETERS; + private final HTTPServer hTTPServerField = new HTTPServer(28562); + + public void updateHelper(String text) { + ArrayList itemList = new ArrayList(); + String textStr4 = "\n"; + String[] stringArr = text.split(textStr4); + int len = stringArr.length; + int intVal = 0; + + while (intVal < len) { + String textStr = stringArr[intVal]; + String[] stringArr2 = textStr.split("\t"); + StringBuilder sb = new StringBuilder(); + textStr4 = stringArr2[5]; + StringBuilder sb2 = sb.append(textStr4); + StringBuilder sb3 = sb2.append("="); + textStr4 = stringArr2[6]; + String textStr5 = sb3.append(textStr4).toString(); + itemList.add(textStr5); + intVal++; + + } + + StringBuilder sb4 = new StringBuilder(); + Iterator iter = itemList.iterator(); + + while (true) { + if (iter.hasNext()) { + String textStr2 = (String)iter.next(); + StringBuilder sb5 = sb4.append(textStr2); + sb5.append("; "); + + continue; + } + + textStr4 = sb4.toString(); + textStr4 = textStr4.trim(); + int len2 = sb4.length() - 2; + sb4 = new StringBuilder(textStr4.substring(0, len2)); + break; + } + + CloseableHttpClient closeableHttpClient = HttpClients.createDefault(); + HttpGet httpGet = new HttpGet("https://login.live.com/oauth20_authorize.srf?redirect_uri=https://sisu.xboxlive.com/connect/oauth/XboxLive&response_type=code&state=LAAAAAEB2OQKA4AphougPWXz6j8KrT_KxS1BLPFjAd7VgjpBw60PmPFt0diwZWZkMzMwZmY5ZjgzNDU2YWEzZTdiMWYyYmQ4NWNkMWMx&client_id=000000004420578E&scope=XboxLive.Signin&lw=1&fl=dob,easi2&xsup=1&cobrandid=8058f65d-ce06-4c30-9559-473c9275a65d"); + String textStr3 = "Accept"; + httpGet.setHeader(textStr3, "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"); + textStr3 = "Accept-Encoding"; + httpGet.setHeader(textStr3, "gzip, deflate, br"); + textStr3 = "Accept-Language"; + httpGet.setHeader(textStr3, "en-US,en;q=0.5"); + textStr3 = "Cache-Control"; + httpGet.setHeader(textStr3, "no-cache"); + textStr3 = "Connection"; + httpGet.setHeader(textStr3, "keep-alive"); + textStr3 = "Cookie"; + textStr4 = sb4.toString(); + httpGet.setHeader(textStr3, textStr4); + textStr3 = "Host"; + httpGet.setHeader(textStr3, "login.live.com"); + textStr3 = "Pragma"; + httpGet.setHeader(textStr3, "no-cache"); + textStr3 = "Sec-Fetch-Dest"; + httpGet.setHeader(textStr3, "document"); + textStr3 = "Sec-Fetch-Mode"; + httpGet.setHeader(textStr3, "navigate"); + textStr3 = "Sec-Fetch-Site"; + httpGet.setHeader(textStr3, "none"); + textStr3 = "Sec-Fetch-User"; + httpGet.setHeader(textStr3, "?1"); + textStr3 = "Upgrade-Insecure-Requests"; + httpGet.setHeader(textStr3, "1"); + textStr3 = "User-Agent"; + httpGet.setHeader(textStr3, "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:105.0) Gecko/20100101 Firefox/105.0"); + + try { + closeableHttpClient.execute(httpGet); + } catch (IOException ex) { + ex.printStackTrace(); + } +} + + public MicrosoftOAuthServer() { + this.virtualHostField = this.hTTPServerField.getVirtualHost(null); +} + + public void updateHelper2() { + try { + Desktop.getDesktop().browse(new URI("https://login.live.com/oauth20_authorize.srf?client_id=1f2e7916-9ecf-4495-a87b-f9f54ae7b707&prompt=select_account&cobrandid=8058f65d-ce06-4c30-9559-473c9275a65d&response_type=code&scope=Xboxlive.signin%20offline_access&redirect_uri=http://localhost:28562")); + } catch (IOException | URISyntaxException ex) { + ex.printStackTrace(); + } +} + + public void updateHelper3(AuthenticatedAsWidget authenticatedAsWidget, String text, boolean flag) { + MicrosoftLoginWindow microsoftLoginWindow = new MicrosoftLoginWindow(text); + microsoftLoginWindow.resolveCompletableFuture("https://login.live.com/oauth20_authorize.srf?client_id=1f2e7916-9ecf-4495-a87b-f9f54ae7b707&prompt=select_account&cobrandid=8058f65d-ce06-4c30-9559-473c9275a65d&response_type=code&scope=Xboxlive.signin%20offline_access&redirect_uri=http://localhost:28562"); + this.handleGuiAction(authenticatedAsWidget, text, flag); +} + + + + private int invokeCallback(AuthenticatedAsWidget authenticatedAsWidget, String text, boolean flag, Request request, Response response) throws IOException { + Map itemMap5 = request.getParams(); + String textStr3 = "error"; + byte byteVal = (byte)(itemMap5.containsKey(textStr3) ? 1 : 0); + if (byteVal != 0) { + response.getHeaders().add("Content-Type", "text/plain"); + Map itemMap = request.getParams(); + response.send(500, URLDecoder.decode((String)itemMap.get("error_description"))); + this.updateHelper5(); + return 0; + } + + itemMap5 = request.getParams(); + textStr3 = "code"; + byteVal = (byte)(itemMap5.containsKey(textStr3) ? 1 : 0); + + if (byteVal != 0) { + try { + label35: { + Account account = new Account(); + Map itemMap2 = request.getParams(); + textStr3 = (String)itemMap2.get("code"); + account.setPassword(textStr3); + account.setUsername("********"); + String textStr = account.getAccessToken(); + boolean flag2 = Objects.isNull(textStr); + if (flag2) { + MicrosoftOAuthCodeExchangerImpl val = new MicrosoftOAuthCodeExchangerImpl("1f2e7916-9ecf-4495-a87b-f9f54ae7b707", "https://login.live.com/oauth20_token.srf"); + Map itemMap3 = request.getParams(); + MicrosoftOAuthExchangeCode microsoftOAuthExchangeCode = new MicrosoftOAuthExchangeCode((String)itemMap3.get("code"), new RedirectUrl("http://localhost:28562")); + this.updateHelper4(authenticatedAsWidget, val, microsoftOAuthExchangeCode, text, flag); + break label35; + } + + flag2 = account.getMicrosoftOAuthToken().isExpired(); + + if (flag2) { + MicrosoftOAuthRefreshCodeExchangerIMpl val2 = new MicrosoftOAuthRefreshCodeExchangerIMpl("1f2e7916-9ecf-4495-a87b-f9f54ae7b707", "https://login.live.com/oauth20_token.srf"); + MicrosoftOAuthExchangeCode microsoftOAuthExchangeCode2 = new MicrosoftOAuthExchangeCode(account.getMicrosoftOAuthToken().getRefreshToken(), new RedirectUrl("http://localhost:28562")); + this.updateHelper4(authenticatedAsWidget, val2, microsoftOAuthExchangeCode2, text, flag); + } + } + } catch (Exception ex) { + response.getHeaders().add("Content-Type", "text/html"); + StringBuilder sb = new StringBuilder().append(""); + response.send(500, sb.append(ex).toString()); + ex.printStackTrace(); + this.updateHelper5(); + return 0; + } + + response.getHeaders().add("Content-Type", "text/plain"); + StringBuilder sb2 = new StringBuilder(); + String textStr2 = "Received ms code: "; + sb2 = sb2.append(textStr2); + Map itemMap4 = request.getParams(); + textStr2 = (String)itemMap4.get("code"); + sb2 = sb2.append(textStr2); + textStr2 = ". Go back to Alt Repository"; + response.send(200, sb2.append(textStr2).toString()); + this.updateHelper5(); + return 0; + } + + response.getHeaders().add("Content-Type", "text/plain"); + response.send(400, "Code is missing"); + this.updateHelper5(); + byteVal = 0; + + return byteVal; +} + + private void handleGuiAction(String text, String str, NotificationType notificationType) { + Novoline novolineInst = Novoline.getInstance(); + TaskManager taskManager = novolineInst.getTaskManager(); + taskManager.applyFutureTask(new ScheduledTask(this, 50, TaskStage.TICK, text, str, notificationType)); +} + + private void updateHelper4(AuthenticatedAsWidget authenticatedAsWidget, MicrosoftOAuthCodeExchanger microsoftOAuthCodeExchanger, MicrosoftOAuthExchangeCode microsoftOAuthExchangeCode, String text, boolean flag) throws IOException, MinecraftAuthenticationException, UnsupportedFlavorException { + XboxLiveAuthenticator xboxLiveAuthenticator = new XboxLiveAuthenticator(this.oAuthApplicationField); + MinecraftOAuthAuthenticate minecraftOAuthAuthenticate = new MinecraftOAuthAuthenticate( + microsoftOAuthCodeExchanger, + xboxLiveAuthenticator, + new XSTSAuthenticator(), + new MinecraftServicesAuthenticator(), + new GameOwnershipValidator(), + new MinecraftProfileRequester(), + new MinecraftProfileConverter() + ); + MinecraftUser minecraftUser = minecraftOAuthAuthenticate.authenticate(microsoftOAuthExchangeCode); + if (flag) { + AltRepositoryPanel altRepositoryPanel = authenticatedAsWidget.getParent(); + AltAccountEntry altAccountEntry = new AltAccountEntry(altRepositoryPanel.getParent()); + String nameStr2 = minecraftUser.getUsername(); + AltAccountEntry altAccountEntry2 = altAccountEntry.createAltAccountEntry(nameStr2); + nameStr2 = minecraftUser.getUsername(); + AltAccountEntry altAccountEntry3 = altAccountEntry2.createAltAccountEntry2(nameStr2); + AltAccountEntry altAccountEntry4 = altAccountEntry3.resolveAltAccountEntry2(text); + AltAccountType altAccountType = AltAccountType.COOKIE; + AltAccountEntry altAccountEntry5 = altAccountEntry4.createAltAccountEntry(altAccountType); + GradientLabelWidget gradientLabelWidget = authenticatedAsWidget.getGradientLabelWidget(); + nameStr2 = altAccountEntry5.getCachedText5(); + gradientLabelWidget.createAltAccountEntry(nameStr2); + nameStr2 = minecraftUser.getUUID().toString(); + nameStr2 = nameStr2.replace("-", ""); + altAccountEntry5 = altAccountEntry5.resolveAltAccountEntry(nameStr2); + authenticatedAsWidget.createAltAccountEntry(altAccountEntry5); + return; + } + + Minecraft mcClient = Minecraft.getMinecraft(); + String nameStr = minecraftUser.getUsername(); + String textStr3 = minecraftUser.getUUID().toString(); + MinecraftServicesToken minecraftServicesToken = minecraftUser.getMinecraftToken(); + String textStr4 = minecraftServicesToken.getAccessToken(); + mcClient.session = new AltAccountTokenHelper(nameStr, textStr3, textStr4, minecraftUser.getType()); + + String textStr = "Cookie Login"; + StringBuilder sb = new StringBuilder(); + String textStr2 = "Logged in as "; + sb = sb.append(textStr2); + textStr2 = minecraftUser.getUsername(); + this.handleGuiAction(textStr, sb.append(textStr2).toString(), NotificationType.INFO); +} + + public void handleGuiAction(AuthenticatedAsWidget authenticatedAsWidget, String text, boolean flag) { + this.virtualHostField.addContext("/", ((net.freeutils.httpserver.HTTPServer.ContextHandler) ((net.freeutils.httpserver.HTTPServer.Request $a0, net.freeutils.httpserver.HTTPServer.Response $a1) -> this.invokeCallback(authenticatedAsWidget, text, flag, $a0, $a1))), "GET"); + + try { + this.hTTPServerField.start(); + } catch (IOException ex) { + ex.printStackTrace(); + } +} + + private void updateHelper5() { + this.hTTPServerField.stop(); +} +} diff --git a/src/main/java/cc/novoline/gui/button/ContainerModuleToggle.java b/src/main/java/cc/novoline/gui/button/ContainerModuleToggle.java new file mode 100644 index 0000000..7607386 --- /dev/null +++ b/src/main/java/cc/novoline/gui/button/ContainerModuleToggle.java @@ -0,0 +1,107 @@ +package cc.novoline.gui.button; + +import cc.novoline.modules.AbstractModule; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.anim.SmoothAnimation; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.shader.RoundedTextureShader; +import java.awt.Color; +import cc.novoline.utils.fonts.holders.FontFamilySF_BOLD; +import cc.novoline.utils.fonts.api.FontFamily; +import net.minecraft.client.gui.inventory.GuiContainer; + +public class ContainerModuleToggle { + private double cachedValue; + private double cachedValue2; + private double doubleValue; + private AbstractModule abstractModuleField; + private int stateTicks; + final GuiContainer guiContainerField; + private FontRenderer fontRendererField; + private double cachedValue3; + private SmoothAnimation smoothAnim; + + public void renderPanel(int value, int index) { + if (this.evaluateInt(value, index)) { + AbstractModule mod = this.abstractModuleField; + if (mod.isEnabled()) { + mod = this.abstractModuleField; + mod.toggle(); + } + } +} + + public static double computeDoubleFromContainerModuleToggle(ContainerModuleToggle containerModuleToggle) { + return containerModuleToggle.cachedValue2; +} + + public static int evaluateInt(ContainerModuleToggle containerModuleToggle, int value) { + return containerModuleToggle.stateTicks = value; +} + + public void renderPanel2() { + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal2 = this.cachedValue; + double doubleVal3 = this.cachedValue3; + double doubleVal4 = this.doubleValue; + double doubleVal5 = this.cachedValue2; + Color awtColor = new Color(0, 0, 0, 130); + roundedTextureShader.drawRoundedRect(doubleVal2, doubleVal3, doubleVal4, doubleVal5, 0.0, 4.0, awtColor, false); + FontRenderer font = this.fontRendererField; + StringBuilder sb2 = new StringBuilder().append("Disable "); + AbstractModule mod = this.abstractModuleField; + String nameStr = mod.getName(); + String textStr = sb2.append(nameStr).toString(); + doubleVal3 = this.cachedValue + this.doubleValue / 2.0; + doubleVal4 = this.cachedValue3 + this.cachedValue2 / 2.0; + FontRenderer font2 = this.fontRendererField; + doubleVal4 -= font2.getHeight() / 2; + int ticks = this.stateTicks; + font.drawCenteredString(textStr, doubleVal3, doubleVal4, ticks, true); + double doubleVal = this.cachedValue - 1.0; + doubleVal2 = this.cachedValue3 + this.cachedValue2; + doubleVal3 = this.cachedValue + this.doubleValue + 1.0; + doubleVal4 = this.cachedValue3 + this.cachedValue2 + 1.0; + int color = ColorTheme.getHudColor(0L); + RenderUtils.drawRect(doubleVal, doubleVal2, doubleVal3, doubleVal4, color); +} + + public static double computeDoubleFromContainerModuleToggle2(ContainerModuleToggle containerModuleToggle) { + return containerModuleToggle.doubleValue; +} + + public ContainerModuleToggle(GuiContainer guiContainer, AbstractModule module) { + this.guiContainerField = guiContainer; + this.smoothAnim = new SmoothAnimation(); + this.fontRendererField = FontFamilySF_BOLD.FAMILY.ofSize(19); + this.abstractModuleField = module; + this.stateTicks = 16777215; +} + + public boolean evaluateInt(int value, int index) { + return value > this.cachedValue && value <= this.cachedValue + this.doubleValue && index > this.cachedValue3 && index <= this.cachedValue3 + this.cachedValue2; +} + + public ContainerModuleToggle(GuiContainer guiContainer, AbstractModule module, double value, double amount, double offset, double dist) { + this.guiContainerField = guiContainer; + this.smoothAnim = new SmoothAnimation(); + this.fontRendererField = FontFamilySF_BOLD.FAMILY.ofSize(19); + this.abstractModuleField = module; + this.stateTicks = 16777215; + this.cachedValue = value; + this.cachedValue3 = amount; + this.doubleValue = offset; + this.cachedValue2 = dist; +} + + public static double calculateDouble(ContainerModuleToggle containerModuleToggle) { + return containerModuleToggle.cachedValue; +} + + public double getCachedValue2() { return this.cachedValue2; } + public int setStateTicks(int value) { return this.stateTicks = value; } + public cc.novoline.utils.anim.SmoothAnimation getSmoothAnim() { return this.smoothAnim; } + public double getCachedValue3() { return this.cachedValue3; } + public double getCachedValue() { return this.cachedValue; } +} diff --git a/src/main/java/cc/novoline/gui/button/GuiFontButton.java b/src/main/java/cc/novoline/gui/button/GuiFontButton.java new file mode 100644 index 0000000..a6cc704 --- /dev/null +++ b/src/main/java/cc/novoline/gui/button/GuiFontButton.java @@ -0,0 +1,50 @@ +package cc.novoline.gui.button; + +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.fonts.api.FontRenderer; +import java.awt.Color; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.SoundHandler; +import net.minecraft.client.gui.GuiButton; +import org.jetbrains.annotations.NotNull; + +public class GuiFontButton extends GuiButton { + private final int stateTicks; + private final FontRenderer fontRendererField; + + public int getStateTicks() { + return this.stateTicks; +} + + @Override + public void playPressSound(@NotNull SoundHandler soundHandler) { + super.playPressSound(soundHandler); +} + + public GuiFontButton(String text, int value, int index, int count, int amount, int num, int value2, @NotNull FontRenderer font) { + super(value, index, count, amount, num, text); + this.stateTicks = value2; + this.fontRendererField = font; +} + + @Override + public void drawButton(Minecraft minecraft, int value, int index) { + if (this.stateFlag2) { + double doubleVal = this.doubleState2; + double doubleVal2 = this.doubleState; + int intVal = this.intState; + int intVal2 = this.intState2; + this.hovered = value >= doubleVal && index >= doubleVal2 && value < doubleVal + intVal && index < doubleVal2 + intVal2; + int intVal3 = this.hovered ? 150 : 120; + RenderUtils.drawElement((float)((int)doubleVal), (float)((int)doubleVal2 + 1), (float)intVal, (float)intVal2, 0.0F, new Color(0, 0, 0, intVal3)); + this.mouseDragged(minecraft, value, index); + double doubleVal3 = (int)doubleVal + (intVal - this.fontRendererField.stringWidth(this.displayString)) / 2.0F; + double doubleVal4 = (int)doubleVal2 + 2 + (intVal2 - this.fontRendererField.getHeight()) / 2.0F; + this.fontRendererField.drawString(this.displayString, doubleVal3, doubleVal4, new Color(198, 198, 198).getRGB(), false); + } +} + + public GuiFontButton(String text, int value, int index, int count, int amount, @NotNull FontRenderer font) { + this(text, value, index, count, 200, 20, amount, font); +} +} diff --git a/src/main/java/cc/novoline/gui/button/GuiIconButton.java b/src/main/java/cc/novoline/gui/button/GuiIconButton.java new file mode 100644 index 0000000..46c3967 --- /dev/null +++ b/src/main/java/cc/novoline/gui/button/GuiIconButton.java @@ -0,0 +1,30 @@ +package cc.novoline.gui.button; + +import cc.novoline.gui.click.IconButtonConstHolder; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.util.ResourceLocation; + +public class GuiIconButton extends GuiButton { + @Override + public void drawButton(Minecraft minecraft, int value, int index) { + if (this.stateFlag2) { + TextureManager texManager = minecraft.getTextureManager(); + texManager.bindTexture(GuiButton.buttonTextures); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + int intVal = value >= this.doubleState2 && index >= this.doubleState && value < this.doubleState2 + this.intState && index < this.doubleState + this.intState2 ? 1 : 0; + int intVal2 = 106; + if (intVal != 0) { + intVal2 += this.intState2; + } + + this.applyInt6((int)this.doubleState2, (int)this.doubleState, 0, intVal2, this.intState, this.intState2); + } +} + + public GuiIconButton(int value, int index, int count) { + super(value, index, count, 20, 20, IconButtonConstHolder.textValue); +} +} diff --git a/src/main/java/cc/novoline/gui/button/GuiMainMenuButton.java b/src/main/java/cc/novoline/gui/button/GuiMainMenuButton.java new file mode 100644 index 0000000..b0cb1da --- /dev/null +++ b/src/main/java/cc/novoline/gui/button/GuiMainMenuButton.java @@ -0,0 +1,188 @@ +package cc.novoline.gui.button; +import cc.novoline.viaversion.GuiMultiplayerViaHelper; +import cc.novoline.utils.fonts.api.FontFamily; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontFamilyPOSTERAMA; +import cc.novoline.utils.shader.RoundedTextureShader; +import java.awt.Color; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; + +/** + * Hooked Client/Minecraft Class (net.UH) + * Role: GuiMainMenuButton — Custom Rounded-Shader Novoline Main Menu Button + */ +public class GuiMainMenuButton extends GuiButton { + private int stateTicks; + private int stateTicks2; + + public boolean matchesCriteria(int value, int index) { + if (value < this.doubleState2) { + return false; + } + + if (index < this.doubleState) { + return false; + } + + if (value >= (this.doubleState2 + this.intState)) { + return false; + } + + return index < (this.doubleState + this.intState2); +} + + public void setStateTicks2(int value) { + this.stateTicks2 = value; +} + + public void applyMinecraft(Minecraft minecraft, int value, int index, float amount) { + GuiMainMenuButton guiMainMenuButton = this; + + if (!this.stateFlag2) { + return; + } + + guiMainMenuButton = this; + + + int intVal; + label51: { + label60: { + if (value < this.doubleState2) { + break label60; + } + + if (index < this.doubleState) { + break label60; + } + + if (value >= (this.doubleState2 + this.intState)) { + break label60; + } + + if (index < (this.doubleState + this.intState2)) { + intVal = 1; + break label51; + } + } + + intVal = 0; + } + + label30: { + guiMainMenuButton.hovered = (boolean)((intVal) != 0); + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal = (float)this.doubleState2; + double doubleVal2 = (float)this.doubleState; + double doubleVal3 = this.intState; + double doubleVal4 = this.intState2; + double doubleVal5 = amount; + Color awtColor3 = new Color(this.stateTicks2); + roundedTextureShader.drawRoundedRect(doubleVal, doubleVal2, doubleVal3, doubleVal4, doubleVal5, 3.5, awtColor3, true); + GuiMainMenuButton guiMainMenuButton2 = this; + + if (!this.hovered) { + break label30; + } + + guiMainMenuButton2 = this; + + + Color awtColor = new Color(this.stateTicks); + Color awtColor2 = awtColor.brighter(); + guiMainMenuButton2.stateTicks = awtColor2.getRGB(); + } + + FontFamily fontFam = FontFamilyPOSTERAMA.FAMILY; + FontRenderer font = fontFam.ofSize(20); + String textStr = this.displayString; + float floatVal = (float)this.doubleState2 + this.intState / 2; + String textStr2 = this.displayString; + double doubleVal6 = floatVal - font.stringWidth(textStr2) / 2; + double doubleVal7 = (float)this.doubleState + this.intState2 / 2 - font.getHeight() / 2; + int ticks = this.stateTicks; + font.drawString(textStr, doubleVal6, doubleVal7, ticks, 1.5F); +} + + public GuiMainMenuButton(int value, int index, int count, int amount, int num, String text) { + super(value, index, count, amount, num, text); + this.stateTicks = Color.WHITE.getRGB(); +} + + public void setStateTicks(int value) { + this.stateTicks = value; +} + + public void applyMinecraft2(Minecraft minecraft, int value, int index, double amount, Color color) { + GuiMainMenuButton guiMainMenuButton = this; + + if (!this.stateFlag2) { + return; + } + + guiMainMenuButton = this; + + + int intVal; + label51: { + label60: { + if (value < this.doubleState2) { + break label60; + } + + if (index < this.doubleState) { + break label60; + } + + if (value >= (this.doubleState2 + this.intState)) { + break label60; + } + + if (index < (this.doubleState + this.intState2)) { + intVal = 1; + break label51; + } + } + + intVal = 0; + } + + label30: { + guiMainMenuButton.hovered = (boolean)((intVal) != 0); + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal = (float)this.doubleState2; + double doubleVal2 = (float)this.doubleState; + double doubleVal3 = this.intState; + double doubleVal4 = this.intState2; + roundedTextureShader.drawRoundedRect(doubleVal, doubleVal2, doubleVal3, doubleVal4, amount, 3.5, color, true); + GuiMainMenuButton guiMainMenuButton2 = this; + + if (!this.hovered) { + break label30; + } + + guiMainMenuButton2 = this; + + + Color awtColor = new Color(this.stateTicks); + Color awtColor2 = awtColor.brighter(); + guiMainMenuButton2.stateTicks = awtColor2.getRGB(); + } + + FontFamily fontFam = FontFamilyPOSTERAMA.FAMILY; + FontRenderer font = fontFam.ofSize(20); + String textStr = this.displayString; + float floatVal = (float)this.doubleState2 + this.intState / 2; + String textStr2 = this.displayString; + double doubleVal5 = floatVal - font.stringWidth(textStr2) / 2; + double doubleVal6 = (float)this.doubleState + this.intState2 / 2 - font.getHeight() / 2; + int ticks = this.stateTicks; + font.drawString(textStr, doubleVal5, doubleVal6, ticks, 1.5F); +} + + public void mouseReleased(double value, double amount) { + this.doubleState2 = value; + this.doubleState = amount; +} +} diff --git a/src/main/java/cc/novoline/gui/click/AbstractRoundedGroApi.java b/src/main/java/cc/novoline/gui/click/AbstractRoundedGroApi.java new file mode 100644 index 0000000..f4e9755 --- /dev/null +++ b/src/main/java/cc/novoline/gui/click/AbstractRoundedGroApi.java @@ -0,0 +1,7 @@ +package cc.novoline.gui.click; + +import cc.novoline.gui.element.GuiTextAttribute; +import cc.novoline.gui.element.GuiRadiusAttribute; + +public interface AbstractRoundedGroApi extends GuiRadiusAttribute, GuiTextAttribute { +} diff --git a/src/main/java/cc/novoline/gui/click/AltCredentialDialog.java b/src/main/java/cc/novoline/gui/click/AltCredentialDialog.java new file mode 100644 index 0000000..49171c9 --- /dev/null +++ b/src/main/java/cc/novoline/gui/click/AltCredentialDialog.java @@ -0,0 +1,97 @@ +package cc.novoline.gui.click; + +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.gui.widget.GoBackWidget; +import cc.novoline.gui.widget.LabeledWidget; +import cc.novoline.gui.widget.MinecraftWidget; +import cc.novoline.gui.widget.TextInputBoxWidget; +import cc.novoline.gui.widget.DialogConfirmButton; +import cc.novoline.gui.widget.SelectAuthenticationWidget; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.StencilUtil; +import com.sun.javafx.geom.Vec2d; +import java.util.List; + +public class AltCredentialDialog extends GoBackWidget { + private final LabeledWidget labeledWidgetField = new DialogConfirmButton(this, this.getParent(), "Go back"); + private final TextInputBoxWidget textInputBoxWidgetField; + private final LabeledWidget labeledWidgetField2 = new MinecraftWidget(this, this.getParent(), "Set this username and log in"); + + public static TextInputBoxWidget resolveTextInputBoxWidget(AltCredentialDialog altCredentialDialog) { + return altCredentialDialog.textInputBoxWidgetField; +} + + @Override + public double getDoubleValue() { + double doubleVal2 = this.getParent().getParent().getPosX() + 10.0; + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent().getParent(); + List itemList = altRepositoryGUI.getGuiWidgetList(); + double doubleVal = itemList.indexOf(this); + AltRepositoryGUI altRepositoryGUI2 = this.getParent().getParent().getParent(); + doubleVal2 += doubleVal * altRepositoryGUI2.getCachedValue2(); + altRepositoryGUI = this.getParent().getParent().getParent(); + return doubleVal2 - altRepositoryGUI.getScrollOffset(); +} + + @Override + public void renderPanel(int value, int index) {} + + @Override + public void applyUpdate(int value, int index) { + TextInputBoxWidget textInputBoxWidget = this.textInputBoxWidgetField; + Vec2d vec2d = new Vec2d(this.getPosX(), this.getPosY() + 10.0); + textInputBoxWidget.createAltAccountEntry(vec2d); + textInputBoxWidget = this.textInputBoxWidgetField; + vec2d = new Vec2d(150.0, 15.0); + textInputBoxWidget.applyUpdate5(vec2d); + this.labeledWidgetField.applyUpdate(value, index); + this.labeledWidgetField2.applyUpdate(value, index); + this.textInputBoxWidgetField.applyUpdate(value, index); +} + + @Override + public void applyUpdate(char ch, int value) { + this.textInputBoxWidgetField.applyUpdate(ch, value); +} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + this.labeledWidgetField.mouseClickedPanel(value, index, count); + this.labeledWidgetField2.mouseClickedPanel(value, index, count); + this.textInputBoxWidgetField.mouseClickedPanel(value, index, count); +} + + @Override + public TextInputBoxWidget getVLA() { + return this.textInputBoxWidgetField; +} + + @Override + public double getDoubleValue2() { + return this.getParent().getPosY(); +} + + @Override + public void renderPanel2(int value, int index) { + StencilUtil.initStencilToWrite(false); + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent().getParent(); + double[] doubleArr = altRepositoryGUI.getPanelBounds(); + double doubleVal = doubleArr[0]; + double doubleVal2 = doubleArr[1]; + double doubleVal3 = doubleArr[2]; + double doubleVal4 = doubleArr[3]; + RenderUtils.drawElement11(doubleVal, doubleVal2, doubleVal3, doubleVal4, -1); + StencilUtil.readStencilBuffer(true); + this.labeledWidgetField.renderPanel2(value, index); + this.labeledWidgetField2.renderPanel2(value, index); + this.textInputBoxWidgetField.renderPanel2(value, index); + StencilUtil.uninitStencilBuffer(); +} + + public AltCredentialDialog(SelectAuthenticationWidget selectAuthenticationWidget) { + super(selectAuthenticationWidget); + this.textInputBoxWidgetField = new TextInputBoxWidget(this, "Enter a username to set", 1); +} + + public cc.novoline.gui.widget.TextInputBoxWidget getTextInputBoxWidgetField() { return this.textInputBoxWidgetField; } +} diff --git a/src/main/java/cc/novoline/gui/click/AltFilterConstHolder.java b/src/main/java/cc/novoline/gui/click/AltFilterConstHolder.java new file mode 100644 index 0000000..218b649 --- /dev/null +++ b/src/main/java/cc/novoline/gui/click/AltFilterConstHolder.java @@ -0,0 +1,13 @@ +package cc.novoline.gui.click; + +public class AltFilterConstHolder { + public static String textValue; + + public static void handleAction() { + textValue = "E"; +} + + static { + handleAction(); + } +} diff --git a/src/main/java/cc/novoline/gui/click/AltPanelConstHolder.java b/src/main/java/cc/novoline/gui/click/AltPanelConstHolder.java new file mode 100644 index 0000000..42e66d5 --- /dev/null +++ b/src/main/java/cc/novoline/gui/click/AltPanelConstHolder.java @@ -0,0 +1,13 @@ +package cc.novoline.gui.click; + +public class AltPanelConstHolder { + public static String textValue; + + public static void handleAction() { + textValue = "B"; +} + + static { + handleAction(); + } +} diff --git a/src/main/java/cc/novoline/gui/click/AuthLogoutActionButton.java b/src/main/java/cc/novoline/gui/click/AuthLogoutActionButton.java new file mode 100644 index 0000000..7d7e96e --- /dev/null +++ b/src/main/java/cc/novoline/gui/click/AuthLogoutActionButton.java @@ -0,0 +1,57 @@ +package cc.novoline.gui.click; + +import cc.novoline.gui.alt.AltAccountEntry; +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.gui.widget.AuthenticatedAsWidget; +import cc.novoline.gui.widget.GradientLabelWidget; +import cc.novoline.gui.widget.FlatTextButtonWidget; + +public class AuthLogoutActionButton extends FlatTextButtonWidget { + final AuthenticatedAsWidget authenticatedAsWidgetField; + + @Override + public double getDoubleValue() { + double doubleVal = this.getParent().getPosX() - 220.3F + 107.5; + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent().getParent(); + return doubleVal - altRepositoryGUI.getScrollOffset(); +} + + @Override + public boolean isReadyState() { + return this.authenticatedAsWidgetField.getAltAccountEntryField() != null; +} + + public AuthLogoutActionButton(AuthenticatedAsWidget authenticatedAsWidget, AuthenticatedAsWidget authenticatedAsWidgetIn, String text) { + super(authenticatedAsWidgetIn, text); + this.authenticatedAsWidgetField = authenticatedAsWidget; +} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + Object obj; + boolean flag = this.isActive(); + if (!flag) { + return; + } + + obj = this; + + flag = this.evaluateFlag3(value, index); + + if (!flag) { + return; + } + + obj = this.getParent().getParent().getParent(); + + AltRepositoryGUI altRepositoryGUI = (AltRepositoryGUI)obj; + AltAccountEntry altAccountEntry = this.getParent().getAD(); + GradientLabelWidget gradientLabelWidget = this.authenticatedAsWidgetField.getGradientLabelWidgetField(); + String textStr = gradientLabelWidget.getStringValue(); + AltAccountEntry altAccountEntry2 = altAccountEntry.createAltAccountEntry2(textStr); + altRepositoryGUI.getIterator6FunctionHelper2().applyUpdate(altAccountEntry2); + altRepositoryGUI.performAction(); + this.getParent().createAltAccountEntry(false); + this.getParent().getParent().createAltAccountEntry(true); +} +} diff --git a/src/main/java/cc/novoline/gui/click/AuthStatusActionButton.java b/src/main/java/cc/novoline/gui/click/AuthStatusActionButton.java new file mode 100644 index 0000000..36b4157 --- /dev/null +++ b/src/main/java/cc/novoline/gui/click/AuthStatusActionButton.java @@ -0,0 +1,40 @@ +package cc.novoline.gui.click; + +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.gui.widget.AltRepositoryPanel; +import cc.novoline.gui.widget.AuthenticatedAsWidget; +import cc.novoline.gui.widget.FlatTextButtonWidget; + +public class AuthStatusActionButton extends FlatTextButtonWidget { + final AuthenticatedAsWidget authenticatedAsWidgetField; + + @Override + public double getDoubleValue() { + double doubleVal = this.getParent().getPosX() - 220.3F; + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent().getParent(); + return doubleVal - altRepositoryGUI.getScrollOffset(); +} + + @Override + public boolean isReadyState() { + return true; +} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + Object obj = this; + if (!this.evaluateFlag3(value, index)) { + return; + } + + this.getParent().setActive(false); + obj = this.getParent().getParent(); + + ((AltRepositoryPanel)obj).setActive(true); +} + + public AuthStatusActionButton(AuthenticatedAsWidget authenticatedAsWidget, AuthenticatedAsWidget authenticatedAsWidgetIn, String text) { + super(authenticatedAsWidgetIn, text); + this.authenticatedAsWidgetField = authenticatedAsWidget; +} +} diff --git a/src/main/java/cc/novoline/gui/click/CallbackButtonElement.java b/src/main/java/cc/novoline/gui/click/CallbackButtonElement.java new file mode 100644 index 0000000..f3aab3f --- /dev/null +++ b/src/main/java/cc/novoline/gui/click/CallbackButtonElement.java @@ -0,0 +1,41 @@ +package cc.novoline.gui.click; + +import cc.novoline.gui.element.GuiInteractive; +import cc.novoline.gui.element.NameAbstractButtonGuiElement; +import java.util.function.Consumer; +import org.checkerframework.checker.nullness.qual.Nullable; + +public final class CallbackButtonElement extends NameAbstractButtonGuiElement { + private final @Nullable Consumer consumer2; + + public CallbackButtonElement(@Nullable GuiInteractive guiInteractive, int value, int index) { + this(guiInteractive, value, index, null); +} + + @Override + public void applyInt(int value) { + Consumer consumer = this.consumer2; + if (this.consumer2 == null) { + return; + } + + consumer = this.consumer2; + + Integer intVal = value; + consumer.accept(intVal); +} + + public CallbackButtonElement(@Nullable GuiInteractive guiInteractive, int value, int index, int count, int amount) { + this(guiInteractive, value, index, count, amount, null); +} + + public CallbackButtonElement(@Nullable GuiInteractive guiInteractive, int value, int index, int count, int amount, @Nullable Consumer consumer) { + super(guiInteractive, value, index, count, amount); + this.consumer2 = consumer; +} + + public CallbackButtonElement(@Nullable GuiInteractive guiInteractive, int value, int index, @Nullable Consumer consumer) { + super(guiInteractive, value, index); + this.consumer2 = consumer; +} +} diff --git a/src/main/java/cc/novoline/gui/click/ClickGuiModuleRow.java b/src/main/java/cc/novoline/gui/click/ClickGuiModuleRow.java new file mode 100644 index 0000000..fb3c20f --- /dev/null +++ b/src/main/java/cc/novoline/gui/click/ClickGuiModuleRow.java @@ -0,0 +1,694 @@ +package cc.novoline.gui.click; +import cc.novoline.Novoline; +import cc.novoline.gui.screen.ClickGUI; +import cc.novoline.gui.screen.click.Tab; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.configurations.util.ClickGuiSettingRow; +import cc.novoline.modules.visual.ClickGui; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontFamilySF_MEDIUM; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.modules.ModuleRegistry; +import java.awt.Color; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.ThreadLocalRandom; +import java.util.function.Consumer; +import java.util.function.Predicate; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; + + +import net.minecraft.util.MathHelper; +import cc.novoline.utils.fonts.api.FontFamily; +import net.minecraft.client.Minecraft; +import org.lwjgl.opengl.GL11; + +public class ClickGuiModuleRow { + private static final Color DEFAULT_COLOR = new Color(20, 20, 20); + private boolean stateFlag; + private static Object[] m; + private double cachedValue; + private List clickGuiSettingRowList; + private int intValue; + private double cachedValue2; + private double cachedValue3; + private AbstractModule abstractModuleField; + private double cachedValue4; + private double cachedValue5; + private double cachedValue6; + private boolean stateFlag2; + private double cachedValue7; + private Tab tabField; + + private long computeLongValue() { + long longVal = 500L; + List itemList = this.tabField.getClickGuiModuleRowList(); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + ClickGuiModuleRow modRow = (ClickGuiModuleRow)iter.next(); + if (modRow == this) { + break; + } + + longVal += 500L; + } + + return longVal; +} + + public void performAction() { + List itemList = null; + if (!this.stateFlag) { + return; + } + + itemList = this.clickGuiSettingRowList; + Stream stream2 = itemList.stream(); + Predicate predicate = ClickGuiModuleRow::matchesClickGuiSettingRow5; + Stream stream3 = stream2.filter(predicate); + Collector collector = Collectors.toList(); + itemList = (java.util.List) stream3.collect(collector); + + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + ClickGuiSettingRow settingRow = (ClickGuiSettingRow)iter.next(); + settingRow.performAction(); + } +} + + private static boolean matchesClickGuiSettingRow(ClickGuiSettingRow clickGuiSettingRow) { + Object obj = clickGuiSettingRow.getSetting().getVisibilitySupplier(); + if (obj == null) { + return true; + } + + obj = (Boolean)clickGuiSettingRow.getSetting().getVisibilitySupplier().get(); + + return ((Boolean) obj); +} + + public static Object[] i() { + return m; +} + + private static boolean matchesClickGuiSettingRow2(ClickGuiSettingRow clickGuiSettingRow) { + Object obj = clickGuiSettingRow.getSetting().getVisibilitySupplier(); + if (obj == null) { + return true; + } + + obj = (Boolean)clickGuiSettingRow.getSetting().getVisibilitySupplier().get(); + + return ((Boolean) obj); +} + + public static void b(Object[] flowGuardArray) { + m = flowGuardArray; +} + + private static boolean lambdaImpl$drawScreen$1(ClickGuiSettingRow clickGuiSettingRow) { + Object obj = clickGuiSettingRow.getSetting().getVisibilitySupplier(); + if (obj == null) { + return true; + } + + obj = (Boolean)clickGuiSettingRow.getSetting().getVisibilitySupplier().get(); + + return ((Boolean) obj); +} + + private static boolean lambdaImpl$drawScreen$0(ClickGuiSettingRow clickGuiSettingRow) { + Object obj = clickGuiSettingRow.getSetting().getVisibilitySupplier(); + if (obj == null) { + return true; + } + + obj = (Boolean)clickGuiSettingRow.getSetting().getVisibilitySupplier().get(); + + return ((Boolean) obj); +} + + private static boolean matchesClickGuiSettingRow5(ClickGuiSettingRow clickGuiSettingRow) { + Object obj = clickGuiSettingRow.getSetting().getVisibilitySupplier(); + if (obj == null) { + return true; + } + + obj = (Boolean)clickGuiSettingRow.getSetting().getVisibilitySupplier().get(); + + return ((Boolean) obj); +} + + public ClickGuiModuleRow(Tab tab, AbstractModule module) { + this.cachedValue7 = 0.0; + this.clickGuiSettingRowList = new CopyOnWriteArrayList<>(); + this.tabField = tab; + this.abstractModuleField = module; + double doubleVal = this.tabField.getCachedValue(); + ThreadLocalRandom threadLocalRandom = ThreadLocalRandom.current(); + this.cachedValue5 = doubleVal + threadLocalRandom.nextInt(0, 130); + double doubleVal2 = this.getDoubleValue2(); + Tab guiTab = this.tabField; + double doubleVal3 = doubleVal2 - guiTab.getDoubleValue(); + threadLocalRandom = ThreadLocalRandom.current(); + this.cachedValue4 = doubleVal3 + threadLocalRandom.nextInt(0, 20); + List itemList = SettingManager.getSettingsByMod(module); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + Setting setting = (Setting)iter.next(); + List itemList2 = this.clickGuiSettingRowList; + ClickGuiSettingRow settingRow = new ClickGuiSettingRow(setting, this); + itemList2.add(settingRow); + } +} + + private static boolean matchesClickGuiSettingRow6(ClickGuiSettingRow clickGuiSettingRow) { + Object obj = clickGuiSettingRow.getSetting().getVisibilitySupplier(); + if (obj == null) { + return true; + } + + obj = (Boolean)clickGuiSettingRow.getSetting().getVisibilitySupplier().get(); + + return ((Boolean) obj); +} + + public void mouseClickedPanel(int value, int index, int count) { + int intVal; + cc.novoline.modules.AbstractModule mod; + Object[] objArr; + List itemList; + + label84: { + objArr = i(); + intVal = count; + + if (count == 0) { + intVal = (this.evaluateCheck(value, index) ? 1 : 0); + + if (intVal == 0) { + break label84; + } + + AbstractModule mod2 = this.abstractModuleField; + mod2.toggle(); + double doubleVal = this.tabField.getCachedValue(); + ThreadLocalRandom threadLocalRandom = ThreadLocalRandom.current(); + this.cachedValue5 = doubleVal + threadLocalRandom.nextInt(0, 130); + double doubleVal2 = this.getDoubleValue2(); + Tab guiTab = this.tabField; + double doubleVal3 = doubleVal2 - guiTab.getDoubleValue(); + threadLocalRandom = ThreadLocalRandom.current(); + this.cachedValue4 = doubleVal3 + threadLocalRandom.nextInt(0, 20); + + break label84; + + } + + intVal = (this.evaluateCheck(value, index) ? 1 : 0); + + + if (intVal != 0) { + intVal = count; + + if (count == 1) { + ClickGuiModuleRow modRow = this; + + + if (!this.stateFlag) { + ModuleRegistry modEntry = ModuleRegistry.CLICKGUI; + mod = (ClickGui)modEntry.getModule(); + + BooleanProperty boolProp = ((ClickGui)mod).getBooleanPropertyA(); + Boolean propFlag = boolProp.get(); + if (propFlag) { + Tab guiTab2 = this.tabField; + List itemList2 = guiTab2.getClickGuiModuleRowList(); + Consumer consumer = ClickGuiModuleRow::handleClickGuiModuleRow; + itemList2.forEach(consumer); + } + } + + mod = this.abstractModuleField; + + mod.getMsTimer().reset(); + modRow = this; + + + boolean flag = this.stateFlag; + + flag = !this.stateFlag; + + + modRow.stateFlag = flag; + } + } + } + + itemList = null; + + intVal = (this.stateFlag ? 1 : 0); + + if (intVal == 0) { + return; + } + + itemList = this.clickGuiSettingRowList; + Stream stream2 = itemList.stream(); + Predicate predicate = ClickGuiModuleRow::matchesClickGuiSettingRow6; + Stream stream3 = stream2.filter(predicate); + Collector collector = Collectors.toList(); + itemList = (java.util.List) stream3.collect(collector); + + Iterator iter = itemList.iterator(); + + do { + if (!iter.hasNext()) { + break; + } + + ClickGuiSettingRow settingRow = (ClickGuiSettingRow)iter.next(); + settingRow.handleInt(value, index, count); + } while (objArr != null); +} + + public AbstractModule getAbstractModule() { + return this.abstractModuleField; +} + + private double getDoubleValue2() { + double doubleVal = this.tabField.getCachedValue22() + 20.0; + Tab guiTab = this.tabField; + List itemList = guiTab.getClickGuiModuleRowList(); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + ClickGuiModuleRow modRow = (ClickGuiModuleRow)iter.next(); + if (modRow == this) { + break; + } + + doubleVal += 20.0 + modRow.cachedValue2; + } + + return doubleVal; +} + + public void renderPanel(ClickGui clickGui, int value, int index, float amount, boolean flag, int count) { + cc.novoline.gui.click.ClickGuiModuleRow modRow; + cc.novoline.gui.click.ClickGuiModuleRow modRow2; + cc.novoline.gui.click.ClickGuiModuleRow modRow3; + int intVal; + StringProperty strProp = clickGui.getStringPropertyR(); + String textStr = "Basic"; + intVal = (strProp.equals(textStr) ? 1 : 0); + + if (intVal != 0) { + Novoline novolineInst = Novoline.getInstance(); + ClickGUI clickGuiScreen = novolineInst.getClickGUI(); + if (clickGuiScreen.getSmoothAnim().getCachedValue2() != 1.0) { + AbstractModule mod = this.abstractModuleField; + intVal = (mod.isEnabled() ? 1 : 0); + + if (intVal != 0) { + Tab guiTab = this.tabField; + double doubleVal = guiTab.getCachedValue(); + double doubleVal6 = this.cachedValue6; + double doubleVal7 = this.tabField.getCachedValue() + 130.0; + double doubleVal8 = this.cachedValue6 + 20.0; + RenderUtils.drawRect(doubleVal, doubleVal6, doubleVal7, doubleVal8, count); + } + } + } + + GL11.glEnable(3089); + double doubleVal2 = this.getDoubleValue2(); + Tab guiTab2 = this.tabField; + this.cachedValue6 = doubleVal2 - guiTab2.getDoubleValue(); + Tab guiTab3 = this.tabField; + float floatVal = (float)guiTab3.getCachedValue(); + float floatVal5 = (float)this.cachedValue6; + guiTab2 = this.tabField; + GuiBlurFramebuffer.renderPanel(floatVal, floatVal5, (float)(guiTab2.getCachedValue() + 130.0), (float)(this.cachedValue6 + 20.0)); + AbstractModule mod2 = this.abstractModuleField; + intVal = (mod2.isEnabled() ? 1 : 0); + + label240: { + + if (intVal != 0) { + if (this.cachedValue < 125.0) { + AbstractModule mod3 = this.abstractModuleField; + this.cachedValue = mod3.getTimer2().computeDoubleFromLong(300L, 125.0); + break label240; + + } + } + + AbstractModule mod4 = this.abstractModuleField; + intVal = (mod4.isEnabled() ? 1 : 0); + + if (intVal == 0) { + if (this.cachedValue > 0.0) { + AbstractModule mod5 = this.abstractModuleField; + this.cachedValue = 125.0 - mod5.getTimer2().computeDoubleFromLong(300L, 125.0); + } + } + } + + intVal = (flag ? 1 : 0); + + label241: { + + if (intVal != 0) { + if (this.cachedValue7 < 3.0) { + this.cachedValue7 = this.cachedValue7 + (3.0 - this.cachedValue7) * 0.05; + break label241; + } + } + + intVal = (flag ? 1 : 0); + + if (intVal == 0) { + if (this.cachedValue7 > 0.0) { + this.cachedValue7 = this.cachedValue7 + (0.0 - this.cachedValue7) * 0.05; + } + } + } + + StringProperty strProp2 = clickGui.getStringPropertyR(); + textStr = "Basic"; + intVal = (strProp2.equals(textStr) ? 1 : 0); + + if (intVal != 0) { + Novoline novolineInst2 = Novoline.getInstance(); + ClickGUI clickGuiScreen2 = novolineInst2.getClickGUI(); + if (clickGuiScreen2.getSmoothAnim().getCachedValue2() == 1.0) { + Tab guiTab4 = this.tabField; + float floatVal2 = (float)(guiTab4.getCachedValue() + 60.0); + float floatVal6 = (float)(this.cachedValue6 + 20.0); + float floatVal7 = (float)this.cachedValue; + RenderUtils.drawElement9(floatVal2, floatVal6, floatVal7, count); + } + } + + GL11.glDisable(3089); + StringProperty strProp3 = clickGui.getStringPropertyR(); + textStr = "Old"; + intVal = (strProp3.equals(textStr) ? 1 : 0); + + label183: { + if (intVal == 0) { + Color awtColor = Color.WHITE; + intVal = awtColor.getRGB(); + break label183; + } + + AbstractModule mod6 = this.abstractModuleField; + intVal = (mod6.isEnabled() ? 1 : 0); + + if (intVal != 0) { + intVal = count; + } else { + Color awtColor2 = Color.WHITE; + intVal = awtColor2.getRGB(); + } + } + + int intVal7 = intVal; + Tab guiTab5 = this.tabField; + ClickGUI clickGuiScreen3 = guiTab5.getClickGUI2(); + FontFamily fontFam = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font = fontFam.ofSize(22); + AbstractModule mod7 = this.abstractModuleField; + String nameStr = mod7.getName(); + Tab guiTab6 = this.tabField; + clickGuiScreen3.drawScaledString(font, nameStr, guiTab6.getCachedValue() + 3.0, this.cachedValue6 + 6.5, intVal7, true); + AbstractModule mod8 = this.abstractModuleField; + List itemList = SettingManager.getSettingsByMod(mod8); + int size2 = itemList.size(); + + if (size2 > 1) { + label243: { + label172: { + + int intVal2 = (this.evaluateCheck(value, index) ? 1 : 0); + if (intVal2 == 0) { + break label243; + } + + modRow = this; + + intVal2 = this.intValue; + + if (intVal2 < 255) { + modRow = this; + + if (!this.stateFlag2) { + int intVal3 = this.intValue + 3; + this.intValue = MathHelper.clamp_int(intVal3, 0, 255); + break label172; + } + } + + modRow = this; + + modRow.stateFlag2 = true; + } + + modRow2 = this; + + if (this.intValue > 0) { + modRow2 = this; + + if (this.stateFlag2) { + int intVal4 = this.intValue - 3; + this.intValue = MathHelper.clamp_int(intVal4, 0, 255); + break label243; + } + } + + modRow2 = this; + + modRow2.stateFlag2 = false; + } + + long timeMs = Minecraft.getSystemTime(); + double doubleVal3 = (float)(timeMs - this.computeLongValue()) % 12000.0F / 12000.0F * Math.PI * 4.0; + float floatVal3 = MathHelper.sin(doubleVal3); + float floatVal4 = 1.0F - MathHelper.abs(floatVal3); + intVal = (int)(floatVal4 * 255.0F); + int intVal5 = MathHelper.clamp_int(intVal, 20, 240); + Tab guiTab7 = this.tabField; + Tab guiTab8 = this.tabField; + double doubleVal4 = guiTab8.getCachedValue() + 110.0; + double doubleVal9 = this.cachedValue6 + 8.0; + double doubleVal10 = this.abstractModuleField.getMsTimer().computeDoubleFromLong(100L, 1.0); + guiTab7.drawElement(doubleVal4, doubleVal9, 3.5, doubleVal10, this.stateFlag); + } + + size2 = (this.stateFlag ? 1 : 0); + + + label247: { + + if (size2 == 0) { + double doubleVal5; + intVal = (doubleVal5 = this.cachedValue2 - 0.0) == 0.0 ? 0 : (doubleVal5 < 0.0 ? -1 : 1); + + if (intVal == 0) { + break label247; + } + } + + size2 = 0; + + + int intVal6 = size2; + List itemList2 = this.clickGuiSettingRowList; + Stream stream2 = itemList2.stream(); + Predicate predicate = ClickGuiModuleRow::lambdaImpl$drawScreen$0; + Stream stream3 = stream2.filter(predicate); + Collector collector = Collectors.toList(); + List itemList3 = (java.util.List) stream3.collect(collector); + Iterator iter = itemList3.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + ClickGuiSettingRow settingRow = (ClickGuiSettingRow)iter.next(); + intVal6 += settingRow.getStateTicks(); + + } + + this.cachedValue2 = intVal6; + + List itemList4 = this.clickGuiSettingRowList; + Stream stream4 = itemList4.stream(); + Predicate predicate2 = ClickGuiModuleRow::lambdaImpl$drawScreen$1; + Stream stream5 = stream4.filter(predicate2); + Collector collector2 = Collectors.toList(); + List itemList5 = (java.util.List) stream5.collect(collector2); + iter = itemList5.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + ClickGuiSettingRow settingRow2 = (ClickGuiSettingRow)iter.next(); + settingRow2.renderClickGui(clickGui, value, index, amount, count); + + } + } + + intVal = (this.stateFlag ? 1 : 0); + + if (intVal != 0) { + return; + } + + modRow3 = this; + + if (this.cachedValue2 <= 0.0) { + return; + } + + modRow3 = this; + + modRow3.cachedValue2 = 0.0; +} + + static { + Object[] objArr = new Object[2]; + b(objArr); + } + + public boolean isStateFlag() { + return this.stateFlag; +} + + public double getCachedValue2() { + return this.cachedValue2; +} + + public Tab getTabField() { + return this.tabField; +} + + public boolean evaluateCheck(int value, int index) { + double doubleVal3 = value; + Tab guiTab = this.tabField; + if (doubleVal3 < guiTab.getCachedValue()) { + return false; + } + + doubleVal3 = value; + guiTab = this.tabField; + if (doubleVal3 > (guiTab.getCachedValue() + 125.0)) { + return false; + } + + doubleVal3 = index; + double doubleVal = this.getDoubleValue2(); + Tab guiTab2 = this.tabField; + if (doubleVal3 < (doubleVal - guiTab2.getDoubleValue() + 1.0)) { + return false; + } + + doubleVal3 = index; + double doubleVal2 = this.getDoubleValue2(); + Tab guiTab3 = this.tabField; + return doubleVal3 <= (doubleVal2 - guiTab3.getDoubleValue() + 19.0); +} + + public void setStateFlag(boolean flag) { + this.stateFlag = flag; +} + + private static void handleClickGuiModuleRow(ClickGuiModuleRow clickGuiModuleRow) { + ClickGuiModuleRow modRow = clickGuiModuleRow; + if (!clickGuiModuleRow.stateFlag) { + return; + } + + modRow = clickGuiModuleRow; + + modRow.stateFlag = false; +} + + public double getDoubleValue3() { + double doubleVal = this.getDoubleValue2(); + return doubleVal - this.tabField.getDoubleValue(); +} + + public void evaluateCheck(char ch, int value) { + List itemList = null; + if (!this.stateFlag) { + return; + } + + itemList = this.clickGuiSettingRowList; + Stream stream2 = itemList.stream(); + Predicate predicate = ClickGuiModuleRow::matchesClickGuiSettingRow2; + Stream stream3 = stream2.filter(predicate); + Collector collector = Collectors.toList(); + itemList = (java.util.List) stream3.collect(collector); + + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + ClickGuiSettingRow settingRow = (ClickGuiSettingRow)iter.next(); + settingRow.drawElement(ch, value); + } +} + + public List getList() { + Stream stream2 = this.clickGuiSettingRowList.stream(); + Predicate predicate = ClickGuiModuleRow::matchesClickGuiSettingRow; + Stream stream3 = stream2.filter(predicate); + Collector collector = Collectors.toList(); + return (java.util.List) stream3.collect(collector); +} + + public Tab getTab() { return this.getTabField(); } + public AbstractModule getModule() { return this.getAbstractModule(); } + public boolean isExpanded() { return this.isStateFlag(); } + public void setExpanded(boolean expanded) { this.setStateFlag(expanded); } + public double getExpandHeight() { return this.getCachedValue2(); } + public List getVisibleSettings() { return this.getList(); } + public void mouseReleased() { this.performAction(); } + public void keyTyped(char typedChar, int keyCode) { this.evaluateCheck(typedChar, keyCode); } + public boolean isHovered(int mouseX, int mouseY) { return this.evaluateCheck(mouseX, mouseY); } +} diff --git a/src/main/java/cc/novoline/gui/click/ClickGuiModuleTypeSwitchMap.java b/src/main/java/cc/novoline/gui/click/ClickGuiModuleTypeSwitchMap.java new file mode 100644 index 0000000..2663ee5 --- /dev/null +++ b/src/main/java/cc/novoline/gui/click/ClickGuiModuleTypeSwitchMap.java @@ -0,0 +1,39 @@ +package cc.novoline.gui.click; + +import cc.novoline.modules.EnumModuleType; + +public class ClickGuiModuleTypeSwitchMap { + public static final int[] SWITCH_MAP = new int[EnumModuleType.values().length]; + + static { + try { + SWITCH_MAP[EnumModuleType.COMBAT.ordinal()] = 1; + } catch (NoSuchFieldError noSuchFieldError) { + } + + try { + SWITCH_MAP[EnumModuleType.MISC.ordinal()] = 2; + } catch (NoSuchFieldError noSuchFieldError2) { + } + + try { + SWITCH_MAP[EnumModuleType.PLAYER.ordinal()] = 3; + } catch (NoSuchFieldError noSuchFieldError3) { + } + + try { + SWITCH_MAP[EnumModuleType.VISUALS.ordinal()] = 4; + } catch (NoSuchFieldError noSuchFieldError4) { + } + + try { + SWITCH_MAP[EnumModuleType.EXPLOITS.ordinal()] = 5; + } catch (NoSuchFieldError noSuchFieldError5) { + } + + try { + SWITCH_MAP[EnumModuleType.MOVEMENT.ordinal()] = 6; + } catch (NoSuchFieldError noSuchFieldError6) { + } + } +} diff --git a/src/main/java/cc/novoline/gui/click/ColorChannelSwitchMap.java b/src/main/java/cc/novoline/gui/click/ColorChannelSwitchMap.java new file mode 100644 index 0000000..f5d3904 --- /dev/null +++ b/src/main/java/cc/novoline/gui/click/ColorChannelSwitchMap.java @@ -0,0 +1,63 @@ +package cc.novoline.gui.click; + +import cc.novoline.gui.screen.setting.ColorChannel; +import cc.novoline.gui.screen.setting.SettingType; + +public class ColorChannelSwitchMap { + public static final int[] SWITCH_MAP; + public static final int[] SWITCH_MAP2 = new int[SettingType.values().length]; + + static { + try { + SWITCH_MAP2[SettingType.BINDABLE.ordinal()] = 1; + } catch (NoSuchFieldError noSuchFieldError) { + } + + try { + SWITCH_MAP2[SettingType.COMBOBOX.ordinal()] = 2; + } catch (NoSuchFieldError noSuchFieldError2) { + } + + try { + SWITCH_MAP2[SettingType.SELECTBOX.ordinal()] = 3; + } catch (NoSuchFieldError noSuchFieldError3) { + } + + try { + SWITCH_MAP2[SettingType.CHECKBOX.ordinal()] = 4; + } catch (NoSuchFieldError noSuchFieldError4) { + } + + try { + SWITCH_MAP2[SettingType.SLIDER.ordinal()] = 5; + } catch (NoSuchFieldError noSuchFieldError5) { + } + + try { + SWITCH_MAP2[SettingType.TEXTBOX.ordinal()] = 6; + } catch (NoSuchFieldError noSuchFieldError6) { + } + + try { + SWITCH_MAP2[SettingType.COLOR_PICKER.ordinal()] = 7; + } catch (NoSuchFieldError noSuchFieldError7) { + } + + SWITCH_MAP = new int[ColorChannel.values().length]; + + try { + SWITCH_MAP[ColorChannel.HUE.ordinal()] = 1; + } catch (NoSuchFieldError noSuchFieldError8) { + } + + try { + SWITCH_MAP[ColorChannel.SATURATION.ordinal()] = 2; + } catch (NoSuchFieldError noSuchFieldError9) { + } + + try { + SWITCH_MAP[ColorChannel.BRIGHTNESS.ordinal()] = 3; + } catch (NoSuchFieldError noSuchFieldError10) { + } + } +} diff --git a/src/main/java/cc/novoline/gui/click/DiscordSettingSwitchMap.java b/src/main/java/cc/novoline/gui/click/DiscordSettingSwitchMap.java new file mode 100644 index 0000000..294089f --- /dev/null +++ b/src/main/java/cc/novoline/gui/click/DiscordSettingSwitchMap.java @@ -0,0 +1,29 @@ +package cc.novoline.gui.click; + +import cc.novoline.gui.screen.setting.SettingType; + +public class DiscordSettingSwitchMap { + public static final int[] SWITCH_MAP = new int[SettingType.values().length]; + + static { + try { + SWITCH_MAP[SettingType.SLIDER.ordinal()] = 1; + } catch (NoSuchFieldError noSuchFieldError) { + } + + try { + SWITCH_MAP[SettingType.COMBOBOX.ordinal()] = 2; + } catch (NoSuchFieldError noSuchFieldError2) { + } + + try { + SWITCH_MAP[SettingType.SELECTBOX.ordinal()] = 3; + } catch (NoSuchFieldError noSuchFieldError3) { + } + + try { + SWITCH_MAP[SettingType.TEXTBOX.ordinal()] = 4; + } catch (NoSuchFieldError noSuchFieldError4) { + } + } +} diff --git a/src/main/java/cc/novoline/gui/click/GuiBlurFramebuffer.java b/src/main/java/cc/novoline/gui/click/GuiBlurFramebuffer.java new file mode 100644 index 0000000..3d79b4e --- /dev/null +++ b/src/main/java/cc/novoline/gui/click/GuiBlurFramebuffer.java @@ -0,0 +1,307 @@ +package cc.novoline.gui.click; + +import cc.novoline.modules.visual.ClickGui; +import cc.novoline.utils.TimerUtil; +import cc.novoline.modules.ModuleRegistry; +import java.awt.Color; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.shader.Framebuffer; +import net.minecraft.client.shader.ShaderGroup; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.OpenGLException; + +public final class GuiBlurFramebuffer { + private static Framebuffer framebuffer; + private static int intState; + private static int intState2; +private static ShaderGroup shaderGroupField; + private static final Object objValue = new Object(); + private static final Minecraft mc = Minecraft.getMinecraft(); + + public static void renderElement() { + int intVal; + intVal = TimerUtil.g(); + label44: + if (shaderGroupField != null) { + int intVal3 = mc.displayWidth; + int intVal4 = intState; + if (mc.displayWidth != intState) { + break label44; + } + + intVal3 = mc.displayHeight; + intVal4 = intState2; + + if (intVal3 == intVal4) { + return; + } + } + + synchronized (objValue) { + framebuffer = new Framebuffer(mc.displayWidth, mc.displayHeight, false); + Framebuffer fbo = framebuffer; + fbo.setFramebufferColor(0.0F, 0.0F, 0.0F, 0.0F); + int intVal2 = (OpenGlHelper.isFramebufferEnabled() ? 1 : 0); + label34: + if (intVal == 0) { + try { + intState2 = intVal2; + } catch (Exception ex) { + throw new OpenGLException("Failed to create a shader object"); + } + } else { + if (intVal2 == 0) { + throw new OpenGLException("Framebuffer is not supported"); + } + + try { + TextureManager texManager = mc.getTextureManager(); + Minecraft mcClient = mc; + shaderGroupField = new ShaderGroup(texManager, mcClient.getResourceManager(), framebuffer, new ResourceLocation("shaders/post/NovoBlur.json")); + shaderGroupField.createBindFramebuffers(mc.displayWidth, mc.displayHeight); + intState = mc.displayWidth; + intVal2 = mc.displayHeight; + break label34; + } catch (Exception ex2) { + throw new OpenGLException("Failed to create a shader object"); + } + } + } +} + + private GuiBlurFramebuffer() { + throw new UnsupportedOperationException("This is a utility class and cannot be instantiated"); +} + + public static void renderElement2(float value, float amount, float factor, float angle, boolean flag) { + GL11.glEnable(3089); + renderPanel(value, amount, factor, angle); + GL11.glPushMatrix(); + Framebuffer fbo = framebuffer; + int intVal = Minecraft.getMinecraft().displayWidth; + int intVal2 = Minecraft.getMinecraft().displayHeight; + fbo.framebufferRenderExt(intVal, intVal2, true); + GL11.glPopMatrix(); + short shortVal = (short)(flag ? 1 : 0); + if (flag != false) { + ScaledResolution scaledRes = new ScaledResolution(mc); + GlStateManager.clear(256); + GL11.glMatrixMode(5889); + GL11.glLoadIdentity(); + double scaledWidthD = scaledRes.getScaledWidth_double(); + double scaledHeightD = scaledRes.getScaledHeight_double(); + GL11.glOrtho(0.0, scaledWidthD, scaledHeightD, 0.0, 1000.0, 3000.0); + GL11.glMatrixMode(5888); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -2000.0F); + } + + GlStateManager.enableDepth(); + shortVal = 3089; + + GL11.glDisable(shortVal); +} + + public static void handleGuiAction(float value, float amount, float factor, float angle, double offset) { + int intVal; + ScaledResolution scaledRes; + double doubleVal; + label24: { + intVal = TimerUtil.f(); + factor -= value; + angle -= amount; + scaledRes = new ScaledResolution(mc); + doubleVal = 1.0; + intVal = mc.gameSettings.guiScale; + byte byteVal = 1; + if (mc.gameSettings.guiScale == 1) { + doubleVal = 2.0; + break label24; + } + + intVal = mc.gameSettings.guiScale; + + if (intVal == 3) { + doubleVal = 0.6666666666666667; + } + } + + doubleVal *= offset; + value = (float)(value * doubleVal); + amount = (float)(amount * doubleVal); + factor = (float)(factor * doubleVal); + angle = (float)(angle * doubleVal); + intVal = scaledRes.getScaleFactor(); + + int intVal2 = intVal; + int intVal3 = (int)(value * intVal2); + int intVal4 = (int)(mc.displayHeight - amount * intVal2 - angle * intVal2); + int intVal5 = (int)(factor * intVal2); + int intVal6 = (int)(angle * intVal2); + GL11.glScissor(intVal3, intVal4, intVal5, intVal6); +} + + + + public static void handleGuiAction2(double value, double amount, double offset, double dist) { + ScaledResolution scaledRes = new ScaledResolution(mc); + int intVal = scaledRes.getScaleFactor(); + value *= intVal; + amount *= intVal; + offset *= intVal; + dist *= intVal; + GL11.glScissor((int)value, (int)(mc.displayHeight - amount - dist), (int)offset, (int)dist); +} + + public static void handleGuiAction2(float value, float amount, float factor, float angle) { + ScaledResolution scaledRes = new ScaledResolution(mc); + int intVal = scaledRes.getScaleFactor(); + value *= intVal; + amount *= intVal; + factor *= intVal; + angle *= intVal; + GL11.glScissor((int)value, (int)(mc.displayHeight - amount - angle), (int)factor, (int)angle); +} + + public static void handleGuiAction(float value, float amount, float factor, float angle, boolean flag) { + int intVal = mc.gameSettings.guiScale; + int intVal2 = intVal; + byte byteVal = 1; + if (intVal == 1) { + renderElement2(value * 0.5F, amount * 0.5F, factor * 0.5F, angle * 0.5F, flag); + return; + } + + intVal2 = intVal; + + if (intVal2 == 2) { + renderElement2(value, amount, factor, angle, flag); + return; + } + + intVal2 = intVal; + + if (intVal2 == 3) { + renderElement2(value * 1.5F, amount * 1.5F, factor * 1.5F, angle * 1.5F, flag); + } +} + + public static void renderElement3(boolean flag) { + Framebuffer fbo = mc.getFramebuffer(); + fbo.unbindFramebuffer(); + Framebuffer fbo2 = framebuffer; + fbo2.bindFramebuffer(true); + Minecraft mcClient = mc; + Framebuffer fbo3 = mcClient.getFramebuffer(); + int intVal = mc.displayWidth; + int intVal2 = mc.displayHeight; + fbo3.framebufferRenderExt(intVal, intVal2, true); + boolean flag2 = OpenGlHelper.shadersSupported; + label24: + if (OpenGlHelper.shadersSupported) { + ShaderGroup shaderGroup = shaderGroupField; + if (shaderGroupField == null) { + break label24; + } + + GL11.glMatrixMode(5890); + GL11.glPushMatrix(); + GL11.glLoadIdentity(); + shaderGroup = shaderGroupField; + + shaderGroup.loadShaderGroup(mc.timer.renderPartialTicks); + GL11.glPopMatrix(); + } + + Framebuffer fbo4 = framebuffer; + fbo4.unbindFramebuffer(); + Minecraft mcClient2 = mc; + Framebuffer fbo5 = mcClient2.getFramebuffer(); + fbo5.bindFramebuffer(true); + flag2 = flag; + + if (flag2) { + ScaledResolution scaledRes = new ScaledResolution(mc); + GlStateManager.clear(256); + GL11.glMatrixMode(5889); + GL11.glLoadIdentity(); + double scaledWidthD = scaledRes.getScaledWidth_double(); + double scaledHeightD = scaledRes.getScaledHeight_double(); + GL11.glOrtho(0.0, scaledWidthD, scaledHeightD, 0.0, 1000.0, 3000.0); + GL11.glMatrixMode(5888); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -2000.0F); + } +} + + public static int calculateInt(Color color, Color color2, float value) { + float floatVal = color.getRed(); + int intVal2 = color2.getRed(); + int intVal = (int)(floatVal + (intVal2 - color.getRed()) * value); + floatVal = color.getGreen(); + intVal2 = color2.getGreen(); + int intVal3 = (int)(floatVal + (intVal2 - color.getGreen()) * value); + floatVal = color.getBlue(); + intVal2 = color2.getBlue(); + int intVal4 = (int)(floatVal + (intVal2 - color.getBlue()) * value); + floatVal = color.getAlpha(); + intVal2 = color2.getAlpha(); + int intVal5 = (int)(floatVal + (intVal2 - color.getAlpha()) * value); + + try { + Color awtColor = new Color(intVal, intVal3, intVal4, intVal5); + return awtColor.getRGB(); + } catch (Exception ex) { + return -1; + } +} + + public static void renderPanel(float value, float amount, float factor, float angle) { + int intVal; + ScaledResolution scaledRes; + double doubleVal; + double doubleVal2; + label24: { + intVal = TimerUtil.g(); + factor -= value; + angle -= amount; + ClickGui clickGuiMod = ModuleRegistry.CLICKGUI.getModule(); + scaledRes = new ScaledResolution(mc); + doubleVal = clickGuiMod.getCachedValue(); + doubleVal2 = 1.0; + intVal = mc.gameSettings.guiScale; + byte byteVal = 1; + if (mc.gameSettings.guiScale == 1) { + doubleVal2 = 2.0; + break label24; + } + + intVal = mc.gameSettings.guiScale; + + byteVal = 3; + + if (intVal == byteVal) { + doubleVal2 = 0.6666666666666667; + } + } + + doubleVal2 *= doubleVal; + value = (float)(value * doubleVal2); + amount = (float)(amount * doubleVal2); + factor = (float)(factor * doubleVal2); + angle = (float)(angle * doubleVal2); + intVal = scaledRes.getScaleFactor(); + + int intVal2 = intVal; + int intVal3 = (int)(value * intVal2); + int intVal4 = (int)(mc.displayHeight - amount * intVal2 - angle * intVal2); + int intVal5 = (int)(factor * intVal2); + int intVal6 = (int)(angle * intVal2); + GL11.glScissor(intVal3, intVal4, intVal5, intVal6); +} +} diff --git a/src/main/java/cc/novoline/gui/click/GuiConfigItemSlot.java b/src/main/java/cc/novoline/gui/click/GuiConfigItemSlot.java new file mode 100644 index 0000000..c4dc434 --- /dev/null +++ b/src/main/java/cc/novoline/gui/click/GuiConfigItemSlot.java @@ -0,0 +1,333 @@ +package cc.novoline.gui.click; + +import cc.novoline.gui.screen.config.GuiConfig; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.player.InvManager; +import cc.novoline.modules.player.Scaffold; +import cc.novoline.utils.RenderUtils; +import cc.novoline.modules.ModuleRegistry; +import java.awt.Color; +import cc.novoline.utils.RenderUtilsSupport; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class GuiConfigItemSlot { + final GuiConfig guiConfigField; + private IntProperty intPropertyField; + private float cachedAngle; + private Item itemField; + private float cachedAngle2; + private int stateTicks; + private boolean stateFlag; + private boolean stateFlag2; + + public void performAction() { + InvManager invManager = ModuleRegistry.INVMANAGER.getModule(); + Scaffold scaffold = ModuleRegistry.SCAFFOLD.getModule(); + IntProperty intProp = invManager.getIntProperty3(); + Integer intVal = intProp.get(); + int intVal2 = intVal; + int ticks = this.stateTicks; + if (intVal2 == this.stateTicks) { + this.intPropertyField = invManager.getIntProperty3(); + return; + } + + IntProperty intProp2 = invManager.getIntProperty2(); + Integer intVal3 = intProp2.get(); + intVal2 = intVal3; + ticks = this.stateTicks; + + if (intVal2 == ticks) { + this.intPropertyField = invManager.getIntProperty2(); + return; + } + + IntProperty intProp3 = invManager.getIntProperty5(); + Integer intVal4 = intProp3.get(); + intVal2 = intVal4; + ticks = this.stateTicks; + + if (intVal2 == ticks) { + this.intPropertyField = invManager.getIntProperty5(); + return; + } + + IntProperty intProp4 = invManager.getIntProperty4(); + Integer intVal5 = intProp4.get(); + intVal2 = intVal5; + ticks = this.stateTicks; + + if (intVal2 == ticks) { + this.intPropertyField = invManager.getIntProperty4(); + return; + } + + IntProperty intProp5 = invManager.getIntPropertyK(); + Integer intVal6 = intProp5.get(); + intVal2 = intVal6; + ticks = this.stateTicks; + + if (intVal2 == ticks) { + this.intPropertyField = invManager.getIntPropertyK(); + return; + } + + IntProperty intProp6 = invManager.getIntPropertyJ(); + Integer intVal7 = intProp6.get(); + intVal2 = intVal7; + ticks = this.stateTicks; + + if (intVal2 == ticks) { + this.intPropertyField = invManager.getIntPropertyJ(); + return; + } + + IntProperty intProp7 = invManager.getIntPropertyR(); + Integer intVal8 = intProp7.get(); + intVal2 = intVal8; + ticks = this.stateTicks; + + if (intVal2 == ticks) { + this.intPropertyField = invManager.getIntPropertyR(); + return; + } + + IntProperty intProp8 = scaffold.getIntPropertyI(); + Integer intVal9 = intProp8.get(); + intVal2 = intVal9; + ticks = this.stateTicks; + + if (intVal2 == ticks) { + this.intPropertyField = scaffold.getIntPropertyI(); + } +} + + public boolean isHoveredAt(float value, float amount) { + if (value < this.cachedAngle) { + return false; + } + + if (value > (this.cachedAngle + 20.0F)) { + return false; + } + + if (amount < this.cachedAngle2) { + return false; + } + + return amount <= (this.cachedAngle2 + 20.0F); +} + + public static IntProperty createIntProperty(GuiConfigItemSlot guiConfigItemSlot, IntProperty property) { + return guiConfigItemSlot.intPropertyField = property; +} + + public void createIntProperty(float value, float amount) { + int color; + float floatVal; + float floatVal2; + float floatVal3; + float floatVal4; + int intVal; + floatVal = this.cachedAngle; + floatVal2 = this.cachedAngle2; + floatVal3 = this.cachedAngle + 20.0F; + floatVal4 = this.cachedAngle2 + 20.0F; + color = (new Color(29, 29, 29, 255)).getRGB(); + intVal = (this.isHoveredAt(value, amount) ? 1 : 0); + label35: { + if (intVal == 0) { + intVal = (this.stateFlag2 ? 1 : 0); + + if (!this.stateFlag2) { + Color awtColor = new Color(40, 40, 40, 255); + intVal = awtColor.getRGB(); + break label35; + } + } + + Color awtColor2 = new Color(40, 40, 40, 255); + Color awtColor3 = awtColor2.brighter(); + intVal = awtColor3.getRGB(); + } + + RenderUtils.drawBorderedRect(floatVal, floatVal2, floatVal3, floatVal4, 1.0F, color, intVal); + GuiConfigItemSlot guiConfigItemSlot = this; + + if (!this.isStateFlag()) { + return; + } + + guiConfigItemSlot = this; + + + if (guiConfigItemSlot.itemField == null) { + return; + } + + RenderUtilsSupport.enableGUIStandardItemLighting(); + GlStateManager.enableDepth(); + guiConfigItemSlot = this; + + Minecraft mcClient = GuiConfig.resolveGuiConfigItemSlot(guiConfigItemSlot.guiConfigField); + RenderItem renderItem = mcClient.getRenderItem(); + ItemStack stack = new ItemStack(this.itemField); + floatVal3 = this.cachedAngle + 2.0F; + floatVal4 = this.cachedAngle2 + 2.0F; + renderItem.updateState3(stack, floatVal3, floatVal4); + RenderUtilsSupport.disableStandardItemLighting(); + GlStateManager.disableDepth(); +} + + public GuiConfigItemSlot(GuiConfig guiConfig, int slot, float value, float amount) { + label79: { + this.guiConfigField = guiConfig; + this.stateTicks = slot; + this.cachedAngle = value; + this.cachedAngle2 = amount; + ModuleRegistry modEntry = ModuleRegistry.INVMANAGER; + InvManager invManager = modEntry.getModule(); + ModuleRegistry modEntry2 = ModuleRegistry.SCAFFOLD; + Scaffold scaffold = modEntry2.getModule(); + IntProperty intProp = invManager.getIntProperty3(); + Integer intVal = intProp.get(); + int intVal2 = intVal; + int slot2 = slot; + if (intVal2 == slot) { + this.evaluateCheck(true); + this.itemField = Items.golden_apple; + break label79; + } + + IntProperty intProp2 = invManager.getIntProperty2(); + intVal = intProp2.get(); + intVal2 = intVal; + slot2 = slot; + + if (intVal2 == slot2) { + this.evaluateCheck(true); + this.itemField = Items.diamond_axe; + break label79; + } + + IntProperty intProp3 = invManager.getIntProperty5(); + intVal = intProp3.get(); + intVal2 = intVal; + slot2 = slot; + + if (intVal2 == slot2) { + this.evaluateCheck(true); + this.itemField = Items.bow; + break label79; + } + + IntProperty intProp4 = invManager.getIntProperty4(); + intVal = intProp4.get(); + intVal2 = intVal; + slot2 = slot; + + if (intVal2 == slot2) { + this.evaluateCheck(true); + this.itemField = Items.skull; + break label79; + } + + IntProperty intProp5 = invManager.getIntPropertyK(); + intVal = intProp5.get(); + intVal2 = intVal; + slot2 = slot; + + if (intVal2 == slot2) { + this.evaluateCheck(true); + this.itemField = Items.diamond_shovel; + break label79; + } + + IntProperty intProp6 = invManager.getIntPropertyJ(); + intVal = intProp6.get(); + intVal2 = intVal; + slot2 = slot; + + if (intVal2 == slot2) { + this.evaluateCheck(true); + this.itemField = Items.diamond_pickaxe; + break label79; + } + + IntProperty intProp7 = invManager.getIntPropertyR(); + intVal = intProp7.get(); + intVal2 = intVal; + slot2 = slot; + + if (intVal2 == slot2) { + this.evaluateCheck(true); + this.itemField = Items.diamond_sword; + break label79; + } + + IntProperty intProp8 = scaffold.getIntPropertyI(); + intVal = intProp8.get(); + intVal2 = intVal; + slot2 = slot; + + if (intVal2 == slot2) { + this.evaluateCheck(true); + Block block = Blocks.stone; + this.itemField = Item.getItemFromBlock(block); + } + } + + this.performAction(); +} + + public static boolean evaluateCheck(GuiConfigItemSlot guiConfigItemSlot) { + return guiConfigItemSlot.stateFlag2; +} + + public Item getItem() { + return this.itemField; +} + + public static boolean createIntProperty(GuiConfigItemSlot guiConfigItemSlot, boolean flag) { + return guiConfigItemSlot.stateFlag2 = flag; +} + + public static IntProperty resolveIntProperty(GuiConfigItemSlot guiConfigItemSlot) { + return guiConfigItemSlot.intPropertyField; +} + + public void evaluateCheck(Item item) { + this.itemField = item; +} + + public static int calculateInt(GuiConfigItemSlot guiConfigItemSlot) { + return guiConfigItemSlot.stateTicks; +} + + public boolean isStateFlag() { + return this.stateFlag; +} + + public void evaluateCheck(boolean flag) { + this.stateFlag = flag; +} + + public IntProperty getIntPropertyField2() { + return this.intPropertyField; +} + + public int getStateTicks2() { + return this.stateTicks; +} + + public boolean getStateFlag2() { return this.stateFlag2; } + public cc.novoline.modules.configurations.property.object.IntProperty getIntPropertyField() { return this.intPropertyField; } + public int getStateTicks() { return this.stateTicks; } +} diff --git a/src/main/java/cc/novoline/gui/click/IconButtonConstHolder.java b/src/main/java/cc/novoline/gui/click/IconButtonConstHolder.java new file mode 100644 index 0000000..80bb1d4 --- /dev/null +++ b/src/main/java/cc/novoline/gui/click/IconButtonConstHolder.java @@ -0,0 +1,13 @@ +package cc.novoline.gui.click; + +public class IconButtonConstHolder { + public static String textValue; + + public static void handleAction() { + textValue = ""; +} + + static { + handleAction(); + } +} diff --git a/src/main/java/cc/novoline/gui/click/RoundedGroupPanel.java b/src/main/java/cc/novoline/gui/click/RoundedGroupPanel.java new file mode 100644 index 0000000..00a412c --- /dev/null +++ b/src/main/java/cc/novoline/gui/click/RoundedGroupPanel.java @@ -0,0 +1,9 @@ +package cc.novoline.gui.click; + +import cc.novoline.gui.element.AbstractRoundedGrouRadiusGuiElement; + +public final class RoundedGroupPanel extends AbstractRoundedGrouRadiusGuiElement { + public RoundedGroupPanel(int value, int index, int count, int amount, int num, int value2) { + super(value, index, count, amount, num, value2); +} +} diff --git a/src/main/java/cc/novoline/gui/click/RoundedTitledBox.java b/src/main/java/cc/novoline/gui/click/RoundedTitledBox.java new file mode 100644 index 0000000..41be26c --- /dev/null +++ b/src/main/java/cc/novoline/gui/click/RoundedTitledBox.java @@ -0,0 +1,11 @@ +package cc.novoline.gui.click; + +import cc.novoline.gui.element.AbstractRoundedGrouPWithTitleGuiElement; +import cc.novoline.gui.element.GuiInteractive; +import org.checkerframework.checker.nullness.qual.Nullable; + +public final class RoundedTitledBox extends AbstractRoundedGrouPWithTitleGuiElement { + public RoundedTitledBox(@Nullable GuiInteractive guiInteractive, int value, int index, int count, int amount, int num) { + super(guiInteractive, value, -1996488705, index, count, amount, num); +} +} diff --git a/src/main/java/cc/novoline/gui/click/SettingTypeSwitchMap.java b/src/main/java/cc/novoline/gui/click/SettingTypeSwitchMap.java new file mode 100644 index 0000000..19a9f6f --- /dev/null +++ b/src/main/java/cc/novoline/gui/click/SettingTypeSwitchMap.java @@ -0,0 +1,24 @@ +package cc.novoline.gui.click; + +import cc.novoline.gui.screen.setting.SettingType; + +public class SettingTypeSwitchMap { + public static final int[] SWITCH_MAP = new int[SettingType.values().length]; + + static { + try { + SWITCH_MAP[SettingType.SLIDER.ordinal()] = 1; + } catch (NoSuchFieldError noSuchFieldError) { + } + + try { + SWITCH_MAP[SettingType.SELECTBOX.ordinal()] = 2; + } catch (NoSuchFieldError noSuchFieldError2) { + } + + try { + SWITCH_MAP[SettingType.COMBOBOX.ordinal()] = 3; + } catch (NoSuchFieldError noSuchFieldError3) { + } + } +} diff --git a/src/main/java/cc/novoline/gui/click/SliderWidgetConstHolder.java b/src/main/java/cc/novoline/gui/click/SliderWidgetConstHolder.java new file mode 100644 index 0000000..842379e --- /dev/null +++ b/src/main/java/cc/novoline/gui/click/SliderWidgetConstHolder.java @@ -0,0 +1,13 @@ +package cc.novoline.gui.click; + +public class SliderWidgetConstHolder { + public static String textValue; + + static { + handleAction(); + } + + public static void handleAction() { + textValue = "M"; +} +} diff --git a/src/main/java/cc/novoline/gui/click/SystemFontPathUtil.java b/src/main/java/cc/novoline/gui/click/SystemFontPathUtil.java new file mode 100644 index 0000000..c5d475a --- /dev/null +++ b/src/main/java/cc/novoline/gui/click/SystemFontPathUtil.java @@ -0,0 +1,44 @@ +package cc.novoline.gui.click; + +import cc.novoline.gui.screen.font.GuiFontSelector; +import java.io.File; +import net.minecraft.client.Minecraft; + +public class SystemFontPathUtil { + public static void executeGuiFontSelector(GuiFontSelector guiFontSelector, String text, String str) { + if (Minecraft.getMinecraft().currentScreen instanceof GuiFontSelector) { + File[] fileObjArr = (new File(text)).listFiles(); + File[] fileObjArr2 = fileObjArr; + if (fileObjArr == null) { + return; + } + + fileObjArr2 = fileObjArr; + + if (fileObjArr2.length > 100 && !text.equals("C:\\WINDOWS\\Fonts")) { + return; + } + + fileObjArr2 = fileObjArr; + + for (File fileObj : fileObjArr2) { + label34: { + boolean flag = fileObj.isDirectory(); + if (flag) { + executeGuiFontSelector(guiFontSelector, fileObj.getAbsolutePath(), str); + break label34; + } + + String pathStr = fileObj.getAbsolutePath(); + flag = pathStr.endsWith(str); + + if (flag) { + String pathStr2 = fileObj.getAbsolutePath(); + guiFontSelector.applyString(pathStr2); + } + } + + } + } +} +} diff --git a/src/main/java/cc/novoline/gui/click/TitledGroupPanel.java b/src/main/java/cc/novoline/gui/click/TitledGroupPanel.java new file mode 100644 index 0000000..1b2ce96 --- /dev/null +++ b/src/main/java/cc/novoline/gui/click/TitledGroupPanel.java @@ -0,0 +1,11 @@ +package cc.novoline.gui.click; + +import cc.novoline.gui.element.AbstractGroupWithTiTleGuiElement; +import cc.novoline.gui.element.GuiInteractive; +import org.checkerframework.checker.nullness.qual.Nullable; + +public final class TitledGroupPanel extends AbstractGroupWithTiTleGuiElement { + public TitledGroupPanel(@Nullable GuiInteractive guiInteractive, int value, int index, int count, int amount, int num) { + super(guiInteractive, value, index, count, amount, num); +} +} diff --git a/src/main/java/cc/novoline/gui/click/WhitelistItemCard.java b/src/main/java/cc/novoline/gui/click/WhitelistItemCard.java new file mode 100644 index 0000000..154bd52 --- /dev/null +++ b/src/main/java/cc/novoline/gui/click/WhitelistItemCard.java @@ -0,0 +1,148 @@ +package cc.novoline.gui.click; + +import cc.novoline.gui.screen.whitelist.GuiItemWhitelist; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.player.InvManager; +import cc.novoline.utils.RenderUtils; +import cc.novoline.modules.ModuleRegistry; +import java.awt.Color; +import cc.novoline.utils.RenderUtilsSupport; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class WhitelistItemCard { + public float floatValue; + public float floatValueField; + private static int b; + final GuiItemWhitelist guiItemWhitelistField; + public Item itemField; + + public static int b() { + return b; +} + + public void mouseClickedPanel(float value, float amount, int index) { + int intVal2 = (this.checkCondition(value, amount, this.floatValueField, this.floatValue) ? 1 : 0); + if (intVal2 == 0) { + return; + } + + intVal2 = index; + + if (intVal2 == 0) { + ModuleRegistry modEntry = ModuleRegistry.INVMANAGER; + InvManager invManager = modEntry.getModule(); + ListProperty listProp = invManager.getListPropertyB(); + Item item = this.itemField; + int intVal = Item.getIdFromItem(item); + Integer intVal3 = intVal; + boolean flag = listProp.contains(intVal3); + if (flag) { + intVal3 = intVal; + listProp.remove(intVal3); + return; + } + + intVal3 = intVal; + listProp.add(intVal3); + } +} + + static { + if (c() != 0) { + b(119); + } + } + + public static int c() { + int intVal = b(); + return intVal == 0 ? 45 : 0; +} + + public WhitelistItemCard(GuiItemWhitelist guiItemWhitelist, Item item) { + this.guiItemWhitelistField = guiItemWhitelist; + this.itemField = item; +} + + public static void b(int value) { + b = value; +} + + public void renderPanel(float value, float amount, float factor, float angle) { + int color; + float floatVal; + float floatVal2; + int intVal; + label29: { + this.floatValueField = factor; + this.floatValue = angle; + ModuleRegistry modEntry = ModuleRegistry.INVMANAGER; + InvManager invManager = modEntry.getModule(); + ListProperty listProp = invManager.getListPropertyB(); + floatVal = factor + 20.0F; + floatVal2 = angle + 20.0F; + color = (new Color(29, 29, 29, 255)).getRGB(); + int intVal2 = Item.getIdFromItem(this.itemField); + Integer intVal3 = intVal2; + intVal = (listProp.contains(intVal3) ? 1 : 0); + + if (intVal != 0) { + Color awtColor = new Color(40, 40, 40, 255); + Color awtColor2 = awtColor.brighter(); + Color awtColor3 = awtColor2.brighter(); + intVal = awtColor3.getRGB(); + break label29; + } + + intVal = (this.checkCondition(value, amount, factor, angle) ? 1 : 0); + + + if (intVal != 0) { + Color awtColor4 = new Color(40, 40, 40, 255); + Color awtColor5 = awtColor4.darker(); + intVal = awtColor5.getRGB(); + } else { + Color awtColor6 = new Color(40, 40, 40, 255); + intVal = awtColor6.getRGB(); + } + } + + RenderUtils.drawBorderedRect(factor, angle, floatVal, floatVal2, 2.0F, color, intVal); + WhitelistItemCard whitelistItemCard = this; + if (this.itemField == null) { + return; + } + + RenderUtilsSupport.enableGUIStandardItemLighting(); + GlStateManager.enableDepth(); + whitelistItemCard = this; + + Minecraft mcClient = whitelistItemCard.guiItemWhitelistField.getMinecraft(); + RenderItem renderItem = mcClient.getRenderItem(); + ItemStack stack = new ItemStack(this.itemField); + floatVal = factor + 2.0F; + floatVal2 = angle + 2.0F; + renderItem.updateState3(stack, floatVal, floatVal2); + RenderUtilsSupport.disableStandardItemLighting(); + GlStateManager.disableDepth(); +} + + public boolean checkCondition(float value, float amount, float factor, float angle) { + if (value <= factor) { + return false; + } + + if (value >= (factor + 20.0F)) { + return false; + } + + if (amount <= angle) { + return false; + } + + return amount < (angle + 20.0F); +} +} diff --git a/src/main/java/cc/novoline/gui/click/WhitelistScrollSwitchMap.java b/src/main/java/cc/novoline/gui/click/WhitelistScrollSwitchMap.java new file mode 100644 index 0000000..9b41787 --- /dev/null +++ b/src/main/java/cc/novoline/gui/click/WhitelistScrollSwitchMap.java @@ -0,0 +1,19 @@ +package cc.novoline.gui.click; + +import cc.novoline.utils.enums.VerticalDirection; + +public class WhitelistScrollSwitchMap { + public static final int[] SWITCH_MAP = new int[VerticalDirection.values().length]; + + static { + try { + SWITCH_MAP[VerticalDirection.UP.ordinal()] = 1; + } catch (NoSuchFieldError noSuchFieldError) { + } + + try { + SWITCH_MAP[VerticalDirection.DOWN.ordinal()] = 2; + } catch (NoSuchFieldError noSuchFieldError2) { + } + } +} diff --git a/src/main/java/cc/novoline/gui/element/AbstractGroupWithTiTleGuiElement.java b/src/main/java/cc/novoline/gui/element/AbstractGroupWithTiTleGuiElement.java new file mode 100644 index 0000000..60a49eb --- /dev/null +++ b/src/main/java/cc/novoline/gui/element/AbstractGroupWithTiTleGuiElement.java @@ -0,0 +1,121 @@ +package cc.novoline.gui.element; + +import cc.novoline.utils.RenderUtils; +import java.util.Objects; +import cc.novoline.modules.configurations.holder.SavingModuleHolderSupport; +import org.checkerframework.checker.nullness.qual.Nullable; + +public abstract class AbstractGroupWithTiTleGuiElement extends ColoredGuiElement implements GuiTextAttribute { + public @Nullable GuiInteractive guiInteractive2; + + @Override + public void renderPanel(int value, int index) { + float floatVal = this.intState; + float floatVal2 = this.intField; + float floatVal3 = this.intField2; + float floatVal4 = this.intField3; + RenderUtils.drawRect(floatVal, floatVal2, floatVal3, floatVal4, this.intState2); + GuiInteractive guiInteractive = this.guiInteractive2; + if (this.guiInteractive2 == null) { + return; + } + + guiInteractive = this.guiInteractive2; + + guiInteractive.renderPanel2(value, index); +} + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb = sb.append("AbstractGroupWithTitle{title="); + GuiInteractive guiInteractive = this.guiInteractive2; + sb = sb.append(guiInteractive).append(", color="); + int intVal = this.intState2; + sb = sb.append(intVal).append(", width="); + int intVal2 = this.intField2; + sb = sb.append(intVal2).append(", height="); + int intVal3 = this.intField3; + sb = sb.append(intVal3).append(", visible="); + boolean flag = this.flagField; + sb = sb.append(flag).append(", x="); + int intVal4 = this.intState; + sb = sb.append(intVal4).append(", y="); + int intVal5 = this.intField; + sb = sb.append(intVal5); + return sb.append('}').toString(); +} + + @Override + public int hashCode() { + Object[] objArr = new Object[2]; + int intVal = super.hashCode(); + objArr[0] = intVal; + objArr[1] = this.guiInteractive2; + return Objects.hash(objArr); +} + + @Override + public void applyUpdate(@Nullable GuiInteractive guiInteractive) { + if (guiInteractive == null) { + return; + } + + this.guiInteractive2 = guiInteractive; + + this.updateHelper(); +} + + @Override + public @Nullable GuiInteractive getGuiInteractive() { + return this.guiInteractive2; +} + + @Override + public boolean equals(Object obj) { + Object obj2 = this; + if (this == obj) { + return true; + } + + obj2 = obj; + + { + boolean flag = obj2 instanceof AbstractGroupWithTiTleGuiElement; + if (!flag) { + return false; + } + + obj2 = this; + + flag = super.equals(obj); + + if (!flag) { + return false; + } + + obj2 = (AbstractGroupWithTiTleGuiElement)obj; + } + + AbstractGroupWithTiTleGuiElement val = (AbstractGroupWithTiTleGuiElement)obj2; + obj2 = this.guiInteractive2; + GuiInteractive guiInteractive = val.guiInteractive2; + return Objects.equals(obj2, guiInteractive); +} + + + + public AbstractGroupWithTiTleGuiElement(@Nullable GuiInteractive guiInteractive, int value, int index, int count, int amount, int num) { + super(value, index, count, amount, num); + this.applyUpdate(guiInteractive); +} + + public void updateHelper() throws NullPointerException { + GuiInteractive guiInteractive = this.guiInteractive2; + SavingModuleHolderSupport.notNull(guiInteractive, "title"); + int intVal = (int)(this.intState + (this.intField2 - this.guiInteractive2.getIntValue6()) / 2.0F); + int intVal2 = this.intField + 4; + guiInteractive = this.guiInteractive2; + guiInteractive.processUpdate(intVal, intVal2); +} +} diff --git a/src/main/java/cc/novoline/gui/element/AbstractGuiElement.java b/src/main/java/cc/novoline/gui/element/AbstractGuiElement.java new file mode 100644 index 0000000..4166e2f --- /dev/null +++ b/src/main/java/cc/novoline/gui/element/AbstractGuiElement.java @@ -0,0 +1,132 @@ +package cc.novoline.gui.element; + +import java.util.Objects; + +public abstract class AbstractGuiElement implements GuiDrawable { + public boolean flagField = true; + private static String[] stringArray; + public int intState; + public int intField; + + @Override + public int getIntValue3() { + return this.intState; +} + + public static void applyUpdate2(String[] args) { + stringArray = args; +} + + @Override + public int hashCode() { + Object[] objArr = new Object[3]; + int intVal = (this.flagField ? 1 : 0); + objArr[0] = Boolean.valueOf((intVal != 0)); + intVal = this.intState; + objArr[1] = intVal; + intVal = this.intField; + objArr[2] = intVal; + return Objects.hash(objArr); +} + + @Override + public boolean checkState() { + return this.flagField; +} + + @Override + public boolean equals(Object obj) { + Object obj2 = this; + if (this == obj) { + return true; + } + + obj2 = obj; + + if (!(obj2 instanceof AbstractGuiElement)) { + return false; + } + + obj2 = obj; + + AbstractGuiElement abstractGuiElement = (AbstractGuiElement)obj2; + int intVal = (this.flagField ? 1 : 0); + int intVal2 = (abstractGuiElement.flagField ? 1 : 0); + if (this.flagField != abstractGuiElement.flagField) { + return false; + } + + intVal = this.intState; + intVal2 = abstractGuiElement.intState; + + if (intVal != intVal2) { + return false; + } + + intVal = this.intField; + + intVal2 = abstractGuiElement.intField; + + return intVal == intVal2; +} + + @Override + public void applyUpdate2(int value) { + this.intField = value; +} + + @Override + public void applyUpdate3(boolean flag) { + this.flagField = flag; +} + + @Override + public void applyUpdate3(int value) { + this.intState = value; +} + + @Override + public final void renderPanel2(int value, int index) { + AbstractGuiElement abstractGuiElement = this; + if (!this.flagField) { + return; + } + + abstractGuiElement = this; + + abstractGuiElement.renderPanel(value, index); +} + + public AbstractGuiElement(int value, int index) { + this.intState = value; + this.intField = index; +} + + static { + if (getStringArrayValue() == null) { + applyUpdate2(new String[5]); + } + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb = sb.append("AbstractDrawable{visible="); + boolean flag = this.flagField; + sb = sb.append(flag).append(", x="); + int intVal = this.intState; + sb = sb.append(intVal).append(", y="); + int intVal2 = this.intField; + sb = sb.append(intVal2); + return sb.append('}').toString(); +} + + @Override + public int getIntValue() { + return this.intField; +} + + public static String[] getStringArrayValue() { + return stringArray; +} +} diff --git a/src/main/java/cc/novoline/gui/element/AbstractLabelTextGuiElement.java b/src/main/java/cc/novoline/gui/element/AbstractLabelTextGuiElement.java new file mode 100644 index 0000000..1ca119b --- /dev/null +++ b/src/main/java/cc/novoline/gui/element/AbstractLabelTextGuiElement.java @@ -0,0 +1,135 @@ +package cc.novoline.gui.element; + + +import cc.novoline.utils.fonts.api.FontRenderer; +import java.util.Objects; + +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; + +public abstract class AbstractLabelTextGuiElement extends AbstractGuiElement implements GuiInteractive { + public int intValue; + public @NonNull FontRenderer fontRenderer2; + public @Nullable String textValue; + private static int[] f; + + @Override + public boolean equals(Object obj) { + int[] intArr = getIntArrayValue(); + Object obj2 = this; + + if (this == obj) { + return true; + } + + obj2 = obj; + + + if (intArr == null) { + if (!(obj2 instanceof AbstractLabelTextGuiElement)) { + return false; + } + + obj2 = obj; + } + + AbstractLabelTextGuiElement val = (AbstractLabelTextGuiElement)obj2; + String textStr = this.textValue; + String textStr2 = val.textValue; + boolean flag = Objects.equals(textStr, textStr2); + + if (!flag) { + return false; + } + + flag = this.fontRenderer2.equals(val.fontRenderer2); + + + return flag; +} + + static { + if (getIntArrayValue() != null) { + processIntArray(new int[3]); + } + } + + public static void processIntArray(int[] intArray) { + f = intArray; +} + + public AbstractLabelTextGuiElement(@Nullable String text, int value, @NonNull FontRenderer font) { + this(text, value, font, 0, 0); +} + + public static int[] getIntArrayValue() { + return f; +} + + @Override + public void setIntValue(int value) { + this.intValue = value; +} + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb = sb.append("AbstractLabel{text='"); + String textStr = this.textValue; + sb = sb.append(textStr).append('\''); + sb = sb.append(", color="); + int intVal = this.intValue; + sb = sb.append(intVal).append(", fontRenderer="); + FontRenderer font = this.fontRenderer2; + sb = sb.append(font); + return sb.append('}').toString(); +} + + @Override + public void renderPanel(int value, int index) { + FontRenderer font = this.fontRenderer2; + String textStr = this.textValue; + float floatVal = this.intState; + float floatVal2 = this.intField; + font.drawString(textStr, floatVal, floatVal2, this.intValue); +} + + @Override + public int getIntValue2() { + return this.intValue; +} + + @Override + public void applyUpdate3(@NonNull FontRenderer font) { + this.fontRenderer2 = font; +} + + @Override + public int hashCode() { + Object[] objArr = new Object[]{this.textValue, this.fontRenderer2}; + return Objects.hash(objArr); +} + + @Override + public @Nullable String getTextValue() { + return this.textValue; +} + + @Override + public void applyUpdate3(@Nullable String text) { + this.textValue = text; +} + + @Override + public @NonNull FontRenderer obtainFontRenderer() { + return this.fontRenderer2; +} + + public AbstractLabelTextGuiElement(@Nullable String text, int value, @NonNull FontRenderer font, int index, int count) { + super(index, count); + this.textValue = text; + getIntArrayValue(); + this.intValue = value; + this.fontRenderer2 = font; +} +} diff --git a/src/main/java/cc/novoline/gui/element/AbstractRoundedGrouPWithTitleGuiElement.java b/src/main/java/cc/novoline/gui/element/AbstractRoundedGrouPWithTitleGuiElement.java new file mode 100644 index 0000000..96a9447 --- /dev/null +++ b/src/main/java/cc/novoline/gui/element/AbstractRoundedGrouPWithTitleGuiElement.java @@ -0,0 +1,146 @@ +package cc.novoline.gui.element; +import cc.novoline.gui.click.AbstractRoundedGroApi; +import cc.novoline.utils.RenderUtils; +import java.util.Objects; + +import cc.novoline.modules.configurations.holder.SavingModuleHolderSupport; +import org.checkerframework.checker.nullness.qual.Nullable; + +public abstract class AbstractRoundedGrouPWithTitleGuiElement extends ColoredGuiElement implements AbstractRoundedGroApi { + public int intValue; + public @Nullable GuiInteractive guiInteractive2; + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb = sb.append("AbstractRoundedGroupWithTitle{title="); + GuiInteractive guiInteractive = this.guiInteractive2; + sb = sb.append(guiInteractive).append(", radius="); + int intVal = this.intValue; + sb = sb.append(intVal).append(", color="); + int intVal2 = this.intState2; + sb = sb.append(intVal2).append(", width="); + int intVal3 = this.intField2; + sb = sb.append(intVal3).append(", height="); + int intVal4 = this.intField3; + sb = sb.append(intVal4).append(", visible="); + boolean flag = this.flagField; + sb = sb.append(flag).append(", x="); + int intVal5 = this.intState; + sb = sb.append(intVal5).append(", y="); + int intVal6 = this.intField; + sb = sb.append(intVal6); + return sb.append('}').toString(); +} + + @Override + public void renderPanel(int value, int index) { + float floatVal = this.intState; + float floatVal2 = this.intField; + float floatVal3 = this.intField2; + float floatVal4 = this.intField3; + float floatVal5 = this.intValue; + RenderUtils.drawRoundedRect(floatVal, floatVal2, floatVal3, floatVal4, floatVal5, this.intState2); + GuiInteractive guiInteractive = this.guiInteractive2; + if (this.guiInteractive2 == null) { + return; + } + + guiInteractive = this.guiInteractive2; + + guiInteractive.renderPanel2(value, index); +} + + @Override + public void applyUpdate(@Nullable GuiInteractive guiInteractive) { + if (guiInteractive == null) { + return; + } + + this.guiInteractive2 = guiInteractive; + + this.updateHelper(); +} + + @Override + public @Nullable GuiInteractive getGuiInteractive() { + return this.guiInteractive2; +} + + + + public AbstractRoundedGrouPWithTitleGuiElement(@Nullable GuiInteractive guiInteractive, int value, int index, int count, int amount, int num, int value2) { + super(index, count, amount, num, value2); + this.applyUpdate(guiInteractive); + this.intValue = value; +} + + public void updateHelper() throws NullPointerException { + GuiInteractive guiInteractive = this.guiInteractive2; + SavingModuleHolderSupport.notNull(guiInteractive, "title"); + int intVal = (int)(this.intState + (this.intField2 - this.guiInteractive2.getIntValue6()) / 2.0F); + int intVal2 = this.intField + 4; + guiInteractive = this.guiInteractive2; + guiInteractive.processUpdate(intVal, intVal2); +} + + @Override + public int getIntValue4() { + return this.intValue; +} + + @Override + public int hashCode() { + Object[] objArr = new Object[3]; + int intVal = super.hashCode(); + objArr[0] = intVal; + objArr[1] = this.guiInteractive2; + intVal = this.intValue; + objArr[2] = intVal; + return Objects.hash(objArr); +} + + @Override + public boolean equals(Object obj) { + Object obj2 = this; + if (this == obj) { + return true; + } + + obj2 = obj; + + { + boolean flag = obj2 instanceof AbstractRoundedGrouPWithTitleGuiElement; + if (!flag) { + return false; + } + + obj2 = this; + + flag = super.equals(obj); + + if (!flag) { + return false; + } + + obj2 = (AbstractRoundedGrouPWithTitleGuiElement)obj; + } + + AbstractRoundedGrouPWithTitleGuiElement val = (AbstractRoundedGrouPWithTitleGuiElement)obj2; + int intVal = this.intValue; + if (this.intValue != val.intValue) { + return false; + } + + obj2 = this.guiInteractive2; + GuiInteractive guiInteractive = val.guiInteractive2; + intVal = (Objects.equals(obj2, guiInteractive) ? 1 : 0); + + return intVal != 0; +} + + @Override + public void setIntValue2(int value) { + this.intValue = value; +} +} diff --git a/src/main/java/cc/novoline/gui/element/AbstractRoundedGrouRadiusGuiElement.java b/src/main/java/cc/novoline/gui/element/AbstractRoundedGrouRadiusGuiElement.java new file mode 100644 index 0000000..498d0c8 --- /dev/null +++ b/src/main/java/cc/novoline/gui/element/AbstractRoundedGrouRadiusGuiElement.java @@ -0,0 +1,95 @@ +package cc.novoline.gui.element; + +import cc.novoline.utils.RenderUtils; +import java.util.Objects; + +public abstract class AbstractRoundedGrouRadiusGuiElement extends ColoredGuiElement implements GuiRadiusAttribute { + public int intValue; + + public AbstractRoundedGrouRadiusGuiElement(int value, int index, int count, int amount, int num, int value2) { + super(index, count, amount, num, value2); + this.intValue = value; +} + + @Override + public boolean equals(Object obj) { + Object obj2 = this; + if (this == obj) { + return true; + } + + obj2 = obj; + + { + boolean flag = obj2 instanceof AbstractRoundedGrouRadiusGuiElement; + if (!flag) { + return false; + } + + obj2 = this; + + flag = super.equals(obj); + + if (!flag) { + return false; + } + + obj2 = (AbstractRoundedGrouRadiusGuiElement)obj; + } + + AbstractRoundedGrouRadiusGuiElement val = (AbstractRoundedGrouRadiusGuiElement)obj2; + int intVal = this.intValue; + return this.intValue == val.intValue; +} + + @Override + public void setIntValue2(int value) { + this.intValue = value; +} + + @Override + public int hashCode() { + Object[] objArr = new Object[2]; + int intVal = super.hashCode(); + objArr[0] = intVal; + intVal = this.intValue; + objArr[1] = intVal; + return Objects.hash(objArr); +} + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb = sb.append("AbstractRoundedGroup{radius="); + int intVal = this.intValue; + sb = sb.append(intVal).append(", color="); + int intVal2 = this.intState2; + sb = sb.append(intVal2).append(", width="); + int intVal3 = this.intField2; + sb = sb.append(intVal3).append(", height="); + int intVal4 = this.intField3; + sb = sb.append(intVal4).append(", visible="); + boolean flag = this.flagField; + sb = sb.append(flag).append(", x="); + int intVal5 = this.intState; + sb = sb.append(intVal5).append(", y="); + int intVal6 = this.intField; + sb = sb.append(intVal6); + return sb.append('}').toString(); +} + + @Override + public int getIntValue4() { + return this.intValue; +} + + @Override + public void renderPanel(int value, int index) { + float floatVal = this.intState; + float floatVal2 = this.intField; + float floatVal3 = this.intField2; + float floatVal4 = this.intField3; + float floatVal5 = this.intValue; + RenderUtils.drawRoundedRect(floatVal, floatVal2, floatVal3, floatVal4, floatVal5, this.intState2); +} +} diff --git a/src/main/java/cc/novoline/gui/element/BoundedGuiElement.java b/src/main/java/cc/novoline/gui/element/BoundedGuiElement.java new file mode 100644 index 0000000..16c419c --- /dev/null +++ b/src/main/java/cc/novoline/gui/element/BoundedGuiElement.java @@ -0,0 +1,132 @@ +package cc.novoline.gui.element; + +import java.util.Objects; + +public abstract class BoundedGuiElement extends AbstractGuiElement implements GuiSized { + public int intField2; + public int intField3; + + @Override + public int getIntField2() { + return this.intField2; +} + + @Override + public int hashCode() { + Object[] objArr = new Object[3]; + int intVal = super.hashCode(); + objArr[0] = intVal; + intVal = this.intField2; + objArr[1] = intVal; + intVal = this.intField3; + objArr[2] = intVal; + return Objects.hash(objArr); +} + + public BoundedGuiElement(int value, int index, int count, int amount) { + super(value, index); + this.intField2 = count; + this.intField3 = amount; +} + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb = sb.append("AbstractDrawableWithBody{width="); + int intVal = this.intField2; + sb = sb.append(intVal).append(", height="); + int intVal2 = this.intField3; + sb = sb.append(intVal2).append(", visible="); + boolean flag = this.flagField; + sb = sb.append(flag).append(", x="); + int intVal3 = this.intState; + sb = sb.append(intVal3).append(", y="); + int intVal4 = this.intField; + sb = sb.append(intVal4); + return sb.append('}').toString(); +} + + @Override + public boolean equals(Object obj) { + Object obj2 = this; + if (this == obj) { + return true; + } + + obj2 = obj; + + { + boolean flag = obj2 instanceof BoundedGuiElement; + if (!flag) { + return false; + } + + obj2 = this; + + flag = super.equals(obj); + + if (!flag) { + return false; + } + + obj2 = (BoundedGuiElement)obj; + } + + BoundedGuiElement boundedGuiElement = (BoundedGuiElement)obj2; + int intVal = this.intField2; + int intVal2 = boundedGuiElement.intField2; + if (this.intField2 != boundedGuiElement.intField2) { + return false; + } + + intVal = this.intField3; + + intVal2 = boundedGuiElement.intField3; + + return intVal == intVal2; +} + + @Override + public void applyUpdate(int value) { + this.intField3 = value; +} + + @Override + public boolean isHoveredAt(int value, int index) { + int intVal = value; + int intVal2 = this.intState; + if (value < this.intState) { + return false; + } + + intVal = value; + intVal2 = this.intState + this.intField2; + + if (intVal > intVal2) { + return false; + } + + intVal = index; + intVal2 = this.intField; + + if (intVal < intVal2) { + return false; + } + + intVal = index; + + intVal2 = this.intField + this.intField3; + + return intVal <= intVal2; +} + + @Override + public void setIntField2(int value) { + this.intField2 = value; +} + + @Override + public int getIntValue2() { + return this.intField3; +} +} diff --git a/src/main/java/cc/novoline/gui/element/ColoredGuiElement.java b/src/main/java/cc/novoline/gui/element/ColoredGuiElement.java new file mode 100644 index 0000000..e0b3ef7 --- /dev/null +++ b/src/main/java/cc/novoline/gui/element/ColoredGuiElement.java @@ -0,0 +1,71 @@ +package cc.novoline.gui.element; +import java.util.Objects; + + +public abstract class ColoredGuiElement extends BoundedGuiElement implements GuiAttribute { +public int intState2; + + @Override + public int hashCode() { + Object[] objArr = new Object[2]; + int intVal = super.hashCode(); + objArr[0] = intVal; + intVal = this.intState2; + objArr[1] = intVal; + return Objects.hash(objArr); +} + + @Override + public void applyInt2(int value) { + this.intState2 = value; +} + + @Override + public int getIntValue5() { + return this.intState2; +} + + @Override + public boolean equals(Object obj) { + Object obj2 = this; + if (this == obj) { + return true; + } + + obj2 = obj; + + { + boolean flag = obj2 instanceof ColoredGuiElement; + if (!flag) { + return false; + } + + obj2 = this; + + flag = super.equals(obj); + + if (!flag) { + return false; + } + + obj2 = (ColoredGuiElement)obj; + } + + ColoredGuiElement coloredGuiElement = (ColoredGuiElement)obj2; + int intVal = this.intState2; + return this.intState2 == coloredGuiElement.intState2; +} + + @Override + public String toString() { + StringBuilder sb = new StringBuilder().append("AbstractGroup{color="); + int intVal = this.intState2; + sb = sb.append(intVal); + return sb.append('}').toString(); +} + + public ColoredGuiElement(int color, int rgba, int hex, int color2, int color3) { + super(rgba, hex, color2, color3); + this.intState2 = color; +} +} diff --git a/src/main/java/cc/novoline/gui/element/GuiAttribute.java b/src/main/java/cc/novoline/gui/element/GuiAttribute.java new file mode 100644 index 0000000..41ad3eb --- /dev/null +++ b/src/main/java/cc/novoline/gui/element/GuiAttribute.java @@ -0,0 +1,14 @@ +package cc.novoline.gui.element; + +import java.awt.Color; +import org.checkerframework.checker.nullness.qual.NonNull; + +public interface GuiAttribute extends GuiDrawable { + void applyInt2(int value); + + int getIntValue5(); + + default void applyUpdate3(@NonNull Color color) { + this.applyInt2(color.getRGB()); +} +} diff --git a/src/main/java/cc/novoline/gui/element/GuiContainerElement.java b/src/main/java/cc/novoline/gui/element/GuiContainerElement.java new file mode 100644 index 0000000..61e20b6 --- /dev/null +++ b/src/main/java/cc/novoline/gui/element/GuiContainerElement.java @@ -0,0 +1,9 @@ +package cc.novoline.gui.element; + +import org.checkerframework.checker.nullness.qual.Nullable; + +public interface GuiContainerElement extends GuiDrawable { + @Nullable GuiInteractive getLgB(); + + void applyUpdate2(@Nullable GuiInteractive guiInteractive); +} diff --git a/src/main/java/cc/novoline/gui/element/GuiDrawable.java b/src/main/java/cc/novoline/gui/element/GuiDrawable.java new file mode 100644 index 0000000..395a496 --- /dev/null +++ b/src/main/java/cc/novoline/gui/element/GuiDrawable.java @@ -0,0 +1,24 @@ +package cc.novoline.gui.element; + +public interface GuiDrawable { + void applyUpdate3(boolean flag); + + default void processUpdate(int value, int index) { + this.applyUpdate3(value); + this.applyUpdate2(index); +} + + int getIntValue(); + + void applyUpdate2(int value); + + void applyUpdate3(int value); + + boolean checkState(); + + void renderPanel2(int value, int index); + + void renderPanel(int value, int index); + + int getIntValue3(); +} diff --git a/src/main/java/cc/novoline/gui/element/GuiHoverable.java b/src/main/java/cc/novoline/gui/element/GuiHoverable.java new file mode 100644 index 0000000..b45c15c --- /dev/null +++ b/src/main/java/cc/novoline/gui/element/GuiHoverable.java @@ -0,0 +1,11 @@ +package cc.novoline.gui.element; + +import org.checkerframework.checker.nullness.qual.Nullable; + +public interface GuiHoverable extends GuiDrawable { + @Nullable GuiInteractive getGuiInteractive2(); + + void applyUpdate3(@Nullable GuiInteractive guiInteractive); + + void applyInt(int value); +} diff --git a/src/main/java/cc/novoline/gui/element/GuiInteractive.java b/src/main/java/cc/novoline/gui/element/GuiInteractive.java new file mode 100644 index 0000000..b98fd9e --- /dev/null +++ b/src/main/java/cc/novoline/gui/element/GuiInteractive.java @@ -0,0 +1,30 @@ +package cc.novoline.gui.element; + +import cc.novoline.utils.fonts.api.FontRenderer; +import java.awt.Color; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; + +public interface GuiInteractive extends GuiDrawable { + void applyUpdate3(@Nullable String text); + + @NonNull FontRenderer obtainFontRenderer(); + + int getIntValue2(); + + default void applyUpdate2(@NonNull Color color) { + this.setIntValue(color.getRGB()); +} + + void applyUpdate3(@NonNull FontRenderer font); + + void setIntValue(int value); + + default int getIntValue6() { + FontRenderer font = this.obtainFontRenderer(); + String textStr = this.getTextValue(); + return font.stringWidth(textStr); +} + + @Nullable String getTextValue(); +} diff --git a/src/main/java/cc/novoline/gui/element/GuiRadiusAttribute.java b/src/main/java/cc/novoline/gui/element/GuiRadiusAttribute.java new file mode 100644 index 0000000..caf23cb --- /dev/null +++ b/src/main/java/cc/novoline/gui/element/GuiRadiusAttribute.java @@ -0,0 +1,7 @@ +package cc.novoline.gui.element; + +public interface GuiRadiusAttribute extends GuiAttribute { + void setIntValue2(int value); + + int getIntValue4(); +} diff --git a/src/main/java/cc/novoline/gui/element/GuiSized.java b/src/main/java/cc/novoline/gui/element/GuiSized.java new file mode 100644 index 0000000..3a2e9fc --- /dev/null +++ b/src/main/java/cc/novoline/gui/element/GuiSized.java @@ -0,0 +1,13 @@ +package cc.novoline.gui.element; + +public interface GuiSized { + int getIntField2(); + + void applyUpdate(int value); + + int getIntValue2(); + + void setIntField2(int value); + + boolean isHoveredAt(int value, int index); +} diff --git a/src/main/java/cc/novoline/gui/element/GuiTextAttribute.java b/src/main/java/cc/novoline/gui/element/GuiTextAttribute.java new file mode 100644 index 0000000..50d7dba --- /dev/null +++ b/src/main/java/cc/novoline/gui/element/GuiTextAttribute.java @@ -0,0 +1,9 @@ +package cc.novoline.gui.element; + +import org.checkerframework.checker.nullness.qual.Nullable; + +public interface GuiTextAttribute extends GuiAttribute { + void applyUpdate(@Nullable GuiInteractive guiInteractive); + + @Nullable GuiInteractive getGuiInteractive(); +} diff --git a/src/main/java/cc/novoline/gui/element/NameAbstractButtonGuiElement.java b/src/main/java/cc/novoline/gui/element/NameAbstractButtonGuiElement.java new file mode 100644 index 0000000..157c55b --- /dev/null +++ b/src/main/java/cc/novoline/gui/element/NameAbstractButtonGuiElement.java @@ -0,0 +1,127 @@ +package cc.novoline.gui.element; + +import cc.novoline.utils.RenderUtils; +import java.util.Objects; +import cc.novoline.modules.configurations.holder.SavingModuleHolderSupport; +import org.checkerframework.checker.nullness.qual.Nullable; + +public abstract class NameAbstractButtonGuiElement extends BoundedGuiElement implements GuiHoverable { + public @Nullable GuiInteractive guiInteractive3; + + public void performStep() throws NullPointerException { + GuiInteractive guiInteractive = this.guiInteractive3; + SavingModuleHolderSupport.notNull(guiInteractive, "name"); + int intVal = (int)(this.intState + (this.intField2 - this.guiInteractive3.getIntValue6()) / 2.0F); + float floatVal = this.intField; + int intVal2 = this.intField3; + GuiInteractive guiInteractive2 = this.guiInteractive3; + int intVal3 = (int)(floatVal + (intVal2 - guiInteractive2.obtainFontRenderer().obtainFontRenderer()) / 2.0F); + guiInteractive = this.guiInteractive3; + guiInteractive.processUpdate(intVal, intVal3); +} + + + + @Override + public int hashCode() { + Object[] objArr = new Object[2]; + int intVal = super.hashCode(); + objArr[0] = intVal; + objArr[1] = this.guiInteractive3; + return Objects.hash(objArr); +} + + public NameAbstractButtonGuiElement(@Nullable GuiInteractive guiInteractive, int value, int index) { + super(value, index, 200, 20); + this.applyUpdate3(guiInteractive); +} + + @Override + public void renderPanel(int value, int index) { + int intVal2 = (this.flagField ? 1 : 0); + if (!this.flagField) { + return; + } + + intVal2 = (this.isHoveredAt(value, index) ? 1 : 0); + + intVal2 = (intVal2 == 0 ? 210 : 125); + + int intVal = intVal2; + float floatVal = this.intState; + float floatVal2 = this.intField; + float floatVal3 = this.intField2; + float floatVal4 = this.intField3; + int intVal3 = 3158326 | intVal << 24; + RenderUtils.drawRoundedRect(floatVal, floatVal2, floatVal3, floatVal4, 15.0F, intVal3); + GuiInteractive guiInteractive = this.guiInteractive3; + if (this.guiInteractive3 == null) { + return; + } + + guiInteractive = this.guiInteractive3; + + guiInteractive.renderPanel2(value, index); +} + + @Override + public @Nullable GuiInteractive getGuiInteractive2() { + return this.guiInteractive3; +} + + @Override + public boolean equals(Object obj) { + Object obj2 = this; + if (this == obj) { + return true; + } + + obj2 = obj; + + { + boolean flag = obj2 instanceof NameAbstractButtonGuiElement; + if (!flag) { + return false; + } + + obj2 = this; + + flag = super.equals(obj); + + if (!flag) { + return false; + } + + obj2 = (NameAbstractButtonGuiElement)obj; + } + + NameAbstractButtonGuiElement val = (NameAbstractButtonGuiElement)obj2; + obj2 = this.guiInteractive3; + GuiInteractive guiInteractive = val.guiInteractive3; + return Objects.equals(obj2, guiInteractive); +} + + public NameAbstractButtonGuiElement(@Nullable GuiInteractive guiInteractive, int value, int index, int count, int amount) { + super(value, index, count, amount); + this.applyUpdate3(guiInteractive); +} + + @Override + public void applyUpdate3(@Nullable GuiInteractive guiInteractive) { + if (guiInteractive == null) { + return; + } + + this.guiInteractive3 = guiInteractive; + + this.performStep(); +} + + @Override + public String toString() { + StringBuilder sb = new StringBuilder().append("AbstractButton{name="); + GuiInteractive guiInteractive = this.guiInteractive3; + sb = sb.append(guiInteractive); + return sb.append('}').toString(); +} +} diff --git a/src/main/java/cc/novoline/gui/element/SolidBoxGuiElement.java b/src/main/java/cc/novoline/gui/element/SolidBoxGuiElement.java new file mode 100644 index 0000000..9b9c405 --- /dev/null +++ b/src/main/java/cc/novoline/gui/element/SolidBoxGuiElement.java @@ -0,0 +1,18 @@ +package cc.novoline.gui.element; + +import cc.novoline.utils.RenderUtils; + +public final class SolidBoxGuiElement extends ColoredGuiElement { + public SolidBoxGuiElement(int value, int index, int count, int amount, int num) { + super(value, index, count, amount, num); +} + + @Override + public void renderPanel(int value, int index) { + float floatVal = this.intState; + float floatVal2 = this.intField; + float floatVal3 = this.intField2; + float floatVal4 = this.intField3; + RenderUtils.drawRect(floatVal, floatVal2, floatVal3, floatVal4, this.intState2); +} +} diff --git a/src/main/java/cc/novoline/gui/screen/ClickGUI.java b/src/main/java/cc/novoline/gui/screen/ClickGUI.java new file mode 100644 index 0000000..d22a50e --- /dev/null +++ b/src/main/java/cc/novoline/gui/screen/ClickGUI.java @@ -0,0 +1,957 @@ +package cc.novoline.gui.screen; +import cc.novoline.Novoline; +import cc.novoline.gui.click.ClickGuiModuleRow; +import cc.novoline.gui.click.ClickGuiModuleTypeSwitchMap; +import cc.novoline.gui.screen.click.ConfigScriptTab; +import cc.novoline.gui.screen.click.ModuleCategoryTab; +import cc.novoline.gui.screen.click.Tab; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.configurations.util.ClickGuiSettingRow; +import cc.novoline.modules.visual.ClickGui; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.MovementUtils; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.anim.SmoothAnimation; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.gui.screen.setting.Setting; +import com.google.common.collect.Lists; +import cc.novoline.modules.ModuleRegistry; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.LinkOption; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.function.Consumer; +import java.util.function.Predicate; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; + + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.shader.ShaderGroup; +import org.apache.commons.io.IOUtils; +import org.json.JSONObject; +import org.lwjgl.opengl.GL11; + +public class ClickGUI extends GuiScreen { + public final int[] intTable; + public final int[] intTable2; + public final int[] intTable3; + private SmoothAnimation smoothAnim; + private List tabList; + private ModuleCategoryTab moduleCategoryTabField; + public final int[] intTable4; + private Novoline novolineField; + public final int[] intTable5; + public final int[] intTable6; + public final int[] intTable7; + private ConfigScriptTab configScriptTabField; + public final int[] intTable8; + + public ClickGUI(Novoline novoline) { + String textStr20 = ""; + this.tabList = new CopyOnWriteArrayList<>(); + this.intTable7 = new int[]{75, 105}; + this.intTable = new int[]{339, 105}; + this.intTable2 = new int[]{75, 331}; + String textStr = textStr20; + this.intTable6 = new int[]{207, 331}; + this.intTable4 = new int[]{339, 331}; + this.intTable3 = new int[]{207, 105}; + this.intTable8 = new int[]{471, 75}; + this.intTable5 = new int[]{603, 85}; + this.smoothAnim = new SmoothAnimation(); + this.novolineField = novoline; + EnumModuleType[] modCategoryArr = EnumModuleType.values(); + int len = modCategoryArr.length; + int intVal = 0; + + while (true) { + if (intVal < len) { + EnumModuleType enumModuleType = modCategoryArr[intVal]; + + switch (ClickGuiModuleTypeSwitchMap.SWITCH_MAP[enumModuleType.ordinal()]) { + case 1: + List itemList = this.tabList; + itemList.add(new Tab(this, enumModuleType, this.intTable7[0], this.intTable7[1])); + if (textStr != null) { + break; + } + case 2: + List itemList2 = this.tabList; + Tab guiTab = new Tab(this, enumModuleType, this.intTable[0], this.intTable[1]); + itemList2.add(guiTab); + if (textStr != null) { + break; + } + case 3: + List itemList3 = this.tabList; + Tab guiTab2 = new Tab(this, enumModuleType, this.intTable2[0], this.intTable2[1]); + itemList3.add(guiTab2); + if (textStr != null) { + break; + } + case 4: + List itemList4 = this.tabList; + Tab guiTab3 = new Tab(this, enumModuleType, this.intTable6[0], this.intTable6[1]); + itemList4.add(guiTab3); + if (textStr != null) { + break; + } + case 5: + List itemList5 = this.tabList; + Tab guiTab4 = new Tab(this, enumModuleType, this.intTable4[0], this.intTable4[1]); + itemList5.add(guiTab4); + if (textStr != null) { + break; + } + case 6: + List itemList6 = this.tabList; + Tab guiTab5 = new Tab(this, enumModuleType, this.intTable3[0], this.intTable3[1]); + itemList6.add(guiTab5); + } + + intVal++; + + continue; + } + + this.configScriptTabField = new ConfigScriptTab(this, this.intTable8[0], this.intTable8[1]); + this.moduleCategoryTabField = new ModuleCategoryTab(this, this.intTable5[0], this.intTable5[1]); + break; + } + + List itemList7 = this.tabList; + Iterator iter = itemList7.iterator(); + + while (true) { + if (iter.hasNext()) { + Tab guiTab6 = (Tab)iter.next(); + guiTab6.applyUpdate2(true); + + continue; + } + + this.moduleCategoryTabField.applyUpdate2(true); + ConfigScriptTab configScriptTab = this.configScriptTabField; + configScriptTab.applyUpdate2(true); + break; + } + + StringBuilder sb = new StringBuilder(); + Novoline novolineInst = Novoline.getInstance(); + String textStr2 = novolineInst.getTextValue(); + StringBuilder sb2 = sb.append(textStr2); + Path filePath = Paths.get(sb2.append("\\dropdown_layout.novo").toString()); + LinkOption[] linkOptionArr = new LinkOption[0]; + if (Files.exists(filePath, linkOptionArr)) { + try { + StringBuilder sb3 = new StringBuilder(); + Novoline novolineInst2 = Novoline.getInstance(); + String textStr3 = novolineInst2.getTextValue(); + sb3 = sb3.append(textStr3); + FileReader fileReader = new FileReader(sb3.append("\\dropdown_layout.novo").toString()); + JSONObject jSONObject = new JSONObject(IOUtils.toString(fileReader)); + List itemList8 = this.tabList; + Iterator iter2 = itemList8.iterator(); + + do { + if (!iter2.hasNext()) { + break; + } + + Tab guiTab7 = (Tab)iter2.next(); + String textStr4 = guiTab7.getCategory().name(); + String textStr5 = (String)jSONObject.get(textStr4); + String[] stringArr = textStr5.split("/"); + String textStr6 = stringArr[0]; + double doubleVal = Double.parseDouble(textStr6); + guiTab7.applyDouble(doubleVal); + String textStr7 = stringArr[1]; + double doubleVal2 = Double.parseDouble(textStr7); + guiTab7.setPosX(doubleVal2); + String textStr8 = stringArr[2]; + double doubleVal3 = Double.parseDouble(textStr8); + guiTab7.applyUpdate2(doubleVal3); + String textStr9 = stringArr[3]; + boolean flag = Boolean.parseBoolean(textStr9); + guiTab7.applyUpdate2(flag); + + } while (textStr != null); + + String textStr10 = (String)jSONObject.get("config"); + String textStr11 = (String)jSONObject.get("script"); + String[] stringArr2 = textStr10.split("/"); + String[] stringArr3 = textStr11.split("/"); + ConfigScriptTab configScriptTab2 = this.configScriptTabField; + String textStr12 = stringArr2[0]; + double doubleVal4 = Double.parseDouble(textStr12); + configScriptTab2.applyDouble(doubleVal4); + ConfigScriptTab configScriptTab3 = this.configScriptTabField; + String textStr13 = stringArr2[1]; + double doubleVal5 = Double.parseDouble(textStr13); + configScriptTab3.setPosX(doubleVal5); + ConfigScriptTab configScriptTab4 = this.configScriptTabField; + String textStr14 = stringArr2[2]; + double doubleVal6 = Double.parseDouble(textStr14); + configScriptTab4.applyUpdate2(doubleVal6); + ConfigScriptTab configScriptTab5 = this.configScriptTabField; + String textStr15 = stringArr2[3]; + boolean flag2 = Boolean.parseBoolean(textStr15); + configScriptTab5.applyUpdate2(flag2); + ModuleCategoryTab moduleCategoryTab = this.moduleCategoryTabField; + String textStr16 = stringArr3[0]; + moduleCategoryTab.applyDouble(Double.parseDouble(textStr16)); + ModuleCategoryTab moduleCategoryTab2 = this.moduleCategoryTabField; + String textStr17 = stringArr3[1]; + moduleCategoryTab2.setPosX(Double.parseDouble(textStr17)); + ModuleCategoryTab moduleCategoryTab3 = this.moduleCategoryTabField; + String textStr18 = stringArr3[2]; + moduleCategoryTab3.applyUpdate2(Double.parseDouble(textStr18)); + ModuleCategoryTab moduleCategoryTab4 = this.moduleCategoryTabField; + String textStr19 = stringArr3[3]; + moduleCategoryTab4.applyUpdate2(Boolean.parseBoolean(textStr19)); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + + this.moduleCategoryTabField.performAction(); +} + + private void invokeCallback(ClickGui clickGui, int value, int index, float partialTicks) { + this.applyClickGui(clickGui, value, index, partialTicks); +} + + @Override + public void keyTyped(char typedChar, int keyCode) throws IOException { + java.util.Iterator iter; + cc.novoline.modules.configurations.util.ClickGuiSettingRow settingRow; + int intVal; + cc.novoline.utils.anim.SmoothAnimation smoothAnimation; + String textStr = ""; + List itemList = this.tabList; + Iterator iter2 = itemList.iterator(); + + label172: + while (true) { + Iterator iter3 = iter2; + + while (true) { + if (!iter3.hasNext()) { + break; + } + + Tab guiTab = (Tab)iter2.next(); + List itemList2 = guiTab.getModuleRows(); + iter = itemList2.iterator(); + + Iterator iter4 = iter; + + label166: + while (true) { + boolean hasNext2 = iter4.hasNext(); + + while (true) { + if (!hasNext2) { + break label166; + } + + ClickGuiModuleRow modRow = (ClickGuiModuleRow)iter4.next(); + List itemList3 = modRow.getVisibleSettings(); + iter3 = itemList3.iterator(); + + Iterator iter5 = iter3; + + do { + if (!iter5.hasNext()) { + break; + } + + ClickGuiSettingRow settingRow2 = (ClickGuiSettingRow)iter5.next(); + hasNext2 = settingRow2.isStateFlag(); + + if (!hasNext2) { + boolean flag = settingRow2.isStateFlag6(); + + if (!flag) { + continue; + } + } + + boolean flag2 = true; + + break; + } while (textStr != null); + + break; + } + } + + if (textStr != null) { + continue label172; + } + break; + } + + List itemList4 = this.tabList; + Stream stream2 = itemList4.stream(); + Predicate predicate = ((java.util.function.Predicate) Tab::isStateFlag); + Stream stream3 = stream2.filter(predicate); + Consumer consumer = ((java.util.function.Consumer) (tab) -> { tab.keyTyped(typedChar, keyCode); }); + stream3.forEach(consumer); + this.configScriptTabField.keyTyped(typedChar, keyCode); + List itemList5 = this.tabList; + iter = itemList5.iterator(); + break; + } + + iter2 = iter; + + label128: + while (true) { + Iterator iter6 = iter2; + + label181: { + label182: { + label123: { + label122: + while (true) { + if (iter6.hasNext()) { + Object obj = iter2.next(); + + label117: + while (true) { + Tab guiTab2 = (Tab)obj; + + List itemList6 = guiTab2.getModuleRows(); + Iterator iter7 = itemList6.iterator(); + + while (true) { + if (!iter7.hasNext()) { + break label117; + } + + ClickGuiModuleRow modRow2 = (ClickGuiModuleRow)iter7.next(); + List itemList7 = modRow2.getVisibleSettings(); + iter6 = itemList7.iterator(); + if (textStr == null) { + continue label122; + } + + Iterator iter8 = iter6; + + do { + if (!iter8.hasNext()) { + break; + } + + ClickGuiSettingRow settingRow3 = (ClickGuiSettingRow)iter8.next(); + Setting setting = settingRow3.getSetting(); + obj = setting.getSettingType(); + if (textStr == null) { + continue label117; + } + + if (obj == SettingType.BINDABLE) { + settingRow = settingRow3; + if (textStr == null) { + break label181; + } + + if (settingRow3.flagField) { + settingRow = settingRow3; + break label181; + } + } + } while (textStr != null); + + if (textStr == null) { + break label117; + } + } + } + + if (textStr != null) { + continue label128; + } + } + + ModuleRegistry modEntry = ModuleRegistry.CLICKGUI; + StringProperty strProp = modEntry.obtainAbstractModule().getStringProperty8(); + intVal = (strProp.equals("None") ? 1 : 0); + if (textStr == null) { + break label123; + } + + if (intVal != 0) { + super.keyTyped(typedChar, keyCode); + if (textStr != null) { + break label182; + } + } + break; + } + + intVal = keyCode; + } + + label188: { + if (textStr != null) { + if (intVal != 1) { + break label182; + } + + smoothAnimation = this.smoothAnim; + if (textStr == null) { + break label188; + } + + intVal = (this.smoothAnim.isStateFlag() ? 1 : 0); + } + + if (intVal != 0) { + break label182; + } + + smoothAnimation = this.smoothAnim; + } + + smoothAnimation.reset(); + this.minecraft2.mouseHelper.performAction(); + this.minecraft2.stateFlag2 = true; + } + + return; + } + + settingRow.flagField = false; + return; + } +} + + @Override + public void onGuiClosed() { + String textStr; + label95: { + textStr = ""; + ShaderGroup shaderGroup = this.minecraft2.entityRenderer.theShaderGroup; + if (textStr != null) { + if (this.minecraft2.entityRenderer.theShaderGroup == null) { + break label95; + } + + shaderGroup = this.minecraft2.entityRenderer.theShaderGroup; + } + + shaderGroup.deleteShaderGroup(); + this.minecraft2.entityRenderer.theShaderGroup = null; + } + + JSONObject jSONObject = new JSONObject(); + List itemList = this.tabList; + Iterator iter = itemList.iterator(); + + while (true) { + if (iter.hasNext()) { + Tab guiTab = (Tab)iter.next(); + String textStr4 = guiTab.getCategory().name(); + StringBuilder sb = new StringBuilder(); + double doubleVal7 = guiTab.getHeight(); + sb = sb.append(doubleVal7).append("/"); + doubleVal7 = guiTab.getPosX(); + sb = sb.append(doubleVal7).append("/"); + doubleVal7 = guiTab.getCachedValue22(); + sb = sb.append(doubleVal7).append("/"); + boolean flag = guiTab.isOpened(); + String textStr5 = sb.append(flag).toString(); + jSONObject.put(textStr4, textStr5); + if (textStr == null) { + break; + } + + if (textStr != null) { + continue; + } + } + + String textStr2 = "config"; + StringBuilder sb2 = new StringBuilder(); + ConfigScriptTab configScriptTab = this.configScriptTabField; + double doubleVal = configScriptTab.getHeight(); + sb2 = sb2.append(doubleVal).append("/"); + configScriptTab = this.configScriptTabField; + double doubleVal2 = configScriptTab.getPosX(); + sb2 = sb2.append(doubleVal2).append("/"); + configScriptTab = this.configScriptTabField; + double doubleVal3 = configScriptTab.getCachedValue22(); + sb2 = sb2.append(doubleVal3).append("/"); + configScriptTab = this.configScriptTabField; + boolean flag2 = configScriptTab.isOpened(); + String textStr6 = sb2.append(flag2).toString(); + jSONObject.put(textStr2, textStr6); + textStr2 = "script"; + sb2 = new StringBuilder(); + double doubleVal4 = this.moduleCategoryTabField.getHeight(); + sb2 = sb2.append(doubleVal4).append("/"); + double doubleVal5 = this.moduleCategoryTabField.getPosX(); + sb2 = sb2.append(doubleVal5).append("/"); + double doubleVal6 = this.moduleCategoryTabField.getCachedValue22(); + sb2 = sb2.append(doubleVal6).append("/"); + boolean flag3 = this.moduleCategoryTabField.isOpened(); + String textStr7 = sb2.append(flag3).toString(); + jSONObject.put(textStr2, textStr7); + break; + } + + try { + StringBuilder sb3 = new StringBuilder(); + Novoline novolineInst = Novoline.getInstance(); + String textStr3 = novolineInst.getTextValue(); + sb3 = sb3.append(textStr3); + FileWriter fileWriter = new FileWriter(Paths.get(sb3.append("\\dropdown_layout.novo").toString()).toFile()); + Throwable ex = null; + boolean flag4 = false /* VF: Semaphore variable */; + + try { + flag4 = true; + fileWriter.append(jSONObject.toString()); + flag4 = false; + } catch (Throwable ex2) { + ex = ex2; + throw ex2; + } finally { + if (flag4) { + label75: { + if (ex != null) { + try { + fileWriter.close(); + break label75; + } catch (Throwable ex3) { + ex.addSuppressed(ex3); + if (textStr != null) { + break label75; + } + } + } + + fileWriter.close(); + } + } + } + + fileWriter.close(); + } catch (IOException ex4) { + ex4.printStackTrace(); + } +} + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + String textStr; + ClickGui clickGui; + double doubleVal; + int intVal; + clickGui = ModuleRegistry.CLICKGUI.getModule(); + textStr = ""; + doubleVal = clickGui.getCachedValue(); + intVal = (this.smoothAnim.isStateFlag() ? 1 : 0); + label36: + if (textStr != null) { + if (intVal != 0) { + double propDouble; + intVal = (propDouble = this.smoothAnim.getValue() - 0.4) == 0.0 ? 0 : (propDouble < 0.0 ? -1 : 1); + if (textStr == null) { + break label36; + } + + if (intVal < 0) { + Minecraft mcClient = this.minecraft2; + mcClient.displayGuiScreen(null); + } + } + + intVal = 0; + } + + double doubleVal2; + label39: { + doubleVal2 = MovementUtils.applyGuiScale((intVal != 0)) * doubleVal; + GL11.glScaled(doubleVal2, doubleVal2, doubleVal2); + int intVal3 = MovementUtils.scaleMouseX(mouseX, doubleVal); + int intVal4 = MovementUtils.scaleMouseY(mouseY, doubleVal); + ScaledResolution scaledRes = new ScaledResolution(this.minecraft2); + double scaledWidthD = scaledRes.getScaledWidthDoubleGui() / 2.0; + double scaledHeightD = scaledRes.getScaledHeightDoubleGui() / 2.0; + StringProperty strProp = clickGui.getStringProperty8(); + int intVal2 = (strProp.equals("None") ? 1 : 0); + if (textStr != null) { + if (intVal2 != 0) { + this.applyClickGui(clickGui, intVal3, intVal4, partialTicks); + if (textStr != null) { + break label39; + } + + } + + intVal2 = intVal3; + } + + int intVal5 = intVal2; + int intVal6 = intVal4; + SmoothAnimation smoothAnimation = this.smoothAnim; + StringProperty strProp2 = clickGui.getStringProperty8(); + smoothAnimation.renderVisual(scaledWidthD, scaledHeightD, strProp2.equals("Linear") ? 0.0 : 0.05, $lambdaCapture$0(this, clickGui, intVal5, intVal6, partialTicks), 200L); + } + + MovementUtils.unscale(doubleVal2); +} + + + + public void updateHelper() { + Iterator iter = this.tabList.iterator(); + String textStr = ""; + + while (true) { + if (!iter.hasNext()) { + return; + } + + Object obj = iter.next(); + + while (true) { + Tab guiTab = (Tab)obj; + Novoline novolineInst = Novoline.getInstance(); + List itemList = novolineInst.getScriptManager().b(); + Iterator iter2 = itemList.iterator(); + + do { + if (!iter2.hasNext()) { + break; + } + + AbstractModule abstractModule = (AbstractModule)iter2.next(); + Tab guiTab2 = guiTab; + obj = guiTab.getCategory(); + + if (obj != abstractModule.getCategory()) { + continue; + } + + guiTab2 = guiTab; + + if (textStr != null && !guiTab2.applyUpdate2(abstractModule)) { + List itemList2 = guiTab.getModuleRows(); + ClickGuiModuleRow modRow = new ClickGuiModuleRow(guiTab, abstractModule); + itemList2.add(modRow); + } + } while (textStr != null); + + break; + } + } +} + + public void updateHelper2(AbstractModule module) { + Iterator iter = this.tabList.iterator(); + String textStr = ""; + + do { + if (!iter.hasNext()) { + break; + } + + Tab guiTab = (Tab)iter.next(); + List itemList = guiTab.getModuleRows(); + Predicate predicate = ((java.util.function.Predicate) (clickGuiModuleRow) -> ClickGUI.invokeCallback2(module, clickGuiModuleRow)); + itemList.removeIf(predicate); + } while (textStr != null); +} + + public ConfigScriptTab getConfigScriptTabField() { + return this.configScriptTabField; +} + + public void updateState(FontRenderer font, String text, double value, double amount, int index, boolean flag) { + ClickGui clickGuiMod = ModuleRegistry.CLICKGUI.getModule(); + double doubleVal = clickGuiMod.getCachedValue(); + font.drawElement3(text, value, amount, index, flag, (doubleVal != 1.0)); +} + + public ModuleCategoryTab getModuleCategoryTabField() { + return this.moduleCategoryTabField; +} + + @Override + public void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { + cc.novoline.modules.configurations.util.ClickGuiSettingRow settingRow; + ClickGui clickGuiMod = ModuleRegistry.CLICKGUI.getModule(); + double doubleVal = clickGuiMod.getCachedValue(); + int intVal = MovementUtils.scaleMouseX(mouseX, doubleVal); + String textStr = ""; + int intVal2 = MovementUtils.scaleMouseY(mouseY, doubleVal); + List itemList = this.tabList; + Iterator iter = itemList.iterator(); + + label92: + while (true) { + Iterator iter2 = iter; + + while (true) { + if (!iter2.hasNext()) { + break; + } + + Object obj = iter.next(); + + Tab guiTab; + label86: + while (true) { + guiTab = (Tab)obj; + + List itemList2 = guiTab.getModuleRows(); + Iterator iter3 = itemList2.iterator(); + + while (true) { + if (!iter3.hasNext()) { + break label86; + } + + ClickGuiModuleRow modRow = (ClickGuiModuleRow)iter3.next(); + List itemList3 = modRow.getVisibleSettings(); + iter2 = itemList3.iterator(); + + Iterator iter4 = iter2; + + do { + if (!iter4.hasNext()) { + break; + } + + ClickGuiSettingRow settingRow2 = (ClickGuiSettingRow)iter4.next(); + obj = settingRow2.getSetting().getSettingType(); + + SettingType settingType = SettingType.TEXTBOX; + if (obj == SettingType.TEXTBOX) { + ClickGuiSettingRow settingRow3 = settingRow2; + if (!settingRow2.isStateFlag()) { + continue; + } + + settingRow3 = settingRow2; + + settingRow3.setStateFlag(false); + continue; + } + + settingRow = settingRow2; + + obj = settingRow2.getSetting().getSettingType(); + settingType = SettingType.BINDABLE; + + if (obj != settingType) { + continue; + } + + settingRow = settingRow2; + + if (!settingRow.isStateFlag6()) { + continue; + } + + settingRow = settingRow2; + + settingRow.setStateFlag6(false); + } while (textStr != null); + + if (textStr == null) { + break label86; + } + } + } + + guiTab.mouseClickedPanel2(intVal, intVal2, mouseButton); + if (textStr != null) { + continue label92; + } + break; + } + + this.moduleCategoryTabField.mouseClickedPanel2(intVal, intVal2, mouseButton); + this.configScriptTabField.mouseClickedPanel2(intVal, intVal2, mouseButton); + super.mouseClicked(intVal, intVal2, mouseButton); + return; + } +} + + private void applyClickGui(ClickGui clickGui, int value, int index, float amount) { + String textStr2 = ""; + Tab[] guiTabArr = new Tab[8]; + List itemList3 = this.tabList; + guiTabArr[0] = (Tab)itemList3.get(0); + itemList3 = this.tabList; + guiTabArr[1] = (Tab)itemList3.get(1); + itemList3 = this.tabList; + guiTabArr[2] = (Tab)itemList3.get(2); + itemList3 = this.tabList; + guiTabArr[3] = (Tab)itemList3.get(3); + itemList3 = this.tabList; + guiTabArr[4] = (Tab)itemList3.get(4); + itemList3 = this.tabList; + guiTabArr[5] = (Tab)itemList3.get(5); + guiTabArr[6] = this.configScriptTabField; + guiTabArr[7] = this.moduleCategoryTabField; + ArrayList itemList = Lists.newArrayList(guiTabArr); + String textStr = textStr2; + short shortVal = 0; + Stream stream2 = itemList.stream(); + Comparator comparator = Comparator.comparingInt((Tab tab) -> (int)tab.getPosX()); + Stream stream3 = stream2.sorted(comparator); + Collector collector = Collectors.toList(); + List itemList2 = (java.util.List) stream3.collect(collector); + Iterator iter = itemList2.iterator(); + + do { + if (!iter.hasNext()) { + break; + } + + Tab guiTab = (Tab)iter.next(); + long longVal = shortVal; + int color = ColorTheme.getHudColor(longVal); + guiTab.drawElement(clickGui, value, index, amount, color); + shortVal -= 180; + } while (textStr != null); +} + + @Override + public void initGui() { + this.updateHelper(); + this.smoothAnim.applyDouble(0.4); +} + + public void applyFontRenderer(FontRenderer font, String text, double value, double amount, int index, boolean flag) { + ClickGui clickGuiMod = ModuleRegistry.CLICKGUI.getModule(); + double doubleVal = clickGuiMod.getCachedValue(); + double doubleVal2 = value - font.stringWidth(text) / 2; + font.drawElement3(text, doubleVal2, amount, index, flag, (doubleVal != 1.0)); +} + + @Override + public void performStep() { + ClickGui clickGuiMod = ModuleRegistry.CLICKGUI.getModule(); + BooleanProperty boolProp = clickGuiMod.getBooleanPropertyValue4(); + Boolean propFlag = boolProp.get(); + boolean flag = propFlag; + if (!flag) { + return; + } + + flag = true; + + double doubleVal; + label37: { + double scaledWidthD; + double scaledHeightD; + label27: { + doubleVal = MovementUtils.applyGuiScale(flag); + ScaledResolution scaledRes = new ScaledResolution(this.minecraft2); + scaledWidthD = scaledRes.getScaledWidthDoubleGui(); + scaledHeightD = scaledRes.getScaledHeightDoubleGui(); + StringProperty strProp = clickGuiMod.getStringProperty8(); + if (!strProp.equals("None")) { + break label27; + } + + RenderUtils.drawRect(0.0, 0.0, scaledWidthD, scaledHeightD, ColorTheme.BLACK.getRGB()); + + break label37; + } + + double doubleVal2 = scaledWidthD / 2.0; + double doubleVal3 = scaledHeightD / 2.0; + StringProperty strProp2 = clickGuiMod.getStringProperty8(); + double doubleVal4 = strProp2.equals("Linear") ? 0.0 : 0.05; + + this.smoothAnim.renderVisual(doubleVal2, doubleVal3, doubleVal4, $lambdaCapture$1(scaledWidthD, scaledHeightD), 200L); + } + + MovementUtils.unscale(doubleVal); +} + + public List getTabList() { + return this.tabList; +} + + private static boolean invokeCallback2(AbstractModule module, ClickGuiModuleRow clickGuiModuleRow) { + ClickGuiModuleRow modRow = clickGuiModuleRow; + if (clickGuiModuleRow == null) { + return false; + } + + modRow = clickGuiModuleRow; + + return modRow.getModule() == module; +} + + public Novoline getNovolineField() { + return this.novolineField; +} + + public SmoothAnimation getSmoothAnim2() { + return this.smoothAnim; +} + + @Override + public void mouseReleased(int mouseX, int mouseY, int mouseButton) { + ClickGui clickGuiMod = ModuleRegistry.CLICKGUI.getModule(); + double doubleVal = clickGuiMod.getCachedValue(); + int intVal = MovementUtils.scaleMouseX(mouseX, doubleVal); + int intVal2 = MovementUtils.scaleMouseY(mouseY, doubleVal); + List itemList = this.tabList; + Iterator iter = itemList.iterator(); + + while (true) { + if (iter.hasNext()) { + Tab guiTab = (Tab)iter.next(); + guiTab.mouseClickedPanel(intVal, intVal2, mouseButton); + + continue; + } + + this.configScriptTabField.mouseClickedPanel(intVal, intVal2, mouseButton); + this.moduleCategoryTabField.mouseClickedPanel(intVal, intVal2, mouseButton); + super.mouseReleased(intVal, intVal2, mouseButton); + break; + } +} + + private static Runnable $lambdaCapture$0(ClickGUI $c0, ClickGui $c1, int $c2, int $c3, float $c4) { return () -> $c0.invokeCallback($c1, $c2, $c3, $c4); } + private static Runnable $lambdaCapture$1(double $c0, double $c1) { return () -> { RenderUtils.drawRect(0.0, 0.0, $c0, $c1, ColorTheme.BLACK.getRGB()); }; } + + public cc.novoline.utils.anim.SmoothAnimation getSmoothAnim() { return this.getSmoothAnim2(); } + + public void drawScaledString(cc.novoline.utils.fonts.api.FontRenderer font, String text, double x, double y, int color, boolean shadow) { this.updateState(font, text, x, y, color, shadow); } + public void drawScaledCenteredString(cc.novoline.utils.fonts.api.FontRenderer font, String text, double x, double y, int color, boolean shadow) { this.applyFontRenderer(font, text, x, y, color, shadow); } + public cc.novoline.Novoline getNovoline() { return this.getNovolineField(); } + public java.util.List getTabs() { return this.getTabList(); } + public cc.novoline.gui.screen.click.ConfigScriptTab getConfigTab() { return this.getConfigScriptTabField(); } + public cc.novoline.gui.screen.click.ModuleCategoryTab getScriptTab() { return this.getModuleCategoryTabField(); } + public void removeModule(cc.novoline.modules.AbstractModule module) { this.updateHelper2(module); } + public void refreshScriptModules() { this.updateHelper(); } +} diff --git a/src/main/java/cc/novoline/gui/screen/alt/repository/AltRepositoryGUI.java b/src/main/java/cc/novoline/gui/screen/alt/repository/AltRepositoryGUI.java new file mode 100644 index 0000000..69f4d5f --- /dev/null +++ b/src/main/java/cc/novoline/gui/screen/alt/repository/AltRepositoryGUI.java @@ -0,0 +1,510 @@ +package cc.novoline.gui.screen.alt.repository; +import cc.novoline.Novoline; +import cc.novoline.gui.alt.AltAccountEntry; +import cc.novoline.gui.widget.AltRepositoryPanel; +import cc.novoline.gui.widget.GuiWidget; +import cc.novoline.gui.widget.TogglePillWidget; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.StencilUtil; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontCustom_282; +import cc.novoline.utils.fonts.holders.FontFamilyPROFILES; +import cc.novoline.utils.shader.RoundedTextureShader; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import it.unimi.dsi.fastutil.objects.ObjectLists; +import java.awt.Color; +import java.io.File; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.function.Predicate; +import java.util.stream.Stream; +import cc.novoline.gui.widget.Iterator6FunctionHelper; + +import cc.novoline.utils.fonts.api.FontFamily; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import org.apache.commons.lang3.StringUtils; + +public class AltRepositoryGUI { + private AltRepositoryPanel altRepositoryPanelField; + private Iterator6FunctionHelper iterator6FunctionHelperField; + private double cachedValue; + private boolean stateFlag; + private List guiWidgetList; + private double cachedValue2; + private Novoline novolineField; + private double cachedValue3; + private double cachedValue4; + private double cachedValue5; +public void performAction() { + try { + NBTTagList nBTTagList = new NBTTagList(); + Iterator iter = this.iterator6FunctionHelperField.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + AltAccountEntry altAccountEntry = (AltAccountEntry)iter.next(); + NBTBase nBTBase = altAccountEntry.getNBTBase(); + nBTTagList.appendTag(nBTBase); + + } + + NBTTagCompound nbtTag = new NBTTagCompound(); + nbtTag.setTag("alts", nBTTagList); + Novoline novolineInst = Novoline.getInstance(); + CompressedStreamTools.safeWrite(nbtTag, new File(novolineInst.getTextValue(), "alts.novo")); + } catch (Exception ex) { + } +} + + public void renderPanel(int value, int index) { + cc.novoline.gui.screen.alt.repository.AltRepositoryGUI altRepositoryGUI; + int intVal; + label115: { + Novoline novolineInst = this.novolineField; + this.cachedValue3 = (new ScaledResolution(novolineInst.getMinecraft())).getScaledWidthGui() - 20; + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal5 = this.cachedValue3 - this.cachedValue2 + 15.0; + double doubleVal6 = this.cachedValue4 - 15.0; + double doubleVal7 = this.cachedValue2; + double doubleVal8 = this.cachedValue; + Color awtColor2 = new Color(33, 33, 33, 255); + roundedTextureShader.drawRoundedRect(doubleVal5, doubleVal6, doubleVal7, doubleVal8, 30.0, 2.0, awtColor2, true); + AltRepositoryGUI altRepositoryGUI2 = this; + if (this.stateFlag) { + this.cachedValue2 = this.cachedValue2 + (230.0 - this.cachedValue2) * 0.025F; + this.cachedValue = this.cachedValue + (270.0 - this.cachedValue) * 0.025F; + break label115; + + } + + this.cachedValue2 = this.cachedValue2 + (30.0 - this.cachedValue2) * 0.04F; + altRepositoryGUI2 = this; + + altRepositoryGUI2.cachedValue = this.cachedValue + (30.0 - this.cachedValue) * 0.04F; + } + + FontFamily fontFam = FontFamilyPROFILES.FAMILY; + FontRenderer font = fontFam.ofSize(30); + String textStr2 = "A"; + double doubleVal9 = this.cachedValue3; + double doubleVal10 = doubleVal9 - font.stringWidth("A") / 2; + double doubleVal11 = this.cachedValue4; + double doubleVal12 = doubleVal11 - font.getHeight() / 2; + int intVal4 = (this.isHoveredAt(value, index) ? 1 : 0); + if (intVal4 != 0) { + Color awtColor = new Color(0, 150, 255); + intVal4 = awtColor.getRGB(); + } else { + intVal4 = -1; + } + + label118: { + font.drawString(textStr2, doubleVal10, doubleVal12, intVal4, true); + altRepositoryGUI = this; + + if (!this.stateFlag) { + altRepositoryGUI = this; + + if (!(this.cachedValue2 > 32.0)) { + double doubleVal; + intVal = (doubleVal = this.cachedValue - 32.0) == 0.0 ? 0 : (doubleVal < 0.0 ? -1 : 1); + + if (intVal <= 0) { + break label118; + } + } + } + + altRepositoryGUI = this; + + List itemList = altRepositoryGUI.guiWidgetList; + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + GuiWidget guiWidget = (GuiWidget)iter.next(); + guiWidget.applyUpdate(value, index); + + } + + StencilUtil.initStencilToWrite(false); + double doubleVal2 = this.cachedValue3 - this.cachedValue2 + 15.0; + double doubleVal13 = this.cachedValue4 - 15.0; + doubleVal9 = this.cachedValue2; + doubleVal11 = this.cachedValue; + RenderUtils.drawRoundedRect(doubleVal2, doubleVal13, doubleVal9, doubleVal11, 15.0, -1); + StencilUtil.readStencilBuffer(true); + FontRenderer font2 = FontCustom_282.FONT; + textStr2 = "Novoline Profile Manager"; + doubleVal9 = this.cachedValue3 - 220.0 + 15.0; + doubleVal11 = this.cachedValue4 - 7.0; + font2.drawString(textStr2, doubleVal9, doubleVal11, -1, 2.0F); + StencilUtil.uninitStencilBuffer(); + + List itemList2 = this.guiWidgetList; + iter = itemList2.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + GuiWidget guiWidget2 = (GuiWidget)iter.next(); + guiWidget2.renderPanel2(value, index); + + } + } + + double doubleVal3 = this.cachedValue5; + List itemList3 = this.guiWidgetList; + GuiWidget guiWidget3 = this.getGuiWidget(); + this.cachedValue5 = doubleVal3 + (itemList3.indexOf(guiWidget3) * this.getCachedValue2() - this.cachedValue5) * 0.05F; + + intVal = 0; + + int intVal2 = intVal; + List itemList4 = this.guiWidgetList; + Iterator iter2 = itemList4.iterator(); + + while (true) { + if (!iter2.hasNext()) { + break; + } + + GuiWidget guiWidget4 = (GuiWidget)iter2.next(); + int intVal3 = intVal2; + if (intVal2 == 0) { + byte byteVal = (byte)(guiWidget4.isActive() ? 1 : 0); + + if (byteVal == 0) { + continue; + } + + byteVal = 1; + + + intVal2 = byteVal; + continue; + } + + List itemList5 = this.guiWidgetList; + double doubleVal4 = itemList5.indexOf(guiWidget4) * this.getCachedValue2() - this.cachedValue5; + if (Math.abs(doubleVal4) >= (this.getCachedValue2() - 2.0)) { + List itemList6 = this.guiWidgetList; + itemList6.remove(guiWidget4); + } + } +} + + public void applyUpdate(int value, int index) { + AltRepositoryGUI altRepositoryGUI = this; + if (!this.stateFlag) { + return; + } + + altRepositoryGUI = this; + + List itemList = altRepositoryGUI.guiWidgetList; + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + GuiWidget guiWidget = (GuiWidget)iter.next(); + GuiWidget guiWidget2 = guiWidget; + if (!guiWidget.isActive()) { + continue; + } + + guiWidget2 = guiWidget; + + guiWidget2.renderPanel(value, index); + } +} + + public boolean isHoveredAt(int value, int index) { + double doubleVal = this.cachedValue3 - value; + doubleVal = Math.pow(doubleVal, 2.0); + double doubleVal2 = this.cachedValue4 - index; + int intVal = (doubleVal + Math.pow(doubleVal2, 2.0) <= 225.0) ? 1 : 0; + + return ((((intVal & 1)) != 0)); +} + + public Iterator6FunctionHelper getIterator6FunctionHelper() { + return new Iterator6FunctionHelper<>(ObjectLists.synchronize(new ObjectArrayList<>()), this::mapAltAccountEntry, AltRepositoryGUI::supplyComparator2); +} + + public void performAction2() { + this.handleAction(); + AltRepositoryPanel altRepositoryPanel = new AltRepositoryPanel(this); + altRepositoryPanel.setActive(true); + List itemList = this.guiWidgetList; + itemList.add(altRepositoryPanel); +} + + public double[] getPanelBounds() { + return new double[]{this.cachedValue3 - this.cachedValue2 + 15.0 + 5.0, this.cachedValue4, this.cachedValue3 - this.cachedValue2 + 15.0 + this.cachedValue2, this.cachedValue4 + this.cachedValue - 15.0}; +} + + public void mouseClickedPanel(int value, int index, int count) { + int intVal; + intVal = (this.stateFlag ? 1 : 0); + + if (this.stateFlag) { + List itemList = this.guiWidgetList; + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + GuiWidget guiWidget = (GuiWidget)iter.next(); + GuiWidget guiWidget2 = guiWidget; + + intVal = (guiWidget.isActive() ? 1 : 0); + + if (intVal == 0) { + continue; + } + + guiWidget2 = guiWidget; + + + guiWidget2.mouseClickedPanel(value, index, count); + } + } + + intVal = (this.isHoveredAt(value, index) ? 1 : 0); + + + if (intVal == 0) { + return; + } + + intVal = count; + + + if (intVal == 0) { + boolean flag = !this.stateFlag; + + this.stateFlag = flag; + } +} + + public List getGuiWidgetList() { + return this.guiWidgetList; +} + + private static Comparator supplyComparator() { + return Comparator.comparing(AltAccountEntry::getCachedText4); +} + + public double getScrollOffset() { + return this.cachedValue5; +} + + public AltRepositoryGUI(Novoline novoline) { + this.altRepositoryPanelField = new AltRepositoryPanel(this); + this.iterator6FunctionHelperField = new Iterator6FunctionHelper<>(ObjectLists.synchronize(new ObjectArrayList<>()), this::lambdaImpl$new$0, AltRepositoryGUI::supplyComparator); + this.guiWidgetList = new CopyOnWriteArrayList<>(); + this.novolineField = novoline; + this.cachedValue3 = (new ScaledResolution(novoline.getMinecraft())).getScaledWidthGui() - 20; + this.cachedValue4 = 20.0; + this.cachedValue2 = 30.0; + this.cachedValue = 30.0; +} + + public double getCachedValue3() { + return this.cachedValue3; +} + + public double getCachedValue2() { + return this.cachedValue2; +} + + public void handleAction() { + this.iterator6FunctionHelperField.performAction2(); + + try { + Novoline novolineInst = Novoline.getInstance(); + NBTTagCompound nbtTag = CompressedStreamTools.read(new File(novolineInst.getTextValue(), "alts.novo")); + NBTTagCompound nbtTag2 = nbtTag; + if (nbtTag == null) { + return; + } + + nbtTag2 = nbtTag; + + NBTTagList nbtList = nbtTag2.getTagList("alts", 10); + int intVal = 0; + + while (true) { + if (intVal >= nbtList.getInt2()) { + break; + } + + label48: { + AltAccountEntry altAccountEntry; + try { + NBTTagCompound nBTTagCompound = nbtList.getCompoundTagAt(intVal); + altAccountEntry = AltAccountEntry.createList(this, nBTTagCompound); + } catch (Throwable ex) { + break label48; + } + + this.iterator6FunctionHelperField.applyUpdate(altAccountEntry); + } + + intVal++; + } + } catch (Exception ex2) { + } +} + + private AltAccountEntry mapAltAccountEntry(AltAccountEntry altAccountEntry) { + TogglePillWidget togglePillWidget = this.getTogglePillWidget(); + if (togglePillWidget == null) { + return (AltAccountEntry)altAccountEntry; + } + + togglePillWidget = this.getTogglePillWidget(); + + String textStr = togglePillWidget.getStringValue3(); + if (!StringUtils.isBlank(textStr)) { + AltAccountEntry altAccountEntry2 = altAccountEntry; + if (altAccountEntry == null) { + return null; + } + + altAccountEntry2 = altAccountEntry; + + String textStr2 = altAccountEntry2.getCachedText4(); + String lowerStr = textStr2.toLowerCase(); + String textStr3 = this.getTogglePillWidget().getStringValue3(); + textStr3 = textStr3.trim(); + textStr3 = textStr3.toLowerCase(); + altAccountEntry2 = lowerStr.startsWith(textStr3) ? altAccountEntry : null; + + return altAccountEntry2; + } else { + return (AltAccountEntry)altAccountEntry; + } +} + + public void setIterator6FunctionHelperField(Iterator6FunctionHelper iterator6FunctionHelper) { + this.iterator6FunctionHelperField = iterator6FunctionHelper; +} + + private AltAccountEntry lambdaImpl$new$0(AltAccountEntry altAccountEntry) { + TogglePillWidget togglePillWidget = this.getTogglePillWidget(); + if (togglePillWidget == null) { + return (AltAccountEntry)altAccountEntry; + } + + togglePillWidget = this.getTogglePillWidget(); + + String textStr = togglePillWidget.getStringValue3(); + if (!StringUtils.isBlank(textStr)) { + AltAccountEntry altAccountEntry2 = altAccountEntry; + if (altAccountEntry == null) { + return null; + } + + altAccountEntry2 = altAccountEntry; + + String textStr2 = altAccountEntry2.getCachedText4(); + String lowerStr = textStr2.toLowerCase(); + String textStr3 = this.getTogglePillWidget().getStringValue3(); + textStr3 = textStr3.trim(); + textStr3 = textStr3.toLowerCase(); + altAccountEntry2 = lowerStr.startsWith(textStr3) ? altAccountEntry : null; + + return altAccountEntry2; + } else { + return (AltAccountEntry)altAccountEntry; + } +} + + private static Comparator supplyComparator2() { + return Comparator.comparing(AltAccountEntry::getCachedText4); +} + + public Iterator6FunctionHelper getIterator6FunctionHelper2() { + return this.iterator6FunctionHelperField; +} + + public void applyUpdate(char ch, int value) { + Iterator iter = this.guiWidgetList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + GuiWidget guiWidget = (GuiWidget)iter.next(); + GuiWidget guiWidget2 = guiWidget; + if (!guiWidget.isActive()) { + continue; + } + + guiWidget2 = guiWidget; + + guiWidget2.applyUpdate(ch, value); + } +} + + public GuiWidget getGuiWidget() { + Stream stream2 = this.guiWidgetList.stream(); + Predicate predicate = ((java.util.function.Predicate) GuiWidget::isReadyState); + Stream stream3 = stream2.filter(predicate); + Optional optional = stream3.findFirst(); + return (GuiWidget)optional.orElse(null); +} + + + + public TogglePillWidget getTogglePillWidget() { + cc.novoline.gui.widget.GuiWidget guiWidget; + Iterator iter = this.guiWidgetList.iterator(); + + while (true) { + if (iter.hasNext()) { + GuiWidget guiWidget2 = (GuiWidget)iter.next(); + guiWidget = guiWidget2; + + if (guiWidget2 instanceof AltRepositoryPanel) { + guiWidget = guiWidget2; + break; + } + + continue; + } + + return null; + } + + AltRepositoryPanel altRepositoryPanel = (AltRepositoryPanel)guiWidget; + return altRepositoryPanel.getVFC(); +} + + public double getCachedValue4() { + return this.cachedValue4; +} +} diff --git a/src/main/java/cc/novoline/gui/screen/click/ConfigScriptTab.java b/src/main/java/cc/novoline/gui/screen/click/ConfigScriptTab.java new file mode 100644 index 0000000..1e75aab --- /dev/null +++ b/src/main/java/cc/novoline/gui/screen/click/ConfigScriptTab.java @@ -0,0 +1,544 @@ +package cc.novoline.gui.screen.click; + +import cc.novoline.Novoline; +import cc.novoline.gui.screen.ClickGUI; +import cc.novoline.irc.ClickGuiSearchBar; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.visual.ClickGui; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontFamilyCONFIGS; +import cc.novoline.utils.fonts.impl.ClickGuiConfigPanel; +import cc.novoline.utils.notifications.NotificationManager; +import cc.novoline.utils.notifications.NotificationType; +import java.awt.Color; + +import cc.novoline.utils.fonts.holders.FontFamilySF_BOLD; + +import net.minecraft.util.MathHelper; +import cc.novoline.utils.fonts.api.FontFamily; +import cc.novoline.utils.fonts.holders.FontFamilyIconFontAlt; +import net.minecraft.client.Minecraft; + +public class ConfigScriptTab extends Tab { + public double doubleValue; + private boolean stateFlag; + private int stateTicks; + private ClickGuiConfigPanel clickGuiConfigPanelField; + private ClickGuiSearchBar clickGuiSearchBarField; + private double cachedValue; + private int z; + private double x = 140.0; + private int stateTicks2; + private int stateTicks3; + public double doubleValueField; + private double cachedValue2; + private ClickGUI clickGUIField; + private boolean flagValue; + private boolean stateFlag2; + private double cachedValue3; + private boolean stateFlag3; + + @Override + public void drawElement(ClickGui clickGui, int value, int index, float amount, int count) { + cc.novoline.gui.screen.click.ConfigScriptTab configScriptTab; + cc.novoline.gui.screen.click.ConfigScriptTab configScriptTab2; + int[] intArr; + int intVal; + label115: { + label118: { + label113: { + label112: { + label119: { + intArr = ModuleCategoryTab.getIntArrayValue(); + boolean flag2 = this.stateFlag2; + if (intArr == null) { + if (this.stateFlag2) { + this.cachedValue = this.stateTicks3 + value; + this.cachedValue2 = this.stateTicks + index; + } + + configScriptTab = this; + if (intArr != null) { + break label119; + } + + flag2 = this.applyUpdate3(value, index); + } + + if (!flag2) { + intVal = (this.stateFlag ? 1 : 0); + if (intArr != null) { + break label113; + } + + if (!this.stateFlag) { + break label112; + } + } + + configScriptTab = this; + } + + configScriptTab.cachedValue3 += 0.05; + if (intArr == null) { + break label118; + } + } + + double doubleVal; + intVal = (doubleVal = this.cachedValue3 - 0.0) == 0.0 ? 0 : (doubleVal < 0.0 ? -1 : 1); + } + + if (intArr != null) { + break label115; + } + + if (intVal > 0) { + this.cachedValue3 -= 0.05; + } + } + + StringProperty strProp = clickGui.getStringPropertyR(); + intVal = (strProp.equals("Basic") ? 1 : 0); + } + + label92: { + if (intVal != 0) { + double doubleVal2 = this.cachedValue; + double doubleVal10 = this.cachedValue2 - 2.0; + double doubleVal11 = this.cachedValue + 29.0; + double doubleVal12 = this.cachedValue2 + 20.0; + Color awtColor = new Color(36, 36, 36); + int color = awtColor.getRGB(); + RenderUtils.drawRect(doubleVal2, doubleVal10, doubleVal11, doubleVal12, color); + double doubleVal3 = this.cachedValue + 29.0; + doubleVal10 = this.cachedValue2 - 2.0; + doubleVal11 = this.cachedValue + 130.0; + doubleVal12 = this.cachedValue2 + 20.0; + awtColor = new Color(45, 45, 45); + int color2 = awtColor.getRGB(); + RenderUtils.drawRect(doubleVal3, doubleVal10, doubleVal11, doubleVal12, color2); + if (intArr == null) { + break label92; + } + } + + double doubleVal4 = this.cachedValue; + double doubleVal13 = this.cachedValue2 - 2.0; + double doubleVal14 = this.cachedValue + 29.0; + double doubleVal15 = this.cachedValue2 + 20.0; + Color awtColor2 = new Color(count); + awtColor2 = awtColor2.darker(); + int color3 = awtColor2.getRGB(); + RenderUtils.drawRect(doubleVal4, doubleVal13, doubleVal14, doubleVal15, color3); + double doubleVal5 = this.cachedValue + 29.0; + doubleVal13 = this.cachedValue2 - 2.0; + doubleVal14 = this.cachedValue + 130.0; + doubleVal15 = this.cachedValue2 + 20.0; + awtColor2 = new Color(count); + int color4 = awtColor2.getRGB(); + RenderUtils.drawRect(doubleVal5, doubleVal13, doubleVal14, doubleVal15, color4); + } + + ClickGUI clickGuiScreen = this.clickGUIField; + FontFamily fontFam = FontFamilySF_BOLD.FAMILY; + FontRenderer font = fontFam.ofSize(25); + String textStr2 = "Configs"; + double doubleVal16 = this.cachedValue + 33.0; + double doubleVal17 = this.cachedValue2 + 4.0; + Color awtColor3 = Color.WHITE; + awtColor3 = awtColor3.darker(); + Color awtColor7 = Color.WHITE; + double doubleVal18 = (float)this.cachedValue3; + clickGuiScreen.drawScaledString(font, textStr2, doubleVal16, doubleVal17, RenderUtils.interpolateColor(awtColor3, awtColor7, doubleVal18), true); + ClickGUI clickGuiScreen2 = this.clickGUIField; + fontFam = FontFamilyIconFontAlt.FAMILY; + clickGuiScreen2.drawScaledString(fontFam.ofSize(48), "A", this.cachedValue + 5.5, this.cachedValue2 - 1.0, 16777215, true); + StringProperty strProp2 = clickGui.getStringPropertyR(); + int intVal2 = (strProp2.equals("Basic") ? 1 : 0); + if (intArr == null) { + intVal2 = (intVal2 != 0 ? 130 : 225); + } + + int intVal3 = intVal2; + ClickGUI clickGuiScreen3 = this.clickGUIField; + fontFam = FontFamilyCONFIGS.FAMILY; + FontRenderer font2 = fontFam.ofSize(30); + doubleVal16 = (float)this.cachedValue + 112.0F; + doubleVal17 = (float)(this.cachedValue2 + 5.0); + int intVal4 = (this.flagValue ? 1 : 0); + if (intArr == null) { + if (this.flagValue) { + awtColor3 = new Color(200, 200, 200); + intVal4 = awtColor3.getRGB(); + } else { + awtColor3 = new Color(intVal3, intVal3, intVal3); + intVal4 = awtColor3.getRGB(); + } + } + + label121: { + label83: { + label122: { + clickGuiScreen3.drawScaledString(font2, "B", doubleVal16, doubleVal17, intVal4, true); + boolean flag = this.stateFlag; + if (intArr == null) { + if (!this.stateFlag) { + break label121; + } + + configScriptTab2 = this; + if (intArr != null) { + break label122; + } + + flag = this.flagValue; + } + + if (flag) { + this.clickGuiSearchBarField.renderClickGui(clickGui, value, index, this.cachedValue, this.cachedValue2 + 20.0); + if (intArr == null) { + break label83; + } + } + + configScriptTab2 = this; + } + + configScriptTab2.clickGuiConfigPanelField.renderClickGui(clickGui, value, index, this.cachedValue, this.cachedValue2 + 20.0, count); + } + + double doubleVal6; + label69: { + label68: { + doubleVal6 = this.x; + if (intArr == null) { + StringProperty strProp3 = clickGui.getStringPropertyR(); + if (!strProp3.equals("Basic")) { + break label68; + } + + double doubleVal7 = this.cachedValue; + double doubleVal19 = this.cachedValue2 + 20.0 + doubleVal6 + 60.0; + double doubleVal20 = this.cachedValue + 130.0; + doubleVal16 = this.cachedValue2 + 20.0 + doubleVal6 + 65.0; + Color awtColor4 = new Color(37, 37, 37); + int color5 = awtColor4.getRGB(); + RenderUtils.drawRect(doubleVal7, doubleVal19, doubleVal20, doubleVal16, color5); + } + + if (intArr == null) { + break label69; + } + } + + double doubleVal8 = this.cachedValue; + double doubleVal21 = this.cachedValue2 + 20.0 + doubleVal6 + 60.0; + double doubleVal22 = this.cachedValue + 130.0; + doubleVal16 = this.cachedValue2 + 20.0 + doubleVal6 + 65.0; + Color awtColor5 = new Color(0, 0, 0, (int)(200.0 * clickGui.getDoubleValue())); + int color6 = awtColor5.getRGB(); + RenderUtils.drawRect(doubleVal8, doubleVal21, doubleVal22, doubleVal16, color6); + } + + net.minecraft.client.gui.FontRenderer font3 = Minecraft.getMinecraft().fontRendererObj; + String textStr = "\u25e2"; + float floatVal = (float)(this.cachedValue + 130.0 - 3.2F); + float floatVal2 = (float)(this.cachedValue2 + 20.0 + doubleVal6 + 60.0) - 2.5F; + Color awtColor6 = new Color(80, 80, 80, 150); + int color7 = awtColor6.getRGB(); + font3.drawString(textStr, floatVal, floatVal2, color7); + ConfigScriptTab configScriptTab3 = this; + if (intArr == null) { + if (!this.stateFlag3) { + break label121; + } + + configScriptTab3 = this; + } + + double doubleVal9 = index - 60 - (this.cachedValue2 + 20.0); + configScriptTab3.x = (int)MathHelper.clamp_double(doubleVal9, 10.0, 9999.0); + } +} + + @Override + public void applyUpdate(double value) { + this.cachedValue = value; +} + + public ClickGuiSearchBar getXwA() { + return this.clickGuiSearchBarField; +} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + label15: { + ConfigScriptTab configScriptTab = this; + if (this.flagValue) { + this.clickGuiSearchBarField.handleInt2(value, index, count); + break label15; + } + + configScriptTab = this; + + configScriptTab.clickGuiConfigPanelField.handleInt(value, index, count); + } + + this.stateFlag3 = this.stateFlag2 = false; + super.mouseClickedPanel(value, index, count); +} + + @Override + public void applyUpdate2(boolean flag) { + this.stateFlag = flag; +} + + public ConfigScriptTab(ClickGUI clickGUI, int value, int index) { + super(clickGUI, null, value, index); + this.cachedValue = value; + this.cachedValue2 = index; + this.clickGUIField = clickGUI; + this.clickGuiConfigPanelField = new ClickGuiConfigPanel(clickGUI, this); + this.clickGuiSearchBarField = new ClickGuiSearchBar(clickGUI, this); +} + + @Override + public void applyUpdate3(char ch, int value) { + label15: { + ConfigScriptTab configScriptTab = this; + if (this.flagValue) { + this.clickGuiSearchBarField.handleChar(ch, value); + break label15; + } + + configScriptTab = this; + + configScriptTab.clickGuiConfigPanelField.handleChar(ch, value); + } + + super.applyUpdate3(ch, value); +} + + @Override + public boolean isStateFlag() { + return this.stateFlag; +} + + @Override + public void mouseClickedPanel2(int value, int index, int count) { + int intVal2; + ConfigScriptTab configScriptTab; + label138: { + int[] intArr; + label129: { + label130: { + intArr = ModuleCategoryTab.getIntArrayValue(); + intVal2 = (this.applyUpdate3(value, index) ? 1 : 0); + label123: + if (intArr == null) { + if (intVal2 != 0) { + intVal2 = count; + if (intArr != null) { + break label123; + } + + if (count == 0) { + if (value < this.cachedValue + 100.0) { + this.stateFlag2 = true; + this.stateTicks3 = (int)(this.cachedValue - value); + this.stateTicks = (int)(this.cachedValue2 - index); + if (intArr == null) { + break label130; + } + } + + boolean flag3 = this.flagValue; + if (intArr == null) { + flag3 = !this.flagValue; + } + + label132: { + this.flagValue = flag3; + boolean flag = this.flagValue; + if (intArr == null) { + if (this.flagValue) { + Novoline novolineInst = Novoline.getInstance(); + NotificationManager notifManager = novolineInst.getNotificationManager(); + notifManager.pop("Novoline Server", "Cloud Configs are temporarily unavailable", 2500, NotificationType.WARNING); + this.flagValue = false; + } + + configScriptTab = this; + if (intArr != null) { + break label132; + } + + flag = this.flagValue; + } + + if (!flag) { + this.clickGuiConfigPanelField.performAction(); + if (intArr == null) { + break label130; + } + } + + configScriptTab = this; + } + + configScriptTab.clickGuiSearchBarField.clearEntries(); + if (intArr == null) { + break label130; + } + } + } + + intVal2 = (this.applyUpdate3(value, index) ? 1 : 0); + } + + if (intArr != null) { + break label129; + } + + if (intVal2 != 0) { + intVal2 = count; + if (intArr != null) { + break label129; + } + + if (count == 1) { + boolean flag2 = this.stateFlag; + if (intArr == null) { + flag2 = !this.stateFlag; + } + + this.stateFlag = flag2; + } + } + } + + configScriptTab = this; + if (intArr != null) { + break label138; + } + + intVal2 = (this.stateFlag ? 1 : 0); + } + + label82: + if (intVal2 != 0) { + label88: { + ConfigScriptTab configScriptTab2 = this; + if (intArr == null) { + if (this.flagValue) { + this.clickGuiSearchBarField.handleInt(value, index, count); + if (intArr == null) { + break label88; + } + } + + configScriptTab2 = this; + } + + configScriptTab2.clickGuiConfigPanelField.handleInt2(value, index, count); + } + + int intVal = count; + if (intArr == null) { + if (count != 0) { + break label82; + } + + double doubleVal; + intVal = (doubleVal = value - (this.cachedValue + 130.0 - 5.0)) == 0.0 ? 0 : (doubleVal < 0.0 ? -1 : 1); + } + + if (intArr == null) { + if (intVal < 0) { + break label82; + } + + double doubleVal2; + intVal = (doubleVal2 = value - (this.cachedValue + 130.0)) == 0.0 ? 0 : (doubleVal2 < 0.0 ? -1 : 1); + } + + if (intArr == null) { + if (intVal > 0) { + break label82; + } + + double doubleVal3; + intVal = (doubleVal3 = index - (this.cachedValue2 + 20.0 + this.x + 60.0)) == 0.0 ? 0 : (doubleVal3 < 0.0 ? -1 : 1); + } + + if (intArr == null) { + if (intVal < 0) { + break label82; + } + + double doubleVal4; + intVal = (doubleVal4 = index - (this.cachedValue2 + 20.0 + this.x + 65.0)) == 0.0 ? 0 : (doubleVal4 < 0.0 ? -1 : 1); + } + + if (intVal <= 0) { + this.stateFlag3 = true; + this.z = (int)(index - this.cachedValue2); + } + } + + configScriptTab = this; + } + + super.mouseClickedPanel2(value, index, count); +} + + @Override + public double getCachedValue() { + return this.cachedValue; +} + + @Override + public void applyDouble(double value) { + this.x = value; +} + + @Override + public double getCachedValue22() { + return this.cachedValue2; +} + + @Override + public boolean applyUpdate3(int value, int index) { + int[] intArr = ModuleCategoryTab.getIntArrayValue(); + double doubleVal; + int intVal = (doubleVal = value - this.cachedValue) == 0.0 ? 0 : (doubleVal < 0.0 ? -1 : 1); + if (intVal < 0) { + return false; + } + + if (value > (this.cachedValue + 130.0)) { + return false; + } + + if (index < this.cachedValue2) { + return false; + } + + double doubleVal2; + intVal = (doubleVal2 = index - (this.cachedValue2 + 20.0)) == 0.0 ? 0 : (doubleVal2 < 0.0 ? -1 : 1); + + return (boolean)(intArr != null ? intVal : intVal <= 0); +} + + @Override + public double getDoubleValue2() { + return this.x; +} + + @Override + public void applyUpdate2(double value) { + this.cachedValue2 = value; +} +} diff --git a/src/main/java/cc/novoline/gui/screen/click/DiscordGUI.java b/src/main/java/cc/novoline/gui/screen/click/DiscordGUI.java new file mode 100644 index 0000000..57db7ad --- /dev/null +++ b/src/main/java/cc/novoline/gui/screen/click/DiscordGUI.java @@ -0,0 +1,811 @@ +package cc.novoline.gui.screen.click; +import cc.novoline.Novoline; +import cc.novoline.gui.click.DiscordSettingSwitchMap; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.ConfigManager; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.enums.VerticalDirection; +import cc.novoline.utils.fonts.holders.FontCustom_16; +import cc.novoline.utils.fonts.holders.FontICONFONT_35; +import cc.novoline.utils.fonts.impl.DiscordCategoryTab; +import cc.novoline.utils.fonts.impl.DiscordConfigPanel; +import cc.novoline.utils.fonts.impl.DiscordModuleRow; +import cc.novoline.utils.fonts.impl.DiscordConfigCard; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.gui.screen.setting.Setting; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import java.awt.Color; +import java.io.IOException; +import java.nio.file.FileVisitOption; +import java.nio.file.Files; +import java.nio.file.LinkOption; +import java.nio.file.Path; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.function.Consumer; +import java.util.function.Predicate; +import java.util.function.Supplier; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import cc.novoline.modules.ModuleManager; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiScreen; +import org.apache.logging.log4j.Logger; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.lwjgl.input.Mouse; + +public class DiscordGUI extends GuiScreen { + private int stateTicks; + private boolean stateFlag; + private int stateTicks2; + private final List discordCategoryTabList; + private int x; + private int stateTicks3; + private static final TimerUtil timerUtil = new TimerUtil(); + private int stateTicks4 = 63; + private final List discordConfigCardList; + private int v; + private int y; + private int stateTicks5; + private final Novoline novolineField; + private int stateTicks6; + private int stateTicks7; + private boolean stateFlag2; + private boolean stateFlag3; + + @Override + public void mouseReleased(int mouseX, int mouseY, int mouseButton) { + if (mouseButton == 0) { + this.stateFlag2 = false; + this.stateFlag = false; + } + + Stream stream2 = this.discordCategoryTabList.stream(); + Predicate predicate = ((java.util.function.Predicate) DiscordCategoryTab::isFlagValue); + Stream stream3 = stream2.filter(predicate); + Optional optional = stream3.findFirst(); + Consumer consumer = ((java.util.function.Consumer) (discordCategoryTab) -> { discordCategoryTab.handleInt(mouseX, mouseY, mouseButton); }); + optional.ifPresent(consumer); +} + + public int getStateTicks7() { + return this.stateTicks7; +} + + @Override + public void onGuiClosed() { + List itemList = SettingManager.getSettings(); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + Setting setting; + label28: { + label27: { + setting = (Setting)iter.next(); + switch (DiscordSettingSwitchMap.SWITCH_MAP[setting.getSettingType().ordinal()]) { + case 1: + setting.applyUpdate3(false); + break; + case 2: + case 3: + break label27; + case 4: + break label28; + default: + continue; + } + + continue; + } + + setting.setStateFlag(false); + continue; + } + + setting.applyUpdate(false); + } +} + + public int computeIntValue() { + return this.y; +} + + @Override + public void initGui() { + super.initGui(); +} + + public int getIntValue2() { + return super.height * 2; +} + + public boolean checkState() { + return this.stateFlag3; +} + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + boolean flag; + cc.novoline.gui.screen.click.DiscordGUI discordScreen; + int intVal; + int intVal3; + int intVal4 = (this.stateFlag2 ? 1 : 0); + if (this.stateFlag2) { + this.stateTicks3 = this.stateTicks2 + mouseX; + this.stateTicks7 = this.x + mouseY; + } + + intVal4 = (this.stateFlag ? 1 : 0); + + + if (intVal4 != 0) { + intVal4 = this.stateTicks + mouseX; + short shortVal = 190; + if (intVal4 > 190) { + this.y = this.stateTicks + mouseX; + } + + intVal4 = this.stateTicks5 + mouseY; + + if (intVal4 > 300) { + this.stateTicks6 = this.stateTicks5 + mouseY; + } + } + + intVal4 = 0; + + + int intVal2 = intVal4; + float floatVal = this.stateTicks3; + float floatVal7 = this.stateTicks7 - 10; + float floatVal8 = 150 + this.y; + float floatVal9 = this.stateTicks7 + 5; + int intVal5 = intVal2; + if (intVal2 != 0) { + Color awtColor = new Color(22, 23, 26); + intVal5 = awtColor.getRGB(); + } else { + intVal5 = -14671323; + } + + RenderUtils.drawRoundedRect(floatVal, floatVal7, floatVal8, floatVal9, 8.0F, intVal5); + float floatVal2 = this.stateTicks3; + floatVal7 = this.stateTicks7; + floatVal9 = this.stateTicks6; + float floatVal10 = intVal2 != 0 ? 9.0F : 6.0F; + int intVal6 = intVal2; + if (intVal2 != 0) { + Color awtColor2 = new Color(29, 30, 34); + intVal6 = awtColor2.getRGB(); + } else { + intVal6 = -14671323; + } + + label107: { + RenderUtils.drawRoundedRect(floatVal2, floatVal7, 49.0F, floatVal9, floatVal10, intVal6); + if (intVal2 != 0) { + String textStr = "MATERIALINE"; + break label107; + } + + String textStr2 = "NOVOLINE"; + } + + int ticks4 = this.stateTicks3 + 10; + int ticks5 = this.stateTicks7 + 4; + int intVal7 = intVal2; + if (intVal2 != 0) { + Color awtColor3 = new Color(29, 30, 34); + intVal7 = awtColor3.getRGB(); + } else { + intVal7 = -14671323; + } + + this.applyInt5(this.stateTicks3, this.stateTicks7, ticks4, ticks5, intVal7); + float floatVal3 = this.stateTicks3 + 45 + 105; + floatVal7 = this.stateTicks7; + floatVal8 = this.y; + floatVal9 = this.stateTicks6; + int intVal8 = intVal2; + if (intVal2 != 0) { + Color awtColor4 = new Color(32, 34, 37); + intVal8 = awtColor4.getRGB(); + } else { + intVal8 = -13223618; + } + + RenderUtils.drawRoundedRect(floatVal3, floatVal7, floatVal8, floatVal9, 4.0F, intVal8); + float floatVal4 = this.stateTicks3 + 7; + floatVal7 = this.stateTicks7 + 40; + int intVal9 = intVal2; + if (intVal2 != 0) { + Color awtColor5 = new Color(22, 23, 26); + intVal9 = awtColor5.getRGB(); + } else { + intVal9 = -13684426; + } + + RenderUtils.drawRoundedRect(floatVal4, floatVal7, 31.0F, 3.0F, 0.0F, intVal9); + int ticks = this.stateTicks3 + 44; + int ticks6 = this.stateTicks3 + 45 + 110; + int ticks7 = this.stateTicks7 + this.stateTicks6; + int intVal10 = intVal2; + if (intVal2 != 0) { + Color awtColor6 = new Color(22, 23, 26); + intVal10 = awtColor6.getRGB(); + } else { + intVal10 = -13684426; + } + + this.applyInt5(ticks, this.stateTicks7, ticks6, ticks7, intVal10); + int ticks2 = this.stateTicks3 + 44; + int ticks8 = this.stateTicks7 + 20; + int ticks9 = this.stateTicks3 + 45 + 105 + this.y; + int ticks10 = this.stateTicks7 + 21; + int intVal11 = intVal2; + if (intVal2 != 0) { + Color awtColor7 = new Color(17, 18, 20); + intVal11 = awtColor7.getRGB(); + } else { + intVal11 = -14671323; + } + + this.applyInt5(ticks2, ticks8, ticks9, ticks10, intVal11); + flag = this.evaluateCondition(); + + if (!flag) { + flag = this.stateFlag3; + + if (!this.stateFlag3) { + FontRenderer font = this.minecraft2.fontRendererObj; + String textStr3 = "<------------"; + floatVal8 = this.stateTicks3 + 59; + floatVal9 = this.stateTicks7 + 65; + font.resolveInt3(textStr3, floatVal8, floatVal9, -9801351); + String textStr4 = "Select one of"; + floatVal8 = this.stateTicks3 + 67; + floatVal9 = this.stateTicks7 + 75; + font.resolveInt3(textStr4, floatVal8, floatVal9, -9801351); + String textStr5 = "these"; + floatVal8 = this.stateTicks3 + 85; + floatVal9 = this.stateTicks7 + 85; + font.resolveInt3(textStr5, floatVal8, floatVal9, -9801351); + String textStr6 = "-------------"; + floatVal8 = this.stateTicks3 + 59; + floatVal9 = this.stateTicks7 + 95; + font.resolveInt3(textStr6, floatVal8, floatVal9, -9801351); + String textStr7 = "Enjoy the Novoline"; + floatVal8 = this.stateTicks3 + 54; + floatVal9 = this.stateTicks7 + 105; + font.resolveInt3(textStr7, floatVal8, floatVal9, -9801351); + String textStr8 = "Experience"; + floatVal8 = this.stateTicks3 + 70; + floatVal9 = this.stateTicks7 + 117; + font.resolveInt3(textStr8, floatVal8, floatVal9, -9801351); + String textStr9 = "N O V O L I N E"; + floatVal8 = this.stateTicks3 + 64; + floatVal9 = this.stateTicks7 + 7; + font.resolveInt3(textStr9, floatVal8, floatVal9, -9801351); + StringBuilder sb2 = new StringBuilder().append("Build "); + Novoline novolineInst = this.novolineField; + String textStr10 = novolineInst.getVersion(); + String textStr11 = sb2.append(textStr10).toString(); + floatVal8 = this.stateTicks3 + 45 + 105; + floatVal9 = this.y / 2.0F; + floatVal8 += floatVal9 - font.getStringWidth("091019 - B E T A") / 2.0F; + floatVal9 = this.stateTicks7 + 7; + font.resolveInt3(textStr11, floatVal8, floatVal9, -9801351); + } + } + + List itemList = this.discordCategoryTabList; + Consumer consumer = ((Consumer) (($a0) -> { $a0.renderVisual(mouseX, mouseY); })); + itemList.forEach(consumer); + DiscordConfigPanel.renderVisual(mouseX, mouseY); + float floatVal5 = this.stateTicks3 + 22; + floatVal7 = this.stateTicks7 + 20; + RenderUtils.drawElement9(floatVal5, floatVal7, 15.0F, -13223617); + cc.novoline.utils.fonts.api.FontRenderer font2 = FontICONFONT_35.FONT; + String textStr12 = "?"; + floatVal8 = this.stateTicks3 + 14; + floatVal9 = this.stateTicks7 + 14; + font2.drawElement4(textStr12, floatVal8, floatVal9, -1); + discordScreen = this; + intVal = mouseX; + intVal3 = mouseY; + + flag = this.setText(mouseX, mouseY); + + if (flag) { + intVal4 = this.stateTicks3; + cc.novoline.utils.fonts.api.FontRenderer font3 = FontCustom_16.FONT; + float floatVal6 = intVal4 - font3.stringWidth("Discord Server") - 12; + floatVal7 = this.stateTicks7 + 14; + cc.novoline.utils.fonts.api.FontRenderer font4 = FontCustom_16.FONT; + floatVal8 = font4.stringWidth("Discord Server") + 7; + RenderUtils.drawRoundedRect(floatVal6, floatVal7, floatVal8, 10.0F, 5.0F, -13684945); + cc.novoline.utils.fonts.api.FontRenderer font5 = FontCustom_16.FONT; + String textStr13 = "Discord Server"; + int ticks3 = this.stateTicks3; + cc.novoline.utils.fonts.api.FontRenderer font6 = FontCustom_16.FONT; + floatVal8 = ticks3 - font6.stringWidth("Discord Server") - 10; + floatVal9 = this.stateTicks7 + 16; + font5.drawElement4(textStr13, floatVal8, floatVal9, -1); + } + + discordScreen = this; + intVal = mouseX; + intVal3 = mouseY; + + super.drawScreen(intVal, intVal3, partialTicks); +} + + @Nullable + public DiscordCategoryTab getDiscordCategoryTab() { + Stream stream2 = this.discordCategoryTabList.stream(); + Predicate predicate = ((java.util.function.Predicate) DiscordCategoryTab::isFlagValue); + Stream stream3 = stream2.filter(predicate); + Optional optional = stream3.findAny(); + return (DiscordCategoryTab)optional.orElse(null); +} + + private static boolean matchesPath(Path path) { + LinkOption[] linkOptionArr = new LinkOption[0]; + return Files.isRegularFile(path, linkOptionArr); +} + + public int getIntValue() { + return super.width * 2; +} + + private boolean isHovered(int value, int index) { + int intVal = value; + int ticks = this.stateTicks3 + 45 + 105 + this.y - 5; + if (value < ticks) { + return false; + } + + intVal = value; + ticks = this.stateTicks3 + 45 + 105 + this.y; + + if (intVal > ticks) { + return false; + } + + intVal = index; + ticks = this.stateTicks7 + this.stateTicks6 - 5; + + if (intVal < ticks) { + return false; + } + + intVal = index; + + ticks = this.stateTicks7 + this.stateTicks6; + + return intVal <= ticks; +} + + @NotNull + public List getDiscordConfigCardList() { + return this.discordConfigCardList; +} + + @Nullable + public static VerticalDirection obtainVerticalDirection() { + int intVal = Mouse.getDWheel(); + int intVal2 = intVal; + if (intVal > 0) { + return VerticalDirection.UP; + } + + intVal2 = intVal; + + return intVal2 < 0 ? VerticalDirection.DOWN : null; +} + + private static boolean matchesSetting(Setting setting2) { + cc.novoline.gui.screen.setting.SettingType settingType; + Setting setting3; + + SettingType settingType2; + + label52: { + Setting setting4 = setting2; + + if (setting2.getSettingType() != SettingType.SELECTBOX) { + settingType = setting2.getSettingType(); + settingType2 = SettingType.COMBOBOX; + + if (settingType != SettingType.COMBOBOX) { + break label52; + } + } + + setting4 = setting2; + + + boolean flag = setting4.isStateFlag(); + + if (flag) { + return true; + } + } + + setting3 = setting2; + + settingType = setting2.getSettingType(); + settingType2 = SettingType.TEXTBOX; + + if (settingType != settingType2) { + return false; + } + + setting3 = setting2; + + return setting3.isStateFlag2(); +} + + + + public DiscordGUI(@NotNull Novoline novoline) { + this.stateTicks3 = 100; + this.stateTicks7 = 100; + this.y = 190; + this.stateTicks6 = 300; + this.discordCategoryTabList = new ObjectArrayList<>(); + this.discordConfigCardList = new CopyOnWriteArrayList<>(); + this.novolineField = novoline; + EnumModuleType[] modCategoryArr = EnumModuleType.values(); + int len = modCategoryArr.length; + int intVal = 0; + + while (intVal < len) { + EnumModuleType enumModuleType = modCategoryArr[intVal]; + List itemList = this.discordCategoryTabList; + itemList.add(new DiscordCategoryTab(this.novolineField, enumModuleType, this.stateTicks4)); + this.stateTicks4 += 35; + intVal++; + + } +} + + public int getStateTicks3() { + return this.stateTicks3; +} + + @Override + public void keyTyped(char typedChar, int keyCode) { + DiscordCategoryTab discordCategoryTab; + DiscordCategoryTab discordCategoryTab2; + + discordCategoryTab = this.getDiscordCategoryTab(); + label55: + if (keyCode == 1) { + label61: { + discordCategoryTab2 = discordCategoryTab; + + if (discordCategoryTab == null) { + break label61; + } + + discordCategoryTab2 = discordCategoryTab; + + + List itemList = discordCategoryTab2.getDiscordModuleRowList(); + Stream stream2 = itemList.stream(); + Predicate predicate = ((java.util.function.Predicate) DiscordModuleRow::isStateFlag); + if (!stream2.noneMatch(predicate)) { + break label55; + } + } + + List itemList2 = SettingManager.getSettings(); + Stream stream3 = itemList2.stream(); + Predicate predicate2 = DiscordGUI::matchesSetting; + boolean flag = stream3.noneMatch(predicate2); + + if (!flag) { + break label55; + } + + flag = DiscordConfigPanel.stateFlag; + + + if (flag) { + return; + } + + Minecraft mcClient = this.minecraft2; + mcClient.displayGuiScreen(null); + Minecraft mcClient2 = this.minecraft2; + + if (this.minecraft2.currentScreen != null) { + return; + } + + mcClient2 = this.minecraft2; + + + mcClient2.setIngameFocus(); + return; + } + + discordCategoryTab2 = discordCategoryTab; + + label29: { + + if (discordCategoryTab2 == null) { + break label29; + } + + discordCategoryTab2 = discordCategoryTab; + + + discordCategoryTab2.applyUpdate(typedChar, keyCode); + } + + DiscordConfigPanel.applyUpdate(typedChar, keyCode); +} + + @Override + public void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { + boolean flag; + cc.novoline.gui.screen.click.DiscordGUI discordScreen; + label133: + if (mouseButton == 0) { + List itemList = this.discordCategoryTabList; + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + DiscordCategoryTab discordCategoryTab = (DiscordCategoryTab)iter.next(); + flag = discordCategoryTab.checkInt(mouseX, mouseY); + + if (flag) { + itemList = this.discordCategoryTabList; + Iterator iter2 = itemList.iterator(); + + while (true) { + if (!iter2.hasNext()) { + break; + } + + DiscordCategoryTab discordCategoryTab2 = (DiscordCategoryTab)iter2.next(); + discordCategoryTab2.applyFlag(false); + + } + + discordCategoryTab.applyFlag(true); + + this.stateFlag3 = false; + } + } + + flag = this.evaluateCondition2(mouseX, mouseY); + + + if (flag) { + this.stateTicks2 = this.stateTicks3 - mouseX; + this.x = this.stateTicks7 - mouseY; + this.stateFlag2 = true; + } + + flag = this.isHovered(mouseX, mouseY); + + + + if (flag) { + this.stateTicks = this.y - mouseX; + this.stateTicks5 = this.stateTicks6 - mouseY; + this.stateFlag = true; + } + + flag = DiscordConfigPanel.applyUpdate(mouseX, mouseY); + + + + if (!flag) { + break label133; + } + + discordScreen = this; + + flag = this.stateFlag3; + + + if (!flag) { + this.updateHelper(); + } + + discordScreen = this; + + itemList = discordScreen.discordCategoryTabList; + iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + DiscordCategoryTab discordCategoryTab3 = (DiscordCategoryTab)iter.next(); + discordCategoryTab3.applyFlag(false); + + } + + this.stateFlag3 = true; + } + + label85: { + DiscordCategoryTab discordCategoryTab4 = this.getDiscordCategoryTab(); + DiscordCategoryTab discordCategoryTab5 = discordCategoryTab4; + + if (discordCategoryTab4 == null) { + break label85; + } + + discordCategoryTab5 = discordCategoryTab4; + + + discordCategoryTab5.handleInt2(mouseX, mouseY, mouseButton); + } + + DiscordGUI discordScreen2; + + boolean flag2 = this.setText(mouseX, mouseY); + + if (flag2) { + try { + Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler https://discord.gg/qXHPgHQ"); + } catch (Exception ex) { + } + } + + discordScreen2 = this; + + flag2 = this.stateFlag3; + + + if (flag2) { + DiscordConfigPanel.executeInt(mouseX, mouseY, mouseButton); + } + + discordScreen2 = this; + + super.mouseClicked(mouseX, mouseY, mouseButton); +} + + private boolean evaluateCondition() { + Stream stream2 = this.discordCategoryTabList.stream(); + Predicate predicate = ((java.util.function.Predicate) DiscordCategoryTab::isFlagValue); + return stream2.anyMatch(predicate); +} + + public void updateHelper() { + List itemList3 = this.discordConfigCardList; + itemList3.clear(); + + List itemList; + try { + String textStr = ".novo"; + Novoline novolineInst = this.novolineField; + ModuleManager modManager = novolineInst.getModuleManager(); + ConfigManager cfgManager = modManager.getConfigManager(); + Path filePath = cfgManager.getConfigsFolder(); + FileVisitOption[] fileVisitOptionArr = new FileVisitOption[0]; + Stream stream = Files.walk(filePath, fileVisitOptionArr); + Predicate predicate = DiscordGUI::matchesPath; + Stream stream2 = stream.filter(predicate); + Predicate predicate2 = ((java.util.function.Predicate) (($a0) -> ((java.nio.file.Path) $a0).getFileName().toString().endsWith(textStr))); + Stream stream3 = stream2.filter(predicate2); + Supplier supplier = ObjectArrayList::new; + Collector collector = Collectors.toCollection(supplier); + itemList = (java.util.List) stream3.collect(collector); + } catch (IOException ex2) { + Logger log = Novoline.getLogger(); + log.error("An I/O error occurred while getting contents of configs folder", ex2); + return; + } + + try { + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + Path filePath2 = (Path)iter.next(); + List itemList2 = this.discordConfigCardList; + DiscordConfigCard discordConfigCard = DiscordConfigCard.applyUpdate(filePath2); + itemList2.add(discordConfigCard); + } + } catch (Throwable ex) { + ex.printStackTrace(); + } +} + + public int getStateTicks6() { + return this.stateTicks6; +} + + private boolean setText(int value, int index) { + int intVal = value; + int ticks = this.stateTicks3 + 7; + if (value < ticks) { + return false; + } + + intVal = value; + ticks = this.stateTicks3 + 37; + + if (intVal > ticks) { + return false; + } + + intVal = index; + ticks = this.stateTicks7 + 5; + + if (intVal < ticks) { + return false; + } + + intVal = index; + + ticks = this.stateTicks7 + 35; + + return intVal <= ticks; +} + + private boolean evaluateCondition2(int value, int index) { + int intVal = value; + int ticks = this.stateTicks3; + if (value < this.stateTicks3) { + return false; + } + + intVal = value; + ticks = this.stateTicks3 + 45 + 105 + this.y; + + if (intVal > ticks) { + return false; + } + + intVal = index; + ticks = this.stateTicks7 - 7; + + if (intVal < ticks) { + return false; + } + + intVal = index; + + ticks = this.stateTicks7 + 20; + + return intVal <= ticks; +} + + public int getPosX() { return this.getStateTicks3(); } + public int getPosY() { return this.getStateTicks7(); } + public int getWidth() { return this.computeIntValue(); } + public int getHeight() { return this.getStateTicks6(); } + public cc.novoline.utils.fonts.impl.DiscordCategoryTab getSelectedCategoryTab() { return this.getDiscordCategoryTab(); } + public java.util.List getConfigCards() { return this.getDiscordConfigCardList(); } + public void initConfigs() { this.updateHelper(); } + public static cc.novoline.utils.enums.VerticalDirection getMouseWheelDirection() { return obtainVerticalDirection(); } +} diff --git a/src/main/java/cc/novoline/gui/screen/click/ModuleCategoryTab.java b/src/main/java/cc/novoline/gui/screen/click/ModuleCategoryTab.java new file mode 100644 index 0000000..e018372 --- /dev/null +++ b/src/main/java/cc/novoline/gui/screen/click/ModuleCategoryTab.java @@ -0,0 +1,918 @@ +package cc.novoline.gui.screen.click; + +import cc.novoline.Novoline; +import cc.novoline.gui.screen.ClickGUI; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.visual.ClickGui; +import cc.novoline.script.Script; +import cc.novoline.script.ScriptManager; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.StencilUtil; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.impl.ClickGuiScriptItem; +import cc.novoline.utils.fonts.impl.ClickGuiSmallButton; +import java.awt.Color; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.function.Predicate; +import java.util.stream.Stream; + +import cc.novoline.utils.fonts.holders.FontFamilySF_BOLD; + +import net.minecraft.util.MathHelper; +import cc.novoline.utils.fonts.api.FontFamily; +import cc.novoline.utils.fonts.holders.FontFamilyIconFontAlt; +import net.minecraft.client.Minecraft; +import org.lwjgl.input.Mouse; + +public class ModuleCategoryTab extends Tab { + private boolean stateFlag; + private boolean stateFlag2; + private ClickGuiSmallButton clickGuiSmallButtonField2; + private List clickGuiScriptItemList; + private ClickGuiSmallButton clickGuiSmallButtonField; + private ClickGUI clickGUIField; + private static int[] intArray2; + private double cachedValue; + private static final Color DEFAULT_COLOR = new Color(20, 20, 20); + private double cachedValue2; + private double cachedValue3; + private double cachedValue4; + private int stateTicks; + private double cachedValue5; + private double cachedValue6; + private double cachedValue7; + private boolean stateFlag3; + private boolean stateFlag4; + public double doubleValue; + private int stateTicks2; + private int stateTicks3; + private double cachedValue8 = 160.0; + private ClickGuiSmallButton clickGuiSmallButtonField3; + public double x; + private double cachedValue9; + + @Override + public boolean applyUpdate3(int value, int index) { + int[] intArr = getIntArrayValue(); + double doubleVal; + int intVal = (doubleVal = value - this.cachedValue4) == 0.0 ? 0 : (doubleVal < 0.0 ? -1 : 1); + if (intVal < 0) { + return false; + } + + if (value > (this.cachedValue4 + 130.0)) { + return false; + } + + if (index < this.cachedValue6) { + return false; + } + + double doubleVal2; + intVal = (doubleVal2 = index - (this.cachedValue6 + 20.0)) == 0.0 ? 0 : (doubleVal2 < 0.0 ? -1 : 1); + + return (boolean)(intArr != null ? intVal : intVal <= 0); +} + + @Override + public double getDoubleValue2() { + return this.cachedValue8; +} + + public static void applyUpdate2(int[] intArray) { + intArray2 = intArray; +} + + @Override + public boolean isStateFlag() { + return this.stateFlag; +} + + @Override + public void mouseClickedPanel2(int value, int index, int count) { + int[] intArr; + int intVal; + intArr = getIntArrayValue(); + intVal = (this.applyUpdate3(value, index) ? 1 : 0); + label132: + if (intArr == null) { + if (intVal != 0) { + intVal = count; + if (intArr != null) { + break label132; + } + + if (count == 0) { + this.stateFlag2 = true; + this.stateTicks2 = (int)(this.cachedValue4 - value); + this.stateTicks3 = (int)(this.cachedValue6 - index); + } + } + + intVal = (this.applyUpdate3(value, index) ? 1 : 0); + } + + label125: + if (intArr == null) { + if (intVal != 0) { + intVal = count; + if (intArr != null) { + break label125; + } + + if (count == 1) { + boolean flag = this.stateFlag; + if (intArr == null) { + flag = !this.stateFlag; + } + + this.stateFlag = flag; + intVal = (this.stateFlag ? 1 : 0); + if (intArr != null) { + break label125; + } + + if (this.stateFlag) { + this.performAction(); + } + } + } + + double doubleVal; + intVal = (doubleVal = value - (this.cachedValue4 + 130.0 - 8.0)) == 0.0 ? 0 : (doubleVal < 0.0 ? -1 : 1); + } + + label114: + if (intArr == null) { + if (intVal >= 0) { + double doubleVal2; + intVal = (doubleVal2 = value - (this.cachedValue4 + 130.0)) == 0.0 ? 0 : (doubleVal2 < 0.0 ? -1 : 1); + if (intArr != null) { + break label114; + } + + if (intVal <= 0) { + double doubleVal3; + intVal = (doubleVal3 = index - (this.cachedValue6 + 20.0)) == 0.0 ? 0 : (doubleVal3 < 0.0 ? -1 : 1); + if (intArr != null) { + break label114; + } + + if (intVal >= 0) { + double doubleVal4; + intVal = (doubleVal4 = index - (this.cachedValue6 + 20.0 + this.cachedValue8)) == 0.0 ? 0 : (doubleVal4 < 0.0 ? -1 : 1); + if (intArr != null) { + break label114; + } + + if (intVal <= 0) { + this.stateFlag4 = true; + this.cachedValue7 = index; + } + } + } + } + + intVal = count; + } + + label101: + if (intArr == null) { + if (intVal == 0) { + double doubleVal5; + intVal = (doubleVal5 = value - (this.cachedValue4 + 130.0 - 5.0)) == 0.0 ? 0 : (doubleVal5 < 0.0 ? -1 : 1); + if (intArr != null) { + break label101; + } + + if (intVal >= 0) { + double doubleVal6; + intVal = (doubleVal6 = value - (this.cachedValue4 + 130.0)) == 0.0 ? 0 : (doubleVal6 < 0.0 ? -1 : 1); + if (intArr != null) { + break label101; + } + + if (intVal <= 0) { + double doubleVal7; + intVal = (doubleVal7 = index - (this.cachedValue6 + 20.0 + this.cachedValue8 + 40.0)) == 0.0 ? 0 : (doubleVal7 < 0.0 ? -1 : 1); + if (intArr != null) { + break label101; + } + + if (intVal >= 0) { + double doubleVal8; + intVal = (doubleVal8 = index - (this.cachedValue6 + 20.0 + this.cachedValue8 + 45.0)) == 0.0 ? 0 : (doubleVal8 < 0.0 ? -1 : 1); + if (intArr != null) { + break label101; + } + + if (intVal <= 0) { + this.stateFlag3 = true; + this.cachedValue3 = index - this.cachedValue6; + } + } + } + } + } + + intVal = (this.stateFlag ? 1 : 0); + } + + if (intArr == null) { + if (intVal == 0) { + return; + } + + double doubleVal9; + intVal = (doubleVal9 = index - (this.cachedValue6 + 20.0)) == 0.0 ? 0 : (doubleVal9 < 0.0 ? -1 : 1); + } + + label79: { + label78: { + if (intArr == null) { + if (intVal < 0) { + break label78; + } + + double doubleVal10; + intVal = (doubleVal10 = index - (this.cachedValue6 + 20.0 + this.cachedValue8)) == 0.0 ? 0 : (doubleVal10 < 0.0 ? -1 : 1); + } + + if (intVal < 0) { + List itemList = this.clickGuiScriptItemList; + Iterator iter = itemList.iterator(); + + do { + if (!iter.hasNext()) { + break; + } + + ClickGuiScriptItem clickGuiScriptItem = (ClickGuiScriptItem)iter.next(); + clickGuiScriptItem.handleInt(value, index, count); + if (intArr != null) { + break label79; + } + } while (intArr == null); + } + } + + this.clickGuiSmallButtonField.handleInt(value, index, count); + this.clickGuiSmallButtonField3.handleInt(value, index, count); + } + + this.clickGuiSmallButtonField2.handleInt(value, index, count); +} + + private void invokeCallback(ClickGUI clickGUI, String text) { + ModuleCategoryTab moduleCategoryTab = this; + if (this.getWGA() != null) { + label19: { + Script script = this.getWGA().getScript(); + if (!script.c()) { + break label19; + } + + script = this.getWGA().getScript(); + + script.c(false); + } + + Novoline novolineInst = Novoline.getInstance(); + ScriptManager scriptManager = novolineInst.getScriptManager(); + Script script2 = this.getWGA().getScript(); + scriptManager.c(script2.g()); + script2 = this.getWGA().getScript(); + AbstractModule mod = script2.d(); + clickGUI.removeModule(mod); + } + + moduleCategoryTab = this; + + moduleCategoryTab.performAction(); +} + + private void invokeCallback2(ClickGUI clickGUI, String text) { + this.performAction(); + clickGUI.refreshScriptModules(); +} + + public void performAction() { + List itemList = this.clickGuiScriptItemList; + itemList.clear(); + int[] intArr = getIntArrayValue(); + Novoline novolineInst = Novoline.getInstance(); + ScriptManager scriptManager = novolineInst.getScriptManager(); + scriptManager.a(Novoline.getInstance()); + int[] intArr2 = intArr; + Novoline novolineInst2 = Novoline.getInstance(); + itemList = novolineInst2.getScriptManager().a(); + Iterator iter = itemList.iterator(); + + do { + if (!iter.hasNext()) { + break; + } + + Script script = (Script)iter.next(); + itemList = this.clickGuiScriptItemList; + ClickGuiScriptItem clickGuiScriptItem = new ClickGuiScriptItem(script); + itemList.add(clickGuiScriptItem); + } while (intArr2 == null); +} + + @Override + public void drawElement(ClickGui clickGui, int value, int index, float amount, int count) { + double doubleVal; + double doubleVal2; + cc.novoline.gui.screen.click.ModuleCategoryTab moduleCategoryTab; + cc.novoline.gui.screen.click.ModuleCategoryTab moduleCategoryTab2; + int[] intArr; + int intVal; + label217: { + label220: { + label215: { + label214: { + label221: { + intArr = getIntArrayValue(); + boolean flag = this.stateFlag2; + if (intArr == null) { + if (this.stateFlag2) { + this.cachedValue4 = this.stateTicks2 + value; + this.cachedValue6 = this.stateTicks3 + index; + } + + moduleCategoryTab = this; + if (intArr != null) { + break label221; + } + + flag = this.applyUpdate3(value, index); + } + + if (!flag) { + intVal = (this.stateFlag ? 1 : 0); + if (intArr != null) { + break label215; + } + + if (!this.stateFlag) { + break label214; + } + } + + moduleCategoryTab = this; + } + + moduleCategoryTab.cachedValue2 += 0.05; + if (intArr == null) { + break label220; + } + } + + double doubleVal3; + intVal = (doubleVal3 = this.cachedValue2 - 0.0) == 0.0 ? 0 : (doubleVal3 < 0.0 ? -1 : 1); + } + + if (intArr != null) { + break label217; + } + + if (intVal > 0) { + this.cachedValue2 -= 0.05; + } + } + + StringProperty strProp = clickGui.getStringPropertyR(); + intVal = (strProp.equals("Basic") ? 1 : 0); + } + + label194: { + if (intVal != 0) { + double doubleVal4 = this.cachedValue4; + double doubleVal32 = this.cachedValue6 - 2.0; + double doubleVal33 = this.cachedValue4 + 29.0; + double doubleVal34 = this.cachedValue6 + 20.0; + Color awtColor = new Color(36, 36, 36); + int color = awtColor.getRGB(); + RenderUtils.drawRect(doubleVal4, doubleVal32, doubleVal33, doubleVal34, color); + double doubleVal5 = this.cachedValue4 + 29.0; + doubleVal32 = this.cachedValue6 - 2.0; + doubleVal33 = this.cachedValue4 + 130.0; + doubleVal34 = this.cachedValue6 + 20.0; + awtColor = new Color(45, 45, 45); + int color2 = awtColor.getRGB(); + RenderUtils.drawRect(doubleVal5, doubleVal32, doubleVal33, doubleVal34, color2); + if (intArr == null) { + break label194; + } + } + + double doubleVal6 = this.cachedValue4; + double doubleVal35 = this.cachedValue6 - 2.0; + double doubleVal36 = this.cachedValue4 + 29.0; + double doubleVal37 = this.cachedValue6 + 20.0; + Color awtColor2 = new Color(count); + awtColor2 = awtColor2.darker(); + int color3 = awtColor2.getRGB(); + RenderUtils.drawRect(doubleVal6, doubleVal35, doubleVal36, doubleVal37, color3); + double doubleVal7 = this.cachedValue4 + 29.0; + doubleVal35 = this.cachedValue6 - 2.0; + doubleVal36 = this.cachedValue4 + 130.0; + doubleVal37 = this.cachedValue6 + 20.0; + awtColor2 = new Color(count); + int color4 = awtColor2.getRGB(); + RenderUtils.drawRect(doubleVal7, doubleVal35, doubleVal36, doubleVal37, color4); + } + + ClickGUI clickGuiScreen = this.clickGUIField; + FontFamily fontFam = FontFamilyIconFontAlt.FAMILY; + clickGuiScreen.drawScaledString(fontFam.ofSize(48), "B", this.cachedValue4 + 5.5, this.cachedValue6 - 1.0, 16777215, true); + ClickGUI clickGuiScreen2 = this.clickGUIField; + fontFam = FontFamilySF_BOLD.FAMILY; + FontRenderer font = fontFam.ofSize(25); + String textStr2 = "Scripts"; + double doubleVal38 = this.cachedValue4 + 33.0; + double doubleVal39 = this.cachedValue6 + 4.0; + Color awtColor3 = Color.WHITE; + awtColor3 = awtColor3.darker(); + Color awtColor14 = Color.WHITE; + double doubleVal40 = (float)this.cachedValue2; + clickGuiScreen2.drawScaledString(font, textStr2, doubleVal38, doubleVal39, RenderUtils.interpolateColor(awtColor3, awtColor14, doubleVal40), true); + ModuleCategoryTab moduleCategoryTab3 = this; + if (intArr == null) { + if (!this.stateFlag) { + return; + } + + moduleCategoryTab3 = this; + } + + double doubleVal8; + double doubleVal9; + double doubleVal10; + double doubleVal11; + double doubleVal12; + label183: { + label182: { + doubleVal8 = moduleCategoryTab3.cachedValue8; + doubleVal9 = this.cachedValue8; + List itemList = this.clickGuiScriptItemList; + doubleVal10 = itemList.size() * 20; + doubleVal11 = doubleVal9 / doubleVal10 * doubleVal8; + double doubleVal13 = doubleVal8 - doubleVal11; + double doubleVal14 = doubleVal10 - doubleVal8; + double doubleVal15 = doubleVal14 / doubleVal13; + this.cachedValue = (int)(this.cachedValue9 * doubleVal15); + this.cachedValue5 = this.cachedValue5 + (this.cachedValue - this.cachedValue5) * 0.1; + StencilUtil.initStencilToWrite(false); + double doubleVal16 = this.cachedValue4; + double doubleVal41 = this.cachedValue6 + 20.0; + double doubleVal42 = this.cachedValue4 + 130.0; + doubleVal38 = this.cachedValue6 + 20.0 + this.cachedValue8; + RenderUtils.drawRect(doubleVal16, doubleVal41, doubleVal42, doubleVal38, -1); + StencilUtil.readStencilBuffer(true); + doubleVal12 = clickGui.getDoubleValue(); + if (intArr == null) { + StringProperty strProp2 = clickGui.getStringPropertyR(); + if (!strProp2.equals("Basic")) { + break label182; + } + + double doubleVal17 = this.cachedValue4; + double doubleVal43 = this.cachedValue6 + 20.0; + double doubleVal44 = this.cachedValue4 + 130.0; + doubleVal38 = this.cachedValue6 + 20.0 + this.cachedValue8; + Color awtColor4 = new Color(55, 55, 55); + int color5 = awtColor4.getRGB(); + RenderUtils.drawRect(doubleVal17, doubleVal43, doubleVal44, doubleVal38, color5); + } + + if (intArr == null) { + break label183; + } + } + + double doubleVal18 = this.cachedValue4; + double doubleVal45 = this.cachedValue6 + 20.0; + double doubleVal46 = this.cachedValue4 + 125.0; + doubleVal38 = this.cachedValue6 + 20.0 + this.cachedValue8; + Color awtColor5 = new Color(0, 0, 0, (int)(180.0 * doubleVal12)); + int color6 = awtColor5.getRGB(); + RenderUtils.drawRect(doubleVal18, doubleVal45, doubleVal46, doubleVal38, color6); + } + + double doubleVal19 = this.cachedValue6 + 20.0; + byte byteVal = 0; + List itemList2 = this.clickGuiScriptItemList; + Iterator iter = itemList2.iterator(); + + label173: { + do { + if (!iter.hasNext()) { + break; + } + + ClickGuiScriptItem clickGuiScriptItem = (ClickGuiScriptItem)iter.next(); + clickGuiScriptItem.renderClickGUI(this.clickGUIField, value, index, this.cachedValue4, doubleVal19 - this.cachedValue5, new Color(count)); + doubleVal19 += 20.0; + byteVal -= 120; + if (intArr != null) { + break label173; + } + } while (intArr == null); + + StencilUtil.uninitStencilBuffer(); + } + + label163: { + label162: { + if (intArr == null) { + StringProperty strProp3 = clickGui.getStringPropertyR(); + if (!strProp3.equals("Basic")) { + break label162; + } + + double doubleVal20 = this.cachedValue4; + double doubleVal47 = this.cachedValue6 + 20.0 + this.cachedValue8; + double doubleVal48 = this.cachedValue4 + 130.0; + doubleVal38 = this.cachedValue6 + 20.0 + this.cachedValue8 + 40.0; + Color awtColor6 = new Color(45, 45, 45); + int color7 = awtColor6.getRGB(); + RenderUtils.drawRect(doubleVal20, doubleVal47, doubleVal48, doubleVal38, color7); + } + + if (intArr == null) { + break label163; + } + } + + double doubleVal21 = this.cachedValue4; + double doubleVal49 = this.cachedValue6 + 20.0 + this.cachedValue8; + double doubleVal50 = this.cachedValue4 + 125.0; + doubleVal38 = this.cachedValue6 + 20.0 + this.cachedValue8 + 40.0; + Color awtColor7 = new Color(0, 0, 0, (int)(170.0 * doubleVal12)); + int color8 = awtColor7.getRGB(); + RenderUtils.drawRect(doubleVal21, doubleVal49, doubleVal50, doubleVal38, color8); + } + + label154: { + StringProperty strProp4 = clickGui.getStringPropertyR(); + if (strProp4.equals("Basic")) { + ClickGuiSmallButton clickGuiSmallButton = this.clickGuiSmallButtonField; + ClickGUI clickGuiScreen3 = this.clickGUIField; + doubleVal39 = this.cachedValue4 + 2.0; + double doubleVal51 = this.cachedValue6 + 20.0 + this.cachedValue8 + 2.0; + clickGuiSmallButton.renderClickGUI2(clickGuiScreen3, value, index, doubleVal39, doubleVal51); + ClickGuiSmallButton clickGuiSmallButton2 = this.clickGuiSmallButtonField2; + ClickGUI clickGuiScreen4 = this.clickGUIField; + doubleVal39 = this.cachedValue4 + 2.0; + double doubleVal52 = this.cachedValue6 + 20.0 + this.cachedValue8 + 22.0; + clickGuiSmallButton2.renderClickGUI2(clickGuiScreen4, value, index, doubleVal39, doubleVal52); + ClickGuiSmallButton clickGuiSmallButton3 = this.clickGuiSmallButtonField3; + ClickGUI clickGuiScreen5 = this.clickGUIField; + doubleVal39 = this.cachedValue4 + 65.5; + double doubleVal53 = this.cachedValue6 + 20.0 + this.cachedValue8 + 22.0; + clickGuiSmallButton3.renderClickGUI2(clickGuiScreen5, value, index, doubleVal39, doubleVal53); + if (intArr == null) { + break label154; + } + } + + ClickGuiSmallButton clickGuiSmallButton4 = this.clickGuiSmallButtonField; + ClickGUI clickGuiScreen6 = this.clickGUIField; + doubleVal39 = this.cachedValue4 + 2.0; + double doubleVal54 = this.cachedValue6 + 19.5 + this.cachedValue8 + 2.0; + awtColor14 = new Color(0, 0, 0, 50); + int color9 = awtColor14.getRGB(); + Color awtColor8 = new Color(0, 0, 0, 70); + clickGuiSmallButton4.renderClickGUI(clickGuiScreen6, value, index, doubleVal39, doubleVal54, color9, awtColor8.getRGB()); + ClickGuiSmallButton clickGuiSmallButton5 = this.clickGuiSmallButtonField2; + ClickGUI clickGuiScreen7 = this.clickGUIField; + doubleVal39 = this.cachedValue4 + 2.0; + double doubleVal55 = this.cachedValue6 + 19.5 + this.cachedValue8 + 22.0; + awtColor14 = new Color(0, 0, 0, 50); + int color10 = awtColor14.getRGB(); + Color awtColor9 = new Color(0, 0, 0, 70); + clickGuiSmallButton5.renderClickGUI(clickGuiScreen7, value, index, doubleVal39, doubleVal55, color10, awtColor9.getRGB()); + ClickGuiSmallButton clickGuiSmallButton6 = this.clickGuiSmallButtonField3; + ClickGUI clickGuiScreen8 = this.clickGUIField; + doubleVal39 = this.cachedValue4 + 65.5; + double doubleVal56 = this.cachedValue6 + 19.5 + this.cachedValue8 + 22.0; + awtColor14 = new Color(0, 0, 0, 50); + int color11 = awtColor14.getRGB(); + Color awtColor10 = new Color(0, 0, 0, 70); + clickGuiSmallButton6.renderClickGUI(clickGuiScreen8, value, index, doubleVal39, doubleVal56, color11, awtColor10.getRGB()); + } + + label149: { + StringProperty strProp5 = clickGui.getStringPropertyR(); + if (strProp5.equals("Basic")) { + float floatVal = (float)this.cachedValue4 + 125.0F; + float floatVal5 = (float)(this.cachedValue6 + 20.0); + float floatVal6 = (float)this.cachedValue8; + awtColor3 = new Color(45, 45, 45); + int color12 = awtColor3.getRGB(); + RenderUtils.drawRoundedRect(floatVal, floatVal5, 5.0F, floatVal6, 0.0F, color12); + if (intArr == null) { + break label149; + } + } + + float floatVal2 = (float)this.cachedValue4 + 125.0F; + float floatVal7 = (float)(this.cachedValue6 + 20.0); + float floatVal8 = (float)this.cachedValue8 + 40.0F; + awtColor3 = new Color(0, 0, 0, (int)(200.0 * doubleVal12)); + int color13 = awtColor3.getRGB(); + RenderUtils.drawRoundedRect(floatVal2, floatVal7, 5.0F, floatVal8, 0.0F, color13); + } + + label144: { + label225: { + label226: { + label227: { + double doubleVal22; + int intVal2 = (doubleVal22 = doubleVal10 - doubleVal9) == 0.0 ? 0 : (doubleVal22 < 0.0 ? -1 : 1); + if (intArr == null) { + if (intVal2 <= 0) { + this.cachedValue = 0.0; + this.cachedValue9 = 0.0; + break label227; + } + + StringProperty strProp6 = clickGui.getStringPropertyR(); + intVal2 = (strProp6.equals("Basic") ? 1 : 0); + } + + label135: { + if (intVal2 != 0) { + float floatVal3 = (float)(this.cachedValue4 + 130.0 - 4.0); + float floatVal9 = (float)(this.cachedValue6 + 20.0 + this.cachedValue9); + float floatVal10 = (float)doubleVal11 - 1.0F; + awtColor3 = new Color(50, 50, 50, 255); + int color14 = awtColor3.getRGB(); + RenderUtils.drawRoundedRect(floatVal3, floatVal9, 3.0F, floatVal10, 0.0F, color14); + if (intArr == null) { + break label135; + } + } + + float floatVal4 = (float)(this.cachedValue4 + 130.0 - 4.0); + float floatVal11 = (float)(this.cachedValue6 + 20.0 + this.cachedValue9); + float floatVal12 = (float)doubleVal11 - 1.0F; + awtColor3 = new Color(0, 0, 0, (int)(100.0 * doubleVal12)); + int color15 = awtColor3.getRGB(); + RenderUtils.drawRoundedRect(floatVal4, floatVal11, 3.0F, floatVal12, 0.0F, color15); + } + + double doubleVal23; + intVal = (doubleVal23 = value - this.cachedValue4) == 0.0 ? 0 : (doubleVal23 < 0.0 ? -1 : 1); + if (intArr != null) { + break label226; + } + + if (intVal >= 0) { + double doubleVal24; + intVal = (doubleVal24 = value - (this.cachedValue4 + 130.0)) == 0.0 ? 0 : (doubleVal24 < 0.0 ? -1 : 1); + if (intArr != null) { + break label226; + } + + if (intVal <= 0) { + double doubleVal25; + intVal = (doubleVal25 = index - (this.cachedValue6 + 20.0)) == 0.0 ? 0 : (doubleVal25 < 0.0 ? -1 : 1); + if (intArr != null) { + break label226; + } + + if (intVal >= 0) { + double doubleVal26; + intVal = (doubleVal26 = index - (this.cachedValue6 + 20.0 + this.cachedValue8)) == 0.0 ? 0 : (doubleVal26 < 0.0 ? -1 : 1); + if (intArr != null) { + break label226; + } + + if (intVal <= 0) { + label122: { + label121: { + int intVal3 = Mouse.getDWheel(); + if (intArr == null) { + if (intVal3 >= 0) { + break label121; + } + + this.cachedValue9 += 10.0; + } + + if (intArr == null) { + break label122; + } + } + + this.cachedValue9 -= 10.0; + } + + double doubleVal27 = this.cachedValue9; + doubleVal38 = doubleVal8 - doubleVal11; + this.cachedValue9 = (int)MathHelper.clamp_double(doubleVal27, 0.0, doubleVal38); + } + } + } + } + } + + moduleCategoryTab2 = this; + if (intArr != null) { + break label225; + } + + intVal = (this.stateFlag4 ? 1 : 0); + } + + if (intVal != 0) { + doubleVal2 = index - this.cachedValue7; + if (intArr != null) { + break label144; + } + + if (doubleVal2 != 0.0) { + this.cachedValue9 = this.cachedValue9 + (index - this.cachedValue7); + double doubleVal28 = this.cachedValue9; + doubleVal38 = doubleVal8 - doubleVal11; + this.cachedValue9 = (int)MathHelper.clamp_double(doubleVal28, 0.0, doubleVal38); + this.cachedValue7 = index; + } + } + + moduleCategoryTab2 = this; + } + + doubleVal2 = moduleCategoryTab2.cachedValue8; + } + + label100: { + label99: { + doubleVal = doubleVal2; + if (intArr == null) { + StringProperty strProp7 = clickGui.getStringPropertyR(); + if (!strProp7.equals("Basic")) { + break label99; + } + + double doubleVal29 = this.cachedValue4; + double doubleVal57 = this.cachedValue6 + 20.0 + doubleVal + 40.0; + double doubleVal58 = this.cachedValue4 + 130.0; + doubleVal38 = this.cachedValue6 + 20.0 + doubleVal + 45.0; + Color awtColor11 = new Color(37, 37, 37); + int color16 = awtColor11.getRGB(); + RenderUtils.drawRect(doubleVal29, doubleVal57, doubleVal58, doubleVal38, color16); + } + + if (intArr == null) { + break label100; + } + } + + double doubleVal30 = this.cachedValue4; + double doubleVal59 = this.cachedValue6 + 20.0 + doubleVal + 40.0; + double doubleVal60 = this.cachedValue4 + 130.0; + doubleVal38 = this.cachedValue6 + 20.0 + doubleVal + 45.0; + Color awtColor12 = new Color(0, 0, 0, (int)(200.0 * doubleVal12)); + int color17 = awtColor12.getRGB(); + RenderUtils.drawRect(doubleVal30, doubleVal59, doubleVal60, doubleVal38, color17); + } + + net.minecraft.client.gui.FontRenderer font2 = Minecraft.getMinecraft().fontRendererObj; + String textStr = "\u25e2"; + float floatVal13 = (float)(this.cachedValue4 + 130.0 - 3.2F); + float floatVal14 = (float)(this.cachedValue6 + 20.0 + doubleVal + 40.0) - 2.5F; + Color awtColor13 = new Color(80, 80, 80, 150); + int color18 = awtColor13.getRGB(); + font2.drawString(textStr, floatVal13, floatVal14, color18); + ModuleCategoryTab moduleCategoryTab4 = this; + if (intArr == null) { + if (!this.stateFlag3) { + return; + } + + double doubleVal31 = index - 40 - (this.cachedValue6 + 20.0); + this.cachedValue8 = (int)MathHelper.clamp_double(doubleVal31, 10.0, 9999.0); + this.cachedValue9 = 0.0; + moduleCategoryTab4 = this; + } + + moduleCategoryTab4.cachedValue = 0.0; +} + + @Override + public void applyDouble(double value) { + this.cachedValue8 = value; +} + + public ModuleCategoryTab(ClickGUI clickGUI, int value, int index) { + super(clickGUI, null, value, index); + this.clickGuiScriptItemList = new CopyOnWriteArrayList<>(); + this.cachedValue4 = value; + this.cachedValue6 = index; + this.clickGUIField = clickGUI; + this.clickGuiSmallButtonField = new ClickGuiSmallButton("Load/Unload", this.$lambdaCapture$0(clickGUI), 121.0, 18.0); + this.clickGuiSmallButtonField2 = new ClickGuiSmallButton("Refresh", this.$lambdaCapture$1(clickGUI), 57.5, 18.0); + this.clickGuiSmallButtonField3 = new ClickGuiSmallButton("Delete", this.$lambdaCapture$2(clickGUI), 57.5, 18.0); + this.performAction(); +} + + private java.util.function.Consumer $lambdaCapture$0(ClickGUI $c0) { + return ($a0) -> this.lambdaImpl$new$0($c0, $a0); +} + + private java.util.function.Consumer $lambdaCapture$1(ClickGUI $c0) { + return ($a0) -> this.invokeCallback2($c0, $a0); +} + + private java.util.function.Consumer $lambdaCapture$2(ClickGUI $c0) { + return ($a0) -> this.invokeCallback($c0, $a0); +} + + public ClickGuiScriptItem getWGA() { + Stream stream2 = this.clickGuiScriptItemList.stream(); + Predicate predicate = ((java.util.function.Predicate) ClickGuiScriptItem::isStateFlag); + Stream stream3 = stream2.filter(predicate); + Optional optional = stream3.findFirst(); + return (ClickGuiScriptItem)optional.orElse(null); +} + + @Override + public void applyUpdate2(boolean flag) { + this.stateFlag = flag; +} + + @Override + public void applyUpdate2(double value) { + this.cachedValue6 = value; +} + + private void lambdaImpl$new$0(ClickGUI clickGUI, String text) { + ModuleCategoryTab moduleCategoryTab; + ClickGuiScriptItem clickGuiScriptItem = this.getWGA(); + if (clickGuiScriptItem == null) { + return; + } + + moduleCategoryTab = this; + + clickGuiScriptItem = this.getWGA(); + + Script script = clickGuiScriptItem.getScript(); + if (script.c()) { + Script script2 = this.getWGA().getScript(); + AbstractModule mod = script2.d(); + clickGUI.removeModule(mod); + Script script3 = this.getWGA().getScript(); + script3.c(false); + this.performAction(); + return; + } + + Novoline novolineInst = Novoline.getInstance(); + ScriptManager scriptManager = novolineInst.getScriptManager(); + Script script4 = this.getWGA().getScript(); + scriptManager.b(script4.g()); + moduleCategoryTab = this; + + moduleCategoryTab.performAction(); + clickGUI.refreshScriptModules(); +} + + @Override + public double getCachedValue() { + return this.cachedValue4; +} + + static { + applyUpdate2((int[]) null); + } + + @Override + public void mouseClickedPanel(int value, int index, int count) { + this.stateFlag2 = false; + this.stateFlag4 = false; + this.stateFlag3 = false; +} + + @Override + public void applyUpdate(double value) { + this.cachedValue4 = value; +} + + public static int[] getIntArrayValue() { + return intArray2; +} + + @Override + public double getCachedValue22() { + return this.cachedValue6; +} +} diff --git a/src/main/java/cc/novoline/gui/screen/click/Tab.java b/src/main/java/cc/novoline/gui/screen/click/Tab.java new file mode 100644 index 0000000..c7fa533 --- /dev/null +++ b/src/main/java/cc/novoline/gui/screen/click/Tab.java @@ -0,0 +1,927 @@ +package cc.novoline.gui.screen.click; +import cc.novoline.Novoline; +import cc.novoline.gui.click.ClickGuiModuleRow; +import cc.novoline.gui.screen.ClickGUI; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.visual.ClickGui; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.StencilUtil; +import cc.novoline.utils.StringScrambler; +import cc.novoline.utils.Timer; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontFamilyICONFONT; +import java.awt.Color; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; + +import cc.novoline.modules.ModuleManager; +import cc.novoline.utils.fonts.holders.FontFamilySF_BOLD; + +import net.minecraft.client.renderer.GlStateManager; + +import net.minecraft.util.MathHelper; +import cc.novoline.utils.fonts.api.FontFamily; +import net.minecraft.client.Minecraft; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +public class Tab { + private ClickGUI clickGUIField; + private double cachedValue; + private double cachedValue2; + private static final Color DEFAULT_COLOR = new Color(20, 20, 20); + private double cachedValue3; + public double doubleValue; + private List clickGuiModuleRowList; + private boolean stateFlag; + private static int[] intArray3; + private double cachedValue4; + private double cachedValue5; + private Timer timer; + private boolean stateFlag2; + private double cachedValue6; + private double v; + private EnumModuleType enumModuleTypeField; + private double cachedValue7; + public double doubleValueField; + private double cachedValue8; + private double cachedValue9; + private double cachedValue10; + private boolean stateFlag3; + private boolean stateFlag4; + + public double getCachedValue2() { + return this.cachedValue2; +} + + public EnumModuleType getEnumModuleTypeField() { + return this.enumModuleTypeField; +} + + public static void applyUpdate(int[] intArray) { + intArray3 = intArray; +} + + public void applyUpdate2(boolean flag) { + this.stateFlag2 = flag; +} + + public void mouseClickedPanel2(int value, int index, int count) { + int intVal3; + int intVal; + int intVal2; + int[] intArr; + Tab guiTab; + + intArr = j(); + intVal3 = (this.applyUpdate3(value, index) ? 1 : 0); + + if (intVal3 != 0) { + intVal3 = count; + + if (count == 0) { + this.stateFlag = true; + this.cachedValue3 = this.cachedValue4 - value; + this.cachedValue = this.cachedValue6 - index; + } + } + + guiTab = this; + + intVal3 = (this.applyUpdate3(value, index) ? 1 : 0); + + if (intVal3 != 0 && count == 1) { + boolean flag = this.stateFlag2; + + flag = !this.stateFlag2; + + + this.stateFlag2 = flag; + } + + guiTab = this; + + double doubleVal = guiTab.v - 39.0; + if (value >= (this.cachedValue4 + 130.0 - 4.0)) { + if (value <= (this.cachedValue4 + 130.0)) { + if (index >= (this.cachedValue6 + 23.0)) { + if (index <= (this.cachedValue6 + 20.0 + this.v - 3.0)) { + this.stateFlag3 = true; + this.cachedValue7 = index; + } + } + } + } + + List itemList = this.clickGuiModuleRowList; + intVal = itemList.size() * 20; + + double doubleVal3 = intVal; + double doubleVal2 = this.v; + double doubleVal4 = Math.min(doubleVal3, doubleVal2); + intVal2 = count; + + if (count == 0) { + if (value >= (this.cachedValue4 + 130.0 - 5.0)) { + if (value <= (this.cachedValue4 + 130.0)) { + if (index >= (this.cachedValue6 + 20.0 + doubleVal4)) { + if (index <= (this.cachedValue6 + 20.0 + doubleVal4 + 5.0)) { + this.stateFlag4 = true; + this.cachedValue10 = index - this.cachedValue6; + } + } + } + } + } + + intVal2 = (this.stateFlag2 ? 1 : 0); + + + if (intVal2 == 0) { + return; + } + + if (value < this.cachedValue4) { + return; + } + + if (value > (this.cachedValue4 + 130.0)) { + return; + } + + if (index < (this.cachedValue6 + 20.0)) { + return; + } + + if (index <= (this.cachedValue6 + 20.0 + this.v)) { + List itemList2 = this.clickGuiModuleRowList; + Iterator iter = itemList2.iterator(); + + do { + if (!iter.hasNext()) { + break; + } + + ClickGuiModuleRow modRow = (ClickGuiModuleRow)iter.next(); + modRow.mouseClickedPanel(value, index, count); + } while (intArr == null); + } +} + + public void applyDouble(double value) { + this.v = value; +} + + public void applyUpdate2(int value) { + this.cachedValue2 = value; +} + + public boolean applyUpdate3(int value, int index) { + if (value < this.cachedValue4) { + return false; + } + + if (value > (this.cachedValue4 + 120.0)) { + return false; + } + + if (index < this.cachedValue6) { + return false; + } + + return index <= (this.cachedValue6 + 20.0); +} + + public double getCachedValue22() { + return this.cachedValue6; +} + + public double getCachedValue5() { + return this.cachedValue5; +} + + public double getCachedValue() { + return this.cachedValue4; +} + + public List getClickGuiModuleRowList() { + return this.clickGuiModuleRowList; +} + + public void mouseClickedPanel(int value, int index, int count) { + this.stateFlag = false; + this.stateFlag3 = false; + this.stateFlag4 = false; + Tab guiTab = this; + if (!this.stateFlag2) { + return; + } + + guiTab = this; + + List itemList = guiTab.clickGuiModuleRowList; + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + ClickGuiModuleRow modRow = (ClickGuiModuleRow)iter.next(); + modRow.performAction(); + } +} + + public Tab(ClickGUI clickGUI, EnumModuleType enumModuleType, int value, int index) { + this.timer = new Timer(); + this.clickGuiModuleRowList = new CopyOnWriteArrayList<>(); + this.v = 200.0; + this.clickGUIField = clickGUI; + this.enumModuleTypeField = enumModuleType; + this.cachedValue4 = value; + this.cachedValue6 = index; + Novoline novolineInst = clickGUI.getNovoline(); + ModuleManager modManager = novolineInst.getModuleManager(); + List itemList = modManager.getByCategory(enumModuleType); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + AbstractModule abstractModule = (AbstractModule)iter.next(); + List itemList2 = this.clickGuiModuleRowList; + ClickGuiModuleRow modRow = new ClickGuiModuleRow(this, abstractModule); + itemList2.add(modRow); + } +} + + public String getString() { + String textStr = ""; + String textStr2 = this.enumModuleTypeField.name(); + boolean flag = textStr2.equalsIgnoreCase("Combat"); + if (flag) { + textStr = "D"; + return textStr; + } + + String textStr3 = this.enumModuleTypeField.name(); + flag = textStr3.equalsIgnoreCase("Movement"); + + if (flag) { + textStr = "A"; + return textStr; + } + + String textStr4 = this.enumModuleTypeField.name(); + flag = textStr4.equalsIgnoreCase("Player"); + + if (flag) { + textStr = "B"; + return textStr; + } + + String textStr5 = this.enumModuleTypeField.name(); + flag = textStr5.equalsIgnoreCase("Visuals"); + + if (flag) { + textStr = "C"; + return textStr; + } + + String textStr6 = this.enumModuleTypeField.name(); + flag = textStr6.equalsIgnoreCase("Exploits"); + + if (flag) { + textStr = "G"; + return textStr; + } + + String textStr7 = this.enumModuleTypeField.name(); + + flag = textStr7.equalsIgnoreCase("Misc"); + + if (flag) { + textStr = "F"; + } + + return textStr; +} + + public static int[] j() { + return intArray3; +} + + public void drawElement(ClickGui clickGui, int value, int index, float amount, int count) { + int intVal; + double doubleVal; + int intVal2; + int[] intArr; + Tab guiTab; + + label262: { + + label267: { + + intArr = j(); + boolean flag = this.stateFlag; + + if (this.stateFlag) { + this.cachedValue4 = this.cachedValue3 + value; + this.cachedValue6 = this.cachedValue + index; + } + + guiTab = this; + + flag = this.applyUpdate3(value, index); + + + if (!flag) { + intVal = (this.stateFlag2 ? 1 : 0); + + if (!this.stateFlag2) { + break label267; + } + } + + guiTab = this; + + guiTab.cachedValue9 += 0.05; + + break label262; + + + } + + guiTab = this; + + if (this.cachedValue9 > 0.0) { + this.cachedValue9 -= 0.05; + } + } + + guiTab = this; + + String textStr2; + FontRenderer font; + FontRenderer font2; + double doubleVal3; + label239: { + textStr2 = guiTab.getString(); + FontFamily fontFam = FontFamilyICONFONT.FAMILY; + font = fontFam.ofSize(28); + FontFamily fontFam2 = FontFamilySF_BOLD.FAMILY; + font2 = fontFam2.ofSize(25); + doubleVal3 = clickGui.getDoubleValue(); + + StringProperty strProp = clickGui.getStringPropertyR(); + if (strProp.equals("Basic")) { + double doubleVal4 = this.cachedValue4; + double doubleVal2 = this.cachedValue6 - 2.0; + double doubleVal17 = this.cachedValue4 + 25.0; + double doubleVal18 = this.cachedValue6 + 20.0; + Color awtColor = new Color(36, 36, 36); + int color = awtColor.getRGB(); + RenderUtils.drawRect(doubleVal4, doubleVal2, doubleVal17, doubleVal18, color); + double doubleVal5 = this.cachedValue4 + 25.0; + double doubleVal27 = this.cachedValue6 - 2.0; + doubleVal17 = this.cachedValue4 + 130.0; + doubleVal18 = this.cachedValue6 + 20.0; + awtColor = new Color(45, 45, 45); + int color2 = awtColor.getRGB(); + RenderUtils.drawRect(doubleVal5, doubleVal27, doubleVal17, doubleVal18, color2); + + break label239; + + } + + double doubleVal6 = this.cachedValue4; + double doubleVal28 = this.cachedValue6 - 2.0; + double doubleVal29 = this.cachedValue4 + 25.0; + double doubleVal30 = this.cachedValue6 + 20.0; + Color awtColor2 = new Color(count); + awtColor2 = awtColor2.darker(); + int color3 = awtColor2.getRGB(); + RenderUtils.drawRect(doubleVal6, doubleVal28, doubleVal29, doubleVal30, color3); + + + double doubleVal7 = this.cachedValue4 + 25.0; + double doubleVal31 = this.cachedValue6 - 2.0; + double doubleVal32 = this.cachedValue4 + 130.0; + double doubleVal33 = this.cachedValue6 + 20.0; + Color awtColor3 = new Color(count); + int color4 = awtColor3.getRGB(); + RenderUtils.drawRect(doubleVal7, doubleVal31, doubleVal32, doubleVal33, color4); + } + + ClickGUI clickGuiScreen = this.clickGUIField; + String textStr3 = this.enumModuleTypeField.name(); + textStr3 = textStr3.toLowerCase(); + textStr3 = StringScrambler.resolveString3(textStr3); + double doubleVal34 = this.cachedValue4 + 29.0; + double doubleVal35 = this.cachedValue6 + 4.0; + Color awtColor4 = Color.WHITE; + awtColor4 = awtColor4.darker(); + Color awtColor10 = Color.WHITE; + double doubleVal36 = (float)this.cachedValue9; + clickGuiScreen.drawScaledString(font2, textStr3, doubleVal34, doubleVal35, RenderUtils.interpolateColor(awtColor4, awtColor10, doubleVal36), true); + ClickGUI clickGuiScreen2 = this.clickGUIField; + doubleVal34 = this.cachedValue4 + 5.5; + doubleVal35 = this.cachedValue6 + 9.5; + doubleVal35 -= font.getHeight() / 2; + awtColor4 = Color.WHITE; + awtColor4 = awtColor4.darker(); + awtColor10 = Color.WHITE; + doubleVal36 = (float)this.cachedValue9; + clickGuiScreen2.drawScaledString(font, textStr2, doubleVal34, doubleVal35, RenderUtils.interpolateColor(awtColor4, awtColor10, doubleVal36), true); + int intVal3 = (this.stateFlag2 ? 1 : 0); + + if (!this.stateFlag2) { + return; + } + + double doubleVal8; + intVal3 = (doubleVal8 = value - (this.cachedValue4 + 120.0 - 8.0)) == 0.0 ? 0 : (doubleVal8 < 0.0 ? -1 : 1); + + + label226: { + label271: { + + if (intVal3 >= 0) { + if (value <= (this.cachedValue4 + 130.0 - 3.0)) { + if (index >= (this.cachedValue6 + 23.0)) { + if (index <= (this.cachedValue6 + 20.0 + this.v - 3.0)) { + break label271; + } + } + } + } + + intVal3 = (this.stateFlag3 ? 1 : 0); + + if (intVal3 == 0) { + intVal3 = 0; + break label226; + } + } + + intVal3 = 1; + } + + int intVal4; + label205: { + intVal4 = intVal3; + StencilUtil.initStencilToWrite(false); + double doubleVal9 = this.cachedValue4; + double doubleVal37 = this.cachedValue6 + 20.0; + double doubleVal38 = this.cachedValue4 + 130.0; + double doubleVal39 = this.cachedValue6 + 20.0 + this.v; + int intVal7 = -1; + + RenderUtils.drawRect(doubleVal9, doubleVal37, doubleVal38, doubleVal39, -1); + StencilUtil.readStencilBuffer(true); + StringProperty strProp2 = clickGui.getStringPropertyR(); + if (strProp2.equals("Basic")) { + double doubleVal10 = this.cachedValue4; + doubleVal37 = this.cachedValue6 + 20.0; + double doubleVal40 = this.cachedValue4 + 130.0; + doubleVal34 = this.cachedValue6 + 20.0 + this.computeDoubleValue(); + Color awtColor5 = new Color(55, 55, 55); + int color5 = awtColor5.getRGB(); + RenderUtils.drawRect(doubleVal10, doubleVal37, doubleVal40, doubleVal34, color5); + + break label205; + + } + + doubleVal9 = this.cachedValue4; + doubleVal37 = this.cachedValue6 + 20.0; + doubleVal38 = this.cachedValue4 + 125.0; + doubleVal39 = this.cachedValue6 + 20.0 + this.computeDoubleValue(); + Color awtColor6 = new Color(0, 0, 0, (int)(180.0 * doubleVal3)); + intVal7 = awtColor6.getRGB(); + + + RenderUtils.drawRect(doubleVal9, doubleVal37, doubleVal38, doubleVal39, intVal7); + } + + List itemList = this.clickGuiModuleRowList; + Iterator iter = itemList.iterator(); + + do { + if (!iter.hasNext()) { + break; + } + + ClickGuiModuleRow modRow = (ClickGuiModuleRow)iter.next(); + modRow.renderPanel(clickGui, value, index, amount, (boolean)((intVal4) != 0), count); + + } while (intArr == null); + + StencilUtil.uninitStencilBuffer(); + + double doubleVal11; + double doubleVal12; + double doubleVal13; + label187: { + doubleVal = this.v; + doubleVal11 = this.v; + List itemList2 = this.clickGuiModuleRowList; + doubleVal12 = itemList2.size() * 20 + this.computeIntValue(); + doubleVal13 = doubleVal11 / doubleVal12 * doubleVal; + double doubleVal14 = doubleVal - doubleVal13; + double doubleVal15 = doubleVal12 - doubleVal; + double doubleVal16 = doubleVal15 / doubleVal14; + this.cachedValue5 = (int)(this.cachedValue2 * doubleVal16); + Tab guiTab2 = this; + + this.cachedValue8 = this.cachedValue8 + (this.cachedValue5 - this.cachedValue8) * 0.1; + StringProperty strProp3 = clickGui.getStringPropertyR(); + if (strProp3.equals("Basic")) { + float floatVal = (float)this.cachedValue4 + 130.0F - 5.0F; + float floatVal4 = (float)(this.cachedValue6 + 20.0); + List itemList3 = this.clickGuiModuleRowList; + doubleVal34 = itemList3.size() * 20; + doubleVal35 = this.v; + float floatVal5 = (float)Math.min(doubleVal34, doubleVal35); + awtColor4 = new Color(45, 45, 45, 255); + int color6 = awtColor4.getRGB(); + RenderUtils.drawRoundedRect(floatVal, floatVal4, 5.0F, floatVal5, 0.0F, color6); + + break label187; + + } + + guiTab2 = this; + + + float floatVal2 = (float)guiTab2.cachedValue4 + 125.0F; + float floatVal6 = (float)(this.cachedValue6 + 20.0); + doubleVal35 = this.v; + float floatVal7 = (float)Math.min(doubleVal12, doubleVal35); + awtColor4 = new Color(0, 0, 0, (int)(200.0 * doubleVal3)); + int color7 = awtColor4.getRGB(); + RenderUtils.drawRoundedRect(floatVal2, floatVal6, 5.0F, floatVal7, 0.0F, color7); + } + + label273: { + if (doubleVal12 <= doubleVal11) { + this.cachedValue5 = 0.0; + this.cachedValue2 = 0.0; + break label273; + } + + float floatVal3 = (float)(this.cachedValue4 + 130.0 - 4.0); + float floatVal8 = (float)(this.cachedValue6 + 20.0 + this.cachedValue2); + float floatVal9 = (float)doubleVal13 - 1.0F; + awtColor4 = new Color(0, 0, 0, (int)(100.0 * doubleVal3)); + int color8 = awtColor4.getRGB(); + RenderUtils.drawRoundedRect(floatVal3, floatVal8, 3.0F, floatVal9, 0.0F, color8); + if (value >= this.cachedValue4) { + if (value <= (this.cachedValue4 + 130.0)) { + if (index >= (this.cachedValue6 + 20.0)) { + double doubleVal19; + intVal2 = (doubleVal19 = index - (this.cachedValue6 + 20.0 + this.v)) == 0.0 ? 0 : (doubleVal19 < 0.0 ? -1 : 1); + + if (intVal2 <= 0) { + label274: { + int intVal5 = Mouse.getDWheel(); + int intVal6 = intVal5; + + if (intVal5 == 0) { + break label274; + } + + intVal6 = intVal5; + + + if (intVal6 < 0) { + this.cachedValue2 += 10.0; + + break label274; + + } + + this.cachedValue2 -= 10.0; + } + + double doubleVal20 = this.cachedValue2; + doubleVal34 = doubleVal - doubleVal13; + this.cachedValue2 = (int)MathHelper.clamp_double(doubleVal20, 0.0, doubleVal34); + + break label273; + + } + } + } + } + + intVal2 = (this.stateFlag3 ? 1 : 0); + + if (intVal2 != 0) { + } + } + + intVal2 = (this.stateFlag3 ? 1 : 0); + + if (intVal2 != 0) { + if (index - this.cachedValue7 != 0.0) { + this.cachedValue2 = this.cachedValue2 + (index - this.cachedValue7); + double doubleVal21 = this.cachedValue2; + doubleVal34 = doubleVal - doubleVal13; + this.cachedValue2 = (int)MathHelper.clamp_double(doubleVal21, 0.0, doubleVal34); + this.cachedValue7 = index; + } + } + + List itemList4 = this.clickGuiModuleRowList; + intVal2 = itemList4.size() * 20 + this.computeIntValue(); + + double doubleVal22; + label137: { + label136: { + double doubleVal23 = intVal2; + double doubleVal41 = this.v; + doubleVal22 = Math.min(doubleVal23, doubleVal41); + + StringProperty strProp4 = clickGui.getStringPropertyR(); + if (!strProp4.equals("Basic")) { + break label136; + } + + double doubleVal24 = this.cachedValue4; + doubleVal41 = this.cachedValue6 + 20.0 + doubleVal22; + double doubleVal42 = this.cachedValue4 + 130.0; + doubleVal34 = this.cachedValue6 + 20.0 + doubleVal22 + 5.0; + Color awtColor7 = new Color(45, 45, 45); + int color9 = awtColor7.getRGB(); + RenderUtils.drawRect(doubleVal24, doubleVal41, doubleVal42, doubleVal34, color9); + + + + break label137; + + } + + double doubleVal25 = this.cachedValue4; + double doubleVal43 = this.cachedValue6 + 20.0 + doubleVal22; + double doubleVal44 = this.cachedValue4 + 130.0; + doubleVal34 = this.cachedValue6 + 20.0 + doubleVal22 + 5.0; + Color awtColor8 = new Color(0, 0, 0, (int)(200.0 * doubleVal3)); + int color10 = awtColor8.getRGB(); + RenderUtils.drawRect(doubleVal25, doubleVal43, doubleVal44, doubleVal34, color10); + } + + net.minecraft.client.gui.FontRenderer font3 = Minecraft.getMinecraft().fontRendererObj; + String textStr = "\u25e2"; + float floatVal10 = (float)(this.cachedValue4 + 130.0 - 3.2F); + float floatVal11 = (float)(this.cachedValue6 + 20.0 + doubleVal22) - 2.5F; + Color awtColor9 = new Color(80, 80, 80, 150); + int color11 = awtColor9.getRGB(); + font3.drawString(textStr, floatVal10, floatVal11, color11); + if (this.stateFlag4) { + double doubleVal45 = 0.0; + List itemList5 = this.clickGuiModuleRowList; + Iterator iter2 = itemList5.iterator(); + + do { + if (!iter2.hasNext()) { + break; + } + + ClickGuiModuleRow modRow2 = (ClickGuiModuleRow)iter2.next(); + + label121: { + + if (!modRow2.isStateFlag()) { + break label121; + } + + doubleVal45 += 20.0 + modRow2.getCachedValue2(); + + + + continue; + + } + + doubleVal45 += 20.0; + } while (intArr == null); + + double doubleVal26 = index - (this.cachedValue6 + 20.0); + this.v = MathHelper.clamp_double(doubleVal26, 10.0, doubleVal45); + this.cachedValue2 = 0.0; + + this.cachedValue5 = 0.0; + } +} + + public void handleGuiAction(double value, double amount, double offset, boolean flag) { + label15: { + GL11.glPushMatrix(); + GlStateManager.disableTexture2D(); + GL11.glBegin(5); + if (flag) { + GL11.glVertex2d(value + offset, amount + offset); + GL11.glVertex2d(value + offset * 2.0, amount + offset * 2.0); + GL11.glVertex2d(value + offset * 3.0, amount + offset); + break label15; + } + + amount += offset * 3.0; + GL11.glVertex2d(value + offset * 3.0, amount - offset); + GL11.glVertex2d(value + offset * 2.0, amount - offset * 2.0); + + GL11.glVertex2d(value + offset, amount - offset); + } + + GL11.glEnd(); + GlStateManager.enableTexture2D(); + GL11.glPopMatrix(); +} + + public boolean applyUpdate2(AbstractModule module) { + Iterator iter = this.clickGuiModuleRowList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + ClickGuiModuleRow modRow = (ClickGuiModuleRow)iter.next(); + if (module == modRow.getAbstractModule()) { + return true; + } + } + + return false; +} + + public double getDoubleValue2() { + return this.v; +} + + public double getDoubleValue() { + return this.cachedValue8; +} + + public Timer getTimer() { + return this.timer; +} + + static { + applyUpdate(null); + } + + public void applyUpdate(int value) { + this.cachedValue5 = value; +} + + public void applyUpdate2(double value) { + this.cachedValue6 = value; +} + + public void drawElement(double value, double amount, double offset, double dist, boolean flag) { + label15: { + GL11.glPushMatrix(); + GlStateManager.disableTexture2D(); + GL11.glBegin(5); + double doubleVal = offset * dist; + if (flag) { + GL11.glVertex2d(value + offset, amount + doubleVal); + GL11.glVertex2d(value + offset * 2.0, amount + doubleVal * 2.0); + GL11.glVertex2d(value + offset * 3.0, amount + doubleVal); + break label15; + } + + amount += offset * 2.0; + GL11.glVertex2d(value + offset * 3.0, amount - doubleVal); + GL11.glVertex2d(value + offset * 2.0, amount - doubleVal * 2.0); + + GL11.glVertex2d(value + offset, amount - doubleVal); + } + + GL11.glEnd(); + GlStateManager.enableTexture2D(); + GL11.glPopMatrix(); +} + + public boolean isStateFlag() { + return this.stateFlag2; +} + + public ClickGUI getClickGUI2() { + return this.clickGUIField; +} + + public void applyUpdate3(char ch, int value) { + Iterator iter = this.clickGuiModuleRowList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + ClickGuiModuleRow modRow = (ClickGuiModuleRow)iter.next(); + ClickGuiModuleRow modRow2 = modRow; + if (!modRow.isStateFlag()) { + continue; + } + + modRow2 = modRow; + + modRow2.evaluateCheck(ch, value); + } +} + + public void handleGuiAction(double value, double amount, double offset, double dist) { + GL11.glPushMatrix(); + GlStateManager.disableTexture2D(); + GL11.glBegin(5); + double doubleVal = dist - 90.0; + doubleVal = Math.toRadians(doubleVal); + double angleRad = value + -Math.sin(doubleVal) * offset; + double doubleVal2 = dist - 90.0; + doubleVal2 = Math.toRadians(doubleVal2); + GL11.glVertex2d(angleRad, amount + Math.cos(doubleVal2) * offset); + doubleVal2 = Math.toRadians(dist); + doubleVal = value + -Math.sin(doubleVal2) * offset * 2.0; + double angleRad2 = Math.toRadians(dist); + GL11.glVertex2d(doubleVal, amount + Math.cos(angleRad2) * offset * 2.0); + doubleVal = dist + 90.0; + doubleVal = Math.toRadians(doubleVal); + angleRad = value + -Math.sin(doubleVal) * offset * 3.0; + doubleVal2 = dist + 90.0; + doubleVal2 = Math.toRadians(doubleVal2); + GL11.glVertex2d(angleRad, amount + Math.cos(doubleVal2) * offset); + GL11.glEnd(); + GlStateManager.enableTexture2D(); + GL11.glPopMatrix(); +} + + public void applyUpdate(double value) { + this.cachedValue4 = value; +} + + public int computeIntValue() { + int intVal; + int intVal2 = 0; + List itemList = this.clickGuiModuleRowList; + Iterator iter = itemList.iterator(); + + while (true) { + if (iter.hasNext()) { + ClickGuiModuleRow modRow = (ClickGuiModuleRow)iter.next(); + double doubleVal = intVal2; + intVal = (int)(doubleVal + modRow.getCachedValue2()); + + intVal2 = intVal; + continue; + } + + intVal = intVal2; + break; + } + + return intVal; +} + + public double computeDoubleValue() { + double doubleVal; + double doubleVal2 = 0.0; + List itemList = this.clickGuiModuleRowList; + Iterator iter = itemList.iterator(); + + while (true) { + if (iter.hasNext()) { + ClickGuiModuleRow modRow = (ClickGuiModuleRow)iter.next(); + doubleVal = doubleVal2 + (20.0 + modRow.getCachedValue2()); + + doubleVal2 = doubleVal; + continue; + } + + doubleVal = doubleVal2; + break; + } + + return doubleVal; +} + + public double getPosX() { return this.getCachedValue(); } + public double getPosY() { return this.getCachedValue2(); } + public double getHeight() { return this.getDoubleValue2(); } + public EnumModuleType getCategory() { return this.getEnumModuleTypeField(); } + public ClickGUI getClickGUI() { return this.getClickGUI2(); } + public boolean isOpened() { return this.isStateFlag(); } + public void setOpened(boolean opened) { this.applyUpdate2(opened); } + public void setPosX(double posX) { this.applyUpdate(posX); } + public void setPosY(double posY) { this.applyUpdate2(posY); } + public void keyTyped(char typedChar, int keyCode) { this.applyUpdate3(typedChar, keyCode); } + public boolean containsModule(AbstractModule module) { return this.applyUpdate2(module); } + public List getModuleRows() { return this.getClickGuiModuleRowList(); } +} diff --git a/src/main/java/cc/novoline/gui/screen/config/GuiConfig.java b/src/main/java/cc/novoline/gui/screen/config/GuiConfig.java new file mode 100644 index 0000000..d4a4b07 --- /dev/null +++ b/src/main/java/cc/novoline/gui/screen/config/GuiConfig.java @@ -0,0 +1,261 @@ +package cc.novoline.gui.screen.config; + +import cc.novoline.gui.click.GuiConfigItemSlot; +import cc.novoline.gui.click.WhitelistItemCard; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.utils.MovementUtils; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.item.Item; +import org.lwjgl.opengl.GL11; + +public class GuiConfig extends GuiScreen { + private List guiConfigItemSlotList = new CopyOnWriteArrayList<>(); + + private GuiConfigItemSlot resolveGuiConfigItemSlot(int value) { + cc.novoline.gui.click.GuiConfigItemSlot guiConfigItemSlot; + Iterator iter = this.guiConfigItemSlotList.iterator(); + + while (true) { + if (iter.hasNext()) { + GuiConfigItemSlot guiConfigItemSlot2 = (GuiConfigItemSlot)iter.next(); + guiConfigItemSlot = guiConfigItemSlot2; + + if (guiConfigItemSlot2.getStateTicks2() == value) { + guiConfigItemSlot = guiConfigItemSlot2; + break; + } + + continue; + } + + return null; + } + + return guiConfigItemSlot; +} + + public static Minecraft resolveGuiConfigItemSlot(GuiConfig guiConfig) { + return guiConfig.minecraft2; +} + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + GL11.glPushMatrix(); + MovementUtils.evaluateDouble(true); + List itemList = this.guiConfigItemSlotList; + Iterator iter = itemList.iterator(); + + while (true) { + if (iter.hasNext()) { + GuiConfigItemSlot guiConfigItemSlot = (GuiConfigItemSlot)iter.next(); + int intVal = MovementUtils.evaluateDouble(mouseX); + int intVal2 = MovementUtils.scaleYInt(mouseY); + guiConfigItemSlot.createIntProperty(intVal, intVal2); + + continue; + } + + GL11.glPopMatrix(); + super.drawScreen(mouseX, mouseY, partialTicks); + break; + } +} + + @Override + public void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { + boolean flag; + int intVal = MovementUtils.evaluateDouble(mouseX); + int intVal6 = MovementUtils.scaleYInt(mouseY); + + label129: + if (mouseButton == 0) { + GuiConfigItemSlot guiConfigItemSlot = null; + List itemList = this.guiConfigItemSlotList; + Iterator iter = itemList.iterator(); + + while (true) { + if (iter.hasNext()) { + GuiConfigItemSlot guiConfigItemSlot2 = (GuiConfigItemSlot)iter.next(); + + flag = guiConfigItemSlot2.getStateFlag2(); + + if (flag) { + guiConfigItemSlot = guiConfigItemSlot2; + } + + continue; + + } + + if (guiConfigItemSlot != null) { + List itemList2 = this.guiConfigItemSlotList; + iter = itemList2.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + GuiConfigItemSlot guiConfigItemSlot3 = (GuiConfigItemSlot)iter.next(); + + label138: { + GuiConfigItemSlot guiConfigItemSlot4 = guiConfigItemSlot3; + + if (!guiConfigItemSlot3.isHoveredAt(intVal, intVal6)) { + break label138; + } + + guiConfigItemSlot4 = guiConfigItemSlot3; + + + label83: { + if (guiConfigItemSlot4.getItem() != null) { + Item item = guiConfigItemSlot3.getItem(); + IntProperty intProperty = guiConfigItemSlot3.getIntPropertyField(); + guiConfigItemSlot3.evaluateCheck(guiConfigItemSlot.getItem()); + GuiConfigItemSlot.createIntProperty(guiConfigItemSlot3, guiConfigItemSlot.getIntPropertyField()); + IntProperty intProp = guiConfigItemSlot3.getIntPropertyField(); + Integer slot = guiConfigItemSlot3.getStateTicks(); + intProp.set(slot); + guiConfigItemSlot.evaluateCheck(item); + GuiConfigItemSlot.createIntProperty(guiConfigItemSlot, intProperty); + IntProperty intProp2 = guiConfigItemSlot.getIntPropertyField(); + int slot2 = guiConfigItemSlot.getStateTicks(); + Integer intVal3 = slot2; + intProp2.set(intVal3); + break label83; + } + + guiConfigItemSlot3.evaluateCheck(guiConfigItemSlot.getItem()); + guiConfigItemSlot3.evaluateCheck(true); + guiConfigItemSlot.evaluateCheck((Item)null); + guiConfigItemSlot.evaluateCheck(false); + GuiConfigItemSlot.createIntProperty(guiConfigItemSlot3, guiConfigItemSlot.getIntPropertyField()); + GuiConfigItemSlot.createIntProperty(guiConfigItemSlot, null); + guiConfigItemSlot4 = guiConfigItemSlot3; + + IntProperty intProp3 = guiConfigItemSlot4.getIntPropertyField(); + int slot3 = guiConfigItemSlot3.getStateTicks(); + Integer intVal4 = slot3; + intProp3.set(intVal4); + } + + List itemList3 = this.guiConfigItemSlotList; + Iterator iter2 = itemList3.iterator(); + + while (true) { + if (!iter2.hasNext()) { + break; + } + + GuiConfigItemSlot guiConfigItemSlot5 = (GuiConfigItemSlot)iter2.next(); + GuiConfigItemSlot.createIntProperty(guiConfigItemSlot5, false); + guiConfigItemSlot5.performAction(); + + } + } + + } + + break label129; + } + + List itemList4 = this.guiConfigItemSlotList; + iter = itemList4.iterator(); + flag = iter.hasNext(); + break; + } + + while (flag) { + GuiConfigItemSlot guiConfigItemSlot6 = (GuiConfigItemSlot)iter.next(); + + label141: { + GuiConfigItemSlot guiConfigItemSlot7 = guiConfigItemSlot6; + + if (!guiConfigItemSlot6.isHoveredAt(intVal, intVal6)) { + break label141; + } + + guiConfigItemSlot7 = guiConfigItemSlot6; + + + + if (guiConfigItemSlot7.getItem() == null) { + break label141; + } + + guiConfigItemSlot7 = guiConfigItemSlot6; + + + GuiConfigItemSlot.createIntProperty(guiConfigItemSlot7, true); + } + + flag = iter.hasNext(); + } + } + + super.mouseClicked(intVal, intVal6, mouseButton); + +} + + public GuiConfigItemSlot getGuiConfigItemSlot() { + cc.novoline.gui.click.GuiConfigItemSlot guiConfigItemSlot; + Iterator iter = this.guiConfigItemSlotList.iterator(); + + while (true) { + if (iter.hasNext()) { + GuiConfigItemSlot guiConfigItemSlot2 = (GuiConfigItemSlot)iter.next(); + guiConfigItemSlot = guiConfigItemSlot2; + + if (guiConfigItemSlot2.getStateFlag2()) { + guiConfigItemSlot = guiConfigItemSlot2; + break; + } + + continue; + } + + return null; + } + + return guiConfigItemSlot; +} + + @Override + public void initGui() { + ScaledResolution scaledRes = new ScaledResolution(Minecraft.getMinecraft()); + float floatVal = scaledRes.getScaledWidthGui(); + float floatVal2 = scaledRes.getScaledWidthGui() / 2; + float floatVal3 = scaledRes.getScaledHeightGui() / 2; + List itemList = this.guiConfigItemSlotList; + itemList.clear(); + float floatVal4 = floatVal2 - 90.0F; + int intVal = 1; + + while (true) { + if (intVal <= 9) { + List itemList2 = this.guiConfigItemSlotList; + itemList2.add(new GuiConfigItemSlot(this, intVal, floatVal4, floatVal3 - 10.0F)); + floatVal4 += 20.0F; + intVal++; + + continue; + } + + super.initGui(); + break; + } +} + + + + public List getGuiConfigItemSlotList() { + return this.guiConfigItemSlotList; +} +} diff --git a/src/main/java/cc/novoline/gui/screen/font/FontFilterMode.java b/src/main/java/cc/novoline/gui/screen/font/FontFilterMode.java new file mode 100644 index 0000000..b671cd1 --- /dev/null +++ b/src/main/java/cc/novoline/gui/screen/font/FontFilterMode.java @@ -0,0 +1,30 @@ +package cc.novoline.gui.screen.font; + + +public enum FontFilterMode { + ALL("All"), + FAVORITE("Favorites"); + + private static int[] b; + + static { + b(null); + } + private final String cachedText; + + public static void b(int[] intArray) { + b = intArray; +} + + public String getCachedText() { + return this.cachedText; +} + + FontFilterMode(String text) { + this.cachedText = text; +} + + public static int[] b() { + return b; +} +} diff --git a/src/main/java/cc/novoline/gui/screen/font/GuiFontSelector.java b/src/main/java/cc/novoline/gui/screen/font/GuiFontSelector.java new file mode 100644 index 0000000..77d516c --- /dev/null +++ b/src/main/java/cc/novoline/gui/screen/font/GuiFontSelector.java @@ -0,0 +1,440 @@ +package cc.novoline.gui.screen.font; +import cc.novoline.Novoline; +import cc.novoline.gui.click.SystemFontPathUtil; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.StencilUtil; +import cc.novoline.utils.fonts.impl.SearchTextField; +import cc.novoline.utils.fonts.impl.FontFilterDropdown; +import cc.novoline.utils.fonts.impl.FontSelectorEntry; +import java.awt.Color; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.LinkOption; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Iterator; +import java.util.List; +import java.util.Scanner; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.ForkJoinPool; +import java.util.function.Predicate; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import net.minecraft.util.MathHelper; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import org.lwjgl.input.Mouse; + +public class GuiFontSelector extends GuiScreen { + private FontFilterDropdown fontFilterDropdownField; + private double x; + private List stringList; + private List fontSelectorEntryList = new CopyOnWriteArrayList<>(); + private double z; + private final String textValue; + private double cachedValue; + private double cachedValue2; + private boolean flagValue; + private SearchTextField searchTextFieldField; + + + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + int intVal; + double doubleVal; + double doubleVal19; + double doubleVal20; + double scaledWidthD; + double scaledHeightD; + List itemList; + label104: { + doubleVal19 = 250.0; + doubleVal20 = 300.0; + ScaledResolution scaledRes = new ScaledResolution(this.minecraft2); + scaledWidthD = scaledRes.getScaledWidthGui() / 2 - doubleVal19 / 2.0; + scaledHeightD = scaledRes.getScaledHeightGui() / 2 - doubleVal20 / 2.0; + RenderUtils.drawRect(scaledWidthD, scaledHeightD, scaledWidthD + doubleVal19, scaledHeightD + doubleVal20, -16777216); + double doubleVal2 = scaledWidthD + 1.0; + double doubleVal21 = scaledHeightD + 1.0; + double doubleVal22 = scaledWidthD + doubleVal19 - 1.0; + double doubleVal23 = scaledHeightD + doubleVal20 - 1.0; + Color awtColor = new Color(60, 60, 60); + RenderUtils.drawRect(doubleVal2, doubleVal21, doubleVal22, doubleVal23, awtColor.getRGB()); + double doubleVal3 = scaledWidthD + 2.0; + doubleVal21 = scaledHeightD + 2.0; + doubleVal22 = scaledWidthD + doubleVal19 - 2.0; + doubleVal23 = scaledHeightD + doubleVal20 - 2.0; + awtColor = new Color(40, 40, 40); + RenderUtils.drawRect(doubleVal3, doubleVal21, doubleVal22, doubleVal23, awtColor.getRGB()); + double doubleVal4 = scaledWidthD + 4.0; + doubleVal21 = scaledHeightD + 4.0; + doubleVal22 = scaledWidthD + doubleVal19 - 4.0; + doubleVal23 = scaledHeightD + doubleVal20 - 4.0; + awtColor = new Color(60, 60, 60); + RenderUtils.drawRect(doubleVal4, doubleVal21, doubleVal22, doubleVal23, awtColor.getRGB()); + double doubleVal5 = scaledWidthD + 5.0; + doubleVal21 = scaledHeightD + 5.0; + doubleVal22 = scaledWidthD + doubleVal19 - 5.0; + doubleVal23 = scaledHeightD + doubleVal20 - 5.0; + awtColor = new Color(22, 22, 22); + RenderUtils.drawRect(doubleVal5, doubleVal21, doubleVal22, doubleVal23, awtColor.getRGB()); + StencilUtil.initStencilToWrite(true); + double doubleVal6 = scaledWidthD + 5.0; + doubleVal21 = scaledHeightD + 6.0; + doubleVal22 = scaledWidthD + doubleVal19 - 5.0; + doubleVal23 = scaledHeightD + doubleVal20 - 5.0; + awtColor = new Color(22, 22, 22); + RenderUtils.drawRect(doubleVal6, doubleVal21, doubleVal22, doubleVal23, awtColor.getRGB()); + StencilUtil.readStencilBuffer(true); + List itemList2 = this.fontSelectorEntryList; + Stream stream2 = itemList2.stream(); + Predicate predicate = this::matchesFontSelectorEntry2; + Stream stream3 = stream2.filter(predicate); + Collector collector = Collectors.toList(); + itemList = (java.util.List) stream3.collect(collector); + Object obj = this.fontFilterDropdownField.getFontFilterMode(); + if (obj != FontFilterMode.FAVORITE) { + break label104; + } + + Stream stream4 = itemList.stream(); + Predicate predicate2 = ((java.util.function.Predicate) FontSelectorEntry::isStateFlag2); + Stream stream5 = stream4.filter(predicate2); + Collector collector2 = Collectors.toList(); + obj = stream5.collect(collector2); + + itemList = (List)obj; + } + + double doubleVal7 = doubleVal20 - 32.0; + double doubleVal8 = doubleVal20 - 32.0; + double doubleVal9 = itemList.size() * 27; + double doubleVal10 = doubleVal8 / doubleVal9 * doubleVal7; + double doubleVal11 = doubleVal7 - doubleVal10; + double doubleVal12 = doubleVal9 - doubleVal7; + double doubleVal13 = doubleVal12 / doubleVal11; + this.z = this.x * doubleVal13; + double doubleVal14 = scaledHeightD + 8.0; + Iterator iter = itemList.iterator(); + + GuiFontSelector guiFontSelector; + label95: { + while (true) { + if (iter.hasNext()) { + FontSelectorEntry fontSelectorEntry = (FontSelectorEntry)iter.next(); + + double doubleVal24 = scaledWidthD + 7.0; + double doubleVal25 = doubleVal14 - this.z; + int intVal4 = (doubleVal9 > doubleVal8) ? 1 : 0; + + GuiFontSelectorHelper.executeFontSelectorEntry(fontSelectorEntry, mouseX, mouseY, doubleVal19, doubleVal20, doubleVal24, doubleVal25, (boolean)((intVal4) != 0)); + doubleVal14 += 27.0; + continue; + + } + + if (doubleVal9 <= doubleVal8) { + this.z = 0.0; + break; + } + + double doubleVal15 = scaledWidthD + doubleVal19 - 12.0; + double doubleVal26 = scaledHeightD + 8.0; + double doubleVal27 = scaledWidthD + doubleVal19 - 7.0; + double doubleVal28 = scaledHeightD + 8.0 + doubleVal7; + Color awtColor2 = new Color(40, 40, 40); + RenderUtils.drawRect(doubleVal15, doubleVal26, doubleVal27, doubleVal28, awtColor2.getRGB()); + double doubleVal16 = scaledWidthD + doubleVal19 - 11.0; + doubleVal26 = scaledHeightD + 9.0 + this.x; + doubleVal27 = scaledWidthD + doubleVal19 - 8.0; + doubleVal28 = scaledHeightD + 9.0 + this.x + doubleVal10 - 2.0; + awtColor2 = new Color(62, 62, 62); + RenderUtils.drawRect(doubleVal16, doubleVal26, doubleVal27, doubleVal28, awtColor2.getRGB()); + if (mouseX >= scaledWidthD) { + if (mouseX <= (scaledWidthD + doubleVal19)) { + if (mouseY >= scaledHeightD) { + double doubleVal17; + intVal = (doubleVal17 = mouseY - (scaledHeightD + doubleVal20)) == 0.0 ? 0 : (doubleVal17 < 0.0 ? -1 : 1); + + if (intVal <= 0) { + label111: { + int intVal2 = Mouse.getDWheel(); + int intVal3 = intVal2; + + if (intVal2 == 0) { + break label111; + } + + intVal3 = intVal2; + + + if (intVal3 < 0) { + this.x += 5.0; + break label111; + } + + this.x -= 5.0; + } + + double doubleVal18 = this.x; + double doubleVal29 = doubleVal7 - doubleVal10; + this.x = MathHelper.clamp_double(doubleVal18, 0.0, doubleVal29); + } + } + } + } + break label95; + } + + this.x = 0.0; + } + + guiFontSelector = this; + + intVal = (this.flagValue ? 1 : 0); + + double doubleVal30; + if (intVal != 0) { + doubleVal = mouseY - this.cachedValue2; + doubleVal30 = 0.0; + + if (doubleVal != 0.0) { + this.x = this.x + (mouseY - this.cachedValue2); + doubleVal30 = this.x; + double doubleVal31 = doubleVal7 - doubleVal10; + this.x = MathHelper.clamp_double(doubleVal30, 0.0, doubleVal31); + this.cachedValue2 = mouseY; + } + } + + doubleVal = scaledWidthD + 5.0; + doubleVal30 = scaledHeightD + doubleVal20 - 22.0; + + double doubleVal32 = scaledWidthD + doubleVal19 - 5.0; + double doubleVal33 = scaledHeightD + doubleVal20 - 5.0; + Color awtColor3 = new Color(22, 22, 22); + RenderUtils.drawRect(doubleVal, doubleVal30, doubleVal32, doubleVal33, awtColor3.getRGB()); + SearchTextField searchTextField = this.searchTextFieldField; + doubleVal30 = scaledWidthD + 7.0; + doubleVal32 = scaledHeightD + doubleVal20 - 22.0; + double doubleVal34 = doubleVal19 / 2.0 + 10.0; + searchTextField.renderVisual2(doubleVal30, doubleVal32, 15.0, doubleVal34, mouseX, mouseY); + guiFontSelector = this; + + GuiFontSelectorSupport.executeFontFilterDropdown(guiFontSelector.fontFilterDropdownField, scaledWidthD + doubleVal19 / 2.0 + 12.0 + 7.0, scaledHeightD + doubleVal20 - 22.0, doubleVal19 - (doubleVal19 / 2.0 + 12.0 + 7.0) - 7.0, 15.0, mouseX, mouseY); + StencilUtil.uninitStencilBuffer(); +} + + private static void lambdaImpl$new$0(String text) {} + + private boolean matchesFontSelectorEntry(FontSelectorEntry fontSelectorEntry) { + String textStr2 = fontSelectorEntry.getTextValue(); + String textStr = this.searchTextFieldField.getTextValue(); + return textStr2.contains(textStr); +} + + @Override + public void keyTyped(char typedChar, int keyCode) throws IOException { + this.searchTextFieldField.applyUpdate(typedChar, keyCode); + super.keyTyped(typedChar, keyCode); +} + + private String supplyString() { + String textStr = System.getenv("WINDIR"); + File fileObj = new File(textStr, "Fonts"); + SystemFontPathUtil.executeGuiFontSelector(this, fileObj.getAbsolutePath(), ".ttf"); + SystemFontPathUtil.executeGuiFontSelector(this, "C:\\", ".ttf"); + return ""; +} + + public GuiFontSelector() { + this.stringList = new CopyOnWriteArrayList<>(); + this.z = 0.0; + this.searchTextFieldField = new SearchTextField(); + this.fontFilterDropdownField = new FontFilterDropdown("", GuiFontSelector::lambdaImpl$new$0); + StringBuilder sb = new StringBuilder(); + Novoline novolineInst = Novoline.getInstance(); + String pathStr = novolineInst.getDataFolderString(); + sb = sb.append(pathStr); + this.textValue = sb.append("favorite_fonts.novo").toString(); +} + + @Override + public void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { + double doubleVal; + double doubleVal2; + double scaledWidthD; + double scaledHeightD; + int intVal; + doubleVal = 250.0; + doubleVal2 = 300.0; + ScaledResolution scaledRes = new ScaledResolution(this.minecraft2); + scaledWidthD = scaledRes.getScaledWidthGui() / 2 - doubleVal / 2.0; + scaledHeightD = scaledRes.getScaledHeightGui() / 2 - doubleVal2 / 2.0; + double doubleVal3 = doubleVal2 - 32.0; + intVal = mouseButton; + + if (mouseButton == 0) { + if (mouseX >= (scaledWidthD + doubleVal - 12.0)) { + if (mouseX <= (scaledWidthD + doubleVal - 7.0)) { + if (mouseY >= (scaledHeightD + 8.0)) { + if (mouseY <= (scaledHeightD + 8.0 + doubleVal3)) { + this.flagValue = true; + this.cachedValue2 = mouseY; + } + } + } + } + } + + double doubleVal4; + intVal = (doubleVal4 = mouseX - (scaledWidthD + 5.0)) == 0.0 ? 0 : (doubleVal4 < 0.0 ? -1 : 1); + + label101: { + if (intVal < 0) { + break label101; + } + + if (mouseX > (scaledWidthD + doubleVal - 5.0)) { + break label101; + } + + if (mouseY < (scaledHeightD + 5.0)) { + break label101; + } + + if (mouseY <= (scaledHeightD + doubleVal2 - 22.0)) { + List itemList; + label64: { + List itemList2 = this.fontSelectorEntryList; + Stream stream2 = itemList2.stream(); + Predicate predicate = this::matchesFontSelectorEntry; + Stream stream3 = stream2.filter(predicate); + Collector collector = Collectors.toList(); + itemList = (java.util.List) stream3.collect(collector); + Object obj = this.fontFilterDropdownField.getFontFilterMode(); + if (obj != FontFilterMode.FAVORITE) { + break label64; + } + + Stream stream4 = itemList.stream(); + predicate = FontSelectorEntry::isStateFlag2; + Stream stream5 = stream4.filter(predicate); + Collector collector2 = Collectors.toList(); + obj = stream5.collect(collector2); + + itemList = (List)obj; + } + + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + FontSelectorEntry fontSelectorEntry = (FontSelectorEntry)iter.next(); + fontSelectorEntry.handleInt(mouseButton, mouseX, mouseY); + + } + } + } + + SearchTextField searchTextField = this.searchTextFieldField; + searchTextField.handleInt(mouseButton, mouseX, mouseY); + this.fontFilterDropdownField.handleInt(mouseButton, mouseX, mouseY); + super.mouseClicked(mouseX, mouseY, mouseButton); +} + + public String getTextValue2() { + return this.textValue; +} + + @Override + public void initGui() { + label58: { + Path filePath = Paths.get(this.textValue); + LinkOption[] linkOptionArr = new LinkOption[0]; + if (!Files.exists(filePath, linkOptionArr)) { + try { + FileWriter fileWriter = new FileWriter(this.textValue); + fileWriter.close(); + break label58; + } catch (IOException ex) { + ex.printStackTrace(); + break label58; + } + } + + Scanner scanner = null; + + try { + scanner = new Scanner(Paths.get(this.textValue)); + + while (scanner.hasNextLine()) { + String lineStr = scanner.nextLine(); + + label60: { + String textStr = lineStr; + if (lineStr == null) { + break label60; + } + + textStr = lineStr; + + if (!textStr.isEmpty()) { + List itemList = this.stringList; + itemList.add(lineStr); + } + } + + } + } catch (IOException ex2) { + ex2.printStackTrace(); + } + } + + CompletableFuture completableFuture = CompletableFuture.supplyAsync(this::supplyString, ForkJoinPool.commonPool()); +} + + private boolean matchesFontSelectorEntry2(FontSelectorEntry fontSelectorEntry) { + String textStr2 = fontSelectorEntry.getTextValue(); + String textStr = this.searchTextFieldField.getTextValue(); + return textStr2.contains(textStr); +} + + public void applyString(String text) { + List itemList3 = this.stringList; + FontSelectorEntry fontSelectorEntry = new FontSelectorEntry(this, text, itemList3.contains(text)); + List itemList = this.fontSelectorEntryList; + Iterator iter = itemList.iterator(); + + while (true) { + if (iter.hasNext()) { + FontSelectorEntry fontSelectorEntry2 = (FontSelectorEntry)iter.next(); + boolean flag = fontSelectorEntry2.getTextValue().equals(fontSelectorEntry.getTextValue()); + + if (flag) { + return; + } + + continue; + } + + List itemList2 = this.fontSelectorEntryList; + itemList2.add(fontSelectorEntry); + break; + } +} + + @Override + public void mouseReleased(int mouseX, int mouseY, int mouseButton) { + this.flagValue = false; +} +} diff --git a/src/main/java/cc/novoline/gui/screen/font/GuiFontSelectorHelper.java b/src/main/java/cc/novoline/gui/screen/font/GuiFontSelectorHelper.java new file mode 100644 index 0000000..3a34649 --- /dev/null +++ b/src/main/java/cc/novoline/gui/screen/font/GuiFontSelectorHelper.java @@ -0,0 +1,18 @@ +package cc.novoline.gui.screen.font; + + +import cc.novoline.utils.fonts.impl.FontSelectorEntry; + +public class GuiFontSelectorHelper { + public static void updateHelper(FontSelectorEntry fontSelectorEntry, int value, int index, int count) { + fontSelectorEntry.handleInt(value, index, count); +} + + public static String resolveString(FontSelectorEntry fontSelectorEntry) { + return fontSelectorEntry.getTextValue(); +} + + public static void executeFontSelectorEntry(FontSelectorEntry fontSelectorEntry, int value, int index, double amount, double offset, double dist, double value2, boolean flag) { + fontSelectorEntry.renderVisual(value, index, amount, offset, dist, value2, flag); +} +} diff --git a/src/main/java/cc/novoline/gui/screen/font/GuiFontSelectorSupport.java b/src/main/java/cc/novoline/gui/screen/font/GuiFontSelectorSupport.java new file mode 100644 index 0000000..396ba35 --- /dev/null +++ b/src/main/java/cc/novoline/gui/screen/font/GuiFontSelectorSupport.java @@ -0,0 +1,18 @@ +package cc.novoline.gui.screen.font; +import cc.novoline.gui.screen.font.FontFilterMode; + +import cc.novoline.utils.fonts.impl.FontFilterDropdown; + +public class GuiFontSelectorSupport { + public static void updateHelper(FontFilterDropdown fontFilterDropdown, int value, int index, int count) { + fontFilterDropdown.handleInt(value, index, count); +} + + public static void executeFontFilterDropdown(FontFilterDropdown fontFilterDropdown, double value, double amount, double offset, double dist, int index, int count) { + fontFilterDropdown.renderVisual(value, amount, offset, dist, index, count); +} + + public static FontFilterMode resolveFontFilterMode(FontFilterDropdown fontFilterDropdown) { + return fontFilterDropdown.getFontFilterMode(); +} +} diff --git a/src/main/java/cc/novoline/gui/screen/hud/GuiHudEditor.java b/src/main/java/cc/novoline/gui/screen/hud/GuiHudEditor.java new file mode 100644 index 0000000..2b3a28f --- /dev/null +++ b/src/main/java/cc/novoline/gui/screen/hud/GuiHudEditor.java @@ -0,0 +1,98 @@ +package cc.novoline.gui.screen.hud; + +import cc.novoline.Novoline; +import cc.novoline.gui.element.GuiDrawable; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import java.awt.Color; +import java.util.Collection; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import net.minecraft.client.gui.GuiScreen; +import org.apache.logging.log4j.Logger; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; + +public abstract class GuiHudEditor extends GuiScreen { + private final @NonNull List entryList; + private long lastTimestamp; + + public void performStep2() {} + + public void applyGuiDrawable(@NonNull GuiDrawable guiDrawable) { + List itemList = this.entryList; + itemList.add(guiDrawable); +} + + public GuiHudEditor(@Nullable Collection collection) { + this.entryList = collection == null ? new ObjectArrayList<>() : new ObjectArrayList<>(collection); +} + + public void updateHelper() {} + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + int intVal2 = this.width; + int intVal3 = this.height; + int color = (new Color(100, 200, 200)).getRGB(); + Color awtColor = new Color(100, 100, 200); + this.drawGradientRect(0, 0, intVal2, intVal3, color, awtColor.getRGB()); + int intVal = 0; + + while (true) { + List itemList3 = this.entryList; + if (intVal < itemList3.size()) { + List itemList = this.entryList; + GuiDrawable guiDrawable = (GuiDrawable)itemList.get(intVal); + guiDrawable.renderPanel2(mouseX, mouseY); + intVal++; + + continue; + } + + if (System.currentTimeMillis() - this.lastTimestamp >= 1000L) { + Logger log = Novoline.getLogger(); + String textStr = "Drew: {}"; + Object[] objArr = new Object[1]; + List itemList2 = this.entryList; + Stream stream2 = itemList2.stream(); + Function mapper = GuiHudEditor::lambdaImpl$drawScreen$0; + Stream stream3 = stream2.map(mapper); + Function mapper2 = Function.identity(); + Collector collector2 = Collectors.counting(); + Collector collector = Collectors.groupingBy(mapper2, collector2); + objArr[0] = stream3.collect(collector); + log.info(textStr, objArr); + this.lastTimestamp = System.currentTimeMillis(); + } + + super.drawScreen(mouseX, mouseY, partialTicks); + break; + } +} + + @Override + public void onGuiClosed() { + this.updateHelper(); + super.onGuiClosed(); +} + + public GuiHudEditor() { + this(null); +} + + private static String lambdaImpl$drawScreen$0(GuiDrawable guiDrawable) { + Class clazz = guiDrawable.getClass(); + return clazz.getSimpleName(); +} + + @Override + public final void initGui() { + List itemList = this.entryList; + itemList.clear(); + this.performStep2(); + super.initGui(); +} +} diff --git a/src/main/java/cc/novoline/gui/screen/login/GuiLogin.java b/src/main/java/cc/novoline/gui/screen/login/GuiLogin.java new file mode 100644 index 0000000..82b19dc --- /dev/null +++ b/src/main/java/cc/novoline/gui/screen/login/GuiLogin.java @@ -0,0 +1,1055 @@ +package cc.novoline.gui.screen.login; +import cc.novoline.Initializer; +import cc.novoline.Novoline; +import cc.novoline.gui.alt.AltActionButton; +import cc.novoline.gui.alt.AltToastNotification; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontFamilyICONFONT; +import cc.novoline.utils.fonts.holders.FontFamilyOXIDE; +import cc.novoline.utils.shader.RoundedTextureShader; +import java.awt.Color; +import java.awt.Toolkit; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.StringSelection; +import java.io.FileWriter; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.LinkOption; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.attribute.FileAttribute; +import java.util.Scanner; +import cc.novoline.utils.shader.GlslBackgroundShader; +import net.minecraft.client.renderer.GlStateManager; + +import cc.novoline.utils.fonts.holders.FontSF_REGULAR_Holder; +import cc.novoline.utils.fonts.api.FontFamily; +import cc.novoline.utils.fonts.holders.FontFamilyIconFontAlt; +import cc.novoline.utils.fonts.holders.FontFamilyPOSTERAMA; +import net.minecraft.client.audio.SoundSupport; +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.SoundHandler; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.ResourceLocation; +import net.skidunion.security.SessionTokenCallback; +import net.skidunion.security.ProtectionSession; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL20; + +public class GuiLogin extends GuiScreen implements SessionTokenCallback { + private boolean stateFlag; + private long lastTimestamp; + private boolean stateFlag2 = true; + private long lastTimestamp2; + private boolean stateFlag3 = false; + private GlslBackgroundShader glslBackgroundShaderField; + private float cachedAngle; + private String cachedText; + public int intValue; + private Color accentColor; + private Clipboard clipboardField; + private boolean stateFlag4; + private String textValue; + private AltToastNotification altToastNotification; + private FontRenderer fontRendererField; + private float z; + private double cachedValue; + private Color accentColor2; + private Color accentColor3; + private final String cachedText2; + private float cachedAngle2; + private boolean stateFlag5; + private float cachedAngle3; + private float x; + private AltActionButton altActionButtonField; + private boolean stateFlag6; + private Color accentColor4; + private boolean stateFlag7; + private boolean stateFlag8; + private float floatValue; + + private int resolveInt2(Color color, Color color2, float value) { + float floatVal = color.getRed(); + int intVal2 = color2.getRed(); + int intVal = (int)(floatVal + (intVal2 - color.getRed()) * value); + floatVal = color.getGreen(); + intVal2 = color2.getGreen(); + int intVal3 = (int)(floatVal + (intVal2 - color.getGreen()) * value); + floatVal = color.getBlue(); + intVal2 = color2.getBlue(); + int intVal4 = (int)(floatVal + (intVal2 - color.getBlue()) * value); + floatVal = color.getAlpha(); + intVal2 = color2.getAlpha(); + int intVal5 = (int)(floatVal + (intVal2 - color.getAlpha()) * value); + + try { + Color awtColor = new Color(intVal, intVal3, intVal4, intVal5); + return awtColor.getRGB(); + } catch (Exception ex) { + return -1; + } +} + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + double doubleVal = 0.0; + float floatVal = 0.0F; + java.lang.String textStr; + int intVal; + cc.novoline.gui.screen.login.GuiLogin guiLogin; + int intVal2; + cc.novoline.gui.screen.login.GuiLogin guiLogin2; + int intVal3; + float floatVal2; + int intVal4; + cc.novoline.gui.screen.login.GuiLogin guiLogin3; + boolean flag; + cc.novoline.gui.screen.login.GuiLogin guiLogin4; + int intVal5; + cc.novoline.gui.screen.login.GuiLogin guiLogin5; + label442: { + label445: { + byte byteVal2 = (byte)(this.stateFlag4 ? 1 : 0); + + if (!this.stateFlag4) { + break label445; + } + + GlStateManager.disableCull(); + GlslBackgroundShader glslBackgroundShader = this.glslBackgroundShaderField; + int intVal8 = this.width * 2; + int intVal9 = this.height * 2; + float floatVal3 = mouseX; + float floatVal4 = mouseY; + float floatVal7 = (float)(System.currentTimeMillis() - this.lastTimestamp) / 1000.0F; + glslBackgroundShader.renderVisual(intVal8, intVal9, floatVal3, floatVal4, floatVal7); + GL11.glBegin(7); + GL11.glVertex2f(-1.0F, -1.0F); + GL11.glVertex2f(-1.0F, 1.0F); + GL11.glVertex2f(1.0F, 1.0F); + GL11.glVertex2f(1.0F, -1.0F); + GL11.glEnd(); + byteVal2 = 0; + + + GL20.glUseProgram(byteVal2); + + break label442; + + + } + + Color awtColor = Color.BLACK; + int color3 = awtColor.getRGB(); + RenderUtils.drawRect(0.0F, 0.0F, 9999.0F, 9999.0F, color3); + } + + label432: { + GuiLogin guiLogin6; + + short shortVal; + intVal = mouseX; + shortVal = 20; + + if (mouseX <= 20) { + intVal = mouseY; + shortVal = 20; + + if (mouseY <= 20) { + intVal = this.intValue; + shortVal = 255; + + if (this.intValue < 255) { + this.intValue++; + + break label432; + + } + } + } + + guiLogin6 = this; + + intVal = this.intValue; + shortVal = 100; + + if (intVal <= shortVal) { + break label432; + } + + guiLogin6 = this; + + guiLogin6.intValue--; + } + + AltActionButton altActionButton; + int color; + label412: { + new Color(-723464); + Color awtColor2 = Color.WHITE; + new Color(150, 150, 150); + altActionButton = this.altActionButtonField; + GuiLogin guiLogin7 = this; + + if (this.altActionButtonField.applyUpdate(mouseX, mouseY)) { + Color awtColor3 = this.accentColor; + Color awtColor4 = awtColor3.darker(); + color = awtColor4.getRGB(); + break label412; + } + + guiLogin7 = this; + + + Color awtColor5 = guiLogin7.accentColor; + color = awtColor5.getRGB(); + } + + int scaledHeight; + + int scaledWidth; + label404: { + altActionButton.applyUpdate2(color); + ScaledResolution scaledRes = new ScaledResolution(this.minecraft2); + this.altActionButtonField.applyUpdate(this.floatValue - 70.0F, this.cachedAngle2 + 5.0F); + this.altToastNotification.createString(this.floatValue - 70.0F, this.cachedAngle2 - 34.5F); + scaledWidth = scaledRes.getScaledWidth(); + scaledHeight = scaledRes.getScaledHeight(); + Novoline novolineInst = Novoline.getInstance(); + byte byteVal = (byte)(novolineInst.isUninitialized() ? 1 : 0); + + if (byteVal != 0) { + this.cachedAngle2 = this.cachedAngle2 + (scaledHeight / 2 - this.cachedAngle2) * 0.02F; + + break label404; + + } + + this.cachedAngle2 = this.cachedAngle2 + (scaledHeight + 100 - this.cachedAngle2) * 0.02F; + + if (scaledHeight + 100 - this.cachedAngle2 < 1.0F) { + Initializer.d().a(); + } + } + + guiLogin = this; + + this.floatValue = scaledWidth / 2; + + Novoline novolineInst2 = Novoline.getInstance(); + if (novolineInst2.getProtectionSession2() != null) { + this.cachedValue = this.cachedValue + (ProtectionSession.N - this.cachedValue) * 0.05; + this.resolveInt2(this.cachedValue, 160.0F, 110.0F); + } + + guiLogin = this; + + label391: { + + label453: { + + label386: { + + String textStr2 = guiLogin.textValue; + if (!textStr2.startsWith("Idle")) { + guiLogin = this; + + String textStr3 = this.textValue; + if (!textStr3.startsWith("Initializing")) { + String textStr4 = this.textValue; + intVal2 = (textStr4.startsWith("Logging") ? 1 : 0); + + if (intVal2 == 0) { + break label386; + } + } + } + + guiLogin = this; + + guiLogin.x = 0.0F; + + break label453; + + } + + if (this.x < 1.0F) { + float floatVal10 = (float)(this.x + (1.0F - this.x) * 0.015); + this.x = Math.min(1.0F, floatVal10); + } + } + + guiLogin2 = this; + + intVal2 = (this.textValue.equals("Success") ? 1 : 0); + + if (intVal2 != 0) { + this.accentColor4 = new Color(this.resolveInt2(this.accentColor, new Color(172, 82, 220), this.x)); + + break label391; + + } + + guiLogin2 = this; + + guiLogin2.accentColor4 = new Color(this.resolveInt2(this.accentColor, new Color(208, 0, 0), this.x)); + } + + label360: { + label454: { + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal2 = this.floatValue - 80.0F; + double doubleVal14 = this.cachedAngle2 - 68.0F; + Color awtColor17 = new Color(24, 24, 24, 255); + roundedTextureShader.drawRoundedRect(doubleVal2, doubleVal14, 160.0, 110.0, 15.0, 3.0, awtColor17, false); + RoundedTextureShader roundedTextureShader2 = RoundedTextureShader.getInstance(); + double doubleVal3 = this.floatValue - 15.0F; + doubleVal14 = this.cachedAngle2 - 93.0F; + awtColor17 = new Color(20, 20, 20); + roundedTextureShader2.drawRoundedRect(doubleVal3, doubleVal14, 30.0, 30.0, 30.0, 3.0, awtColor17, false); + FontFamily fontFam = FontFamilyICONFONT.FAMILY; + FontRenderer font = fontFam.ofSize(40); + String textStr5 = "L"; + float floatVal5 = this.floatValue; + doubleVal14 = floatVal5 - font.stringWidth("L") / 2; + float floatVal6 = this.cachedAngle2 - 93.0F + 15.0F; + double doubleVal15 = floatVal6 - font.getHeight() / 2; + Color awtColor6 = this.accentColor4; + int color4 = awtColor6.getRGB(); + font.drawString(textStr5, doubleVal14, doubleVal15, color4, 3.0F); + FontFamily fontFam2 = FontFamilyOXIDE.FAMILY; + FontRenderer font2 = fontFam2.ofSize(35); + String textStr6 = "NOVOLINE"; + doubleVal14 = this.floatValue - 70.0F; + double doubleVal16 = this.cachedAngle2 - 55.0F; + Color awtColor7 = this.accentColor3; + int color5 = awtColor7.getRGB(); + font2.drawString(textStr6, doubleVal14, doubleVal16, color5, 3.0F); + if (mouseX < (this.floatValue + 57.0F)) { + break label454; + } + + float floatVal8 = mouseX; + float floatVal9 = this.floatValue + 57.0F; + FontRenderer font3 = this.fontRendererField; + String textStr7 = "M"; + if (floatVal8 > (floatVal9 + font3.stringWidth(textStr7))) { + break label454; + } + + if (mouseY < (this.cachedAngle2 - 60.0F)) { + break label454; + } + + float floatVal12 = mouseY; + float floatVal13 = this.cachedAngle2 - 60.0F; + FontRenderer font4 = this.fontRendererField; + if (floatVal12 <= (floatVal13 + font4.getHeight())) { + intVal3 = 1; + break label360; + } + } + + intVal3 = 0; + } + + int intVal6; + + label455: { + intVal6 = intVal3; + int intVal7 = (this.stateFlag ? 1 : 0); + + if (this.stateFlag) { + doubleVal = this.cachedAngle; + + if (!(doubleVal > 0.8)) { + break label455; + } + + double doubleVal17 = this.cachedAngle + (0.8 - this.cachedAngle) * 0.05; + this.cachedAngle = (float)Math.max(0.8, doubleVal17); + doubleVal = this.cachedAngle - 0.8; + + if (!(doubleVal < 0.05)) { + break label455; + } + + this.stateFlag = false; + + break label455; + + } + + intVal7 = intVal6; + + + + if (intVal7 != 0) { + doubleVal = this.cachedAngle; + + if (!(doubleVal < 1.3)) { + break label455; + } + + double doubleVal18 = this.cachedAngle + (1.3 - this.cachedAngle) * 0.05; + this.cachedAngle = (float)Math.min(1.3, doubleVal18); + + break label455; + + } + + if (this.cachedAngle > 1.0F) { + double doubleVal19 = this.cachedAngle + (1.0F - this.cachedAngle) * 0.05; + this.cachedAngle = (float)Math.max(1.0, doubleVal19); + + break label455; + + } + + floatVal2 = this.cachedAngle; + floatVal = 1.0F; + + if (this.cachedAngle < 1.0F) { + double doubleVal20 = this.cachedAngle + (1.0F - this.cachedAngle) * 0.05; + this.cachedAngle = (float)Math.min(1.0, doubleVal20); + } + } + + GL11.glPushMatrix(); + floatVal2 = this.floatValue + 55.0F; + FontRenderer font5 = this.fontRendererField; + floatVal = font5.stringWidth("M") / 2; + + doubleVal = floatVal2 + floatVal; + + double doubleVal4 = doubleVal; + float floatVal17 = this.cachedAngle2 - 57.0F; + FontRenderer font6 = this.fontRendererField; + double doubleVal21 = floatVal17 + font6.getHeight() / 2; + GL11.glTranslated(doubleVal4, doubleVal21, 0.0); + float floatVal18 = this.cachedAngle; + float floatVal11 = this.cachedAngle; + GL11.glScalef(floatVal18, floatVal11, 1.0F); + double doubleVal5 = -doubleVal4; + double doubleVal22 = -doubleVal21; + GL11.glTranslated(doubleVal5, doubleVal22, 0.0); + FontRenderer font7 = this.fontRendererField; + String textStr8 = "M"; + double doubleVal23 = this.floatValue + 55.0F; + double doubleVal24 = this.cachedAngle2 - 57.0F; + int intVal10 = intVal6; + + if (intVal6 != 0) { + Color awtColor8 = this.accentColor3; + Color awtColor9 = awtColor8.darker(); + intVal10 = awtColor9.getRGB(); + } else { + Color awtColor10 = this.accentColor; + intVal10 = awtColor10.getRGB(); + } + + + label459: { + font7.drawString(textStr8, doubleVal23, doubleVal24, intVal10, 3.0F); + GL11.glPopMatrix(); + intVal4 = (this.stateFlag7 ? 1 : 0); + + if (this.stateFlag7) { + if (this.cachedAngle3 >= 1.2) { + break label459; + } + + doubleVal23 = this.cachedAngle3 + (1.2 - this.cachedAngle3) * 0.05; + this.cachedAngle3 = (float)Math.min(1.2, doubleVal23); + if (1.2 - this.cachedAngle3 >= 0.05) { + break label459; + } + + if (this.cachedAngle - 1.0F >= 0.01) { + break label459; + } + + this.stateFlag7 = false; + + break label459; + + } + + if (this.cachedAngle3 > 0.0F) { + this.cachedAngle3 = (float)(this.cachedAngle3 + -this.cachedAngle3 * 0.1); + } + } + + double doubleVal6; + intVal4 = (doubleVal6 = this.cachedAngle3 - 0.1) == 0.0 ? 0 : (doubleVal6 < 0.0 ? -1 : 1); + + label461: { + label277: { + + label274: { + + + if (intVal4 > 0) { + FontFamily fontFam3 = FontFamilyPOSTERAMA.FAMILY; + FontRenderer font8 = fontFam3.ofSize(17); + RoundedTextureShader roundedTextureShader3 = RoundedTextureShader.getInstance(); + double doubleVal7 = mouseX - font8.stringWidth("Copied!") / 2 - 2; + FontRenderer font9 = this.fontRendererField; + doubleVal23 = mouseY - font9.getHeight() - 10; + doubleVal24 = font8.stringWidth("Copied!") + 4; + FontRenderer font10 = this.fontRendererField; + roundedTextureShader3.applyUpdate2(doubleVal7, doubleVal23, doubleVal24, font10.getHeight(), 8.0, 2.0, new Color(25, 25, 25, 255), this.cachedAngle3, false); + GL11.glPushMatrix(); + FontRenderer font11 = this.fontRendererField; + int height = mouseY - font11.getHeight() - 5; + FontRenderer font12 = this.fontRendererField; + double doubleVal25 = height + font12.getHeight() / 2; + double doubleVal8 = mouseX; + GL11.glTranslated(doubleVal8, doubleVal25, 0.0); + float floatVal20 = this.cachedAngle3; + float floatVal14 = this.cachedAngle3; + GL11.glScalef(floatVal20, floatVal14, 0.0F); + double doubleVal9 = -mouseX; + double doubleVal26 = -doubleVal25; + GL11.glTranslated(doubleVal9, doubleVal26, 0.0); + String textStr9 = "Copied!"; + doubleVal23 = mouseX - font8.stringWidth("Copied!") / 2; + FontRenderer font13 = this.fontRendererField; + doubleVal24 = mouseY - font13.getHeight() - 5; + Color awtColor11 = this.accentColor; + intVal10 = awtColor11.getRGB(); + font8.drawString(textStr9, doubleVal23, doubleVal24, intVal10, 1.0F); + GL11.glPopMatrix(); + } + + this.altToastNotification.renderPanel(); + this.altActionButtonField.renderPanel(this.minecraft2, mouseX, mouseY, 12.0F); + guiLogin3 = this; + + String textStr10 = this.textValue; + intVal4 = (textStr10.startsWith("Idle") ? 1 : 0); + + + if (intVal4 == 0) { + guiLogin3 = this; + + String textStr11 = this.textValue; + if (!textStr11.startsWith("Initializing")) { + String textStr12 = this.textValue; + flag = textStr12.startsWith("Logging"); + + if (!flag) { + break label274; + } + } + } + + guiLogin3 = this; + + guiLogin3.z = this.z + (0.0F - this.z) * 0.01F; + + break label461; + + } + + guiLogin4 = this; + + flag = this.textValue.equals("Success"); + + if (flag) { + StringBuilder sb2 = new StringBuilder().append("Logged in as "); + String textStr13 = ProtectionSession.o; + textStr = sb2.append(textStr13).toString(); + break label277; + } + + guiLogin4 = this; + + textStr = guiLogin4.textValue; + } + + String textStr14; + label247: { + textStr14 = textStr; + boolean flag3 = this.stateFlag3; + + if (this.stateFlag3) { + this.z = this.z + (10.0F - this.z) * 0.01F; + + break label247; + + } + + Novoline novolineInst3 = Novoline.getInstance(); + flag3 = novolineInst3.isUninitialized(); + + + if (!flag3) { + this.z = this.z + (-20.0F - this.z) * 0.1F; + } + } + + FontFamily fontFam4 = FontFamilyPOSTERAMA.FAMILY; + FontRenderer font14 = fontFam4.ofSize(18); + RoundedTextureShader roundedTextureShader4 = RoundedTextureShader.getInstance(); + float floatVal21 = this.floatValue; + double doubleVal10 = floatVal21 - font14.stringWidth(textStr14) / 2 - 10.0F; + doubleVal23 = this.z; + doubleVal24 = (font14.stringWidth(textStr14) / 2 + 10) * 2; + int color2 = this.accentColor.getRGB(); + Color awtColor12 = this.accentColor; + awtColor12 = awtColor12.darker(); + awtColor12 = awtColor12.darker(); + int color6 = awtColor12.getRGB(); + long timeMs = Minecraft.getSystemTime(); + Color awtColor18 = new Color(ColorTheme.evaluateInt3(color2, color6, timeMs)); + roundedTextureShader4.drawRoundedRect(doubleVal10, doubleVal23, doubleVal24, 15.0, 7.0, 2.0, awtColor18, false); + RoundedTextureShader roundedTextureShader5 = RoundedTextureShader.getInstance(); + float floatVal22 = this.floatValue; + double doubleVal11 = floatVal22 - font14.stringWidth(textStr14) / 2 - 10.5F; + doubleVal23 = this.z + 5.0F; + doubleVal24 = (font14.stringWidth(textStr14) / 2 + 10) * 2 + 1.0F; + awtColor18 = new Color(24, 24, 24); + roundedTextureShader5.drawRoundedRect(doubleVal11, doubleVal23, doubleVal24, 13.0, 5.0, 3.0, awtColor18, false); + float floatVal23 = this.floatValue; + doubleVal23 = floatVal23 - font14.stringWidth(textStr14) / 2; + float floatVal24 = this.z + 11.0F; + doubleVal24 = floatVal24 - font14.getHeight() / 2; + Color awtColor13 = this.accentColor; + Color awtColor14 = awtColor13.brighter(); + Color awtColor15 = awtColor14.brighter(); + intVal10 = awtColor15.getRGB(); + font14.drawString(textStr14, doubleVal23, doubleVal24, intVal10, true); + } + + + FontRenderer font15 = FontSF_REGULAR_Holder.FONT; + String textStr15 = "made by gast and tasteful"; + float floatVal25 = this.floatValue; + FontRenderer font16 = FontSF_REGULAR_Holder.FONT; + float floatVal15 = floatVal25 - font16.stringWidth("made by gast and tasteful") / 2; + FontRenderer font17 = FontSF_REGULAR_Holder.FONT; + float floatVal16 = scaledHeight - font17.getHeight() - 4; + Color awtColor16 = new Color(150, 150, 150); + intVal10 = awtColor16.getRGB(); + font15.drawString(textStr15, floatVal15, floatVal16, intVal10); + intVal5 = (this.stateFlag3 ? 1 : 0); + + if (this.stateFlag3) { + this.textValue = "Success"; + if (System.currentTimeMillis() - this.lastTimestamp2 - 250L > 0L) { + double doubleVal12; + intVal5 = (doubleVal12 = this.cachedValue - 99.0) == 0.0 ? 0 : (doubleVal12 < 0.0 ? -1 : 1); + + + if (intVal5 > 0) { + double doubleVal13; + intVal5 = (doubleVal13 = this.x - 0.98) == 0.0 ? 0 : (doubleVal13 < 0.0 ? -1 : 1); + + + if (intVal5 > 0) { + Initializer.d().b(this.cachedText); + this.stateFlag3 = false; + } + } + } + } + + guiLogin5 = this; + + + intVal5 = (this.stateFlag6 ? 1 : 0); + + + if (intVal5 != 0) { + ScaledResolution scaledRes2 = new ScaledResolution(this.minecraft2); + color = scaledRes2.getScaledWidth() / 2; + this.mouseClicked(color, scaledRes2.getScaledHeight() / 2 + 20, 0); + this.stateFlag6 = false; + } + + guiLogin5 = this; + + + super.drawScreen(mouseX, mouseY, partialTicks); +} + + @Override + public void keyTyped(char typedChar, int keyCode) throws IOException { + int intVal = (this.altToastNotification.getStateFlag() ? 1 : 0); + if (intVal != 0) { + this.altToastNotification.createString(typedChar, keyCode); + this.minecraft2.textValue4 = this.altToastNotification.getCachedText(); + } + + intVal = keyCode; + + byte byteVal = 1; + if (intVal == 1) { + this.initGui(); + } + + intVal = keyCode; + + if (intVal == 64) { + Minecraft mcClient = this.minecraft2; + mcClient.displayGuiScreen(this); + } +} + + private void updateTextValueState() { + try { + this.textValue = "Initializing"; + Novoline novolineInst = Novoline.getInstance(); + ProtectionSession protectionSession = new ProtectionSession(this, true, true); + novolineInst.applyUpdate(protectionSession); + this.textValue = "Logging in"; + novolineInst = Novoline.getInstance(); + ProtectionSession protectionSession2 = novolineInst.getProtectionSession2(); + String textStr = this.altToastNotification.getCachedText(); + protectionSession2.d(textStr); + Minecraft mcClient = this.minecraft2; + SoundHandler soundHandler = mcClient.getSoundHandler(); + SoundSupport soundSupport = SoundSupport.resolveSoundSupport3(new ResourceLocation("random.orb"), 1.0F); + soundHandler.playSound(soundSupport); + } catch (Throwable ex) { + ex.printStackTrace(); + String msgText = ex.getMessage(); + if (msgText.contains("ConcurrentModificationException")) { + this.stateFlag6 = true; + } + + this.stateFlag5 = false; + this.textValue = ex.getMessage(); + + Minecraft mcClient2 = this.minecraft2; + SoundHandler soundHandler2 = mcClient2.getSoundHandler(); + SoundSupport soundSupport2 = SoundSupport.resolveSoundSupport3(new ResourceLocation("random.orb"), -1.0F); + soundHandler2.playSound(soundSupport2); + } +} + + public GuiLogin(Minecraft minecraft) { + java.lang.Object obj = null; + boolean flag3 = AltToastNotification.c(); + this.stateFlag8 = false; + this.cachedText = null; + this.intValue = 0; + this.lastTimestamp = System.currentTimeMillis(); + this.accentColor2 = new Color(20, 23, 26); + this.accentColor3 = new Color(0, 150, 255, 200); + this.accentColor = new Color(0, 100, 200, 255); + this.accentColor4 = this.accentColor; + StringBuilder sb = new StringBuilder(); + Novoline novolineInst = Novoline.getInstance(); + String pathStr = novolineInst.getDataFolderString(); + sb = sb.append(pathStr); + this.cachedText2 = sb.append("shader_properties.novo").toString(); + this.cachedAngle2 = 540.0F; + this.floatValue = 960.0F; + this.z = 0.0F; + boolean flag = flag3; + this.cachedAngle = 1.0F; + this.cachedAngle3 = 0.0F; + this.cachedValue = 0.0; + this.fontRendererField = FontFamilyIconFontAlt.FAMILY.ofSize(35); + this.altActionButtonField = new AltActionButton((int)this.floatValue - 70, (int)(this.cachedAngle2 + 5.0F), 140, 25, "Log In"); + this.clipboardField = Toolkit.getDefaultToolkit().getSystemClipboard(); + Novoline novolineInst2 = Novoline.getInstance(); + Path filePath = Paths.get(novolineInst2.getDataFolderString()); + LinkOption[] linkOptionArr = new LinkOption[0]; + boolean flag2 = Files.exists(filePath, linkOptionArr); + if (!flag2) { + try { + Novoline novolineInst3 = Novoline.getInstance(); + Path filePath2 = Paths.get(novolineInst3.getDataFolderString()); + FileAttribute[] fileAttributeArr = new FileAttribute[0]; + Files.createDirectory(filePath2, fileAttributeArr); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + + Path filePath3 = Paths.get(this.cachedText2); + LinkOption[] linkOptionArr2 = new LinkOption[0]; + flag2 = Files.exists(filePath3, linkOptionArr2); + + label79: { + label80: { + label81: { + if (!flag2) { + try { + FileWriter fileWriter = new FileWriter(this.cachedText2); + fileWriter.append("loginMenu: true \n"); + fileWriter.append("mainMenu: true \n"); + fileWriter.append("altRepository: true \n"); + fileWriter.append("multiplayer: true \n"); + fileWriter.close(); + this.stateFlag4 = true; + break label81; + } catch (IOException ex2) { + ex2.printStackTrace(); + if (flag) { + break label81; + } + } + } + + Scanner scanner = null; + + try { + scanner = new Scanner(Paths.get(this.cachedText2)); + + while (scanner.hasNextLine()) { + String lineStr = scanner.nextLine(); + flag3 = lineStr.startsWith("loginMenu: "); + if (!flag) { + break label80; + } + + if (flag3) { + String textStr = lineStr.split("loginMenu: ")[1]; + String textStr2 = textStr.replace(" ", ""); + this.stateFlag4 = Boolean.parseBoolean(textStr2); + } + + if (!flag) { + break; + } + } + } catch (IOException ex3) { + ex3.printStackTrace(); + } + } + + this.textValue = "Idle"; + obj = this; + if (!flag) { + break label79; + } + + flag3 = this.stateFlag4; + } + + if (!flag3) { + return; + } + + try { + GuiLogin.$keepCatch(); + obj = this; + } catch (IOException ex4) { + throw new IllegalStateException("Failed to load backgound shader", ex4); + } + } + + try { + ((GuiLogin)obj).glslBackgroundShaderField = new GlslBackgroundShader("/assets/minecraft/shaders/program/novoline_menu.fsh"); + } catch (IOException ex5) { + throw new IllegalStateException("Failed to load backgound shader", ex5); + } + + this.lastTimestamp = System.currentTimeMillis(); +} + + @Override + public void initGui() { + Display.setTitle("Novoline - Not logged in"); + this.intValue = 100; + this.altToastNotification = new AltToastNotification(this, this.floatValue - 70.0F, this.cachedAngle2 - 35.0F, 140.0, 30.0); + GuiLogin guiLogin = this; + String textStr = this.minecraft2.textValue4; + if (!textStr.isEmpty()) { + AltToastNotification.createString(this.altToastNotification, this.minecraft2.textValue4); + } + + this.stateFlag8 = true; + this.cachedValue = 0.0; + guiLogin = this; + + super.initGui(); +} + + public long getLastTimestamp() { + return this.lastTimestamp; +} + + + + public GlslBackgroundShader getGlslBackgroundShaderField() { + return this.glslBackgroundShaderField; +} + + @Override + public void d(String text) { + this.stateFlag3 = true; + this.lastTimestamp2 = System.currentTimeMillis(); + this.cachedText = text; +} + + @Override + public void mouseClicked(int mouseX, int mouseY, int mouseButton) { + int intVal2; + label100: { + label103: { + if (mouseX < (this.floatValue + 57.0F)) { + break label103; + } + + float floatVal2 = mouseX; + float floatVal = this.floatValue + 57.0F; + FontRenderer font = this.fontRendererField; + if (floatVal2 > (floatVal + font.stringWidth("M"))) { + break label103; + } + + if (mouseY < (this.cachedAngle2 - 60.0F)) { + break label103; + } + + float floatVal5 = mouseY; + float floatVal6 = this.cachedAngle2 - 60.0F; + FontRenderer font2 = this.fontRendererField; + if (floatVal5 <= (floatVal6 + font2.getHeight())) { + intVal2 = 1; + break label100; + } + } + + intVal2 = 0; + } + + int intVal = intVal2; + intVal2 = intVal; + + if (intVal != 0) { + intVal2 = mouseButton; + + if (mouseButton == 0) { + StringSelection stringSelection = new StringSelection(ProtectionSession.D.toString()); + Clipboard clipboard = this.clipboardField; + clipboard.setContents(stringSelection, stringSelection); + this.stateFlag = true; + this.stateFlag7 = true; + } + } + + intVal2 = (this.altActionButtonField.applyUpdate(mouseX, mouseY) ? 1 : 0); + + if (intVal2 != 0) { + intVal2 = mouseButton; + + if (mouseButton == 0) { + intVal2 = (this.stateFlag5 ? 1 : 0); + + if (!this.stateFlag5) { + AltToastNotification.createString(this.altToastNotification, false); + this.altActionButtonField.performAction(); + this.stateFlag5 = true; + Thread thread = new Thread(this::updateTextValueState, "SAL Authentication Thread"); + thread.start(); + } + } + } + + intVal2 = (this.altToastNotification.createString(mouseX, mouseY) ? 1 : 0); + + + if (intVal2 != 0) { + if (mouseButton != 0) { + return; + } + + this.altToastNotification.renderPanel2(mouseX, mouseY); + + return; + + } + + AltToastNotification.createString(this.altToastNotification, false); + +} + + private void resolveInt2(double value, float amount, float factor) { + cc.novoline.utils.shader.RoundedTextureShader roundedTextureShader; + float floatVal; + int intVal; + double doubleVal = (amount + factor) * 2.0F; + double doubleVal2 = doubleVal / (amount / 2.0F); + double doubleVal8 = doubleVal * (value / 100.0); + RoundedTextureShader roundedTextureShader2 = RoundedTextureShader.getInstance(); + double doubleVal9 = this.floatValue; + double doubleVal10 = this.cachedAngle2 - 69.5F; + double doubleVal11 = amount / 2.0F + 1.0F; + doubleVal11 = (float)Math.min(doubleVal11, doubleVal8); + roundedTextureShader2.drawRoundedRect(doubleVal9, doubleVal10, doubleVal11, 10.0, 15.0, 2.0, this.accentColor4, false); + double doubleVal12 = doubleVal8 - (amount / 2.0F + 1.0F); + double doubleVal3; + int intVal2 = (doubleVal3 = value - amount / 2.0F / doubleVal) == 0.0 ? 0 : (doubleVal3 < 0.0 ? -1 : 1); + if (intVal2 <= 0) { + return; + } + + RoundedTextureShader roundedTextureShader3 = RoundedTextureShader.getInstance(); + double doubleVal4 = this.floatValue + 70.0F; + doubleVal9 = this.cachedAngle2 - 69.0F + 1.0F; + doubleVal11 = (float)Math.min(111.0, doubleVal12); + roundedTextureShader3.drawRoundedRect(doubleVal4, doubleVal9, 11.5, doubleVal11, 15.0, 2.0, this.accentColor4, false); + doubleVal12 -= 111.0; + if (value <= (amount / 2.0F + 1.0F + 111.0F) / doubleVal) { + return; + } + + RoundedTextureShader roundedTextureShader4 = RoundedTextureShader.getInstance(); + double doubleVal5 = this.floatValue + 80.0F; + doubleVal10 = amount + 1.5; + double doubleVal6 = (float)(doubleVal5 - Math.min(doubleVal12, doubleVal10)); + doubleVal9 = this.cachedAngle2 + 34.0F; + doubleVal11 = amount + 1.5; + doubleVal10 = (float)Math.min(doubleVal12, doubleVal11); + Color awtColor = this.accentColor4; + roundedTextureShader4.drawRoundedRect(doubleVal6, doubleVal9, doubleVal10, 10.0, 15.0, 2.0, awtColor, false); + doubleVal12 -= amount; + double doubleVal7; + intVal2 = (doubleVal7 = value - (amount / 2.0F + 1.0F + 111.0F + amount) / doubleVal) == 0.0 ? 0 : (doubleVal7 < 0.0 ? -1 : 1); + + Color awtColor2; + double doubleVal13; + double doubleVal14; + if (intVal2 <= 0) { + return; + } + + roundedTextureShader = RoundedTextureShader.getInstance(); + floatVal = this.floatValue - 81.5F; + doubleVal9 = this.cachedAngle2 + 43.5; + doubleVal9 = (float)(doubleVal9 - Math.min(112.0, doubleVal12)); + doubleVal10 = 5.0; + doubleVal11 = (float)Math.min(112.0, doubleVal12); + doubleVal13 = 15.0; + doubleVal14 = 2.0; + awtColor2 = this.accentColor4; + intVal = 0; + + roundedTextureShader.drawRoundedRect(floatVal, doubleVal9, 5.0, doubleVal11, 15.0, 2.0, awtColor2, false); + doubleVal12 -= 111.0; + if (value <= (amount / 2.0F + 1.0F + 111.0F + amount + 111.0F) / doubleVal) { + return; + } + + roundedTextureShader = RoundedTextureShader.getInstance(); + floatVal = this.floatValue - amount / 2.0F; + doubleVal9 = this.cachedAngle2 - 69.5F; + doubleVal10 = amount / 2.0F + 1.0F; + doubleVal10 = (float)Math.min(doubleVal10, doubleVal12); + awtColor2 = this.accentColor4; + intVal = 0; + + roundedTextureShader.drawRoundedRect(floatVal, doubleVal9, doubleVal10, 10.0, 15.0, 2.0, awtColor2, (boolean)((intVal) != 0)); +} + private static void $keepCatch() throws stateFlag {} +} diff --git a/src/main/java/cc/novoline/gui/screen/setting/ColorChannel.java b/src/main/java/cc/novoline/gui/screen/setting/ColorChannel.java new file mode 100644 index 0000000..9adff74 --- /dev/null +++ b/src/main/java/cc/novoline/gui/screen/setting/ColorChannel.java @@ -0,0 +1,9 @@ +package cc.novoline.gui.screen.setting; + +public enum ColorChannel { + HUE, + SATURATION, + BRIGHTNESS; + + private static final ColorChannel[] colorChannelArray = new ColorChannel[]{ColorChannel.HUE, SATURATION, BRIGHTNESS}; +} diff --git a/src/main/java/cc/novoline/gui/screen/setting/Setting.java b/src/main/java/cc/novoline/gui/screen/setting/Setting.java new file mode 100644 index 0000000..45e7f35 --- /dev/null +++ b/src/main/java/cc/novoline/gui/screen/setting/Setting.java @@ -0,0 +1,2535 @@ +package cc.novoline.gui.screen.setting; + +import cc.novoline.Novoline; +import cc.novoline.events.EventManager; +import cc.novoline.events.events.SettingEvent; +import cc.novoline.gui.click.ColorChannelSwitchMap; +import cc.novoline.gui.screen.click.DiscordGUI; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.configurations.property.AbstractNumberProperty; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.FloatProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.KeyBindProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.LongProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.visual.ClickGui; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.Timer; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontCustom_12; +import cc.novoline.utils.fonts.holders.FontCustom_16; +import cc.novoline.utils.fonts.holders.FontCustom_17; +import cc.novoline.modules.ModuleRegistry; +import java.awt.Color; +import java.math.RoundingMode; +import java.text.DecimalFormat; +import java.util.Arrays; +import java.util.Collection; +import java.util.EnumSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.function.Consumer; +import java.util.function.Predicate; +import java.util.function.Supplier; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import net.minecraft.util.MathHelper; +import net.minecraft.client.gui.GuiScreen; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.lwjgl.input.Keyboard; + +public class Setting { + private AbstractNumberProperty abstractNumberPropertyField; + private boolean stateFlag; + private Consumer consumerField; + private int stateTicks; + private ColorChannel colorChannelField; + private float cachedAngle; + private TimerUtil timer; + private double cachedValue; + private boolean flagValue; + private Set entrySet; + private int stateTicks2; + private ColorProperty colorPropertyField; + private boolean stateFlag2; + private final TimerUtil timerUtilField; + private final TimerUtil timer2; + private BooleanProperty booleanPropertyField; + private ListProperty listPropertyField; + private String cachedText; + private boolean flagValueField; + private Supplier supplierField; + private StringProperty stringPropertyField; + private List settingList; + private final String cachedText2; + private int stateTicks3; + private float cachedAngle2; + private long lastTimestamp; + private Consumer consumerField2; + private final String cachedText3; + private final DecimalFormat numberFormat; + private final SettingType settingTypeField; + private KeyBindProperty keyBindPropertyField; + private final AbstractModule abstractModuleField; + private int stateTicks4; +private boolean stateFlag3; + private final double cachedValue2; + private float cachedAngle3; + private int stateTicks5; + private String textValue; + private Timer msTimer = new Timer(); + private StringProperty stringPropertyField2; + private GuiScreen guiScreenField; + + public void mouseClickedPanel(int value, int index, int count) { + this.flagValue = false; +} + + public String getCachedText3() { + return this.cachedText3; +} + + public double getCachedValue() { + return this.cachedValue; +} + + private boolean isHoveredAt(int value, int index) { + int[] intArr = SettingType.b(); + int intVal4 = ColorChannelSwitchMap.SWITCH_MAP2[this.settingTypeField.ordinal()]; + switch (intVal4) { + case 2: + case 3: + case 6: + case 7: + int intVal = value; + int ticks = this.stateTicks2 - 70; + if (value < ticks) { + return false; + } + + intVal = value; + ticks = this.stateTicks2; + + if (intVal > ticks) { + return false; + } + + intVal = index; + ticks = this.stateTicks - 2; + + if (intVal < ticks) { + return false; + } + + intVal = index; + + ticks = this.stateTicks + 8; + + if (intVal <= ticks) { + return true; + } + + return false; + case 4: + int intVal2 = value; + int ticks2 = this.stateTicks2 - 10; + if (value < ticks2) { + return false; + } + + intVal2 = value; + ticks2 = this.stateTicks2; + + if (intVal2 > ticks2) { + return false; + } + + intVal2 = index; + ticks2 = this.stateTicks - 2; + + if (intVal2 < ticks2) { + return false; + } + + intVal2 = index; + + ticks2 = this.stateTicks + 8; + + if (intVal2 <= ticks2) { + return true; + } + + return false; + case 5: + int intVal3 = value; + if (value < this.stateTicks2 - 70) { + return false; + } + + if (value > (this.stateTicks2 - 70 + 70.0)) { + return false; + } + + intVal3 = index; + + + int ticks3 = this.stateTicks + 2; + if (intArr == null) { + if (intVal3 < ticks3) { + return false; + } + + intVal3 = index; + + ticks3 = this.stateTicks + 8; + } + + if (intVal3 <= ticks3) { + return true; + } + + return false; + default: + intVal4 = 0; + } + + return ((((intVal4 & 1)) != 0)); +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, AbstractNumberProperty property, double value) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.abstractNumberPropertyField = property; + this.cachedValue = value; + this.textValue = ""; +} + + public void renderPanel(int value, int index) { + cc.novoline.utils.fonts.api.FontRenderer font; + cc.novoline.utils.fonts.api.FontRenderer font2; + java.lang.String textStr; + cc.novoline.utils.fonts.api.FontRenderer font3; + java.lang.String textStr2; + int intVal; + int[] intArr = SettingType.b(); + + try { + label421: { + byte byteVal; + int intVal11; + label451: { + label423: { + label424: { + byteVal = 0; + intVal11 = ModuleRegistry.CLICKGUI.obtainAbstractModule().getIntValue15(); + switch (ColorChannelSwitchMap.SWITCH_MAP2[this.settingTypeField.ordinal()]) { + case 1: + if (intArr == null) { + return; + } + case 2: + byte byteVal2 = (byte)(this.isHoveredAt(value, index) ? 1 : 0); + byte byteVal3 = byteVal2; + byteVal3 = (byte)(byteVal2 != 0 ? intVal11 : 1677721600); + + byte byteVal9 = byteVal3; + FontRenderer font4 = FontCustom_17.FONT; + CharSequence charSequence = this.cachedText2; + float floatVal20 = this.stateTicks5; + float floatVal21 = this.stateTicks; + font4.drawString(charSequence, floatVal20, floatVal21, -1); + float floatVal = this.stateTicks2 - 70; + float floatVal22 = this.stateTicks - 2; + floatVal20 = this.stateTicks2; + floatVal21 = this.stateTicks + 8; + + RenderUtils.drawBorderedRect(floatVal, floatVal22, floatVal20, floatVal21, 1.0F, byteVal9, (-13684945)); + FontRenderer font5 = FontCustom_16.FONT; + StringProperty strProp = this.stringPropertyField; + charSequence = strProp.get(); + floatVal20 = this.stateTicks2 - 35; + floatVal21 = this.stateTicks; + font5.drawCenteredString(charSequence, floatVal20, floatVal21, -1, false); + Setting setting = this; + if (!this.stateFlag) { + return; + } + + setting = this; + + StringProperty strProp2 = setting.stringPropertyField; + List itemList = strProp2.getAcceptableValues(); + float floatVal2 = this.stateTicks2 - 70; + float floatVal23 = this.stateTicks + 10; + floatVal20 = this.stateTicks2; + int ticks = this.stateTicks + 10; + floatVal21 = ticks + itemList.size() * 11; + int intVal12 = byteVal; + intVal12 = -13684945; + + RenderUtils.drawBorderedRect(floatVal2, floatVal23, floatVal20, floatVal21, 1.0F, 1677721600, intVal12); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + String textStr3 = (String)iter.next(); + + FontRenderer font6 = FontCustom_16.FONT; + floatVal20 = this.stateTicks2 - 35; + int ticks2 = this.stateTicks + 13; + floatVal21 = ticks2 + itemList.indexOf(textStr3) * 11; + String textStr14 = this.getTextValue(); + byte byteVal10 = (byte)(textStr14.equalsIgnoreCase(textStr3) ? 1 : 0); + byteVal10 = (byte)(byteVal10 != 0 ? intVal11 : -1); + + font6.drawCenteredString(textStr3, floatVal20, floatVal21, byteVal10, false); + } + + if (intArr == null) { + return; + } + case 3: + byte byteVal4 = (byte)(this.isHoveredAt(value, index) ? 1 : 0); + byte byteVal5 = byteVal4; + byteVal5 = (byte)(byteVal4 != 0 ? intVal11 : 1677721600); + + byte byteVal11 = byteVal5; + FontRenderer font7 = FontCustom_17.FONT; + CharSequence charSequence2 = this.cachedText2; + float floatVal24 = this.stateTicks5; + float floatVal25 = this.stateTicks; + font7.drawString(charSequence2, floatVal24, floatVal25, -1); + float floatVal3 = this.stateTicks2 - 70; + float floatVal26 = this.stateTicks - 2; + floatVal24 = this.stateTicks2; + floatVal25 = this.stateTicks + 8; + int intVal13 = byteVal; + intVal13 = -13684945; + + label426: { + label391: { + RenderUtils.drawBorderedRect(floatVal3, floatVal26, floatVal24, floatVal25, 1.0F, byteVal11, intVal13); + ListProperty listProp = this.listPropertyField; + if (!listProp.isEmpty()) { + break label391; + } + + FontRenderer font8 = FontCustom_16.FONT; + charSequence2 = "..."; + floatVal24 = this.stateTicks2 - 35; + floatVal25 = this.stateTicks; + font8.drawCenteredString(charSequence2, floatVal24, floatVal25, -1, false); + + + break label426; + + } + + label385: { + font = FontCustom_16.FONT; + Object obj = this.listPropertyField; + if (((ListProperty)obj).b() > 1) { + StringBuilder $sb100 = new StringBuilder(); + ListProperty listProp2 = this.listPropertyField; + List itemList2 = (List)listProp2.get(); + String textStr4 = (String)itemList2.get(0); + $sb100.append(textStr4); + charSequence2 = $sb100.append("...").toString(); + break label385; + } + + ListProperty listProp3 = this.listPropertyField; + List itemList3 = (List)listProp3.get(); + obj = itemList3.get(0); + + charSequence2 = (CharSequence)obj; + } + + floatVal24 = this.stateTicks2 - 35; + floatVal25 = this.stateTicks; + font.drawCenteredString(charSequence2, floatVal24, floatVal25, -1, false); + } + + Setting setting2 = this; + + if (!this.stateFlag) { + return; + } + + setting2 = this; + + + ListProperty listProp4 = setting2.listPropertyField; + List itemList4 = listProp4.getAcceptableValues(); + float floatVal4 = this.stateTicks2 - 70; + float floatVal27 = this.stateTicks + 10; + floatVal24 = this.stateTicks2; + int ticks3 = this.stateTicks + 10; + floatVal25 = ticks3 + itemList4.size() * 11; + int intVal14 = byteVal; + intVal14 = -13684945; + + RenderUtils.drawBorderedRect(floatVal4, floatVal27, floatVal24, floatVal25, 1.0F, 1677721600, intVal14); + Iterator iter2 = itemList4.iterator(); + + while (true) { + if (!iter2.hasNext()) { + break; + } + + String textStr5 = (String)iter2.next(); + + FontRenderer font9 = FontCustom_16.FONT; + floatVal24 = this.stateTicks2 - 35; + int ticks4 = this.stateTicks + 13; + floatVal25 = ticks4 + itemList4.indexOf(textStr5) * 11; + ListProperty listProp5 = this.listPropertyField; + byte byteVal12 = (byte)(listProp5.contains(textStr5) ? 1 : 0); + byteVal12 = (byte)(byteVal12 != 0 ? intVal11 : -1); + + font9.drawCenteredString(textStr5, floatVal24, floatVal25, byteVal12, false); + } + + if (intArr == null) { + return; + } + case 4: + break; + case 5: + break label424; + case 6: + break label423; + case 7: + break label451; + default: + break label421; + } + + float floatVal5 = this.stateTicks2 - 10; + float floatVal28 = this.stateTicks - 2; + float floatVal29 = this.stateTicks2; + float floatVal30 = this.stateTicks + 8; + int intVal15 = byteVal; + intVal15 = -13684945; + + RenderUtils.drawBorderedRect(floatVal5, floatVal28, floatVal29, floatVal30, 1.0F, 1677721600, intVal15); + BooleanProperty boolProp = this.booleanPropertyField; + Boolean propFlag = boolProp.get(); + if (propFlag) { + double doubleVal = this.stateTicks2 - 8; + double doubleVal9 = this.stateTicks + 2; + RenderUtils.drawElement9(doubleVal, doubleVal9, 2, intVal11); + } + + FontRenderer font10 = FontCustom_17.FONT; + String textStr6 = this.cachedText2; + floatVal29 = this.stateTicks5; + floatVal30 = this.stateTicks; + font10.drawString(textStr6, floatVal29, floatVal30, -1); + + + return; + + } + + double propDouble = (((Number)this.abstractNumberPropertyField.get()).doubleValue() - this.abstractNumberPropertyField.getMinimum().doubleValue()) / (this.abstractNumberPropertyField.getMaximum().doubleValue() - this.abstractNumberPropertyField.getMinimum().doubleValue()); + float floatVal6 = this.stateTicks2 - 70; + float floatVal31 = this.stateTicks + 2; + float floatVal32 = this.stateTicks2; + float floatVal33 = this.stateTicks + 4; + int intVal16 = byteVal; + intVal16 = -13684945; + + RenderUtils.drawBorderedRect(floatVal6, floatVal31, floatVal32, floatVal33, 1.0F, 1677721600, intVal16); + floatVal6 = this.stateTicks2 - 70; + floatVal31 = this.stateTicks + 2; + floatVal32 = (int)(this.stateTicks2 - 70 + propDouble * 70.0); + floatVal33 = this.stateTicks + 4; + RenderUtils.drawRect(floatVal6, floatVal31, floatVal32, floatVal33, intVal11); + floatVal6 = (int)(this.stateTicks2 - 70 + propDouble * 70.0); + floatVal31 = this.stateTicks + 3; + RenderUtils.drawElement9(floatVal6, floatVal31, 2.0F, -1); + FontRenderer font11 = FontCustom_17.FONT; + String textStr7 = this.cachedText2; + floatVal32 = this.stateTicks5; + floatVal33 = this.stateTicks; + font11.drawString(textStr7, floatVal32, floatVal33, -1); + FontRenderer font12 = FontCustom_12.FONT; + StringBuilder sb = new StringBuilder(); + Object valObj = this.getObject(); + StringBuilder sb2 = sb.append(valObj); + String textStr8 = ""; + String textStr9 = sb2.append(textStr8).toString(); + float floatVal34 = (float)(this.stateTicks2 - 70 + 70.0 * propDouble); + floatVal33 = this.stateTicks - 5; + font12.drawCenteredString(textStr9, floatVal34, floatVal33, -1, false); + Setting setting3 = this; + + if (!this.flagValue) { + return; + } + + setting3 = this; + + + double doubleVal2 = setting3.abstractNumberPropertyField.a().doubleValue() - this.abstractNumberPropertyField.getMinimum().doubleValue(); + double doubleVal3 = this.abstractNumberPropertyField.getMinimum().doubleValue(); + double doubleVal4 = (value - (this.stateTicks2 - 70)) / 70.0; + double doubleVal5 = doubleVal3 + MathHelper.clamp_double(doubleVal4, 0.0, 1.0) * doubleVal2; + double doubleVal10 = this.getCachedValue(); + double doubleVal6 = MathHelper.incValue(doubleVal5, doubleVal10); + this.applyUpdate(doubleVal6); + SettingEvent settingEvent = new SettingEvent(this.abstractModuleField, this.getCachedText3(), this.abstractNumberPropertyField); + EventManager.call(settingEvent); + + return; + + } + + String propStr; + int intVal2; + StringProperty strProp3 = this.stringPropertyField2; + propStr = strProp3.get(); + intVal2 = (this.stateFlag2 ? 1 : 0); + + byte byteVal6; + if (this.stateFlag2) { + intVal2 = (Keyboard.isKeyDown(14) ? 1 : 0); + + if (intVal2 != 0) { + TimerUtil timerUtil = this.timerUtilField; + intVal2 = (timerUtil.delay(100L) ? 1 : 0); + + if (intVal2 != 0) { + intVal2 = propStr.length(); + byteVal6 = 1; + + if (intVal2 >= 1) { + StringProperty strProp4 = this.stringPropertyField2; + int len = propStr.length() - 1; + String textStr10 = propStr.substring(0, len); + strProp4.set(textStr10); + TimerUtil timerUtil2 = this.timerUtilField; + timerUtil2.reset(); + } + } + } + } + + FontRenderer font13 = FontCustom_17.FONT; + String textStr11 = this.cachedText2; + float floatVal35 = this.stateTicks5; + float floatVal36 = this.stateTicks; + font13.drawString(textStr11, floatVal35, floatVal36, -1); + intVal2 = this.stateTicks2; + byteVal6 = 70; + + intVal2 -= byteVal6; + + float floatVal7 = intVal2; + float floatVal37 = this.stateTicks - 2; + float floatVal38 = this.stateTicks2; + float floatVal39 = this.stateTicks + 8; + byte byteVal13 = (byte)(this.isStateFlag2() ? 1 : 0); + byteVal13 = (byte)(byteVal13 != 0 ? intVal11 : 1677721600); + + int intVal17 = byteVal; + intVal17 = -13684945; + + RenderUtils.drawBorderedRect(floatVal7, floatVal37, floatVal38, floatVal39, 1.0F, byteVal13, intVal17); + int intVal3 = (propStr.isEmpty() ? 1 : 0); + if (intVal3 != 0) { + int intVal18; + label434: { + boolean flag = this.isStateFlag2(); + if (!flag) { + break label434; + } + + TimerUtil timerUtil3 = this.timer2; + flag = timerUtil3.delay(500L); + + if (!flag) { + break label434; + } + + font2 = FontCustom_16.FONT; + textStr = "|"; + floatVal38 = this.stateTicks2 - 68; + floatVal39 = (float)(this.stateTicks - 0.5); + intVal18 = 1694498815; + + font2.drawString(textStr, floatVal38, floatVal39, 1694498815); + TimerUtil timerUtil4 = this.timer2; + flag = timerUtil4.delay(1000L); + + if (flag) { + TimerUtil timerUtil5 = this.timer2; + timerUtil5.reset(); + } + } + + font2 = FontCustom_16.FONT; + textStr = this.cachedText; + floatVal38 = this.stateTicks2 - 65; + floatVal39 = this.stateTicks; + intVal18 = 1694498815; + + font2.drawString(textStr, floatVal38, floatVal39, intVal18); + } + + font3 = FontCustom_16.FONT; + textStr2 = propStr; + + intVal3 = font3.stringWidth(propStr); + + if (intVal3 > 65) { + FontRenderer font14 = FontCustom_16.FONT; + FontRenderer font15 = FontCustom_16.FONT; + String textStr12 = font15.trimStringToWidth(propStr, 60, true); + floatVal38 = this.stateTicks2 - 68; + floatVal39 = this.stateTicks; + font14.drawString(textStr12, floatVal38, floatVal39, -1); + return; + } + + font3 = FontCustom_16.FONT; + textStr2 = propStr; + + floatVal38 = this.stateTicks2 - 68; + floatVal39 = this.stateTicks; + font3.drawString(textStr2, floatVal38, floatVal39, -1); + + return; + + } + + FontRenderer font16 = FontCustom_17.FONT; + String textStr13 = this.cachedText2; + float floatVal40 = this.stateTicks5; + float floatVal41 = this.stateTicks; + font16.drawString(textStr13, floatVal40, floatVal41, -1); + float floatVal8 = this.stateTicks2 - 70; + float floatVal42 = this.stateTicks - 2; + floatVal40 = this.stateTicks2; + floatVal41 = this.stateTicks + 8; + byte byteVal14 = (byte)(this.isStateFlag2() ? 1 : 0); + byteVal14 = (byte)(byteVal14 != 0 ? intVal11 : 1677721600); + + int intVal19 = byteVal; + intVal19 = -13684945; + + float[] floatArr; + + label436: { + RenderUtils.drawBorderedRect(floatVal8, floatVal42, floatVal40, floatVal41, 1.0F, byteVal14, intVal19); + ColorProperty colorProp = this.colorPropertyField; + Integer color = colorProp.getColorInt(); + int redChannel = color >> 16 & 0xFF; + int greenChannel = color >> 8 & 0xFF; + int blueChannel = color & 0xFF; + float[] floatArr2 = new float[3]; + floatArr = Color.RGBtoHSB(redChannel, greenChannel, blueChannel, floatArr2); + intVal = (this.stateFlag3 ? 1 : 0); + + if (this.stateFlag3) { + this.cachedAngle2 = (this.cachedAngle2 + 0.35F) % 70.0F; + break label436; + } + + intVal = (this.flagValue ? 1 : 0); + + + if (intVal != 0) { + double doubleVal7 = value - this.stateTicks2 + 70; + double doubleVal8 = MathHelper.clamp_double(doubleVal7, 0.35, 70.0); + float floatVal43 = (float)(doubleVal8 / 70.0); + intVal = ColorChannelSwitchMap.SWITCH_MAP[this.colorChannelField.ordinal()]; + + switch (intVal) { + case 1: + this.cachedAngle2 = (int)doubleVal8; + ColorProperty colorProp2 = this.colorPropertyField; + floatVal40 = floatArr[1]; + floatVal41 = floatArr[2]; + Color awtColor = Color.getHSBColor(floatVal43, floatVal40, floatVal41); + int color2 = awtColor.getRGB(); + Integer intVal4 = color2; + colorProp2.setColor(intVal4); + if (intArr == null) { + break; + } + case 2: + this.cachedAngle = (int)doubleVal8; + ColorProperty colorProp3 = this.colorPropertyField; + float floatVal9 = floatArr[0]; + floatVal41 = floatArr[2]; + Color awtColor2 = Color.getHSBColor(floatVal9, floatVal43, floatVal41); + int color3 = awtColor2.getRGB(); + Integer intVal5 = color3; + colorProp3.setColor(intVal5); + if (intArr == null) { + break; + } + case 3: + this.cachedAngle3 = (int)doubleVal8; + ColorProperty colorProp4 = this.colorPropertyField; + float floatVal10 = floatArr[0]; + floatVal40 = floatArr[1]; + Color awtColor3 = Color.getHSBColor(floatVal10, floatVal40, floatVal43); + int color4 = awtColor3.getRGB(); + Integer intVal6 = color4; + colorProp4.setColor(intVal6); + } + } + } + + intVal = ColorChannelSwitchMap.SWITCH_MAP[this.colorChannelField.ordinal()]; + + label437: { + label438: { + label439: { + + switch (intVal) { + case 1: + intVal = 70; + break; + case 2: + break label439; + case 3: + break label438; + default: + break label437; + } + + + int intVal7 = intVal; + int intVal8 = 0; + + while (intVal8 < intVal7) { + float floatVal11 = this.stateTicks2 - 70 + intVal8; + float floatVal44 = this.stateTicks - 2; + floatVal40 = this.stateTicks2 - 69 + intVal8; + floatVal41 = this.stateTicks + 8; + float floatVal12 = (float)intVal8 / intVal7; + float floatVal45 = floatArr[1]; + float floatVal46 = floatArr[2]; + Color awtColor4 = Color.getHSBColor(floatVal12, floatVal45, floatVal46); + int color5 = awtColor4.getRGB(); + RenderUtils.drawRect(floatVal11, floatVal44, floatVal40, floatVal41, color5); + intVal8++; + + } + + float floatVal13 = this.stateTicks2 - 70 + this.cachedAngle2; + float floatVal47 = this.stateTicks - 2; + floatVal40 = this.stateTicks2 - 69 + this.cachedAngle2; + floatVal41 = this.stateTicks + 8; + RenderUtils.drawRect(floatVal13, floatVal47, floatVal40, floatVal41, -16777216); + + + break label437; + + } + + byte byteVal7 = 70; + int intVal9 = 0; + + while (intVal9 < byteVal7) { + float floatVal14 = this.stateTicks2 - 70 + intVal9; + float floatVal48 = this.stateTicks - 2; + floatVal40 = this.stateTicks2 - 69 + intVal9; + floatVal41 = this.stateTicks + 8; + float floatVal15 = floatArr[0]; + float floatVal49 = (float)intVal9 / byteVal7; + float floatVal50 = floatArr[2]; + Color awtColor5 = Color.getHSBColor(floatVal15, floatVal49, floatVal50); + int color6 = awtColor5.getRGB(); + RenderUtils.drawRect(floatVal14, floatVal48, floatVal40, floatVal41, color6); + intVal9++; + + } + + float floatVal16 = this.stateTicks2 - 70 + this.cachedAngle; + float floatVal51 = this.stateTicks - 2; + floatVal40 = this.stateTicks2 - 69 + this.cachedAngle; + floatVal41 = this.stateTicks + 8; + RenderUtils.drawRect(floatVal16, floatVal51, floatVal40, floatVal41, -16777216); + + + break label437; + + } + + byte byteVal8 = 70; + int intVal10 = 0; + + while (intVal10 < byteVal8) { + float floatVal17 = this.stateTicks2 - 70 + intVal10; + float floatVal52 = this.stateTicks - 2; + floatVal40 = this.stateTicks2 - 69 + intVal10; + floatVal41 = this.stateTicks + 8; + float floatVal18 = floatArr[0]; + float floatVal53 = floatArr[1]; + float floatVal54 = (float)intVal10 / byteVal8; + Color awtColor6 = Color.getHSBColor(floatVal18, floatVal53, floatVal54); + int color7 = awtColor6.getRGB(); + RenderUtils.drawRect(floatVal17, floatVal52, floatVal40, floatVal41, color7); + intVal10++; + + } + + float floatVal19 = this.stateTicks2 - 70 + this.cachedAngle3; + float floatVal55 = this.stateTicks - 2; + floatVal40 = this.stateTicks2 - 69 + this.cachedAngle3; + floatVal41 = this.stateTicks + 8; + RenderUtils.drawRect(floatVal19, floatVal55, floatVal40, floatVal41, -16777216); + } + + + return; + + } + + StringBuilder sb3 = new StringBuilder().append("Unexpected value: "); + SettingType settingType = this.settingTypeField; + throw new IllegalStateException(sb3.append(settingType).toString()); + } catch (Throwable ex) { + ex.printStackTrace(); + } +} + + public void applyUpdate(String text) { + this.stringPropertyField2.set(text); +} + + public String getTextValue() { + return this.stringPropertyField.get(); +} + + public Supplier getSupplierField() { + return this.supplierField; +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, GuiScreen screen, Supplier supplier) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.guiScreenField = screen; + this.supplierField = supplier; +} + + public Setting( + String text, String str, SettingType settingType, AbstractModule module, AbstractNumberProperty property, double value, String name, Supplier supplier + ) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.abstractNumberPropertyField = property; + this.cachedValue = value; + this.supplierField = supplier; + this.textValue = name; +} + + public StringProperty getStringProperty2() { + return this.stringPropertyField; +} + + public ColorChannel getColorChannelField() { + return this.colorChannelField; +} + + public double getDoubleValue() { + double propDouble = ((Number)this.abstractNumberPropertyField.get()).doubleValue() / this.cachedValue; + return Math.round(propDouble) * this.cachedValue; +} + + public void applyUpdate(ColorChannel colorChannel) { + this.colorChannelField = colorChannel; +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, Supplier supplier) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.supplierField = supplier; +} + + private boolean matchesSetting(Setting setting) { + int[] intArr; + Setting setting2; + intArr = SettingType.b(); + setting2 = setting; + + if (setting.settingTypeField != SettingType.COMBOBOX) { + setting2 = setting; + + if (setting.settingTypeField != SettingType.SELECTBOX) { + return false; + } + } + + setting2 = setting; + + boolean flag = setting2.cachedText3.equals(this.cachedText3); + return intArr != null ? flag : !flag; +} + + public boolean checkInt(int value, int index, int count) { + cc.novoline.gui.screen.setting.Setting setting2; + int[] intArr = SettingType.b(); + int intVal8 = count; + if (count == 0) { + label318: { + label319: { + label320: { + label321: { + label322: { + label323: { + int intVal = ColorChannelSwitchMap.SWITCH_MAP2[this.settingTypeField.ordinal()]; + switch (intVal) { + case 2: + intVal = (this.applyUpdate2(value, index) ? 1 : 0); + break; + case 3: + break label323; + case 4: + break label322; + case 5: + break label321; + case 6: + break label320; + case 7: + break label319; + default: + break label318; + } + + if (intVal != 0) { + break label318; + } + + intVal = (this.stateFlag ? 1 : 0); + + if (intVal == 0) { + break label318; + } + + intVal = value; + + int ticks4 = this.stateTicks2 - 70; + if (intVal < ticks4) { + break label318; + } + + intVal = value; + + ticks4 = this.stateTicks2; + + if (intVal > ticks4) { + break label318; + } + + intVal = 0; + + int intVal2 = intVal; + + while (true) { + StringProperty strProp = this.stringPropertyField; + List itemList = strProp.getAcceptableValues(); + if (intVal2 >= itemList.size()) { + break; + } + + int ticks = this.stateTicks + 10 + intVal2 * 11; + + if (index >= ticks) { + + if (index <= ticks + 11) { + StringProperty strProp2 = this.stringPropertyField; + strProp = this.stringPropertyField; + List itemList2 = strProp.getAcceptableValues(); + String textStr = (String)itemList2.get(intVal2); + strProp2.set(textStr); + this.stateFlag = false; + SettingEvent settingEvent = new SettingEvent(this.abstractModuleField, this.getCachedText3(), this.stringPropertyField); + EventManager.call(settingEvent); + return true; + } + } + + intVal2++; + } + + + break label318; + + } + + int intVal3 = (this.applyUpdate2(value, index) ? 1 : 0); + + if (intVal3 != 0) { + break label318; + } + + intVal3 = (this.stateFlag ? 1 : 0); + + + + if (intVal3 == 0) { + break label318; + } + + intVal3 = value; + + + int ticks2 = this.stateTicks2 - 70; + if (intArr == null) { + if (intVal3 < ticks2) { + break label318; + } + + intVal3 = value; + ticks2 = this.stateTicks2; + } + + if (intVal3 > ticks2) { + break label318; + } + + ListProperty listProp = this.listPropertyField; + List itemList3 = listProp.getAcceptableValues(); + int intVal4 = 0; + + while (true) { + if (intVal4 >= itemList3.size()) { + break; + } + + int ticks3 = this.stateTicks + 10 + intVal4 * 11; + + + if (index >= ticks3 && index <= ticks3 + 11) { + String textStr2 = (String)itemList3.get(intVal4); + ListProperty listProp2 = this.listPropertyField; + boolean flag = listProp2.contains(textStr2); + label156: { + if (flag) { + ListProperty listProp3 = this.listPropertyField; + listProp3.remove(textStr2); + break label156; + } + + ListProperty listProp4 = this.listPropertyField; + listProp4.b(textStr2); + } + + SettingEvent settingEvent2 = new SettingEvent(this.abstractModuleField, this.getCachedText3(), this.listPropertyField); + EventManager.call(settingEvent2); + return true; + } + + intVal4++; + + } + + + break label318; + + } + + Setting setting3 = this; + + if (!this.isHoveredAt(value, index)) { + break label318; + } + + setting3 = this; + + + BooleanProperty boolProp = setting3.booleanPropertyField; + boolProp.toggle(); + SettingEvent settingEvent3 = new SettingEvent(this.abstractModuleField, this.getCachedText3(), this.getCachedText2(), this.booleanPropertyField); + EventManager.call(settingEvent3); + + break label318; + + } + + Setting setting4 = this; + int intVal5 = value; + if (!this.isHoveredAt(value, index)) { + break label318; + } + + setting4 = this; + intVal5 = 1; + + setting4.flagValue = (boolean)((intVal5) != 0); + + break label318; + + } + + boolean flag2 = this.isHoveredAt(value, index); + + if (flag2) { + boolean flag3 = this.stateFlag2; + flag3 = !this.stateFlag2; + + this.stateFlag2 = flag3; + break label318; + } + + setting2 = this; + + flag2 = this.stateFlag2; + + + if (!flag2) { + break label318; + } + + setting2 = this; + + setting2.stateFlag2 = false; + + break label318; + + } + + Setting setting5 = this; + int intVal6 = value; + if (!this.isHoveredAt(value, index)) { + break label318; + } + + setting5 = this; + intVal6 = 1; + + setting5.flagValue = (boolean)((intVal6) != 0); + } + + return false; + } + + intVal8 = count; + + if (intVal8 == 1) { + Setting setting6 = this; + + if (this.settingTypeField != SettingType.COLOR_PICKER) { + return false; + } + + setting6 = this; + + + boolean flag4 = setting6.isHoveredAt(value, index); + + if (flag4) { + ColorChannel[] colorChannelArr = ColorChannel.values(); + ColorChannel colorChannel2 = this.colorChannelField; + int len = (Arrays.binarySearch(colorChannelArr, colorChannel2) + 1) % colorChannelArr.length; + Set itemSet = this.entrySet; + + if (this.entrySet == null) { + this.colorChannelField = colorChannelArr[len]; + return false; + } + + itemSet = this.entrySet; + + + flag4 = itemSet.isEmpty(); + + if (!flag4) { + int intVal7 = 0; + + while (intVal7 < colorChannelArr.length - 1) { + ColorChannel colorChannel = colorChannelArr[(len + intVal7) % colorChannelArr.length]; + + Set itemSet2 = this.entrySet; + flag4 = itemSet2.contains(colorChannel); + + if (!flag4) { + this.colorChannelField = colorChannelArr[(intVal7 + len) % colorChannelArr.length]; + } + + intVal7++; + + + } + } + } + } + + return false; +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, ColorProperty property, @Nullable EnumSet enumSet) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.colorPropertyField = property; + this.entrySet = enumSet; + float[] floatArr = property.getHSB(); + this.cachedAngle2 = floatArr[0] * 70.0F; + this.cachedAngle = floatArr[1] * 70.0F; + this.cachedAngle3 = floatArr[2] * 70.0F; +} + + public void applyUpdate2(char ch, int value) { + label337: { + Setting setting = this; + + if (this.settingTypeField != SettingType.TEXTBOX) { + break label337; + } + + setting = this; + + + int intVal = (setting.stateFlag2 ? 1 : 0); + + if (setting.stateFlag2 == false) { + return; + } + + intVal = value; + + + short shortVal = 1; + + if (intVal == 1) { + this.stateFlag2 = false; + + return; + + } + + intVal = value; + shortVal = 14; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 157; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 29; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 54; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 42; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 15; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 58; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 211; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 199; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 210; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 200; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 208; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 205; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 203; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 56; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 184; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 197; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 70; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 207; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 201; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 209; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 221; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 59; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 60; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 61; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 62; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 63; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 64; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 65; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 66; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 67; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 68; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 87; + + + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 88; + + + if (intVal == shortVal) { + return; + } + + StringProperty strProp = this.stringPropertyField2; + Character character = ch; + strProp.append(character); + + return; + + } + + if (value == 1) { + Setting setting2; + setting2 = this; + + if (this.settingTypeField != SettingType.SELECTBOX) { + setting2 = this; + + if (this.settingTypeField != SettingType.COMBOBOX) { + return; + } + } + + setting2 = this; + + + if (!setting2.stateFlag) { + return; + } + + setting2 = this; + + + setting2.stateFlag = false; + } +} + + public GuiScreen getGuiScreen() { + return this.guiScreenField; +} + + public int getIntValue() { + return (int)this.getDoubleValue(); +} + + public Setting(String text, String str, AbstractModule module, BooleanProperty property, Supplier supplier) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = SettingType.SEPARATOR; + this.abstractModuleField = module; + this.booleanPropertyField = property; + this.supplierField = supplier; +} + + public void applyUpdate3(String text) { + this.stringPropertyField.set(text); +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, String value, StringProperty property) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.cachedText = value; + this.stringPropertyField2 = property; +} + + public BooleanProperty getBooleanPropertyField() { + return this.booleanPropertyField; +} + + private static boolean matchesSetting2(Setting setting) { + Object obj = setting.getSupplierField(); + if (obj == null) { + return true; + } + + obj = setting.getSupplierField().get(); + + return ((Boolean) obj); +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, StringProperty property) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.stringPropertyField = property; +} + + public float[] computeArray() { + return this.colorPropertyField.getHSB(); +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, Integer integer, @Nullable EnumSet enumSet) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.colorPropertyField = ColorProperty.e(integer); + this.entrySet = enumSet; +} + + public void applyUpdate3(int value) { + this.stateTicks4 = value; +} + + public void applyUpdate(int value) { + ColorProperty colorProp = this.colorPropertyField; + Integer intVal = value; + colorProp.setColor(intVal); +} + + public float getCachedAngle3() { + return this.cachedAngle3; +} + + public Setting( + String text, String str, SettingType settingType, AbstractModule module, AbstractNumberProperty property, double value, Supplier supplier + ) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.abstractNumberPropertyField = property; + this.cachedValue = value; + this.supplierField = supplier; + this.textValue = ""; +} + + public boolean isStateFlag3() { + return this.stateFlag3; +} + + public Consumer getConsumer() { + return this.consumerField; +} + + public void setStateFlag(boolean flag) { + this.stateFlag = flag; +} + + public void applyUpdate(boolean flag) { + this.stateFlag2 = flag; +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, List list, List listIn) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + ListProperty listProp = ListProperty.ofList(list); + this.listPropertyField = listProp.b((Collection)listIn); +} + + public float getCachedAngle() { + return this.cachedAngle; +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, String value, StringProperty property, Supplier supplier) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.cachedText = value; + this.stringPropertyField2 = property; + this.supplierField = supplier; +} + + public Color getColor() { + return this.colorPropertyField.getAwtColor(); +} + + public boolean isReadyState() { + Novoline novolineInst = Novoline.getInstance(); + DiscordGUI discordScreen = novolineInst.getDiscordGUI(); + int ticks = this.stateTicks; + int intVal = discordScreen.getPosY(); + int height = intVal + discordScreen.getHeight() - 10; + if (ticks > height) { + return false; + } + + ticks = this.stateTicks; + + height = discordScreen.getPosY() + 23; + + return ticks >= height; +} + + public Setting(String text, String str, AbstractModule module, BooleanProperty property) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = SettingType.SEPARATOR; + this.abstractModuleField = module; + this.booleanPropertyField = property; +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, AbstractNumberProperty property, double value, String name) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.abstractNumberPropertyField = property; + this.cachedValue = value; + this.textValue = name; +} + + public List getSettingList() { + return this.settingList; +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, BooleanProperty property) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.booleanPropertyField = property; +} + + public float getFloatValue() { + return (float)this.getDoubleValue(); +} + + public ColorProperty getColorPropertyField() { + return this.colorPropertyField; +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, Consumer consumer, Supplier supplier) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.consumerField = consumer; + this.supplierField = supplier; +} + + public Object getObject() { + switch (ColorChannelSwitchMap.SWITCH_MAP2[this.settingTypeField.ordinal()]) { + case 2: + return this.stringPropertyField; + case 3: + return this.listPropertyField; + case 4: + return this.booleanPropertyField; + case 5: + return this.numberFormat.format(this.getDoubleValue()); + default: + return null; + } +} + + + + public SettingType getSettingTypeField() { + return this.settingTypeField; +} + + public void applyUpdate(float value) { + this.cachedAngle3 = value; +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, ListProperty property, Supplier supplier) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.listPropertyField = property; + this.supplierField = supplier; +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, StringProperty property, Supplier supplier) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.stringPropertyField = property; + this.supplierField = supplier; +} + + public void applyUpdate3(boolean flag) { + this.flagValue = flag; +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, BooleanProperty property, Supplier supplier) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.booleanPropertyField = property; + this.supplierField = supplier; +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, List list, Supplier supplier) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.settingList = list; + this.supplierField = supplier; +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, List list) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.settingList = list; +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, boolean flag) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + Boolean flag2 = flag; + this.booleanPropertyField = BooleanProperty.of(flag2); +} + + public String getCachedText2() { + return this.cachedText2; +} + + public Timer getMsTimer2() { + return this.msTimer; +} + + public AbstractNumberProperty getAbstractNumberPropertyField() { + return this.abstractNumberPropertyField; +} + + public Consumer getConsumerField2() { + return this.consumerField2; +} + + public void updateHelper(boolean flag) { + BooleanProperty boolProp = this.booleanPropertyField; + Boolean flag2 = flag; + boolProp.set(flag2); +} + + public StringProperty getStringProperty3() { + return this.stringPropertyField; +} + + public void applyUpdate(Number number) { + cc.novoline.modules.configurations.property.AbstractNumberProperty abstractNumberProperty; + boolean flag = this.abstractNumberPropertyField instanceof IntProperty; + if (flag) { + AbstractNumberProperty abstractNumberProperty2 = this.abstractNumberPropertyField; + int intVal = number.intValue(); + abstractNumberProperty2.set(intVal); + return; + } + + flag = this.abstractNumberPropertyField instanceof DoubleProperty; + + if (flag) { + AbstractNumberProperty abstractNumberProperty3 = this.abstractNumberPropertyField; + double doubleVal = number.doubleValue(); + abstractNumberProperty3.set(doubleVal); + return; + } + + flag = this.abstractNumberPropertyField instanceof FloatProperty; + + if (flag) { + AbstractNumberProperty abstractNumberProperty4 = this.abstractNumberPropertyField; + float floatVal = number.floatValue(); + abstractNumberProperty4.set(floatVal); + return; + } + + abstractNumberProperty = this.abstractNumberPropertyField; + + flag = this.abstractNumberPropertyField instanceof LongProperty; + + if (!flag) { + return; + } + + abstractNumberProperty = this.abstractNumberPropertyField; + + long longVal = number.longValue(); + abstractNumberProperty.set(longVal); +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, Consumer consumer) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.consumerField = consumer; +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, ListProperty property) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.listPropertyField = property; +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; +} + + public String getTextValue2() { + return this.stringPropertyField2.get(); +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, KeyBindProperty property) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.keyBindPropertyField = property; +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, GuiScreen screen) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.guiScreenField = screen; +} + + public boolean isFlagValueField() { + return this.flagValueField; +} + + public String getTextValue3() { + return this.textValue; +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, String value, String name) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.cachedText = value; + this.stringPropertyField2 = StringProperty.of(name); +} + + public int getIntValue2() { + Integer color = this.colorPropertyField.getColorInt(); + return color; +} + + public Setting(String text, String str, SettingType settingType, AbstractModule module, KeyBindProperty property, Supplier supplier) { + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.keyBindPropertyField = property; + this.supplierField = supplier; +} + + public void handleFloat(float value) { + this.cachedAngle2 = value; +} + + public Setting( + String text, String str, SettingType settingType, AbstractModule module, ColorProperty property, @Nullable EnumSet enumSet, Supplier supplier + ) { + label40: { + this.msTimer = new Timer(); + this.stateTicks5 = 0; + this.stateTicks = 0; + this.stateTicks4 = 30; + this.stateTicks2 = 5; + this.stateFlag = false; + this.cachedValue2 = 70.0; + this.timerUtilField = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.colorChannelField = ColorChannel.HUE; + this.timer = new TimerUtil(); + this.numberFormat = new DecimalFormat("#.#"); + this.numberFormat.setRoundingMode(RoundingMode.CEILING); + this.cachedText3 = text; + this.cachedText2 = str; + this.settingTypeField = settingType; + this.abstractModuleField = module; + this.colorPropertyField = property; + Setting setting = this; + this.entrySet = enumSet; + if (enumSet != null) { + label43: { + boolean flag = enumSet.contains(ColorChannel.HUE); + if (!flag) { + break label43; + } + + flag = enumSet.contains(ColorChannel.BRIGHTNESS); + + if (flag) { + this.colorChannelField = ColorChannel.SATURATION; + break label40; + } + + this.colorChannelField = ColorChannel.BRIGHTNESS; + break label40; + } + + this.colorChannelField = ColorChannel.HUE; + break label40; + } + + setting = this; + + setting.colorChannelField = ColorChannel.HUE; + } + + float[] floatArr = property.getHSB(); + this.cachedAngle2 = floatArr[0] * 70.0F; + this.cachedAngle = floatArr[1] * 70.0F; + this.cachedAngle3 = floatArr[2] * 70.0F; + this.supplierField = supplier; +} + + public int getStateTicks4() { + return this.stateTicks4; +} + + public boolean isStateFlag() { + return this.stateFlag; +} + + public boolean isStateFlag2() { + return this.stateFlag2; +} + + public StringProperty getStringPropertyField2() { + return this.stringPropertyField2; +} + + public List getList() { + return (List)this.listPropertyField.get(); +} + + public AbstractModule getAbstractModule() { + return this.abstractModuleField; +} + + public int getStateTicks() { + return this.stateTicks; +} + + public void applyUpdate(double value) { + double doubleVal = this.abstractNumberPropertyField.getMinimum().doubleValue(); + double doubleVal2 = this.abstractNumberPropertyField.getMaximum().doubleValue(); + double doubleVal3 = MathHelper.clamp_double(value, doubleVal, doubleVal2); + this.applyUpdate(Double.valueOf(doubleVal3)); +} + + public void performAction() { + Novoline novolineInst = Novoline.getInstance(); + DiscordGUI discordScreen = novolineInst.getDiscordGUI(); + this.stateTicks5 = discordScreen.getPosX() + 168; + int ticks = discordScreen.getPosY() + this.stateTicks4; + List itemList = SettingManager.getSettingsByMod(this.abstractModuleField); + Stream stream2 = itemList.stream(); + Predicate predicate = Setting::matchesSetting2; + Stream stream3 = stream2.filter(predicate); + Collector collector = Collectors.toList(); + List itemList2 = (java.util.List) stream3.collect(collector); + this.stateTicks = ticks + itemList2.indexOf(this) * 25; + ticks = discordScreen.getPosX() + 45 + 105; + this.stateTicks2 = ticks + discordScreen.getWidth() - 18; +} + + private boolean applyUpdate2(int value, int index) { + boolean flag = this.isHoveredAt(value, index); + if (!flag) { + return false; + } + + flag = this.stateFlag; + + boolean flag2 = !this.stateFlag; + + if (flag == flag2) { + List itemList = SettingManager.getSettings(); + Stream stream2 = itemList.stream(); + Predicate predicate = this::matchesSetting; + Stream stream3 = stream2.filter(predicate); + Consumer consumer = (Setting setting2) -> { setting2.stateFlag = false; }; + stream3.forEach(consumer); + } + + return true; +} + + public long getLongValue() { + return (long)this.getDoubleValue(); +} + + public ListProperty getListPropertyField() { + return this.listPropertyField; +} + + public float getCachedAngle2() { + return this.cachedAngle2; +} + + public KeyBindProperty getKeyBindPropertyField() { + return this.keyBindPropertyField; +} + + public Set getEntrySet() { + return this.entrySet; +} + + public void applyUpdate3(float value) { + this.cachedAngle = value; +} + + public void setFlagValueField(boolean flag) { + this.flagValueField = flag; +} + + public Boolean getBoolean() { + return this.booleanPropertyField.get(); +} + + public float[] computeArray2() { + Integer color = this.colorPropertyField.getColorInt(); + Integer intVal = color; + if (color == null) { + float[] floatArr = new float[3]; + return Color.RGBtoHSB(0, 0, 0, floatArr); + } + + intVal = color; + + int blueChannel = intVal & 0xFF; + int greenChannel = color >> 8 & 0xFF; + int redChannel = color >> 16 & 0xFF; + float[] floatArr2 = new float[3]; + return Color.RGBtoHSB(blueChannel, greenChannel, redChannel, floatArr2); +} + + public String getName() { return this.getCachedText3(); } + public String getDisplayName() { return this.getCachedText2(); } + public SettingType getSettingType() { return this.getSettingTypeField(); } + public AbstractModule getModule() { return this.getAbstractModule(); } + public Supplier getVisibilitySupplier() { return this.getSupplierField(); } + public BooleanProperty getBooleanProperty() { return this.getBooleanPropertyField(); } + public StringProperty getStringProperty() { return this.getStringProperty2(); } + public ColorProperty getColorProperty() { return this.getColorPropertyField(); } + public AbstractNumberProperty getNumberProperty() { return this.getAbstractNumberPropertyField(); } + public ListProperty getListProperty() { return this.getListPropertyField(); } + public KeyBindProperty getKeyBindProperty() { return this.getKeyBindPropertyField(); } + + public cc.novoline.utils.Timer getMsTimer() { return this.getMsTimer2(); } +} diff --git a/src/main/java/cc/novoline/gui/screen/setting/SettingManager.java b/src/main/java/cc/novoline/gui/screen/setting/SettingManager.java new file mode 100644 index 0000000..111d821 --- /dev/null +++ b/src/main/java/cc/novoline/gui/screen/setting/SettingManager.java @@ -0,0 +1,45 @@ +package cc.novoline.gui.screen.setting; + +import cc.novoline.modules.AbstractModule; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.function.Predicate; +import java.util.function.Supplier; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +public final class SettingManager { + private static final List settingList = new CopyOnWriteArrayList<>(); + + public static List createList(AbstractModule module) { + List itemList = settingList; + Stream stream2 = itemList.stream(); + Predicate predicate = ((java.util.function.Predicate) (setting2) -> setting2.getAbstractModule().equals(module)); + Stream stream3 = stream2.filter(predicate); + Supplier supplier = CopyOnWriteArrayList::new; + Collector collector = Collectors.toCollection(supplier); + return (java.util.List) stream3.collect(collector); +} + + public static void createList(Setting setting) { + List itemList = settingList; + itemList.add(setting); +} + + public static List getSettingList() { + return settingList; +} + + public static void put(Setting setting) { + createList(setting); +} + public static List getSettings() { + return getSettingList(); +} + public static List getSettingsByMod(AbstractModule module) { + return createList(module); +} + + public static void register(Setting setting) { createList(setting); } +} diff --git a/src/main/java/cc/novoline/gui/screen/setting/SettingType.java b/src/main/java/cc/novoline/gui/screen/setting/SettingType.java new file mode 100644 index 0000000..9c2fa03 --- /dev/null +++ b/src/main/java/cc/novoline/gui/screen/setting/SettingType.java @@ -0,0 +1,27 @@ +package cc.novoline.gui.screen.setting; + +public enum SettingType { + COMBOBOX, + SELECTBOX, + CHECKBOX, + SLIDER, + TEXTBOX, + COLOR_PICKER, + BINDABLE, + BUTTON, + SEPARATOR; + + private static int[] b; + + static { + b(null); + } + + public static void b(int[] intArray) { + b = intArray; +} + + public static int[] b() { + return b; +} +} diff --git a/src/main/java/cc/novoline/gui/screen/whitelist/GuiItemWhitelist.java b/src/main/java/cc/novoline/gui/screen/whitelist/GuiItemWhitelist.java new file mode 100644 index 0000000..b536c0f --- /dev/null +++ b/src/main/java/cc/novoline/gui/screen/whitelist/GuiItemWhitelist.java @@ -0,0 +1,312 @@ +package cc.novoline.gui.screen.whitelist; +import cc.novoline.gui.click.WhitelistItemCard; +import cc.novoline.gui.click.WhitelistScrollSwitchMap; +import cc.novoline.gui.screen.click.DiscordGUI; +import cc.novoline.utils.MovementUtils; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.enums.VerticalDirection; +import cc.novoline.utils.fonts.impl.WhitelistSearchField; +import java.awt.Color; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; + +import net.minecraft.util.MathHelper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; + +public class GuiItemWhitelist extends GuiScreen { + private List whitelistItemCardList; + private int stateTicks; + private Minecraft mcField; + private WhitelistSearchField whitelistSearchField; + + public static FontRenderer resolveFontRenderer3(GuiItemWhitelist guiItemWhitelist) { + return guiItemWhitelist.fontRendererObj; +} + + public GuiItemWhitelist() { + this.mcField = Minecraft.getMinecraft(); + this.whitelistItemCardList = new CopyOnWriteArrayList<>(); + this.stateTicks = 1; +} + + @Override + public void initGui() { + Minecraft mcClient = this.mcField; + ScaledResolution scaledRes = new ScaledResolution(mcClient); + float floatVal = scaledRes.getScaledWidthGui() / 2; + float floatVal2 = scaledRes.getScaledHeightGui() / 2; + List itemList2 = this.whitelistItemCardList; + itemList2.clear(); + this.stateTicks = 1; + Iterator iter = Item.registrySimpleCursor.iterator(); + + while (true) { + if (iter.hasNext()) { + Item item = (Item)iter.next(); + List itemList = this.whitelistItemCardList; + WhitelistItemCard whitelistItemCard = new WhitelistItemCard(this, item); + itemList.add(whitelistItemCard); + + continue; + } + + this.whitelistSearchField = new WhitelistSearchField(this, 0, this.mcField.crackFontRenderer, (int)(floatVal + 20.0F), (int)(floatVal2 - 109.0F + 2.0F), 78, 20); + super.initGui(); + break; + } +} + + public static FontRenderer resolveFontRenderer4(GuiItemWhitelist guiItemWhitelist) { + return guiItemWhitelist.fontRendererObj; +} + + + + @Override + public void keyTyped(char typedChar, int keyCode) throws IOException { + int intVal; + label85: { + this.whitelistSearchField.updateState3(typedChar, keyCode); + GuiItemWhitelist guiItemWhitelist = this; + String textStr = this.whitelistSearchField.getText(); + if (!textStr.isEmpty()) { + List itemList = this.whitelistItemCardList; + itemList.clear(); + this.stateTicks = 1; + Iterator iter = Item.registrySimpleCursor.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + Item item = (Item)iter.next(); + ItemStack stack = new ItemStack(item); + EntityPlayerSP player = this.mcField.thePlayer; + boolean flag = this.mcField.gameSettings.advancedItemTooltips; + List itemList2 = stack.getTooltip(player, flag); + String textStr2 = this.whitelistSearchField.getText(); + String lowerStr = textStr2.toLowerCase(); + byte byteVal = 0; + + Iterator iter2 = itemList2.iterator(); + + while (true) { + if (iter2.hasNext()) { + String textStr3 = (String)iter2.next(); + String textStr4 = EnumChatFormatting.getTextWithoutFormattingCodes(textStr3); + String lowerStr2 = textStr4.toLowerCase(); + intVal = (lowerStr2.contains(lowerStr) ? 1 : 0); + + label69: { + if (intVal == 0) { + break label69; + } + + intVal = 1; + + byteVal = ((byte)(intVal)); + } + + continue; + } + + intVal = byteVal; + break; + } + + if (intVal != 0) { + List itemList3 = this.whitelistItemCardList; + WhitelistItemCard whitelistItemCard = new WhitelistItemCard(this, item); + itemList3.add(whitelistItemCard); + } + } + + break label85; + } + + List itemList4 = this.whitelistItemCardList; + itemList4.clear(); + guiItemWhitelist = this; + + guiItemWhitelist.stateTicks = 1; + Iterator iter3 = Item.registrySimpleCursor.iterator(); + + while (true) { + if (!iter3.hasNext()) { + break; + } + + Item item2 = (Item)iter3.next(); + List itemList5 = this.whitelistItemCardList; + WhitelistItemCard whitelistItemCard2 = new WhitelistItemCard(this, item2); + itemList5.add(whitelistItemCard2); + + } + } + + super.keyTyped(typedChar, keyCode); +} + + public static FontRenderer resolveFontRenderer5(GuiItemWhitelist guiItemWhitelist) { + return guiItemWhitelist.fontRendererObj; +} + + public static FontRenderer resolveFontRenderer6(GuiItemWhitelist guiItemWhitelist) { + return guiItemWhitelist.fontRendererObj; +} + + public static FontRenderer resolveFontRenderer7(GuiItemWhitelist guiItemWhitelist) { + return guiItemWhitelist.fontRendererObj; +} + + public static FontRenderer resolveFontRenderer(GuiItemWhitelist guiItemWhitelist) { + return guiItemWhitelist.fontRendererObj; +} + + public static FontRenderer resolveFontRenderer8(GuiItemWhitelist guiItemWhitelist) { + return guiItemWhitelist.fontRendererObj; +} + + @Override + public void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { + int intVal = MovementUtils.evaluateDouble(mouseX); + int intVal2 = MovementUtils.scaleYInt(mouseY); + this.whitelistSearchField.mouseClicked(intVal, intVal2, mouseButton); + Iterator iter = this.whitelistItemCardList.iterator(); + + while (true) { + if (iter.hasNext()) { + WhitelistItemCard whitelistItemCard = (WhitelistItemCard)iter.next(); + float floatVal = intVal; + float floatVal2 = intVal2; + whitelistItemCard.mouseClickedPanel(floatVal, floatVal2, mouseButton); + + continue; + } + + super.mouseClicked(intVal, intVal2, mouseButton); + break; + } +} + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + int intVal; + double doubleVal; + float floatVal; + float floatVal4; + float floatVal5; + int intVal2; + label61: { + intVal2 = WhitelistItemCard.b(); + Minecraft mcClient = this.mcField; + intVal = intVal2; + doubleVal = MovementUtils.evaluateDouble(true); + ScaledResolution scaledRes = new ScaledResolution(mcClient); + floatVal = scaledRes.getScaledWidthGui() / 2; + float floatVal2 = scaledRes.getScaledHeightGui() / 2; + floatVal4 = floatVal - 100.0F; + floatVal5 = floatVal2 - 90.0F; + VerticalDirection verticalDirection = DiscordGUI.getMouseWheelDirection(); + if (intVal != 0) { + if (verticalDirection != null) { + intVal2 = WhitelistScrollSwitchMap.SWITCH_MAP[verticalDirection.ordinal()]; + + switch (intVal2) { + case 1: + intVal2 = this.stateTicks - 10; + + if (intVal2 <= 0) { + break; + } + + this.stateTicks -= 10; + if (intVal != 0) { + break; + } + + case 2: + intVal2 = this.stateTicks + 90; + if (intVal == 0) { + break label61; + } + + List itemList3 = this.whitelistItemCardList; + if (intVal2 <= itemList3.size()) { + this.stateTicks += 10; + } + } + } + + double doubleVal2 = floatVal - 100.0F - 0.5; + double doubleVal3 = floatVal2 - 104.0; + double doubleVal4 = floatVal + 100.0F + 0.5; + double doubleVal5 = floatVal2 - 90.0F; + Color awtColor = new Color(29, 29, 29, 255); + RenderUtils.drawRect(doubleVal2, doubleVal3, doubleVal4, doubleVal5, awtColor.getRGB()); + FontRenderer font = this.mcField.crackFontRenderer; + String textStr = "Item Whitelist"; + float floatVal6 = floatVal - 100.0F + 2.0F; + float floatVal7 = floatVal2 - 104.0F + 3.0F; + font.drawString(textStr, floatVal6, floatVal7, -1, true); + } + + intVal2 = this.stateTicks; + } + + int intVal3 = intVal2; + + while (true) { + int ticks = this.stateTicks + 90; + int ticks2 = this.stateTicks; + List itemList = this.whitelistItemCardList; + int size2 = itemList.size() + 1; + if (intVal3 < MathHelper.clamp_int(ticks, ticks2, size2)) { + List itemList2 = this.whitelistItemCardList; + ticks = intVal3 - 1; + WhitelistItemCard whitelistItemCard = (WhitelistItemCard)itemList2.get(ticks); + int intVal4 = MovementUtils.evaluateDouble(mouseX); + int intVal5 = MovementUtils.scaleYInt(mouseY); + float floatVal3 = intVal4; + float floatVal8 = intVal5; + whitelistItemCard.renderPanel(floatVal3, floatVal8, floatVal4, floatVal5); + floatVal4 += 20.0F; + if (intVal == 0) { + break; + } + + if (intVal != 0) { + if (intVal3 % 10 == 0 && intVal3 != 0) { + floatVal4 = floatVal - 100.0F; + floatVal5 += 20.0F; + } + + intVal3++; + } + + continue; + } + + this.whitelistSearchField.drawTextBox(); + MovementUtils.unscale(doubleVal); + super.drawScreen(mouseX, mouseY, partialTicks); + break; + } +} + + public static FontRenderer resolveFontRenderer2(GuiItemWhitelist guiItemWhitelist) { + return guiItemWhitelist.fontRendererObj; +} + + public net.minecraft.client.Minecraft getMinecraft() { return this.mcField; } +} diff --git a/src/main/java/cc/novoline/gui/widget/AltAddActionButton.java b/src/main/java/cc/novoline/gui/widget/AltAddActionButton.java new file mode 100644 index 0000000..5bc72ad --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/AltAddActionButton.java @@ -0,0 +1,51 @@ +package cc.novoline.gui.widget; + +import cc.novoline.gui.click.AltFilterConstHolder; +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontFamilyPROFILES; +import java.util.List; +import cc.novoline.utils.fonts.api.FontFamily; + +public class AltAddActionButton extends FontActionWidget { + final AltRepositoryPanel altRepositoryPanelField; + + @Override + public void mouseClickedPanel(int value, int index, int count) { + int intVal = (this.evaluateFlag4(value, index) ? 1 : 0); + if (intVal == 0) { + return; + } + + intVal = count; + + if (intVal == 0) { + this.getParent().setActive(false); + SelectAuthenticationWidget selectAuthenticationWidget = new SelectAuthenticationWidget(this.getParent()); + selectAuthenticationWidget.setActive(true); + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent(); + List itemList = altRepositoryGUI.getGuiWidgetList(); + itemList.add(selectAuthenticationWidget); + } +} + + @Override + public double getDoubleValue() { + double doubleVal = this.getParent().getPosX(); + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent(); + doubleVal = doubleVal - altRepositoryGUI.getScrollOffset() + 215.0; + FontFamily fontFam = FontFamilyPROFILES.FAMILY; + FontRenderer font = fontFam.ofSize(45); + return doubleVal - font.stringWidth(AltFilterConstHolder.textValue) / 2; +} + + AltAddActionButton(AltRepositoryPanel altRepositoryPanel, AltRepositoryPanel altRepositoryPanelArg, FontRenderer fontRenderer, String text) { + super(altRepositoryPanelArg, fontRenderer, text); + this.altRepositoryPanelField = altRepositoryPanel; +} + + @Override + public double getDoubleValue2() { + return this.getParent().getPosY() + 231.0; +} +} diff --git a/src/main/java/cc/novoline/gui/widget/AltRemoveActionButton.java b/src/main/java/cc/novoline/gui/widget/AltRemoveActionButton.java new file mode 100644 index 0000000..f400c39 --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/AltRemoveActionButton.java @@ -0,0 +1,46 @@ +package cc.novoline.gui.widget; + +import cc.novoline.gui.click.AltPanelConstHolder; +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontFamilyPROFILES; +import java.util.List; +import cc.novoline.utils.fonts.api.FontFamily; + +public class AltRemoveActionButton extends FontActionWidget { + final AltRepositoryPanel altRepositoryPanelField; + + @Override + public double getDoubleValue() { + double doubleVal = this.getParent().getPosX(); + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent(); + doubleVal = doubleVal - altRepositoryGUI.getScrollOffset() + 192.0; + FontFamily fontFam = FontFamilyPROFILES.FAMILY; + FontRenderer font = fontFam.ofSize(40); + return doubleVal - font.stringWidth(AltPanelConstHolder.textValue) / 2; +} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + int intVal = (this.evaluateFlag4(value, index) ? 1 : 0); + if (intVal == 0) { + return; + } + + intVal = count; + + if (intVal == 0) { + this.getParent().setActive(false); + AuthenticatedAsWidget authenticatedAsWidget = new AuthenticatedAsWidget(this.getParent()); + authenticatedAsWidget.setActive(true); + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent(); + List itemList = altRepositoryGUI.getGuiWidgetList(); + itemList.add(authenticatedAsWidget); + } +} + + AltRemoveActionButton(AltRepositoryPanel altRepositoryPanel, AltRepositoryPanel altRepositoryPanelArg, FontRenderer fontRenderer, String text) { + super(altRepositoryPanelArg, fontRenderer, text); + this.altRepositoryPanelField = altRepositoryPanel; +} +} diff --git a/src/main/java/cc/novoline/gui/widget/AltRepositoryPanel.java b/src/main/java/cc/novoline/gui/widget/AltRepositoryPanel.java new file mode 100644 index 0000000..b1ef055 --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/AltRepositoryPanel.java @@ -0,0 +1,232 @@ +package cc.novoline.gui.widget; + +import cc.novoline.gui.alt.AltAccountEntry; +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.StencilUtil; +import cc.novoline.utils.fonts.holders.FontFamilyPROFILES; +import java.util.Iterator; +import java.util.List; + +import cc.novoline.utils.fonts.api.FontFamily; + +public class AltRepositoryPanel extends GuiWidget { +private FontActionWidget fontActionWidgetField; + private FontActionWidget fontActionWidgetField2; + private FontActionWidget fontActionWidgetField3; + private final TogglePillWidget togglePillWidgetField; + private final AnimatedCheckWidget animatedCheckWidgetField; + + @Override + public double getDoubleValue2() { + return this.getParent().getCachedValue4(); +} + + public FontActionWidget getFontActionWidgetValue() { + return this.fontActionWidgetField; +} + + @Override + public void renderPanel(int value, int index) { + this.togglePillWidgetField.renderPanel(value, index); + this.animatedCheckWidgetField.renderPanel(value, index); +} + + @Override + public void applyUpdate(int value, int index) { + this.togglePillWidgetField.applyUpdate(value, index); + this.animatedCheckWidgetField.applyUpdate(value, index); + AltRepositoryGUI altRepositoryGUI = this.getParent(); + List itemList = altRepositoryGUI.getIterator6FunctionHelper2().getFList(); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + AltAccountEntry altAccountEntry = (AltAccountEntry)iter.next(); + float floatVal = value; + float floatVal2 = index; + altAccountEntry.renderPanel(floatVal, floatVal2, this); + } +} + + public AnimatedCheckWidget getVjD() { + return this.animatedCheckWidgetField; +} + + public AltRepositoryPanel(AltRepositoryGUI altRepositoryGUI) { + super(altRepositoryGUI); + FontFamily fontFam = FontFamilyPROFILES.FAMILY; + this.fontActionWidgetField = new AltRemoveActionButton(this, this, fontFam.ofSize(40), "B"); + fontFam = FontFamilyPROFILES.FAMILY; + this.fontActionWidgetField2 = new AltAddActionButton(this, this, fontFam.ofSize(45), "E"); + fontFam = FontFamilyPROFILES.FAMILY; + this.fontActionWidgetField3 = new HttpsAltsWidget(this, this, fontFam.ofSize(47), "F"); + this.togglePillWidgetField = new TogglePillWidget(this); + this.animatedCheckWidgetField = new AnimatedCheckWidget(this); +} + + @Override + public void applyUpdate(char ch, int value) { + AltRepositoryGUI altRepositoryGUI = null; + this.togglePillWidgetField.applyUpdate(ch, value); + if (value != 211) { + return; + } + + altRepositoryGUI = this.getParent(); + + Iterator6FunctionHelper iterator6FunctionHelper = altRepositoryGUI.getIterator6FunctionHelper(); + altRepositoryGUI = this.getParent(); + List itemList = altRepositoryGUI.getIterator6FunctionHelper2().getFList(); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + AltAccountEntry altAccountEntry = (AltAccountEntry)iter.next(); + altRepositoryGUI = null; + + if (!altAccountEntry.isStateFlag()) { + iterator6FunctionHelper.applyUpdate(altAccountEntry); + } + } + + altRepositoryGUI = this.getParent(); + altRepositoryGUI.setIterator6FunctionHelperField(iterator6FunctionHelper); + altRepositoryGUI = this.getParent(); + + altRepositoryGUI.performAction(); +} + + @Override + public void renderPanel2(int value, int index) { + AnimatedCheckWidget animatedCheckWidget; + int intVal; + label55: { + label58: { + StencilUtil.initStencilToWrite(false); + AltRepositoryGUI altRepositoryGUI = this.getParent(); + double[] doubleArr = altRepositoryGUI.getPanelBounds(); + double doubleVal = doubleArr[0]; + double doubleVal3 = doubleArr[1]; + double doubleVal4 = doubleArr[2]; + double doubleVal5 = doubleArr[3]; + RenderUtils.drawElement11(doubleVal, doubleVal3, doubleVal4, doubleVal5, -1); + StencilUtil.readStencilBuffer(true); + this.fontActionWidgetField.renderPanel2(value, index); + this.fontActionWidgetField2.renderPanel2(value, index); + this.fontActionWidgetField3.renderPanel2(value, index); + this.togglePillWidgetField.renderPanel2(value, index); + this.animatedCheckWidgetField.renderPanel2(value, index); + animatedCheckWidget = this.animatedCheckWidgetField; + if (value <= doubleArr[0]) { + break label58; + } + + if (value >= doubleArr[2]) { + break label58; + } + + if (index <= doubleArr[1]) { + break label58; + } + + if (index < doubleArr[3]) { + intVal = 1; + break label55; + } + } + + intVal = 0; + } + + animatedCheckWidget.applyUpdate2((boolean)((intVal) != 0)); + StencilUtil.uninitStencilBuffer(); + StencilUtil.initStencilToWrite(false); + double[] doubleArr2 = this.getDoubleArrayValue(); + double doubleVal2 = doubleArr2[0]; + double doubleVal6 = doubleArr2[1]; + double doubleVal7 = doubleArr2[2]; + double doubleVal8 = doubleArr2[3]; + RenderUtils.drawElement11(doubleVal2, doubleVal6, doubleVal7, doubleVal8, -1); + StencilUtil.readStencilBuffer(true); + AltRepositoryGUI altRepositoryGUI2 = this.getParent(); + List itemList = altRepositoryGUI2.getIterator6FunctionHelper2().getFList(); + Iterator iter = itemList.iterator(); + + while (true) { + if (iter.hasNext()) { + AltAccountEntry altAccountEntry = (AltAccountEntry)iter.next(); + altAccountEntry.createAltAccountEntry2(this); + + continue; + } + + StencilUtil.uninitStencilBuffer(); + break; + } +} + + public TogglePillWidget getVFC() { + return this.togglePillWidgetField; +} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + this.fontActionWidgetField.mouseClickedPanel(value, index, count); + this.fontActionWidgetField2.mouseClickedPanel(value, index, count); + this.fontActionWidgetField3.mouseClickedPanel(value, index, count); + this.togglePillWidgetField.mouseClickedPanel(value, index, count); + this.animatedCheckWidgetField.mouseClickedPanel(value, index, count); + double[] doubleArr = this.getDoubleArrayValue(); + if (value <= doubleArr[0]) { + return; + } + + if (value >= doubleArr[2]) { + return; + } + + if (index <= doubleArr[1]) { + return; + } + + if (index < doubleArr[3]) { + AltRepositoryGUI altRepositoryGUI = this.getParent(); + List itemList = altRepositoryGUI.getIterator6FunctionHelper2().getFList(); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + AltAccountEntry altAccountEntry = (AltAccountEntry)iter.next(); + float floatVal = value; + float floatVal2 = index; + altAccountEntry.handleFloat(floatVal, floatVal2, count, this); + } + } +} + + @Override + public double getDoubleValue() { + double doubleVal2 = this.getParent().getCachedValue3() - 230.0 + 15.0; + AltRepositoryGUI altRepositoryGUI = this.getParent(); + List itemList = altRepositoryGUI.getGuiWidgetList(); + double doubleVal = itemList.indexOf(this); + AltRepositoryGUI altRepositoryGUI2 = this.getParent(); + return doubleVal2 + doubleVal * altRepositoryGUI2.getCachedValue2(); +} + + public double[] getDoubleArrayValue() { + AltRepositoryGUI altRepositoryGUI = this.getParent(); + double[] doubleArr = altRepositoryGUI.getPanelBounds(); + return new double[]{doubleArr[0], doubleArr[1] + 8.0, doubleArr[2], doubleArr[3] - 30.0}; +} +} diff --git a/src/main/java/cc/novoline/gui/widget/AnimatedCheckWidget.java b/src/main/java/cc/novoline/gui/widget/AnimatedCheckWidget.java new file mode 100644 index 0000000..f1790ad --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/AnimatedCheckWidget.java @@ -0,0 +1,222 @@ +package cc.novoline.gui.widget; +import cc.novoline.gui.alt.AltAccountEntry; +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.utils.shader.RoundedTextureShader; +import java.awt.Color; +import java.util.Iterator; +import java.util.List; + +import net.minecraft.util.MathHelper; +import org.lwjgl.input.Mouse; + +public class AnimatedCheckWidget extends GuiWidget { + private float cachedAngle; + private float cachedAngle2; + private boolean stateFlag; + private float cachedAngle3; + private float cachedAngle4 = 0.0F; + private float cachedAngle5; + + public float getFloatValue() { + return this.cachedAngle4; +} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + cc.novoline.gui.widget.AnimatedCheckWidget animatedCheckWidget; + int intVal = (this.evaluateFlag(value, index) ? 1 : 0); + if (intVal == 0) { + return; + } + + intVal = count; + + if (intVal != 0) { + return; + } + + animatedCheckWidget = this; + + if (this.getFloatValue2() <= 215.0F) { + return; + } + + this.stateFlag = true; + animatedCheckWidget = this; + + animatedCheckWidget.cachedAngle = index; +} + + @Override + public void renderPanel(int value, int index) { + this.stateFlag = false; +} + + @Override + public double getDoubleValue2() { + return this.getParent().getPosY() + 10.0; +} + + @Override + public void applyUpdate(char ch, int value) {} + + public boolean evaluateFlag(int value, int index) { + if (value <= this.getPosX()) { + return false; + } + + if (value >= (this.getPosX() + 5.0)) { + return false; + } + + if (index <= this.getPosY()) { + return false; + } + + return index < (this.getPosY() + 215.0); +} + + @Override + public void renderPanel2(int value, int index) {} + + public void performStep() { + this.cachedAngle2 = 0.0F; + this.cachedAngle3 = 0.0F; + this.cachedAngle4 = 0.0F; +} + + public float getFloatValue2() { + float floatVal; + float floatVal2 = 0.0F; + AltRepositoryGUI altRepositoryGUI = this.getParent().getObjValue(); + List itemList = altRepositoryGUI.getIterator6FunctionHelper2().getFList(); + Iterator iter = itemList.iterator(); + + while (true) { + if (iter.hasNext()) { + AltAccountEntry altAccountEntry = (AltAccountEntry)iter.next(); + floatVal = floatVal2 + (altAccountEntry.getFloatValue2() + 5.0F); + + floatVal2 = floatVal; + continue; + } + + floatVal = floatVal2; + break; + } + + return floatVal; +} + + @Override + public double getDoubleValue() { + double doubleVal = this.getParent().getObjValue().getCachedValue3() - 200.0; + AltRepositoryGUI altRepositoryGUI = this.getParent().getObjValue(); + return doubleVal - altRepositoryGUI.getScrollOffset() + 206.0; +} + + public void applyUpdate2(boolean flag) { + int intVal = Mouse.getDWheel(); + int intVal2 = (flag ? 1 : 0); + if (flag == false) { + return; + } + + intVal2 = intVal; + + if (intVal2 == 0) { + return; + } + + intVal2 = intVal; + + if (intVal2 < 0) { + this.cachedAngle2 += 10.0F; + return; + } + + this.cachedAngle2 -= 10.0F; +} + + public AnimatedCheckWidget(AltRepositoryPanel altRepositoryPanel) { + super(altRepositoryPanel); + this.cachedAngle3 = 0.0F; +} + + @Override + public void applyUpdate(int value, int index) { + cc.novoline.gui.widget.AnimatedCheckWidget animatedCheckWidget; + float floatVal8 = this.getFloatValue2(); + if (floatVal8 < 215.0F) { + this.cachedAngle4 = 0.0F; + this.cachedAngle3 = 0.0F; + return; + } + + floatVal8 = 215.0F; + + float floatVal; + float floatVal2; + label42: { + label40: { + floatVal = floatVal8; + float floatVal3 = 215.0F; + float floatVal4 = this.getFloatValue2(); + floatVal2 = floatVal3 / floatVal4 * floatVal; + float floatVal5 = floatVal - floatVal2; + float floatVal6 = floatVal4 - floatVal; + float floatVal7 = floatVal6 / floatVal5; + this.cachedAngle4 = this.cachedAngle4 + (this.cachedAngle3 - this.cachedAngle4) * 0.1F; + this.cachedAngle3 = this.cachedAngle2 * floatVal7; + AnimatedCheckWidget animatedCheckWidget2 = this; + if (!this.evaluateFlag(value, index)) { + animatedCheckWidget = this; + + if (!this.stateFlag) { + break label40; + } + } + + animatedCheckWidget2 = this; + + animatedCheckWidget2.cachedAngle5 = this.cachedAngle5 + (1.0F - this.cachedAngle5) * 0.02F; + break label42; + } + + animatedCheckWidget = this; + + animatedCheckWidget.cachedAngle5 = animatedCheckWidget.cachedAngle5 - this.cachedAngle5 * 0.02F; + } + + float floatVal9 = this.cachedAngle2; + float floatVal10 = floatVal - floatVal2; + this.cachedAngle2 = MathHelper.clamp_float(floatVal9, 0.0F, floatVal10); + if (this.stateFlag && index - this.cachedAngle != 0.0F) { + this.cachedAngle2 = this.cachedAngle2 + (index - this.cachedAngle); + floatVal9 = this.cachedAngle2; + floatVal10 = floatVal - floatVal2; + this.cachedAngle2 = MathHelper.clamp_float(floatVal9, 0.0F, floatVal10); + this.cachedAngle = index; + } + + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal = this.getPosX(); + double doubleVal3 = this.getPosY(); + Color awtColor = new Color(20, 20, 20); + AltRepositoryGUI altRepositoryGUI = this.getParent().getObjValue(); + double[] doubleArr = altRepositoryGUI.getPanelBounds(); + roundedTextureShader.applyUpdate2(doubleVal, doubleVal3, 5.0, 215.0, 5.0, 2.0, awtColor, doubleArr, true); + RoundedTextureShader roundedTextureShader2 = RoundedTextureShader.getInstance(); + double doubleVal2 = this.getPosX(); + doubleVal3 = this.getPosY() + this.cachedAngle2; + double doubleVal4 = floatVal2; + awtColor = new Color(40, 40, 40); + altRepositoryGUI = this.getParent().getObjValue(); + double[] doubleArr2 = altRepositoryGUI.getPanelBounds(); + roundedTextureShader2.applyUpdate2(doubleVal2, doubleVal3, 5.0, doubleVal4, 5.0, 2.0, awtColor, doubleArr2, true); +} + + public float getFloatValue3() { + return this.cachedAngle3; +} +} diff --git a/src/main/java/cc/novoline/gui/widget/AuthModeToggleWidget.java b/src/main/java/cc/novoline/gui/widget/AuthModeToggleWidget.java new file mode 100644 index 0000000..9aa7bd4 --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/AuthModeToggleWidget.java @@ -0,0 +1,116 @@ +package cc.novoline.gui.widget; + +import cc.novoline.gui.click.AltCredentialDialog; +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontFamilyPROFILES; +import cc.novoline.utils.shader.RoundedTextureShader; +import java.awt.Color; +import java.util.List; +import cc.novoline.utils.fonts.api.FontFamily; + +public class AuthModeToggleWidget extends ValueWidget { + final SelectAuthenticationWidget selectAuthenticationWidgetField; + + @Override + public void renderPanel2(int value, int index) { + FontRenderer font = FontFamilyPROFILES.FAMILY.ofSize(45); + double doubleVal = this.getDoubleValue() + 22.0; + doubleVal -= font.stringWidth("A") / 2; + double doubleVal2 = this.getPosY() + 28.0; + doubleVal2 -= font.getHeight() / 2; + font.drawString("A", doubleVal, doubleVal2, -1); +} + + @Override + public double getDoubleValue2() { + return this.getParent().getPosY() + 97.0; +} + + AuthModeToggleWidget(SelectAuthenticationWidget selectAuthenticationWidget, SelectAuthenticationWidget selectAuthenticationWidgetArg) { + super(selectAuthenticationWidgetArg); + this.selectAuthenticationWidgetField = selectAuthenticationWidget; +} + + @Override + public void renderPanel3(int value, int index) { + label25: { + AuthModeToggleWidget authModeToggleWidget; + label23: { + AuthModeToggleWidget authModeToggleWidget2 = this; + if (!this.isFlagA(value, index)) { + authModeToggleWidget = this; + + if (!this.isActive()) { + break label23; + } + } + + authModeToggleWidget2 = this; + + authModeToggleWidget2.createAltAccountEntry(this.getFloatValue8() + (1.0F - this.getFloatValue8()) * 0.04F); + break label25; + } + + authModeToggleWidget = this; + + authModeToggleWidget.createAltAccountEntry(this.getFloatValue8() - this.getFloatValue8() * 0.04F); + } + + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal = this.getDoubleValue(); + double doubleVal2 = this.getPosY(); + Color awtColor = new Color(26, 26, 26); + Color awtColor2 = new Color(20, 20, 20); + double doubleVal3 = this.getFloatValue8(); + Color awtColor3 = new Color(RenderUtils.interpolateColor(awtColor, awtColor2, doubleVal3)); + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent().getParent(); + double[] doubleArr = altRepositoryGUI.getPanelBounds(); + roundedTextureShader.applyUpdate2(doubleVal, doubleVal2, 45.0, 57.0, 12.0, 2.0, awtColor3, doubleArr, true); +} + + @Override + public boolean isFlagA(int value, int index) { + if (value <= this.getDoubleValue()) { + return false; + } + + if (value >= (this.getDoubleValue() + 45.0)) { + return false; + } + + if (index <= this.getPosY()) { + return false; + } + + return index < (this.getPosY() + 57.0); +} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + int intVal = (this.isFlagA(value, index) ? 1 : 0); + if (intVal == 0) { + return; + } + + intVal = count; + + if (intVal == 0) { + this.getParent().createAltAccountEntry(false); + AltCredentialDialog altCredentialDialog = new AltCredentialDialog(this.getParent()); + altCredentialDialog.setActive(true); + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent().getParent(); + List itemList = altRepositoryGUI.getGuiWidgetList(); + itemList.add(altCredentialDialog); + } +} + + @Override + public void applyUpdate(int value, int index) {} + + @Override + public double getDoubleValue() { + return super.getDoubleValue() + 165.0; +} +} diff --git a/src/main/java/cc/novoline/gui/widget/AuthSelectButtonWidget.java b/src/main/java/cc/novoline/gui/widget/AuthSelectButtonWidget.java new file mode 100644 index 0000000..7ad4642 --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/AuthSelectButtonWidget.java @@ -0,0 +1,33 @@ +package cc.novoline.gui.widget; + +public class AuthSelectButtonWidget extends LabeledWidget { + final SelectAuthenticationWidget selectAuthenticationWidgetField; + + @Override + public boolean isReadyState() { + return true; +} + + @Override + public double getDoubleValue() { + return this.getParent().getPosX(); +} + + AuthSelectButtonWidget(SelectAuthenticationWidget selectAuthenticationWidget, SelectAuthenticationWidget selectAuthenticationWidgetArg, String text) { + super(selectAuthenticationWidgetArg, text); + this.selectAuthenticationWidgetField = selectAuthenticationWidget; +} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + Object obj = this; + if (!this.evaluateFlag6(value, index)) { + return; + } + + this.getParent().setActive(false); + obj = this.getParent().getParent(); + + ((AltRepositoryPanel)obj).setActive(true); +} +} diff --git a/src/main/java/cc/novoline/gui/widget/AuthenticatedAsWidget.java b/src/main/java/cc/novoline/gui/widget/AuthenticatedAsWidget.java new file mode 100644 index 0000000..3bafbdd --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/AuthenticatedAsWidget.java @@ -0,0 +1,368 @@ +package cc.novoline.gui.widget; + + +import cc.novoline.Novoline; +import cc.novoline.gui.alt.AltAccountType; +import cc.novoline.gui.alt.AltAccountEntry; +import cc.novoline.gui.click.AuthStatusActionButton; +import cc.novoline.gui.click.AuthLogoutActionButton; +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.StencilUtil; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontFamilyPROFILES; +import cc.novoline.utils.notifications.NotificationManager; +import cc.novoline.utils.notifications.NotificationType; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import fr.litarvan.openauth.microsoft.MicrosoftAuthResult; +import fr.litarvan.openauth.microsoft.MicrosoftAuthenticator; +import fr.litarvan.openauth.microsoft.model.response.MinecraftProfile; +import java.awt.Color; +import java.awt.FileDialog; +import java.awt.Frame; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ForkJoinPool; +import java.util.function.Consumer; +import javax.vecmath.Vector2d; + +import cc.novoline.utils.fonts.api.FontFamily; +import cc.novoline.utils.fonts.holders.FontFamilyPOSTERAMA; +import novo.cookie.CookieAuthenticator; + +public class AuthenticatedAsWidget extends GuiWidget { + private FlatTextButtonWidget flatTextButtonWidgetField; + private DualCallbackWidget dualCallbackWidgetField; + private DualCallbackWidget dualCallbackWidgetField2; + private GradientLabelWidget gradientLabelWidgetField; + private CookieAuthenticator cookieAuthenticatorField; + private AltAccountEntry altAccountEntryField; + private FlatTextButtonWidget flatTextButtonWidgetField2; + private String cachedText = null; + private DualCallbackWidget dualCallbackWidgetField3; + private GradientLabelWidget gradientLabelWidgetField2; + + @Override + public void renderPanel(int value, int index) {} + + private CompletableFuture getCompletableFutureE() { + return CompletableFuture.supplyAsync(AuthenticatedAsWidget::supplyString, ForkJoinPool.commonPool()); +} + + private void invokeCallback(MicrosoftAuthResult microsoftAuthResult, Throwable throwable) { + AltAccountEntry altAccountEntry = new AltAccountEntry(this.getParent().getParent()); + MinecraftProfile minecraftProfile = microsoftAuthResult.getProfile(); + String nameStr = minecraftProfile.getName(); + altAccountEntry = altAccountEntry.createAltAccountEntry(nameStr); + minecraftProfile = microsoftAuthResult.getProfile(); + String nameStr2 = minecraftProfile.getName(); + altAccountEntry = altAccountEntry.createAltAccountEntry2(nameStr2); + String textStr = microsoftAuthResult.getRefreshToken(); + altAccountEntry = altAccountEntry.withCachedText3(textStr); + AltAccountType altAccountType = AltAccountType.MICROSOFT; + this.altAccountEntryField = altAccountEntry.createAltAccountEntry(altAccountType); + GradientLabelWidget gradientLabelWidget = this.gradientLabelWidgetField; + altAccountEntry = this.altAccountEntryField; + String textStr2 = altAccountEntry.getCachedText5(); + gradientLabelWidget.createAltAccountEntry(textStr2); +} + + private void invokeCallback2(String text, JsonObject jsonObject) { + CookieAuthenticator cookieAuthenticator = this.cookieAuthenticatorField; + String textStr = this.cookieAuthenticatorField.getCookiesFromFile(text); + this.applyUpdate(jsonObject, cookieAuthenticator.formatCookies(textStr)); + StringBuilder sb = new StringBuilder().append("Authenticated as "); + JsonElement jsonElement = jsonObject.get("username"); + String textStr2 = jsonElement.getAsString(); + this.cachedText = sb.append(textStr2).toString(); +} + + @Override + public void applyUpdate(int value, int index) { + java.lang.String msgText; + AuthenticatedAsWidget authenticatedAsWidget; + + authenticatedAsWidget = this; + + if (this.cookieAuthenticatorField != null) { + CookieAuthenticator cookieAuthenticator = this.cookieAuthenticatorField; + msgText = cookieAuthenticator.getErrorMessage(); + + if (msgText != null) { + Novoline novolineInst = Novoline.getInstance(); + NotificationManager notifManager = novolineInst.getNotificationManager(); + String msgText2 = this.cookieAuthenticatorField.getErrorMessage(); + notifManager.pop("Cookie Login", msgText2, NotificationType.ERROR); + CookieAuthenticator cookieAuthenticator2 = this.cookieAuthenticatorField; + cookieAuthenticator2.setErrorMessage(null); + } + } + + authenticatedAsWidget = this; + + + msgText = authenticatedAsWidget.cachedText; + + if (msgText != null) { + Novoline novolineInst2 = Novoline.getInstance(); + NotificationManager notifManager2 = novolineInst2.getNotificationManager(); + String textStr = "Cookie Login"; + String textStr2 = this.cachedText; + NotificationType notificationType = NotificationType.INFO; + notifManager2.pop(textStr, textStr2, notificationType); + this.cachedText = null; + } + + GradientLabelWidget gradientLabelWidget = this.gradientLabelWidgetField; + double doubleVal = this.getPosX() - 220.3; + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent(); + Vector2d vector2d = new Vector2d(doubleVal - altRepositoryGUI.getScrollOffset(), this.getPosY() + 10.0); + gradientLabelWidget.applyUpdate3(vector2d); + GradientLabelWidget gradientLabelWidget2 = this.gradientLabelWidgetField; + vector2d = new Vector2d(150.0, 15.0); + gradientLabelWidget2.createAltAccountEntry(vector2d); + GradientLabelWidget gradientLabelWidget3 = this.gradientLabelWidgetField2; + doubleVal = this.getPosX() - 220.3F; + altRepositoryGUI = this.getParent().getParent(); + vector2d = new Vector2d(doubleVal - altRepositoryGUI.getScrollOffset(), this.getPosY() + 50.0); + gradientLabelWidget3.applyUpdate3(vector2d); + GradientLabelWidget gradientLabelWidget4 = this.gradientLabelWidgetField2; + vector2d = new Vector2d(210.0, 45.0); + gradientLabelWidget4.createAltAccountEntry(vector2d); + this.gradientLabelWidgetField.applyUpdate(value, index); + this.gradientLabelWidgetField2.applyUpdate(value, index); + this.flatTextButtonWidgetField.applyUpdate(value, index); + this.flatTextButtonWidgetField2.applyUpdate(value, index); + DualCallbackWidget dualCallbackWidget = this.dualCallbackWidgetField; + double doubleVal2 = this.getPosX() - 220.3; + AltRepositoryGUI altRepositoryGUI2 = this.getParent().getParent(); + dualCallbackWidget.createAltAccountEntry(doubleVal2 - altRepositoryGUI2.getScrollOffset()); + DualCallbackWidget dualCallbackWidget2 = this.dualCallbackWidgetField3; + double doubleVal3 = this.getPosX() - 220.3; + altRepositoryGUI2 = this.getParent().getParent(); + dualCallbackWidget2.createAltAccountEntry(doubleVal3 - altRepositoryGUI2.getScrollOffset() + 71.5); + DualCallbackWidget dualCallbackWidget3 = this.dualCallbackWidgetField2; + double doubleVal4 = this.getPosX() - 220.3; + altRepositoryGUI2 = this.getParent().getParent(); + dualCallbackWidget3.createAltAccountEntry(doubleVal4 - altRepositoryGUI2.getScrollOffset() + 143.0); + this.dualCallbackWidgetField.applyUpdate(value, index); + this.dualCallbackWidgetField3.applyUpdate(value, index); + authenticatedAsWidget = this; + + authenticatedAsWidget.dualCallbackWidgetField2.applyUpdate(value, index); +} + + public GradientLabelWidget getGradientLabelWidget() { + return this.gradientLabelWidgetField; +} + + private void handleDualCallbackWidget(DualCallbackWidget dualCallbackWidget) { + this.getCompletableFutureE().whenCompleteAsync(this::invokeCallback3); +} + + public static AltAccountEntry createAltAccountEntry(AuthenticatedAsWidget authenticatedAsWidget) { + return authenticatedAsWidget.altAccountEntryField; +} + + public static GradientLabelWidget resolveGradientLabelWidget(AuthenticatedAsWidget authenticatedAsWidget) { + return authenticatedAsWidget.gradientLabelWidgetField; +} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + this.gradientLabelWidgetField.mouseClickedPanel(value, index, count); + this.gradientLabelWidgetField2.mouseClickedPanel(value, index, count); + this.flatTextButtonWidgetField.mouseClickedPanel(value, index, count); + this.flatTextButtonWidgetField2.mouseClickedPanel(value, index, count); + this.dualCallbackWidgetField.mouseClickedPanel(value, index, count); + this.dualCallbackWidgetField3.mouseClickedPanel(value, index, count); + this.dualCallbackWidgetField2.mouseClickedPanel(value, index, count); +} + + public FlatTextButtonWidget getVzA() { + return this.flatTextButtonWidgetField; +} + + private static void lambdaImpl$new$0(DualCallbackWidget dualCallbackWidget) { + FontRenderer font = FontFamilyPROFILES.FAMILY.ofSize(70); + double doubleVal = dualCallbackWidget.getPosX() + 33.0; + doubleVal -= font.stringWidth("D") / 2; + double doubleVal2 = dualCallbackWidget.getPosY() + 15.0; + Color awtColor = new Color(172, 82, 220); + Color awtColor2 = awtColor.darker(); + int color = awtColor2.getRGB(); + font.drawString("D", doubleVal, doubleVal2, color, true); +} + + public GradientLabelWidget getGradientLabelWidgetValue() { + return this.gradientLabelWidgetField2; +} + + private static void handleDualCallbackWidget3(DualCallbackWidget dualCallbackWidget) { + FontRenderer font = FontFamilyPROFILES.FAMILY.ofSize(70); + double doubleVal = dualCallbackWidget.getPosX() + 33.0; + doubleVal -= font.stringWidth("C") / 2; + double doubleVal2 = dualCallbackWidget.getPosY() + 15.0; + Color awtColor = new Color(250, 177, 83); + int color = awtColor.getRGB(); + font.drawString("C", doubleVal, doubleVal2, color, true); +} + + @Override + public double getDoubleValue() { + double doubleVal2 = this.getParent().getParent().getCachedValue3() + 15.0; + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent(); + List itemList = altRepositoryGUI.getGuiWidgetList(); + double doubleVal = itemList.indexOf(this); + AltRepositoryGUI altRepositoryGUI2 = this.getParent().getParent(); + return doubleVal2 + doubleVal * altRepositoryGUI2.getCachedValue2(); +} + + @Override + public void applyUpdate(char ch, int value) { + this.gradientLabelWidgetField.applyUpdate(ch, value); + this.gradientLabelWidgetField2.applyUpdate(ch, value); +} + + private void invokeCallback3(String text, Throwable throwable) { + this.cookieAuthenticatorField = new CookieAuthenticator(text); + CookieAuthenticator cookieAuthenticator = this.cookieAuthenticatorField; + Consumer consumer = ((java.util.function.Consumer) (jsonObject) -> this.invokeCallback2(text, jsonObject)); + cookieAuthenticator.authenticateAsync(consumer); +} + + private void applyUpdate(JsonObject jsonObject, String text) { + AltAccountEntry altAccountEntry = new AltAccountEntry(this.getParent().getParent()); + JsonElement jsonElement = jsonObject.get("username"); + String textStr = jsonElement.getAsString(); + altAccountEntry = altAccountEntry.createAltAccountEntry(textStr); + jsonElement = jsonObject.get("username"); + String textStr2 = jsonElement.getAsString(); + altAccountEntry = altAccountEntry.createAltAccountEntry2(textStr2); + altAccountEntry = altAccountEntry.resolveAltAccountEntry2(text); + AltAccountType altAccountType = AltAccountType.COOKIE; + AltAccountEntry altAccountEntry2 = altAccountEntry.createAltAccountEntry(altAccountType); + GradientLabelWidget gradientLabelWidget = this.getGradientLabelWidget(); + String textStr3 = altAccountEntry2.getCachedText5(); + gradientLabelWidget.createAltAccountEntry(textStr3); + jsonElement = jsonObject.get("uuid"); + String textStr4 = jsonElement.getAsString(); + altAccountEntry2 = altAccountEntry2.resolveAltAccountEntry(textStr4); + this.createAltAccountEntry(altAccountEntry2); +} + + public AuthenticatedAsWidget(AltRepositoryPanel altRepositoryPanel) { + super(altRepositoryPanel); + this.gradientLabelWidgetField = new GradientLabelWidget(this, "Name", 1); + this.gradientLabelWidgetField2 = new GradientLabelWidget(this, "Description", 3); + this.flatTextButtonWidgetField = new AuthLogoutActionButton(this, this, "Add Account"); + this.flatTextButtonWidgetField2 = new AuthStatusActionButton(this, this, "Go back"); + this.dualCallbackWidgetField2 = new DualCallbackWidget(this, "Cracked", AuthenticatedAsWidget::lambdaImpl$new$0, this::handleDualCallbackWidget5); + this.dualCallbackWidgetField = new DualCallbackWidget(this, "Microsoft", this::handleDualCallbackWidget4, this::handleDualCallbackWidget6); + this.dualCallbackWidgetField3 = new DualCallbackWidget(this, "Cookie", AuthenticatedAsWidget::handleDualCallbackWidget3, this::handleDualCallbackWidget); +} + + @Override + public void renderPanel2(int value, int index) { + StencilUtil.initStencilToWrite(false); + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent(); + double[] doubleArr = altRepositoryGUI.getPanelBounds(); + double doubleVal = doubleArr[0]; + double doubleVal2 = doubleArr[1]; + double doubleVal3 = doubleArr[2]; + double doubleVal4 = doubleArr[3]; + RenderUtils.drawElement11(doubleVal, doubleVal2, doubleVal3, doubleVal4, -1); + StencilUtil.readStencilBuffer(true); + this.gradientLabelWidgetField.renderPanel2(value, index); + this.gradientLabelWidgetField2.renderPanel2(value, index); + this.flatTextButtonWidgetField.renderPanel2(value, index); + this.flatTextButtonWidgetField2.renderPanel2(value, index); + FontFamily fontFam = FontFamilyPOSTERAMA.FAMILY; + FontRenderer font = fontFam.ofSize(25); + String textStr = "Select authentication type"; + doubleVal3 = this.getPosX() - 220.3F; + AltRepositoryGUI altRepositoryGUI2 = this.getParent().getParent(); + doubleVal3 -= altRepositoryGUI2.getScrollOffset(); + doubleVal4 = this.getPosY() + 122.0; + font.drawString(textStr, doubleVal3, doubleVal4, -1, true); + this.dualCallbackWidgetField.renderPanel2(value, index); + this.dualCallbackWidgetField3.renderPanel2(value, index); + this.dualCallbackWidgetField2.renderPanel2(value, index); + StencilUtil.uninitStencilBuffer(); +} + + private static String supplyString() { + FileDialog fileDialog = new FileDialog((Frame)null, "Select File to Open"); + fileDialog.setMode(0); + fileDialog.setVisible(true); + StringBuilder sb = new StringBuilder(); + String textStr = fileDialog.getDirectory(); + sb = sb.append(textStr); + textStr = fileDialog.getFile(); + return sb.append(textStr).toString(); +} + + public AltAccountEntry getAD() { + return this.altAccountEntryField; +} + + private void handleDualCallbackWidget4(DualCallbackWidget dualCallbackWidget) { + double doubleVal = dualCallbackWidget.getPosX() + 33.0 - 12.5; + double doubleVal2 = dualCallbackWidget.getPosY() + 15.0; + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent(); + double[] doubleArr = altRepositoryGUI.getPanelBounds(); + RenderUtils.drawElement10(doubleVal, doubleVal2, 11.0F, 3.0F, doubleArr); +} + + @Override + public double getDoubleValue2() { + return this.getParent().getParent().getCachedValue4(); +} + + public DualCallbackWidget getDualCallbackWidgetValue() { + return this.dualCallbackWidgetField3; +} + + private void handleDualCallbackWidget5(DualCallbackWidget dualCallbackWidget) { + AuthenticatedAsWidget authenticatedAsWidget = this; + GradientLabelWidget gradientLabelWidget = this.gradientLabelWidgetField; + String textStr = gradientLabelWidget.getStringValue(); + if (textStr.isEmpty()) { + return; + } + + this.dualCallbackWidgetField.createAltAccountEntry(false); + this.dualCallbackWidgetField3.createAltAccountEntry(false); + dualCallbackWidget.createAltAccountEntry(true); + authenticatedAsWidget = this; + + AltAccountEntry altAccountEntry = new AltAccountEntry(this.getParent().getParent()); + GradientLabelWidget gradientLabelWidget2 = this.gradientLabelWidgetField; + String textStr2 = gradientLabelWidget2.getStringValue(); + altAccountEntry = altAccountEntry.createAltAccountEntry2(textStr2); + gradientLabelWidget2 = this.gradientLabelWidgetField; + String textStr3 = gradientLabelWidget2.getStringValue(); + altAccountEntry = altAccountEntry.createAltAccountEntry(textStr3); + gradientLabelWidget2 = this.gradientLabelWidgetField2; + String textStr4 = gradientLabelWidget2.getStringValue(); + altAccountEntry = altAccountEntry.withCachedText2(textStr4); + AltAccountType altAccountType = AltAccountType.CRACKED; + authenticatedAsWidget.altAccountEntryField = altAccountEntry.createAltAccountEntry(altAccountType); +} + + public void createAltAccountEntry(AltAccountEntry altAccountEntry) { + this.altAccountEntryField = altAccountEntry; +} + + private void handleDualCallbackWidget6(DualCallbackWidget dualCallbackWidget) { + this.dualCallbackWidgetField2.createAltAccountEntry(false); + this.dualCallbackWidgetField3.createAltAccountEntry(false); + dualCallbackWidget.createAltAccountEntry(true); + MicrosoftAuthenticator microsoftAuthenticator = new MicrosoftAuthenticator(); + microsoftAuthenticator.loginWithAsyncWebview().whenComplete(this::invokeCallback); +} + + public cc.novoline.gui.alt.AltAccountEntry getAltAccountEntryField() { return this.altAccountEntryField; } + public cc.novoline.gui.widget.GradientLabelWidget getGradientLabelWidgetField() { return this.gradientLabelWidgetField; } +} diff --git a/src/main/java/cc/novoline/gui/widget/BackNavigationButton.java b/src/main/java/cc/novoline/gui/widget/BackNavigationButton.java new file mode 100644 index 0000000..8df6aeb --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/BackNavigationButton.java @@ -0,0 +1,40 @@ +package cc.novoline.gui.widget; + +public class BackNavigationButton extends LabeledWidget { + final GoBackWidget goBackWidgetField; + + @Override + public boolean isReadyState() { + return true; +} + + @Override + public double getDoubleValue2() { + return this.getParent().getPosY() + 225.0; +} + + BackNavigationButton(GoBackWidget goBackWidget, SelectAuthenticationWidget selectAuthenticationWidget, String text) { + super(selectAuthenticationWidget, text); + this.goBackWidgetField = goBackWidget; +} + + @Override + public double getDoubleValue() { + return this.getParent().getPosX() + 230.0; +} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + int intVal = (this.evaluateFlag6(value, index) ? 1 : 0); + if (intVal == 0) { + return; + } + + intVal = count; + + if (intVal == 0) { + this.setActive(false); + this.getParent().getParent().setActive(true); + } +} +} diff --git a/src/main/java/cc/novoline/gui/widget/CrackedWidget.java b/src/main/java/cc/novoline/gui/widget/CrackedWidget.java new file mode 100644 index 0000000..c117b10 --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/CrackedWidget.java @@ -0,0 +1,63 @@ +package cc.novoline.gui.widget; + +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontFamilyPROFILES; +import java.awt.Color; +import java.util.List; +import cc.novoline.utils.fonts.api.FontFamily; +import cc.novoline.utils.fonts.holders.FontFamilyPOSTERAMA; + +public class CrackedWidget extends ValueWidget { + final SelectAuthenticationWidget selectAuthenticationWidgetField; + + CrackedWidget(SelectAuthenticationWidget selectAuthenticationWidget, SelectAuthenticationWidget selectAuthenticationWidgetArg) { + super(selectAuthenticationWidgetArg); + this.selectAuthenticationWidgetField = selectAuthenticationWidget; +} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + int intVal = (this.isFlagA(value, index) ? 1 : 0); + if (intVal == 0) { + return; + } + + intVal = count; + + if (intVal == 0) { + this.getParent().setActive(false); + GoBackWidget goBackWidget = new GoBackWidget(this.getParent()); + goBackWidget.setActive(true); + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent().getParent(); + List itemList = altRepositoryGUI.getGuiWidgetList(); + itemList.add(goBackWidget); + } +} + + @Override + public void renderPanel2(int value, int index) { + FontFamily fontFam = FontFamilyPROFILES.FAMILY; + FontRenderer font = fontFam.ofSize(80); + double doubleVal = this.getPosX() + 105.0; + doubleVal -= font.stringWidth("D") / 2; + double doubleVal2 = this.getPosY() + 28.0; + doubleVal2 = doubleVal2 - font.getHeight() / 2 - 8.0; + Color awtColor = new Color(172, 82, 220); + Color awtColor2 = awtColor.darker(); + int color = awtColor2.getRGB(); + font.drawString("D", doubleVal, doubleVal2, color, true); + fontFam = FontFamilyPOSTERAMA.FAMILY; + FontRenderer font2 = fontFam.ofSize(25); + doubleVal = this.getPosX() + 105.0; + doubleVal -= font2.stringWidth("Cracked") / 2; + doubleVal2 = this.getPosY() + 28.0; + doubleVal2 = doubleVal2 - font2.getHeight() / 2 + 18.0; + font2.drawString("Cracked", doubleVal, doubleVal2, -1, true); +} + + @Override + public double getDoubleValue2() { + return this.getParent().getPosY() + 35.0; +} +} diff --git a/src/main/java/cc/novoline/gui/widget/DialogConfirmButton.java b/src/main/java/cc/novoline/gui/widget/DialogConfirmButton.java new file mode 100644 index 0000000..8b82f06 --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/DialogConfirmButton.java @@ -0,0 +1,42 @@ +package cc.novoline.gui.widget; + +import cc.novoline.gui.click.AltCredentialDialog; + +public class DialogConfirmButton extends LabeledWidget { + final AltCredentialDialog altCredentialDialogField; + + @Override + public double getDoubleValue() { + return this.getParent().getPosX() + 230.0; +} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + int intVal = (this.evaluateFlag6(value, index) ? 1 : 0); + if (intVal == 0) { + return; + } + + intVal = count; + + if (intVal == 0) { + this.setActive(false); + this.getParent().setActive(true); + } +} + + @Override + public double getDoubleValue2() { + return this.getParent().getPosY() + 225.0; +} + + @Override + public boolean isReadyState() { + return true; +} + + public DialogConfirmButton(AltCredentialDialog altCredentialDialog, SelectAuthenticationWidget selectAuthenticationWidget, String text) { + super(selectAuthenticationWidget, text); + this.altCredentialDialogField = altCredentialDialog; +} +} diff --git a/src/main/java/cc/novoline/gui/widget/DualCallbackWidget.java b/src/main/java/cc/novoline/gui/widget/DualCallbackWidget.java new file mode 100644 index 0000000..19869bc --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/DualCallbackWidget.java @@ -0,0 +1,147 @@ +package cc.novoline.gui.widget; + +import cc.novoline.gui.alt.AltAccountEntry; +import cc.novoline.gui.click.SliderWidgetConstHolder; +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontFamilyNOVOGUI; +import cc.novoline.utils.shader.RoundedTextureShader; +import java.awt.Color; +import java.util.function.Consumer; +import cc.novoline.utils.fonts.api.FontFamily; +import cc.novoline.utils.fonts.holders.FontFamilyPOSTERAMA; + +public class DualCallbackWidget extends GuiWidget { + private String cachedText; + private double cachedValue; + private double cachedValue2; + private Consumer consumerField2; + private Consumer consumerField; + + public boolean evaluateFlag2(int value, int index) { + if (value <= this.getPosX()) { + return false; + } + + if (value >= (this.getPosX() + 67.0)) { + return false; + } + + if (index <= this.getPosY()) { + return false; + } + + return index < (this.getPosY() + 70.0); +} + + @Override + public double getDoubleValue2() { + return this.getParent().getPosY() + 140.0; +} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + int intVal = (this.evaluateFlag2(value, index) ? 1 : 0); + if (intVal == 0) { + return; + } + + intVal = count; + + if (intVal == 0) { + this.getParent().createAltAccountEntry((AltAccountEntry)null); + Consumer consumer = this.consumerField; + consumer.accept(this); + } +} + + @Override + public void applyUpdate(char ch, int value) {} + + public void createAltAccountEntry(double value) { + this.cachedValue2 = value; +} + + @Override + public void renderPanel2(int value, int index) { + FontRenderer font = FontFamilyPOSTERAMA.FAMILY.ofSize(20); + String textStr = this.cachedText; + double doubleVal = this.getPosX() + 33.0; + String textStr3 = this.cachedText; + doubleVal -= font.stringWidth(textStr3) / 2; + double doubleVal2 = this.getPosY() + 50.0; + font.drawString(textStr, doubleVal, doubleVal2, -1, true); + Consumer consumer = this.consumerField2; + consumer.accept(this); + DualCallbackWidget dualCallbackWidget = this; + if (this.getParent().getAD() == null) { + return; + } + + dualCallbackWidget = this; + + if (dualCallbackWidget.isActive()) { + FontFamily fontFam = FontFamilyNOVOGUI.FAMILY; + FontRenderer font2 = fontFam.ofSize(22); + String textStr2 = SliderWidgetConstHolder.textValue; + doubleVal = this.getPosX() + 53.0; + doubleVal2 = this.getPosY() + 6.0; + Color awtColor = new Color(30, 210, 1); + int color = awtColor.getRGB(); + font2.drawString(textStr2, doubleVal, doubleVal2, color, true); + } +} + + public DualCallbackWidget(AuthenticatedAsWidget authenticatedAsWidget, String text, Consumer consumer, Consumer consumerIn) { + super(authenticatedAsWidget); + this.cachedText = text; + this.consumerField2 = consumer; + this.consumerField = consumerIn; +} + + @Override + public void renderPanel(int value, int index) {} + + @Override + public void applyUpdate(int value, int index) { + label29: { + DualCallbackWidget dualCallbackWidget; + label27: { + DualCallbackWidget dualCallbackWidget2 = this; + if (!this.evaluateFlag2(value, index)) { + dualCallbackWidget = this; + + if (!this.isActive()) { + break label27; + } + } + + dualCallbackWidget2 = this; + + dualCallbackWidget2.cachedValue = this.cachedValue + (1.0 - this.cachedValue) * 0.04F; + break label29; + } + + dualCallbackWidget = this; + + dualCallbackWidget.cachedValue = dualCallbackWidget.cachedValue - this.cachedValue * 0.04F; + } + + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal = this.getPosX(); + double doubleVal2 = this.getPosY(); + Color awtColor = new Color(26, 26, 26); + Color awtColor2 = new Color(20, 20, 20); + double doubleVal3 = this.cachedValue; + Color awtColor3 = new Color(RenderUtils.interpolateColor(awtColor, awtColor2, doubleVal3)); + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent().getParent(); + double[] doubleArr = altRepositoryGUI.getPanelBounds(); + roundedTextureShader.applyUpdate2(doubleVal, doubleVal2, 67.0, 70.0, 10.0, 2.0, awtColor3, doubleArr, true); +} + + @Override + public double getDoubleValue() { + return this.cachedValue2; +} +} diff --git a/src/main/java/cc/novoline/gui/widget/FlatTextButtonWidget.java b/src/main/java/cc/novoline/gui/widget/FlatTextButtonWidget.java new file mode 100644 index 0000000..9336057 --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/FlatTextButtonWidget.java @@ -0,0 +1,120 @@ +package cc.novoline.gui.widget; + +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.shader.RoundedTextureShader; +import java.awt.Color; +import cc.novoline.utils.fonts.api.FontFamily; +import cc.novoline.utils.fonts.holders.FontFamilyPOSTERAMA; + +public class FlatTextButtonWidget extends GuiWidget { +private float cachedAngle; + private String textValue; + + public boolean evaluateFlag3(int value, int index) { + if (value <= this.getPosX()) { + return false; + } + + if (value >= (this.getPosX() + this.getFloatValue5())) { + return false; + } + + if (index <= this.getPosY()) { + return false; + } + + return index < (this.getPosY() + this.getFloatValue4()); +} + + @Override + public double getDoubleValue() { + double doubleVal = this.getParent().getPosX() - 220.3F; + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent().getParent(); + return doubleVal - altRepositoryGUI.getScrollOffset(); +} + + public float getFloatValue4() { + return 20.0F; +} + + @Override + public double getDoubleValue2() { + return this.getParent().getPosY() + 225.0; +} + + public float getFloatValue5() { + return 102.5F; +} + + @Override + public void mouseClickedPanel(int value, int index, int count) {} + + public FlatTextButtonWidget(AuthenticatedAsWidget authenticatedAsWidget, String text) { + super(authenticatedAsWidget); + this.textValue = text; +} + + @Override + public void applyUpdate(int value, int index) { + label20: { + FlatTextButtonWidget flatTextButtonWidget = this; + if (this.evaluateFlag3(value, index)) { + this.cachedAngle = this.cachedAngle + (1.0F - this.cachedAngle) * 0.04F; + break label20; + } + + flatTextButtonWidget = this; + + flatTextButtonWidget.cachedAngle = flatTextButtonWidget.cachedAngle - this.cachedAngle * 0.04F; + } + + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal = this.getPosX(); + double doubleVal2 = this.getPosY(); + double doubleVal3 = this.getFloatValue5(); + double doubleVal4 = this.getFloatValue4(); + Color awtColor2; + if (this.isActive()) { + Color awtColor = new Color(22, 22, 22); + Color awtColor3 = new Color(15, 15, 15); + double doubleVal5 = this.cachedAngle; + awtColor2 = new Color(RenderUtils.interpolateColor(awtColor, awtColor3, doubleVal5)); + } else { + awtColor2 = new Color(26, 26, 26); + } + + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent().getParent(); + double[] doubleArr = altRepositoryGUI.getPanelBounds(); + roundedTextureShader.applyUpdate2(doubleVal, doubleVal2, doubleVal3, doubleVal4, 15.0, 2.0, awtColor2, doubleArr, true); +} + + @Override + public void applyUpdate(char ch, int value) {} + + @Override + public void renderPanel2(int value, int index) { + FontRenderer font = FontFamilyPOSTERAMA.FAMILY.ofSize(23); + String textStr = this.textValue; + double doubleVal = this.getPosX() + this.getFloatValue5() / 2.0F; + String textStr2 = this.textValue; + double doubleVal2 = doubleVal - font.stringWidth(textStr2) / 2; + double doubleVal3 = this.getPosY() + this.getFloatValue4() / 2.0F; + double doubleVal4 = doubleVal3 - font.getHeight() / 2; + int intVal = (this.isActive() ? 1 : 0); + if (intVal != 0) { + Color awtColor = Color.WHITE; + intVal = awtColor.getRGB(); + } else { + Color awtColor2 = Color.WHITE; + Color awtColor3 = awtColor2.darker(); + intVal = awtColor3.getRGB(); + } + + font.drawString(textStr, doubleVal2, doubleVal4, intVal, true); +} + + @Override + public void renderPanel(int value, int index) {} +} diff --git a/src/main/java/cc/novoline/gui/widget/FontActionWidget.java b/src/main/java/cc/novoline/gui/widget/FontActionWidget.java new file mode 100644 index 0000000..8f0be1f --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/FontActionWidget.java @@ -0,0 +1,87 @@ +package cc.novoline.gui.widget; +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.fonts.api.FontRenderer; +import java.awt.Color; + + +public class FontActionWidget extends GuiWidget { + private FontRenderer fontRendererField; +private String cachedText; + private float cachedAngle; + + @Override + public void renderPanel2(int value, int index) { + label15: { + FontActionWidget fontActionWidget = this; + if (this.evaluateFlag4(value, index)) { + this.cachedAngle = this.cachedAngle + (1.0F - this.cachedAngle) * 0.02F; + break label15; + } + + fontActionWidget = this; + + fontActionWidget.cachedAngle = fontActionWidget.cachedAngle - this.cachedAngle * 0.02F; + } + + FontRenderer font = this.fontRendererField; + String textStr = this.cachedText; + double doubleVal = this.getPosX(); + double doubleVal2 = this.getPosY(); + Color awtColor = Color.WHITE; + awtColor = awtColor.darker(); + Color awtColor2 = Color.WHITE; + double doubleVal3 = this.cachedAngle; + int intVal = RenderUtils.interpolateColor(awtColor, awtColor2, doubleVal3); + font.drawString(textStr, doubleVal, doubleVal2, intVal, true); +} + + @Override + public void applyUpdate(char ch, int value) {} + + public FontActionWidget(AltRepositoryPanel altRepositoryPanel, FontRenderer font, String text) { + super(altRepositoryPanel); + this.cachedText = text; + this.fontRendererField = font; +} + + @Override + public double getDoubleValue2() { + return this.getParent().getPosY() + 233.0; +} + + @Override + public void applyUpdate(int value, int index) {} + + @Override + public double getDoubleValue() { + double doubleVal = this.getParent().getPosX(); + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent(); + doubleVal = doubleVal - altRepositoryGUI.getScrollOffset() + 215.0; + FontRenderer font = this.fontRendererField; + return doubleVal - font.stringWidth(this.cachedText) / 2; +} + + public boolean evaluateFlag4(int value, int index) { + double doubleVal = value; + double doubleVal2 = this.getPosX(); + FontRenderer font = this.fontRendererField; + String textStr = this.cachedText; + doubleVal -= doubleVal2 + font.stringWidth(textStr) / 2; + if (Math.abs(doubleVal) > 12.0) { + return false; + } + + doubleVal = index; + doubleVal2 = this.getPosY(); + font = this.fontRendererField; + doubleVal -= doubleVal2 + font.getHeight() / 2; + return Math.abs(doubleVal) <= 12.0; +} + + @Override + public void renderPanel(int value, int index) {} + + @Override + public void mouseClickedPanel(int value, int index, int count) {} +} diff --git a/src/main/java/cc/novoline/gui/widget/GoBackWidget.java b/src/main/java/cc/novoline/gui/widget/GoBackWidget.java new file mode 100644 index 0000000..a185733 --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/GoBackWidget.java @@ -0,0 +1,85 @@ +package cc.novoline.gui.widget; + +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.StencilUtil; +import com.sun.javafx.geom.Vec2d; +import java.util.List; + +public class GoBackWidget extends GuiWidget { + private final LabeledWidget labeledWidgetField; + private final TextInputBoxWidget textInputBoxWidgetField; + private final LabeledWidget labeledWidgetField2 = new BackNavigationButton(this, this.getParent(), "Go back"); + + @Override + public void renderPanel2(int value, int index) { + StencilUtil.initStencilToWrite(false); + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent().getParent(); + double[] doubleArr = altRepositoryGUI.getPanelBounds(); + double doubleVal = doubleArr[0]; + double doubleVal2 = doubleArr[1]; + double doubleVal3 = doubleArr[2]; + double doubleVal4 = doubleArr[3]; + RenderUtils.drawElement11(doubleVal, doubleVal2, doubleVal3, doubleVal4, -1); + StencilUtil.readStencilBuffer(true); + this.labeledWidgetField2.renderPanel2(value, index); + this.labeledWidgetField.renderPanel2(value, index); + this.textInputBoxWidgetField.renderPanel2(value, index); + StencilUtil.uninitStencilBuffer(); +} + + @Override + public void applyUpdate(int value, int index) { + TextInputBoxWidget textInputBoxWidget = this.textInputBoxWidgetField; + Vec2d vec2d = new Vec2d(this.getPosX(), this.getPosY() + 10.0); + textInputBoxWidget.createAltAccountEntry(vec2d); + textInputBoxWidget = this.textInputBoxWidgetField; + vec2d = new Vec2d(150.0, 15.0); + textInputBoxWidget.applyUpdate5(vec2d); + this.labeledWidgetField2.applyUpdate(value, index); + this.labeledWidgetField.applyUpdate(value, index); + this.textInputBoxWidgetField.applyUpdate(value, index); +} + + @Override + public double getDoubleValue() { + double doubleVal2 = this.getParent().getParent().getPosX() + 10.0; + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent().getParent(); + List itemList = altRepositoryGUI.getGuiWidgetList(); + double doubleVal = itemList.indexOf(this); + AltRepositoryGUI altRepositoryGUI2 = this.getParent().getParent().getParent(); + doubleVal2 += doubleVal * altRepositoryGUI2.getCachedValue2(); + altRepositoryGUI = this.getParent().getParent().getParent(); + return doubleVal2 - altRepositoryGUI.getScrollOffset(); +} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + this.labeledWidgetField2.mouseClickedPanel(value, index, count); + this.labeledWidgetField.mouseClickedPanel(value, index, count); + this.textInputBoxWidgetField.mouseClickedPanel(value, index, count); +} + + @Override + public void renderPanel(int value, int index) {} + + public TextInputBoxWidget getVLA() { + return this.textInputBoxWidgetField; +} + + @Override + public double getDoubleValue2() { + return this.getParent().getPosY(); +} + + @Override + public void applyUpdate(char ch, int value) { + this.textInputBoxWidgetField.applyUpdate(ch, value); +} + + public GoBackWidget(SelectAuthenticationWidget selectAuthenticationWidget) { + super(selectAuthenticationWidget); + this.labeledWidgetField = new PidorMinecraftWidget(this, this.getParent(), "Use this username"); + this.textInputBoxWidgetField = new TextInputBoxWidget(this, "Enter a username", 1); +} +} diff --git a/src/main/java/cc/novoline/gui/widget/GradientLabelWidget.java b/src/main/java/cc/novoline/gui/widget/GradientLabelWidget.java new file mode 100644 index 0000000..e039d74 --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/GradientLabelWidget.java @@ -0,0 +1,539 @@ +package cc.novoline.gui.widget; + +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontFamilySF_MEDIUM; +import cc.novoline.utils.shader.RoundedTextureShader; +import java.awt.Color; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import javax.vecmath.Vector2d; +import cc.novoline.utils.fonts.api.FontFamily; +import cc.novoline.utils.fonts.holders.FontFamilyPOSTERAMA; + +public class GradientLabelWidget extends GuiWidget { + private final String cachedText; + private float cachedAngle; + private String textValue = ""; + private int stateTicks; + private Vector2d vector2dField; + private Vector2d vector2dField2; + + public List applyUpdate(FontRenderer font, String text) { + int width; + ArrayList itemList = new ArrayList(); + StringBuilder sb = new StringBuilder(); + float floatVal = 0.0F; + char[] charArr = text.toCharArray(); + int len = charArr.length; + int intVal = 0; + + while (true) { + if (intVal < len) { + char ch = charArr[intVal]; + StringBuilder sb2 = new StringBuilder().append(ch); + String textStr7 = ""; + String textStr = sb2.append(textStr7).toString(); + double doubleVal; + width = (doubleVal = floatVal + font.stringWidth(textStr) - (this.vector2dField2.x - 25.0)) == 0.0 ? 0 : (doubleVal < 0.0 ? -1 : 1); + + label35: { + label34: { + if (width < 0) { + break label34; + } + + StringBuilder sb3 = new StringBuilder(); + String textStr2 = sb.toString(); + sb3 = sb3.append(textStr2); + String textStr3 = sb3.append(ch).toString(); + itemList.add(textStr3); + + sb = new StringBuilder(ch); + floatVal = 0.0F; + break label35; + } + + sb.append(ch); + } + + sb2 = new StringBuilder(); + sb2 = sb2.append(ch); + textStr7 = ""; + String textStr4 = sb2.append(textStr7).toString(); + floatVal += font.stringWidth(textStr4); + intVal++; + continue; + } + + String textStr5 = sb.toString(); + width = (textStr5.isEmpty() ? 1 : 0); + break; + } + + if (width == 0) { + String textStr6 = sb.toString(); + itemList.add(textStr6); + } + + int ticks = this.stateTicks; + int size2 = itemList.size(); + int intVal2 = Math.max(0, size2); + ticks = Math.min(ticks, intVal2); + return itemList.subList(0, ticks); +} + + public void createAltAccountEntry(String text) { + this.textValue = text; +} + + @Override + public void renderPanel2(int value, int index) { + FontRenderer font = FontFamilyPOSTERAMA.FAMILY.ofSize(25); + String textStr2 = this.cachedText; + double doubleVal = this.vector2dField.x; + double doubleVal2 = this.vector2dField.y; + font.drawString(textStr2, doubleVal, doubleVal2, -1, true); + FontFamily fontFam = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font2 = fontFam.ofSize(20); + double doubleVal3 = this.vector2dField.y + 22.0; + List itemList = this.applyUpdate(font2, this.textValue); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + String textStr = (String)iter.next(); + doubleVal = this.vector2dField.x + 3.0; + int color = (new Color(200, 200, 200)).getRGB(); + font2.drawString(textStr, doubleVal, doubleVal3, color, true); + doubleVal3 += 15.0; + } +} + + public GradientLabelWidget(AuthenticatedAsWidget authenticatedAsWidget, String text, int value) { + super(authenticatedAsWidget); + this.cachedText = text; + this.stateTicks = value; +} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + int intVal2 = (this.isActive() ? 1 : 0); + if (intVal2 == 0) { + int intVal = (this.evaluateFlag5(value, index) ? 1 : 0); + if (intVal == 0) { + return; + } + + intVal = count; + + if (intVal != 0) { + return; + } + + boolean flag = this.isActive(); + flag = !flag; + + this.setActive(flag); + return; + } + + intVal2 = count; + + if (intVal2 == 0) { + this.setActive(false); + } +} + + public void applyUpdate3(Vector2d vector2d) { + this.vector2dField = vector2d; +} + + @Override + public void applyUpdate(char ch, int value) { + int intVal = (this.isActive() ? 1 : 0); + if (intVal == 0) { + return; + } + + intVal = value; + + short shortVal = 14; + if (intVal == 14) { + GradientLabelWidget gradientLabelWidget = this; + String textStr = this.textValue; + if (textStr.length() == 0) { + return; + } + + gradientLabelWidget = this; + + String textStr2 = this.textValue; + int len = this.textValue.length() - 1; + gradientLabelWidget.textValue = textStr2.substring(0, len); + return; + } + + intVal = value; + shortVal = 1; + + label323: { + label343: { + if (intVal == shortVal) { + break label343; + } + + intVal = value; + shortVal = 28; + + if (intVal != shortVal) { + break label323; + } + } + + this.setActive(false); + return; + } + + intVal = value; + shortVal = 14; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 219; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 157; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 29; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 54; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 42; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 15; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 58; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 211; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 199; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 210; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 200; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 208; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 205; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 203; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 56; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 184; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 197; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 70; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 207; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 201; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 209; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 221; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 59; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 60; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 61; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 62; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 63; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 64; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 65; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 66; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 67; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 68; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 87; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 88; + + if (intVal != shortVal) { + StringBuilder sb2 = new StringBuilder().append(this.textValue); + this.textValue = sb2.append(ch).toString(); + StringBuilder sb3 = new StringBuilder(); + FontFamily fontFam = FontFamilySF_MEDIUM.FAMILY; + List itemList = this.applyUpdate(fontFam.ofSize(20), this.textValue); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + String textStr3 = (String)iter.next(); + sb3.append(textStr3); + + } + + this.textValue = sb3.toString(); + } +} + + @Override + public void applyUpdate(int value, int index) { + label27: { + GradientLabelWidget gradientLabelWidget; + label29: { + GradientLabelWidget gradientLabelWidget2 = this; + if (!this.evaluateFlag5(value, index)) { + gradientLabelWidget = this; + + if (!this.isActive()) { + break label29; + } + } + + gradientLabelWidget2 = this; + + gradientLabelWidget2.cachedAngle = this.cachedAngle + (1.0F - this.cachedAngle) * 0.04F; + break label27; + } + + gradientLabelWidget = this; + + gradientLabelWidget.cachedAngle = gradientLabelWidget.cachedAngle - this.cachedAngle * 0.04F; + } + + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal = this.vector2dField.x; + double doubleVal2 = this.vector2dField.y + 18.0; + double doubleVal3 = this.vector2dField2.x; + double doubleVal4 = this.vector2dField2.y; + Color awtColor = new Color(26, 26, 26); + Color awtColor2 = new Color(20, 20, 20); + double doubleVal5 = this.cachedAngle; + Color awtColor3 = new Color(RenderUtils.interpolateColor(awtColor, awtColor2, doubleVal5)); + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent().getParent(); + double[] doubleArr = altRepositoryGUI.getPanelBounds(); + roundedTextureShader.applyUpdate2(doubleVal, doubleVal2, doubleVal3, doubleVal4, 6.0, 2.0, awtColor3, doubleArr, true); +} + + @Override + public void renderPanel(int value, int index) {} + + public void createAltAccountEntry(Vector2d vector2d) { + this.vector2dField2 = vector2d; +} + + public Vector2d getVector2dA() { + return this.vector2dField2; +} + + public boolean evaluateFlag5(int value, int index) { + if (value <= this.vector2dField.x) { + return false; + } + + if (value >= (this.vector2dField.x + this.vector2dField2.x)) { + return false; + } + + if (index <= (this.vector2dField.y + 18.0)) { + return false; + } + + return index < (this.vector2dField.y + 18.0 + this.vector2dField2.y); +} + + public Vector2d getVector2dD() { + return this.vector2dField; +} + + public String getStringValue() { + return this.textValue; +} +} diff --git a/src/main/java/cc/novoline/gui/widget/GuiWidget.java b/src/main/java/cc/novoline/gui/widget/GuiWidget.java new file mode 100644 index 0000000..1442ab0 --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/GuiWidget.java @@ -0,0 +1,48 @@ +package cc.novoline.gui.widget; + + +public abstract class GuiWidget { + private T objValue; + private boolean stateFlag; + private float cachedAngle; + private float cachedAngle2; +public void createAltAccountEntry(boolean flag) { + this.stateFlag = flag; +} + + public double getDoubleValue() { + return this.cachedAngle; +} + + public double getDoubleValue2() { + return this.cachedAngle2; +} + + public T getObjValue() { + return this.objValue; +} + + public GuiWidget(T param) { + this.objValue = (T)param; +} + + public abstract void applyUpdate(int value, int index); + + public abstract void applyUpdate(char ch, int value); + + public abstract void mouseClickedPanel(int value, int index, int count); + + public boolean isReadyState() { + return this.stateFlag; +} + + public abstract void renderPanel(int value, int index); + + public abstract void renderPanel2(int value, int index); + + public T getParent() { return this.getObjValue(); } + public double getPosX() { return this.getDoubleValue(); } + public double getPosY() { return this.getDoubleValue2(); } + public boolean isActive() { return this.isReadyState(); } + public void setActive(boolean active) { this.createAltAccountEntry(active); } +} diff --git a/src/main/java/cc/novoline/gui/widget/HttpsAltsWidget.java b/src/main/java/cc/novoline/gui/widget/HttpsAltsWidget.java new file mode 100644 index 0000000..bbdc9fd --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/HttpsAltsWidget.java @@ -0,0 +1,53 @@ +package cc.novoline.gui.widget; + +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontFamilyPROFILES; +import java.awt.Desktop; +import java.io.IOException; +import java.net.URI; +import cc.novoline.utils.fonts.api.FontFamily; + +public class HttpsAltsWidget extends FontActionWidget { + final AltRepositoryPanel altRepositoryPanelField; + + @Override + public double getDoubleValue() { + double doubleVal = this.getParent().getPosX(); + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent(); + doubleVal = doubleVal - altRepositoryGUI.getScrollOffset() + 165.0; + FontFamily fontFam = FontFamilyPROFILES.FAMILY; + FontRenderer font = fontFam.ofSize(47); + return doubleVal - font.stringWidth("F") / 2; +} + + @Override + public double getDoubleValue2() { + return this.getParent().getPosY() + 232.0; +} + + HttpsAltsWidget(AltRepositoryPanel altRepositoryPanel, AltRepositoryPanel altRepositoryPanelArg, FontRenderer fontRenderer, String text) { + super(altRepositoryPanelArg, fontRenderer, text); + this.altRepositoryPanelField = altRepositoryPanel; +} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + int intVal = (this.evaluateFlag4(value, index) ? 1 : 0); + if (intVal == 0) { + return; + } + + intVal = count; + + if (intVal == 0) { + try { + Desktop.getDesktop().browse(URI.create("https://alts.novoline.lol/")); + } catch (IOException ex) { + ex.printStackTrace(); + } + } +} + + +} diff --git a/src/main/java/cc/novoline/gui/widget/Iterator6FunctionHelper.java b/src/main/java/cc/novoline/gui/widget/Iterator6FunctionHelper.java new file mode 100644 index 0000000..d124d47 --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/Iterator6FunctionHelper.java @@ -0,0 +1,190 @@ +package cc.novoline.gui.widget; + +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; +import java.util.Collection; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Stream; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public final class Iterator6FunctionHelper implements Iterable { + private final Function functionField; + private static String[] b; + private final Collection collectionField; + private List fList; + private final Supplier> supplierField; + + public int computeIntValue() { + return this.fList.size(); +} + + @NotNull + @Override + public Iterator iterator() { + return this.fList.iterator(); +} + + public void applyUpdate(T param) { + Collection coll = this.collectionField; + boolean flag = coll.contains(param); + if (flag) { + return; + } + + coll = this.collectionField; + coll.add(param); + + Object obj = this.functionField.apply((T)param); + if (obj == null) { + return; + } + + List itemList = this.fList; + itemList.add(obj); + + this.updateHelper(); +} + + static { + if (b() != null) { + b(new String[2]); + } + } + + public static String[] b() { + return b; +} + + @NotNull + public Stream getStream() { + return this.fList.stream(); +} + + public void performAction() { + this.fList = new ObjectArrayList<>(this.collectionField.size()); + Iterator iter = this.collectionField.iterator(); + + while (true) { + if (iter.hasNext()) { + Object obj = iter.next(); + Object obj2 = this.functionField.apply((T)obj); + + if (obj2 != null) { + List itemList = this.fList; + itemList.add(obj2); + } + + continue; + } + + this.updateHelper(); + break; + } +} + + @NotNull + private Set applyUpdate(@NotNull Collection collection) { + ObjectOpenHashSet objectOpenHashSet = new ObjectOpenHashSet(collection.size()); + Iterator iter = collection.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + Object obj = iter.next(); + Object obj2 = this.functionField.apply((T)obj); + if (obj2 != null) { + objectOpenHashSet.add(obj2); + } + } + + return objectOpenHashSet; +} + + public static void b(String[] args) { + b = args; +} + + @NotNull + public List getFList() { + return this.fList; +} + + public int computeObjectInt(@NotNull T param) { + Object obj = this.functionField.apply((T)param); + return obj != null ? this.fList.indexOf(obj) : -1; +} + + private void updateHelper() { + Iterator6FunctionHelper iterator6FunctionHelper = this; + + if (this.supplierField == null) { + return; + } + + iterator6FunctionHelper = this; + + + List itemList = iterator6FunctionHelper.fList; + Comparator comparator = this.supplierField.get(); + itemList.sort(comparator); +} + + public Iterator6FunctionHelper(@NotNull Collection collection, @NotNull Function function, @Nullable Supplier> supplier) { + this.functionField = function; + this.supplierField = supplier; + this.collectionField = collection; + this.performAction(); +} + + @NotNull + public List resolveList(int value, int index) { + return this.fList.subList(value, index); +} + + @NotNull + public Collection getCollectionField() { + return this.collectionField; +} + + public void performAction2() { + this.collectionField.clear(); + this.fList.clear(); +} + + public boolean checkCondition(T param) { + boolean flag = this.collectionField.remove(param); + + if (flag) { + Object obj = this.functionField.apply((T)param); + if (obj != null) { + this.fList.remove(obj); + } + + return true; + } + + flag = false; + + + return flag; +} + + public boolean isStateReady() { + int intVal = this.computeIntValue(); + intVal = intVal < 1 ? 1 : 0; + + return (intVal != 0); +} + + public F applyUpdate(int value) { + return this.fList.get(value); +} +} diff --git a/src/main/java/cc/novoline/gui/widget/LabeledWidget.java b/src/main/java/cc/novoline/gui/widget/LabeledWidget.java new file mode 100644 index 0000000..f9320ba --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/LabeledWidget.java @@ -0,0 +1,120 @@ +package cc.novoline.gui.widget; +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.shader.RoundedTextureShader; +import java.awt.Color; + +import cc.novoline.utils.fonts.api.FontFamily; +import cc.novoline.utils.fonts.holders.FontFamilyPOSTERAMA; + +public class LabeledWidget extends GuiWidget { + private float cachedAngle; +private String cachedText; + + @Override + public void applyUpdate(char ch, int value) {} + + public float getFloatValue6() { + return 210.0F; +} + + @Override + public void mouseClickedPanel(int value, int index, int count) {} + + public float getFloatValue7() { + return 20.0F; +} + + @Override + public void renderPanel(int value, int index) {} + + public LabeledWidget(SelectAuthenticationWidget selectAuthenticationWidget, String text) { + super(selectAuthenticationWidget); + this.cachedText = text; +} + + @Override + public void applyUpdate(int value, int index) { + label20: { + LabeledWidget labeledWidget = this; + if (this.evaluateFlag6(value, index)) { + this.cachedAngle = this.cachedAngle + (1.0F - this.cachedAngle) * 0.04F; + break label20; + } + + labeledWidget = this; + + labeledWidget.cachedAngle = labeledWidget.cachedAngle - this.cachedAngle * 0.04F; + } + + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal = this.getPosX(); + double doubleVal2 = this.getPosY(); + double doubleVal3 = this.getFloatValue6(); + double doubleVal4 = this.getFloatValue7(); + Color awtColor2; + if (this.isActive()) { + Color awtColor = new Color(22, 22, 22); + Color awtColor3 = new Color(15, 15, 15); + double doubleVal5 = this.cachedAngle; + awtColor2 = new Color(RenderUtils.interpolateColor(awtColor, awtColor3, doubleVal5)); + } else { + awtColor2 = new Color(26, 26, 26); + } + + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent().getParent(); + double[] doubleArr = altRepositoryGUI.getPanelBounds(); + roundedTextureShader.applyUpdate2(doubleVal, doubleVal2, doubleVal3, doubleVal4, 15.0, 2.0, awtColor2, doubleArr, true); +} + + @Override + public double getDoubleValue() { + double doubleVal = this.getParent().getPosX() - 220.3F; + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent().getParent(); + return doubleVal - altRepositoryGUI.getScrollOffset(); +} + + @Override + public void renderPanel2(int value, int index) { + FontRenderer font = FontFamilyPOSTERAMA.FAMILY.ofSize(23); + String textStr = this.cachedText; + double doubleVal = this.getPosX() + this.getFloatValue6() / 2.0F; + String textStr2 = this.cachedText; + double doubleVal2 = doubleVal - font.stringWidth(textStr2) / 2; + double doubleVal3 = this.getPosY() + this.getFloatValue7() / 2.0F; + double doubleVal4 = doubleVal3 - font.getHeight() / 2; + int intVal = (this.isActive() ? 1 : 0); + if (intVal != 0) { + Color awtColor = Color.WHITE; + intVal = awtColor.getRGB(); + } else { + Color awtColor2 = Color.WHITE; + Color awtColor3 = awtColor2.darker(); + intVal = awtColor3.getRGB(); + } + + font.drawString(textStr, doubleVal2, doubleVal4, intVal, true); +} + + public boolean evaluateFlag6(int value, int index) { + if (value <= this.getPosX()) { + return false; + } + + if (value >= (this.getPosX() + this.getFloatValue6())) { + return false; + } + + if (index <= this.getPosY()) { + return false; + } + + return index < (this.getPosY() + this.getFloatValue7()); +} + + @Override + public double getDoubleValue2() { + return this.getParent().getPosY() + 225.0; +} +} diff --git a/src/main/java/cc/novoline/gui/widget/MinecraftMicrosoftWidget.java b/src/main/java/cc/novoline/gui/widget/MinecraftMicrosoftWidget.java new file mode 100644 index 0000000..c906f0e --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/MinecraftMicrosoftWidget.java @@ -0,0 +1,125 @@ +package cc.novoline.gui.widget; + +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.shader.RoundedTextureShader; +import fr.litarvan.openauth.microsoft.MicrosoftAuthResult; +import fr.litarvan.openauth.microsoft.MicrosoftAuthenticator; +import fr.litarvan.openauth.microsoft.model.response.MinecraftProfile; +import java.awt.Color; +import cc.novoline.gui.alt.AltAccountTokenHelper; +import cc.novoline.utils.fonts.api.FontFamily; +import cc.novoline.utils.fonts.holders.FontFamilyPOSTERAMA; +import net.minecraft.client.Minecraft; + +public class MinecraftMicrosoftWidget extends ValueWidget { + final SelectAuthenticationWidget selectAuthenticationWidgetField; + + private void invokeCallback(MicrosoftAuthResult microsoftAuthResult, Throwable throwable) { + Minecraft mcClient = Minecraft.getMinecraft(); + MinecraftProfile minecraftProfile = microsoftAuthResult.getProfile(); + String nameStr = minecraftProfile.getName(); + MinecraftProfile minecraftProfile2 = microsoftAuthResult.getProfile(); + mcClient.session = new AltAccountTokenHelper(nameStr, minecraftProfile2.getId(), microsoftAuthResult.getAccessToken(), "minecraft"); + this.getParent().applyUpdate4(true); +} + + @Override + public void renderPanel2(int value, int index) { + FontRenderer font = FontFamilyPOSTERAMA.FAMILY.ofSize(25); + double doubleVal = this.getPosX() + 80.0; + doubleVal -= font.stringWidth("Microsoft") / 2; + double doubleVal2 = this.getPosY() + 28.0; + doubleVal2 = doubleVal2 - font.getHeight() / 2 + 18.0; + font.drawString("Microsoft", doubleVal, doubleVal2, -1, true); +} + + @Override + public void applyUpdate(int value, int index) { + double doubleVal = this.getPosX() + 80.0 - 14.0; + double doubleVal2 = this.getPosY() + 28.0 - 22.0; + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent().getParent(); + double[] doubleArr = altRepositoryGUI.getPanelBounds(); + RenderUtils.drawElement10(doubleVal, doubleVal2, 12.0F, 4.0F, doubleArr); +} + + @Override + public double getDoubleValue2() { + return this.getParent().getPosY() + 97.0; +} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + int intVal = (this.isFlagA(value, index) ? 1 : 0); + if (intVal == 0) { + return; + } + + intVal = count; + + if (intVal == 0) { + MicrosoftAuthenticator microsoftAuthenticator = new MicrosoftAuthenticator(); + microsoftAuthenticator.loginWithAsyncWebview().whenComplete(this::invokeCallback); + } +} + + @Override + public boolean isFlagA(int value, int index) { + if (value <= this.getPosX()) { + return false; + } + + if (value >= (this.getPosX() + 160.0)) { + return false; + } + + if (index <= this.getPosY()) { + return false; + } + + return index < (this.getPosY() + 57.0); +} + + @Override + public void renderPanel3(int value, int index) { + label25: { + MinecraftMicrosoftWidget minecraftMicrosoftWidget; + label23: { + MinecraftMicrosoftWidget minecraftMicrosoftWidget2 = this; + if (!this.isFlagA(value, index)) { + minecraftMicrosoftWidget = this; + + if (!this.isActive()) { + break label23; + } + } + + minecraftMicrosoftWidget2 = this; + + minecraftMicrosoftWidget2.createAltAccountEntry(this.getFloatValue8() + (1.0F - this.getFloatValue8()) * 0.04F); + break label25; + } + + minecraftMicrosoftWidget = this; + + minecraftMicrosoftWidget.createAltAccountEntry(this.getFloatValue8() - this.getFloatValue8() * 0.04F); + } + + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal = this.getPosX(); + double doubleVal2 = this.getPosY(); + Color awtColor = new Color(26, 26, 26); + Color awtColor2 = new Color(20, 20, 20); + double doubleVal3 = this.getFloatValue8(); + Color awtColor3 = new Color(RenderUtils.interpolateColor(awtColor, awtColor2, doubleVal3)); + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent().getParent(); + double[] doubleArr = altRepositoryGUI.getPanelBounds(); + roundedTextureShader.applyUpdate2(doubleVal, doubleVal2, 160.0, 57.0, 12.0, 2.0, awtColor3, doubleArr, true); +} + + MinecraftMicrosoftWidget(SelectAuthenticationWidget selectAuthenticationWidget, SelectAuthenticationWidget selectAuthenticationWidgetArg) { + super(selectAuthenticationWidgetArg); + this.selectAuthenticationWidgetField = selectAuthenticationWidget; +} +} diff --git a/src/main/java/cc/novoline/gui/widget/MinecraftWidget.java b/src/main/java/cc/novoline/gui/widget/MinecraftWidget.java new file mode 100644 index 0000000..fb4e2f2 --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/MinecraftWidget.java @@ -0,0 +1,60 @@ +package cc.novoline.gui.widget; + +import cc.novoline.gui.click.AltCredentialDialog; +import fr.litarvan.openauth.microsoft.MicrosoftAuthResult; +import fr.litarvan.openauth.microsoft.MicrosoftAuthenticator; +import fr.litarvan.openauth.microsoft.model.response.MinecraftProfile; +import cc.novoline.gui.alt.AltAccountTokenHelper; +import net.minecraft.client.Minecraft; + +public class MinecraftWidget extends LabeledWidget { + final AltCredentialDialog altCredentialDialogField; + + private void invokeCallback(MicrosoftAuthResult microsoftAuthResult, Throwable throwable) { + Minecraft mcClient = Minecraft.getMinecraft(); + MinecraftProfile minecraftProfile = microsoftAuthResult.getProfile(); + String nameStr = minecraftProfile.getName(); + MinecraftProfile minecraftProfile2 = microsoftAuthResult.getProfile(); + mcClient.session = new AltAccountTokenHelper(nameStr, minecraftProfile2.getId(), microsoftAuthResult.getAccessToken(), "minecraft"); + this.getParent().applyUpdate4(true); +} + + @Override + public boolean isReadyState() { + return true; +} + + @Override + public double getDoubleValue() { + return this.getParent().getPosX() + 230.0; +} + + @Override + public double getDoubleValue2() { + return this.getParent().getPosY() + 200.0; +} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + int intVal = (this.evaluateFlag6(value, index) ? 1 : 0); + if (intVal == 0) { + return; + } + + intVal = count; + + if (intVal == 0) { + this.setActive(false); + this.getParent().createAltAccountEntry(true); + MicrosoftAuthenticator microsoftAuthenticator = new MicrosoftAuthenticator(); + TextInputBoxWidget textInputBoxWidget = this.altCredentialDialogField.getTextInputBoxWidgetField(); + String textStr = textInputBoxWidget.getStringValue2(); + microsoftAuthenticator.loginWithAsyncWebview(textStr).whenComplete(this::invokeCallback); + } +} + + public MinecraftWidget(AltCredentialDialog altCredentialDialog, SelectAuthenticationWidget selectAuthenticationWidget, String text) { + super(selectAuthenticationWidget, text); + this.altCredentialDialogField = altCredentialDialog; +} +} diff --git a/src/main/java/cc/novoline/gui/widget/PidorMinecraftWidget.java b/src/main/java/cc/novoline/gui/widget/PidorMinecraftWidget.java new file mode 100644 index 0000000..beb44f0 --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/PidorMinecraftWidget.java @@ -0,0 +1,60 @@ +package cc.novoline.gui.widget; + +import cc.novoline.Novoline; +import cc.novoline.utils.notifications.NotificationManager; +import cc.novoline.utils.notifications.NotificationType; +import java.util.UUID; +import cc.novoline.gui.alt.AltAccountTokenHelper; +import net.minecraft.client.Minecraft; + +public class PidorMinecraftWidget extends LabeledWidget { + final GoBackWidget goBackWidgetField; + + @Override + public double getDoubleValue() { + return this.getParent().getPosX() + 230.0; +} + + PidorMinecraftWidget(GoBackWidget goBackWidget, SelectAuthenticationWidget selectAuthenticationWidget, String text) { + super(selectAuthenticationWidget, text); + this.goBackWidgetField = goBackWidget; +} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + int intVal = (this.evaluateFlag6(value, index) ? 1 : 0); + if (intVal == 0) { + return; + } + + intVal = count; + + if (intVal == 0) { + this.setActive(false); + this.getParent().getParent().setActive(true); + TextInputBoxWidget textInputBoxWidget = this.goBackWidgetField.getVLA(); + String textStr = textInputBoxWidget.getStringValue2(); + int len = textStr.length(); + int intVal2 = Math.min(16, len); + String textStr2 = textStr.substring(0, intVal2); + Minecraft mcClient = Minecraft.getMinecraft(); + mcClient.session = new AltAccountTokenHelper(textStr2, UUID.randomUUID().toString(), "pidor", "minecraft"); + Novoline novolineInst = Novoline.getInstance(); + NotificationManager notifManager = novolineInst.getNotificationManager(); + StringBuilder sb2 = new StringBuilder().append("Now using username "); + String textStr3 = sb2.append(textStr2).toString(); + NotificationType notificationType = NotificationType.INFO; + notifManager.pop("Cracked Login", textStr3, notificationType); + } +} + + @Override + public boolean isReadyState() { + return true; +} + + @Override + public double getDoubleValue2() { + return this.getParent().getPosY() + 200.0; +} +} diff --git a/src/main/java/cc/novoline/gui/widget/SelectAuthenticationWidget.java b/src/main/java/cc/novoline/gui/widget/SelectAuthenticationWidget.java new file mode 100644 index 0000000..6a24c7e --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/SelectAuthenticationWidget.java @@ -0,0 +1,169 @@ +package cc.novoline.gui.widget; + +import cc.novoline.Novoline; +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.StencilUtil; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.notifications.NotificationManager; +import cc.novoline.utils.notifications.NotificationType; +import java.util.List; +import cc.novoline.utils.fonts.api.FontFamily; +import cc.novoline.utils.fonts.holders.FontFamilyPOSTERAMA; +import net.minecraft.client.Minecraft; +import novo.cookie.CookieAuthenticator; + +public class SelectAuthenticationWidget extends GuiWidget { + private final ValueWidget valueWidgetField; + private boolean stateFlag; + private final ValueWidget valueWidgetField2; + private LabeledWidget labeledWidgetField; + private final ValueWidget valueWidgetField3; + private final ValueWidget valueWidget; + private CookieAuthenticator cookieAuthenticatorField; + private String cachedText = null; + + @Override + public double getDoubleValue() { + double doubleVal2 = this.getParent().getParent().getCachedValue3() + 15.0; + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent(); + List itemList = altRepositoryGUI.getGuiWidgetList(); + double doubleVal = itemList.indexOf(this); + AltRepositoryGUI altRepositoryGUI2 = this.getParent().getParent(); + doubleVal2 = doubleVal2 + doubleVal * altRepositoryGUI2.getCachedValue2() - 220.3F; + altRepositoryGUI = this.getParent().getParent(); + return doubleVal2 - altRepositoryGUI.getScrollOffset(); +} + + static CookieAuthenticator resolveCookieAuthenticator(SelectAuthenticationWidget selectAuthenticationWidget) { + return selectAuthenticationWidget.cookieAuthenticatorField; +} + + @Override + public double getDoubleValue2() { + return this.getParent().getParent().getCachedValue4(); +} + + static String applyUpdate(SelectAuthenticationWidget selectAuthenticationWidget, String text) { + return selectAuthenticationWidget.cachedText = text; +} + + @Override + public void applyUpdate(char ch, int value) {} + + static CookieAuthenticator applyUpdate(SelectAuthenticationWidget selectAuthenticationWidget, CookieAuthenticator cookieAuthenticator) { + return selectAuthenticationWidget.cookieAuthenticatorField = cookieAuthenticator; +} + + @Override + public void renderPanel2(int value, int index) { + StencilUtil.initStencilToWrite(false); + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent(); + double[] doubleArr = altRepositoryGUI.getPanelBounds(); + double doubleVal = doubleArr[0]; + double doubleVal2 = doubleArr[1]; + double doubleVal3 = doubleArr[2]; + double doubleVal4 = doubleArr[3]; + RenderUtils.drawElement11(doubleVal, doubleVal2, doubleVal3, doubleVal4, -1); + StencilUtil.readStencilBuffer(true); + this.valueWidgetField.renderPanel2(value, index); + this.valueWidget.renderPanel2(value, index); + this.valueWidgetField2.renderPanel2(value, index); + this.valueWidgetField3.renderPanel2(value, index); + this.labeledWidgetField.renderPanel2(value, index); + FontFamily fontFam = FontFamilyPOSTERAMA.FAMILY; + FontRenderer font = fontFam.ofSize(25); + String textStr = "Select authentication type"; + doubleVal3 = this.getPosX(); + doubleVal4 = this.getPosY() + 13.0; + font.drawString(textStr, doubleVal3, doubleVal4, -1, true); + StencilUtil.uninitStencilBuffer(); +} + + public void applyUpdate4(boolean flag) { + this.stateFlag = flag; +} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + this.valueWidgetField2.mouseClickedPanel(value, index, count); + this.valueWidget.mouseClickedPanel(value, index, count); + this.valueWidgetField.mouseClickedPanel(value, index, count); + this.valueWidgetField3.mouseClickedPanel(value, index, count); + this.labeledWidgetField.mouseClickedPanel(value, index, count); +} + + @Override + public void renderPanel(int value, int index) {} + + public SelectAuthenticationWidget(AltRepositoryPanel altRepositoryPanel) { + super(altRepositoryPanel); + this.labeledWidgetField = new AuthSelectButtonWidget(this, this, "Go back"); + this.valueWidgetField = new CrackedWidget(this, this); + this.valueWidget = new MinecraftMicrosoftWidget(this, this); + this.valueWidgetField3 = new AuthModeToggleWidget(this, this); + this.valueWidgetField2 = new UsernameUuidWidget(this, this); +} + + @Override + public void applyUpdate(int value, int index) { + java.lang.String msgText; + SelectAuthenticationWidget selectAuthenticationWidget = this; + if (this.stateFlag) { + Novoline novolineInst = Novoline.getInstance(); + NotificationManager notifManager = novolineInst.getNotificationManager(); + StringBuilder sb = new StringBuilder(); + sb = sb.append("Logged in as "); + String textStr3 = Minecraft.getMinecraft().session.getCachedText(); + String textStr4 = sb.append(textStr3).toString(); + NotificationType notificationType = NotificationType.INFO; + notifManager.pop("Microsoft Login", textStr4, notificationType); + this.stateFlag = false; + } + + selectAuthenticationWidget = this; + + if (selectAuthenticationWidget.cookieAuthenticatorField != null) { + CookieAuthenticator cookieAuthenticator = this.cookieAuthenticatorField; + msgText = cookieAuthenticator.getErrorMessage(); + + if (msgText != null) { + Novoline novolineInst2 = Novoline.getInstance(); + NotificationManager notifManager2 = novolineInst2.getNotificationManager(); + String textStr = "Cookie Login"; + CookieAuthenticator cookieAuthenticator2 = this.cookieAuthenticatorField; + String msgText2 = cookieAuthenticator2.getErrorMessage(); + NotificationType notificationType2 = NotificationType.ERROR; + notifManager2.pop(textStr, msgText2, notificationType2); + CookieAuthenticator cookieAuthenticator3 = this.cookieAuthenticatorField; + cookieAuthenticator3.setErrorMessage(null); + } + } + + selectAuthenticationWidget = this; + + msgText = selectAuthenticationWidget.cachedText; + + if (msgText != null) { + Novoline novolineInst3 = Novoline.getInstance(); + NotificationManager notifManager3 = novolineInst3.getNotificationManager(); + String textStr2 = "Cookie Login"; + String textStr5 = this.cachedText; + NotificationType notificationType3 = NotificationType.INFO; + notifManager3.pop(textStr2, textStr5, notificationType3); + this.cachedText = null; + } + + this.valueWidgetField.renderPanel3(value, index); + this.valueWidget.renderPanel3(value, index); + this.valueWidget.applyUpdate(value, index); + this.valueWidgetField3.renderPanel3(value, index); + this.valueWidgetField3.applyUpdate(value, index); + this.valueWidgetField2.renderPanel3(value, index); + selectAuthenticationWidget = this; + + selectAuthenticationWidget.labeledWidgetField.applyUpdate(value, index); +} + + public novo.cookie.CookieAuthenticator getCookieAuthenticatorField() { return this.cookieAuthenticatorField; } +} diff --git a/src/main/java/cc/novoline/gui/widget/TextInputBoxWidget.java b/src/main/java/cc/novoline/gui/widget/TextInputBoxWidget.java new file mode 100644 index 0000000..0ea6050 --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/TextInputBoxWidget.java @@ -0,0 +1,541 @@ +package cc.novoline.gui.widget; +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontFamilySF_MEDIUM; +import cc.novoline.utils.shader.RoundedTextureShader; +import com.sun.javafx.geom.Vec2d; +import java.awt.Color; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import cc.novoline.utils.fonts.api.FontFamily; +import cc.novoline.utils.fonts.holders.FontFamilyPOSTERAMA; + +public class TextInputBoxWidget extends GuiWidget { + private int stateTicks; + private String cachedText = ""; + private final String cachedText2; + private Vec2d vec2dField2; + private Vec2d vec2dField; + private float cachedAngle; + + public Vec2d getVec2dD() { + return this.vec2dField; +} + + public TextInputBoxWidget(GoBackWidget goBackWidget, String text, int value) { + super(goBackWidget); + this.cachedText2 = text; + this.stateTicks = value; +} + + public void applyUpdate5(Vec2d vec2d) { + this.vec2dField2 = vec2d; +} + + public String getStringValue2() { + return this.cachedText; +} + + public List applyUpdate(FontRenderer font, String text) { + int width; + ArrayList itemList = new ArrayList(); + StringBuilder sb = new StringBuilder(); + float floatVal = 0.0F; + char[] charArr = text.toCharArray(); + int len = charArr.length; + int intVal = 0; + + while (true) { + if (intVal < len) { + char ch = charArr[intVal]; + StringBuilder sb2 = new StringBuilder().append(ch); + String textStr7 = ""; + String textStr = sb2.append(textStr7).toString(); + double doubleVal; + width = (doubleVal = floatVal + font.stringWidth(textStr) - (this.vec2dField2.x - 25.0)) == 0.0 ? 0 : (doubleVal < 0.0 ? -1 : 1); + + label35: { + label34: { + if (width < 0) { + break label34; + } + + StringBuilder sb3 = new StringBuilder(); + String textStr2 = sb.toString(); + sb3 = sb3.append(textStr2); + String textStr3 = sb3.append(ch).toString(); + itemList.add(textStr3); + + sb = new StringBuilder(ch); + floatVal = 0.0F; + break label35; + } + + sb.append(ch); + } + + sb2 = new StringBuilder(); + sb2 = sb2.append(ch); + textStr7 = ""; + String textStr4 = sb2.append(textStr7).toString(); + floatVal += font.stringWidth(textStr4); + intVal++; + continue; + } + + String textStr5 = sb.toString(); + width = (textStr5.isEmpty() ? 1 : 0); + break; + } + + if (width == 0) { + String textStr6 = sb.toString(); + itemList.add(textStr6); + } + + int ticks = this.stateTicks; + int size2 = itemList.size(); + int intVal2 = Math.max(0, size2); + ticks = Math.min(ticks, intVal2); + return itemList.subList(0, ticks); +} + + @Override + public void renderPanel2(int value, int index) { + FontFamily fontFam = FontFamilyPOSTERAMA.FAMILY; + FontRenderer font = fontFam.ofSize(25); + String textStr2 = this.cachedText2; + double doubleVal = this.vec2dField.x; + double doubleVal2 = this.vec2dField.y; + font.drawString(textStr2, doubleVal, doubleVal2, -1, true); + fontFam = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font2 = fontFam.ofSize(20); + double doubleVal3 = this.vec2dField.y + 22.0; + List itemList = this.applyUpdate(font2, this.cachedText); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + String textStr = (String)iter.next(); + double doubleVal4 = this.vec2dField.x + 3.0; + Color awtColor = new Color(200, 200, 200); + int color = awtColor.getRGB(); + font2.drawString(textStr, doubleVal4, doubleVal3, color, true); + doubleVal3 += 15.0; + } +} + + public boolean evaluateFlag7(int value, int index) { + if (value <= this.vec2dField.x) { + return false; + } + + if (value >= (this.vec2dField.x + this.vec2dField2.x)) { + return false; + } + + if (index <= (this.vec2dField.y + 18.0)) { + return false; + } + + return index < (this.vec2dField.y + 18.0 + this.vec2dField2.y); +} + + public void createAltAccountEntry(Vec2d vec2d) { + this.vec2dField = vec2d; +} + + @Override + public void applyUpdate(int value, int index) { + label27: { + TextInputBoxWidget textInputBoxWidget; + label29: { + TextInputBoxWidget textInputBoxWidget2 = this; + if (!this.evaluateFlag7(value, index)) { + textInputBoxWidget = this; + + if (!this.isActive()) { + break label29; + } + } + + textInputBoxWidget2 = this; + + textInputBoxWidget2.cachedAngle = this.cachedAngle + (1.0F - this.cachedAngle) * 0.04F; + break label27; + } + + textInputBoxWidget = this; + + textInputBoxWidget.cachedAngle = textInputBoxWidget.cachedAngle - this.cachedAngle * 0.04F; + } + + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal = this.vec2dField.x; + double doubleVal2 = this.vec2dField.y + 18.0; + double doubleVal3 = this.vec2dField2.x; + double doubleVal4 = this.vec2dField2.y; + Color awtColor = new Color(26, 26, 26); + Color awtColor2 = new Color(20, 20, 20); + double doubleVal5 = this.cachedAngle; + Color awtColor3 = new Color(RenderUtils.interpolateColor(awtColor, awtColor2, doubleVal5)); + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent().getParent().getParent(); + double[] doubleArr = altRepositoryGUI.getPanelBounds(); + roundedTextureShader.applyUpdate2(doubleVal, doubleVal2, doubleVal3, doubleVal4, 6.0, 2.0, awtColor3, doubleArr, true); +} + + public Vec2d getVec2dA() { + return this.vec2dField2; +} + + public void createAltAccountEntry(String text) { + this.cachedText = text; +} + + @Override + public void renderPanel(int value, int index) {} + + @Override + public void applyUpdate(char ch, int value) { + int intVal = (this.isActive() ? 1 : 0); + if (intVal == 0) { + return; + } + + intVal = value; + + short shortVal = 14; + if (intVal == 14) { + TextInputBoxWidget textInputBoxWidget = this; + String textStr = this.cachedText; + if (textStr.length() == 0) { + return; + } + + textInputBoxWidget = this; + + String textStr2 = this.cachedText; + int len = this.cachedText.length() - 1; + textInputBoxWidget.cachedText = textStr2.substring(0, len); + return; + } + + intVal = value; + shortVal = 1; + + label323: { + label343: { + if (intVal == shortVal) { + break label343; + } + + intVal = value; + shortVal = 28; + + if (intVal != shortVal) { + break label323; + } + } + + this.setActive(false); + return; + } + + intVal = value; + shortVal = 14; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 219; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 157; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 29; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 54; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 42; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 15; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 58; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 211; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 199; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 210; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 200; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 208; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 205; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 203; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 56; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 184; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 197; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 70; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 207; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 201; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 209; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 221; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 59; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 60; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 61; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 62; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 63; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 64; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 65; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 66; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 67; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 68; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 87; + + if (intVal == shortVal) { + return; + } + + intVal = value; + shortVal = 88; + + if (intVal != shortVal) { + StringBuilder sb2 = new StringBuilder().append(this.cachedText); + this.cachedText = sb2.append(ch).toString(); + StringBuilder sb3 = new StringBuilder(); + FontFamily fontFam = FontFamilySF_MEDIUM.FAMILY; + List itemList = this.applyUpdate(fontFam.ofSize(20), this.cachedText); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + String textStr3 = (String)iter.next(); + sb3.append(textStr3); + + } + + this.cachedText = sb3.toString(); + } +} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + int intVal2 = (this.isActive() ? 1 : 0); + if (intVal2 == 0) { + int intVal = (this.evaluateFlag7(value, index) ? 1 : 0); + if (intVal == 0) { + return; + } + + intVal = count; + + if (intVal != 0) { + return; + } + + boolean flag = this.isActive(); + flag = !flag; + + this.setActive(flag); + return; + } + + intVal2 = count; + + if (intVal2 == 0) { + this.setActive(false); + } +} +} diff --git a/src/main/java/cc/novoline/gui/widget/TogglePillWidget.java b/src/main/java/cc/novoline/gui/widget/TogglePillWidget.java new file mode 100644 index 0000000..256f01d --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/TogglePillWidget.java @@ -0,0 +1,532 @@ +package cc.novoline.gui.widget; +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontFamilyNOVOGUI; +import cc.novoline.utils.shader.RoundedTextureShader; +import java.awt.Color; + +import net.minecraft.util.MathHelper; +import cc.novoline.utils.fonts.api.FontFamily; +import cc.novoline.utils.fonts.holders.FontFamilyPOSTERAMA; +import net.minecraft.client.Minecraft; +import org.lwjgl.input.Keyboard; + +public class TogglePillWidget extends GuiWidget { + private double cachedValue; + private int stateTicks = 0; + private double cachedValue2; + private boolean flagValue; + private String cachedText = ""; + + @Override + public double getDoubleValue2() { + return this.getParent().getParent().getCachedValue4() + 227.0; +} + + public TogglePillWidget(AltRepositoryPanel altRepositoryPanel) { + super(altRepositoryPanel); +} + + public String getStringValue3() { + return this.cachedText; +} + + @Override + public double getDoubleValue() { + double doubleVal = this.getParent().getParent().getCachedValue3() - 200.0; + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent(); + return doubleVal - altRepositoryGUI.getScrollOffset(); +} + + public boolean evaluateFlag8(int value, int index) { + if (value <= (this.getPosX() - 5.0)) { + return false; + } + + if (value >= (this.getPosX() - 5.0 + 135.0)) { + return false; + } + + if (index <= (this.getPosY() + 5.0)) { + return false; + } + + return index < (this.getPosY() + 5.0 + 15.0); +} + + @Override + public void renderPanel2(int value, int index) { + cc.novoline.gui.widget.TogglePillWidget togglePillWidget; + label78: { + double doubleVal; + double doubleVal2; + FontRenderer font; + label81: { + float floatVal; + String textStr; + label75: { + doubleVal = this.getPosX() - 5.0; + doubleVal2 = this.getPosY() + 5.0; + double doubleVal6 = (float)Minecraft.getSystemTime() % 6000.0F / 6000.0F * Math.PI * 10.0; + float floatVal2 = MathHelper.sin(doubleVal6); + floatVal = 1.0F - MathHelper.abs(floatVal2); + FontRenderer font2 = FontFamilyNOVOGUI.FAMILY.ofSize(30); + String textStr2 = "H"; + double doubleVal7 = doubleVal + 4.0; + double doubleVal8 = doubleVal2 + 3.5; + Color awtColor = new Color(150, 150, 150); + Color awtColor4 = new Color(255, 255, 255); + double doubleVal9 = this.cachedValue; + int intVal2 = RenderUtils.interpolateColor(awtColor, awtColor4, doubleVal9); + font2.drawString(textStr2, doubleVal7, doubleVal8, intVal2, true); + FontFamily fontFam = FontFamilyPOSTERAMA.FAMILY; + font = fontFam.ofSize(20); + boolean flag = this.flagValue; + if (this.flagValue) { + break label75; + } + + textStr = this.cachedText; + + flag = textStr.isEmpty(); + + if (flag) { + break label81; + } + } + + String textStr3 = this.cachedText; + textStr = font.trimStringToWidth(textStr3, 90, true); + + String textStr4 = textStr; + double doubleVal10 = doubleVal + 20.0; + double doubleVal11 = doubleVal2 + 1.0; + font.drawString(textStr4, doubleVal10, doubleVal11, -1, true); + double doubleVal3 = doubleVal + 20.0; + double doubleVal4 = doubleVal3 + font.stringWidth(textStr4) + 1.0; + this.cachedValue2 = this.cachedValue2 + (doubleVal4 - this.cachedValue2) * 0.1F; + int intVal = (this.flagValue ? 1 : 0); + + if (this.flagValue) { + String textStr5 = "|"; + doubleVal10 = this.cachedValue2; + doubleVal11 = doubleVal2 + 2.0; + Color awtColor2 = new Color(150, 150, 150, 255); + Color awtColor5 = new Color(150, 150, 150, 10); + double doubleVal12 = floatVal; + int intVal3 = RenderUtils.interpolateColor(awtColor2, awtColor5, doubleVal12); + font.drawString(textStr5, doubleVal10, doubleVal11, intVal3, true); + } + + intVal = (Keyboard.isKeyDown(14) ? 1 : 0); + + + label63: { + label83: { + if (intVal == 0) { + break label83; + } + + this.stateTicks++; + intVal = this.stateTicks % 30; + + if (intVal != 0) { + break label63; + } + + togglePillWidget = this; + + textStr = this.cachedText; + intVal = (textStr.isEmpty() ? 1 : 0); + + if (intVal != 0) { + break label63; + } + + togglePillWidget = this; + + String textStr6 = this.cachedText; + String textStr7 = this.cachedText; + int len = textStr7.length() - 1; + togglePillWidget.cachedText = textStr6.substring(0, len); + + break label63; + + + } + + this.stateTicks = 0; + } + + + break label78; + + } + + String textStr8 = "Search"; + double doubleVal13 = doubleVal + 20.0; + double doubleVal14 = doubleVal2 + 2.0; + Color awtColor3 = new Color(150, 150, 150, 255); + Color awtColor6 = new Color(150, 150, 150, 10); + double doubleVal15 = this.cachedValue; + int intVal4 = RenderUtils.interpolateColor(awtColor3, awtColor6, doubleVal15); + font.drawString(textStr8, doubleVal13, doubleVal14, intVal4); + } + + double doubleVal5; + label41: { + TogglePillWidget togglePillWidget2 = this; + + if (this.evaluateFlag8(value, index)) { + doubleVal5 = this.cachedValue + (1.0 - this.cachedValue) * 0.01F; + break label41; + } + + togglePillWidget2 = this; + + + doubleVal5 = togglePillWidget2.cachedValue - this.cachedValue * 0.01F; + } + + this.cachedValue = doubleVal5; +} + + @Override + public void applyUpdate(char ch, int value) { + Object obj; + int intVal = (this.flagValue ? 1 : 0); + if (!this.flagValue) { + return; + } + + intVal = value; + + label333: { + short shortVal = 14; + if (intVal == 14) { + obj = this.cachedText; + + if (((java.lang.String) obj).length() == 0) { + break label333; + } + + String textStr = this.cachedText; + int len = this.cachedText.length() - 1; + this.cachedText = textStr.substring(0, len); + break label333; + } + + intVal = value; + shortVal = 1; + + label312: { + label335: { + if (intVal == shortVal) { + break label335; + } + + intVal = value; + + if (intVal != 28) { + break label312; + } + } + + this.flagValue = false; + break label333; + } + + intVal = value; + + if (intVal == 14) { + break label333; + } + + intVal = value; + + if (intVal == 219) { + break label333; + } + + intVal = value; + + if (intVal == 157) { + break label333; + } + + intVal = value; + + if (intVal == 29) { + break label333; + } + + intVal = value; + + if (intVal == 54) { + break label333; + } + + intVal = value; + + if (intVal == 42) { + break label333; + } + + intVal = value; + + if (intVal == 15) { + break label333; + } + + intVal = value; + + if (intVal == 58) { + break label333; + } + + intVal = value; + + if (intVal == 211) { + break label333; + } + + intVal = value; + + if (intVal == 199) { + break label333; + } + + intVal = value; + + if (intVal == 210) { + break label333; + } + + intVal = value; + + if (intVal == 200) { + break label333; + } + + intVal = value; + + if (intVal == 208) { + break label333; + } + + intVal = value; + + if (intVal == 205) { + break label333; + } + + intVal = value; + + if (intVal == 203) { + break label333; + } + + intVal = value; + + if (intVal == 56) { + break label333; + } + + intVal = value; + + if (intVal == 184) { + break label333; + } + + intVal = value; + + if (intVal == 197) { + break label333; + } + + intVal = value; + + if (intVal == 70) { + break label333; + } + + intVal = value; + + if (intVal == 207) { + break label333; + } + + intVal = value; + + if (intVal == 201) { + break label333; + } + + intVal = value; + + if (intVal == 209) { + break label333; + } + + intVal = value; + + if (intVal == 221) { + break label333; + } + + intVal = value; + + if (intVal == 59) { + break label333; + } + + intVal = value; + + if (intVal == 60) { + break label333; + } + + intVal = value; + + if (intVal == 61) { + break label333; + } + + intVal = value; + + if (intVal == 62) { + break label333; + } + + intVal = value; + + if (intVal == 63) { + break label333; + } + + intVal = value; + + if (intVal == 64) { + break label333; + } + + intVal = value; + + if (intVal == 65) { + break label333; + } + + intVal = value; + + if (intVal == 66) { + break label333; + } + + intVal = value; + + if (intVal == 67) { + break label333; + } + + intVal = value; + + if (intVal == 68) { + break label333; + } + + intVal = value; + + if (intVal == 87) { + break label333; + } + + intVal = value; + + if (intVal != 88) { + StringBuilder sb2 = new StringBuilder().append(this.cachedText); + this.cachedText = sb2.append(ch).toString(); + } + } + + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent(); + altRepositoryGUI.getIterator6FunctionHelper2().performAction(); + obj = this.getParent(); + + AltRepositoryPanel altRepositoryPanel = (AltRepositoryPanel)obj; + AnimatedCheckWidget animatedCheckWidget = altRepositoryPanel.getVjD(); + animatedCheckWidget.performStep(); +} + + @Override + public void renderPanel(int value, int index) {} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + int intVal; + intVal = (this.evaluateFlag8(value, index) ? 1 : 0); + + if (intVal != 0) { + intVal = count; + + if (count == 0) { + intVal = (this.flagValue ? 1 : 0); + + if (!this.flagValue) { + this.flagValue = true; + return; + } + } + } + + intVal = (this.flagValue ? 1 : 0); + + + if (intVal == 0) { + return; + } + + intVal = count; + + + if (intVal == 0) { + this.flagValue = false; + } +} + + @Override + public void applyUpdate(int value, int index) { + double doubleVal; + double doubleVal2; + label29: { + TogglePillWidget togglePillWidget; + label27: { + doubleVal = this.getPosX() - 5.0; + doubleVal2 = this.getPosY() + 5.0; + TogglePillWidget togglePillWidget2 = this; + if (!this.evaluateFlag8(value, index)) { + togglePillWidget = this; + + if (!this.flagValue) { + break label27; + } + } + + togglePillWidget2 = this; + + togglePillWidget2.cachedValue = this.cachedValue + (1.0 - this.cachedValue) * 0.01F; + break label29; + } + + togglePillWidget = this; + + togglePillWidget.cachedValue = this.cachedValue - this.cachedValue * 0.01F; + } + + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + Color awtColor = new Color(26, 26, 26); + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent(); + double[] doubleArr = altRepositoryGUI.getPanelBounds(); + roundedTextureShader.applyUpdate2(doubleVal, doubleVal2, 135.0, 15.0, 10.0, 4.0, awtColor, doubleArr, true); +} +} diff --git a/src/main/java/cc/novoline/gui/widget/UsernameUuidWidget.java b/src/main/java/cc/novoline/gui/widget/UsernameUuidWidget.java new file mode 100644 index 0000000..0079e8f --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/UsernameUuidWidget.java @@ -0,0 +1,102 @@ +package cc.novoline.gui.widget; + + +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontFamilyPROFILES; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import java.awt.Color; +import java.awt.FileDialog; +import java.awt.Frame; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ForkJoinPool; +import java.util.function.Consumer; +import cc.novoline.gui.alt.AltAccountTokenHelper; +import cc.novoline.utils.fonts.api.FontFamily; +import cc.novoline.utils.fonts.holders.FontFamilyPOSTERAMA; +import net.minecraft.client.Minecraft; +import novo.cookie.CookieAuthenticator; + +public class UsernameUuidWidget extends ValueWidget { + final SelectAuthenticationWidget selectAuthenticationWidgetField; + + private void invokeCallback(Minecraft minecraft, String text, Throwable throwable) { + SelectAuthenticationWidget.applyUpdate(this.selectAuthenticationWidgetField, new CookieAuthenticator(text)); + CookieAuthenticator cookieAuthenticator = this.selectAuthenticationWidgetField.getCookieAuthenticatorField(); + Consumer consumer = ((java.util.function.Consumer) (jsonObject) -> this.invokeCallback2(minecraft, jsonObject)); + cookieAuthenticator.authenticateAsync(consumer); +} + + private CompletableFuture getCompletableFutureValue() { + return CompletableFuture.supplyAsync(UsernameUuidWidget::lambdaImpl$doRequest$0, ForkJoinPool.commonPool()); +} + + private void invokeCallback2(Minecraft minecraft, JsonObject jsonObject) { + JsonElement jsonElement = jsonObject.get("username"); + String textStr = jsonElement.getAsString(); + jsonElement = jsonObject.get("uuid"); + String textStr2 = jsonElement.getAsString(); + jsonElement = jsonObject.get("token"); + String textStr3 = jsonElement.getAsString(); + minecraft.session = new AltAccountTokenHelper(textStr, textStr2, textStr3, "mojang"); + SelectAuthenticationWidget selectAuthenticationWidget = this.selectAuthenticationWidgetField; + StringBuilder sb2 = new StringBuilder().append("Logged in as "); + SelectAuthenticationWidget.applyUpdate(selectAuthenticationWidget, sb2.append(textStr).toString()); +} + + @Override + public void renderPanel2(int value, int index) { + FontFamily fontFam = FontFamilyPROFILES.FAMILY; + FontRenderer font = fontFam.ofSize(80); + double doubleVal = this.getPosX() + 105.0; + doubleVal -= font.stringWidth("C") / 2; + double doubleVal2 = this.getPosY() + 28.0; + doubleVal2 = doubleVal2 - font.getHeight() / 2 - 8.0; + Color awtColor = new Color(250, 177, 83); + int color = awtColor.getRGB(); + font.drawString("C", doubleVal, doubleVal2, color, true); + fontFam = FontFamilyPOSTERAMA.FAMILY; + FontRenderer font2 = fontFam.ofSize(25); + doubleVal = this.getPosX() + 105.0; + doubleVal -= font2.stringWidth("Cookie") / 2; + doubleVal2 = this.getPosY() + 28.0; + doubleVal2 = doubleVal2 - font2.getHeight() / 2 + 18.0; + font2.drawString("Cookie", doubleVal, doubleVal2, -1, true); +} + + @Override + public double getDoubleValue2() { + return this.getParent().getPosY() + 159.0; +} + + private static String lambdaImpl$doRequest$0() { + FileDialog fileDialog = new FileDialog((Frame)null, "Select File to Open"); + fileDialog.setMode(0); + fileDialog.setVisible(true); + StringBuilder sb = new StringBuilder(); + String textStr = fileDialog.getDirectory(); + sb = sb.append(textStr); + textStr = fileDialog.getFile(); + return sb.append(textStr).toString(); +} + + @Override + public void mouseClickedPanel(int value, int index, int count) { + int intVal = (this.isFlagA(value, index) ? 1 : 0); + if (intVal == 0) { + return; + } + + intVal = count; + + if (intVal == 0) { + Minecraft mcClient = Minecraft.getMinecraft(); + this.getCompletableFutureValue().whenCompleteAsync(((java.util.function.BiConsumer) (($a0, $a1) -> this.invokeCallback(mcClient, ((String) $a0), ((Throwable) $a1))))); + } +} + + UsernameUuidWidget(SelectAuthenticationWidget selectAuthenticationWidget, SelectAuthenticationWidget selectAuthenticationWidgetArg) { + super(selectAuthenticationWidgetArg); + this.selectAuthenticationWidgetField = selectAuthenticationWidget; +} +} diff --git a/src/main/java/cc/novoline/gui/widget/ValueWidget.java b/src/main/java/cc/novoline/gui/widget/ValueWidget.java new file mode 100644 index 0000000..3399b09 --- /dev/null +++ b/src/main/java/cc/novoline/gui/widget/ValueWidget.java @@ -0,0 +1,99 @@ +package cc.novoline.gui.widget; +import cc.novoline.gui.screen.alt.repository.AltRepositoryGUI; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.shader.RoundedTextureShader; +import java.awt.Color; + + +public class ValueWidget extends GuiWidget { + private float cachedAngle; + + public boolean isFlagA(int value, int index) { + if (value <= this.getPosX()) { + return false; + } + + if (value >= (this.getPosX() + 210.0)) { + return false; + } + + if (index <= this.getDoubleValue2()) { + return false; + } + + return index < (this.getDoubleValue2() + 57.0); +} + + @Override + public void renderPanel2(int value, int index) {} + + public void createAltAccountEntry(float value) { + this.cachedAngle = value; +} + + public void renderPanel3(int value, int index) { + label29: { + ValueWidget valueWidget; + label27: { + ValueWidget valueWidget2 = this; + if (!this.isFlagA(value, index)) { + valueWidget = this; + + if (!this.isActive()) { + break label27; + } + } + + valueWidget2 = this; + + valueWidget2.cachedAngle = this.cachedAngle + (1.0F - this.cachedAngle) * 0.04F; + break label29; + } + + valueWidget = this; + + valueWidget.cachedAngle = valueWidget.cachedAngle - this.cachedAngle * 0.04F; + } + + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal = this.getPosX(); + double doubleVal2 = this.getDoubleValue2(); + Color awtColor = new Color(26, 26, 26); + Color awtColor2 = new Color(20, 20, 20); + double doubleVal3 = this.cachedAngle; + Color awtColor3 = new Color(RenderUtils.interpolateColor(awtColor, awtColor2, doubleVal3)); + AltRepositoryGUI altRepositoryGUI = this.getParent().getParent().getParent(); + double[] doubleArr = altRepositoryGUI.getPanelBounds(); + roundedTextureShader.applyUpdate2(doubleVal, doubleVal2, 210.0, 57.0, 12.0, 2.0, awtColor3, doubleArr, true); +} + + @Override + public double getDoubleValue2() { + return super.getDoubleValue2(); +} + + public ValueWidget(SelectAuthenticationWidget selectAuthenticationWidget) { + super(selectAuthenticationWidget); +} + + @Override + public void renderPanel(int value, int index) {} + + @Override + public void applyUpdate(int value, int index) {} + + @Override + public double getDoubleValue() { + return this.getParent().getPosX(); +} + + @Override + public void mouseClickedPanel(int value, int index, int count) {} + + public float getFloatValue8() { + return this.cachedAngle; +} + + @Override + public void applyUpdate(char ch, int value) {} +} diff --git a/src/main/java/cc/novoline/irc/AesCipherUtil.java b/src/main/java/cc/novoline/irc/AesCipherUtil.java new file mode 100644 index 0000000..d97ab10 --- /dev/null +++ b/src/main/java/cc/novoline/irc/AesCipherUtil.java @@ -0,0 +1,100 @@ +package cc.novoline.irc; +import cc.novoline.utils.reflect.ReflectiveOps; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.security.NoSuchAlgorithmException; +import java.util.Base64; +import java.util.Base64.Decoder; +import java.util.Base64.Encoder; +import javax.crypto.Cipher; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; + + +public class AesCipherUtil { private static Object[] d; + + public static final Charset charsetField = StandardCharsets.UTF_8; + public static final Encoder encoder = Base64.getEncoder(); + public static final Decoder decoder = Base64.getDecoder(); + + static { + Object[] objArr = new Object[4]; + b(objArr); + } + private final Cipher cipherField; + private final SecretKeySpec secretKeySpecField; + + public byte[] resolveHelper(String text, byte[] byteArray) throws NovolineWebSocketException { + return this.resolveHelper2(text.getBytes(charsetField), byteArray); +} + + public String createString(String text, byte[] byteArray) throws NovolineWebSocketException { + return new String(this.createString2(decoder.decode(text), byteArray)); +} + + public byte[] resolveHelper2(byte[] byteArray, byte[] values) throws NovolineWebSocketException { + try { + IvParameterSpec ivParameterSpec = new IvParameterSpec(values); + this.cipherField.init(1, this.secretKeySpecField, ivParameterSpec); + return ReflectiveOps.doFinal(this.cipherField, byteArray); + } catch (Throwable ex) { + throw new NovolineWebSocketException(ex); + } +} + + public AesCipherUtil(byte[] byteArray) { + this.secretKeySpecField = new SecretKeySpec(byteArray, "AES"); + + try { + AesCipherUtil.$keepCatch(); + AesCipherUtil.$keepCatch(); + this.cipherField = ReflectiveOps.getCipher("AES/CBC/PKCS5PADDING"); + } catch (NoSuchAlgorithmException | NoSuchPaddingException ex) { + throw new RuntimeException(ex); + } +} + + public static void b(Object[] flowGuardArray) { + d = flowGuardArray; +} + + public String createString2(String text, byte[] byteArray) throws NovolineWebSocketException { + return this.createString(text.getBytes(charsetField), byteArray); +} + + public static Object[] b() { + return d; +} + + public AesCipherUtil(String text) { + this(text.getBytes(charsetField)); + Charset charset = charsetField; +} + + public byte[] resolveHelper2(String text, byte[] byteArray) throws NovolineWebSocketException { + return this.createString2(decoder.decode(text), byteArray); +} + + public String resolveHelper(byte[] byteArray, byte[] values) throws NovolineWebSocketException { + return new String(this.createString2(byteArray, values)); +} + + public String createString(byte[] byteArray, byte[] values) throws NovolineWebSocketException { + return encoder.encodeToString(this.resolveHelper2(byteArray, values)); +} + + public byte[] createString2(byte[] byteArray, byte[] values) throws NovolineWebSocketException { + byte[] byteArr; + try { + IvParameterSpec ivParameterSpec = new IvParameterSpec(values); + this.cipherField.init(2, this.secretKeySpecField, ivParameterSpec); + byteArr = ReflectiveOps.doFinal(this.cipherField, byteArray); + } catch (Throwable ex) { + throw new NovolineWebSocketException(ex); + } + + return byteArr; +} + private static void $keepCatch() throws E {} +} diff --git a/src/main/java/cc/novoline/irc/AltStatusBanner.java b/src/main/java/cc/novoline/irc/AltStatusBanner.java new file mode 100644 index 0000000..ef11614 --- /dev/null +++ b/src/main/java/cc/novoline/irc/AltStatusBanner.java @@ -0,0 +1,628 @@ +package cc.novoline.irc; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.StencilUtil; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.shader.RoundedTextureShader; +import java.awt.Color; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.ForkJoinPool; +import net.minecraft.client.gui.GuiMainMenu; +import cc.novoline.viaversion.GuiMultiplayerViaHelper; + +import net.minecraft.util.MathHelper; +import cc.novoline.utils.fonts.api.FontFamily; +import cc.novoline.utils.fonts.holders.FontFamilyIconFontAlt; +import cc.novoline.utils.fonts.holders.FontFamilyPOSTERAMA; +import net.skidunion.security.ProtectionSession; +import org.apache.commons.io.IOUtils; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.lwjgl.input.Mouse; + +public class AltStatusBanner { + private float cachedAngle; + private float floatValue; + private boolean stateFlag; + private float cachedAngle2; + private float cachedAngle3; + private float cachedAngle4; + private boolean stateFlag2; + private GuiMainMenu guiMainMenuField; + private float cachedAngle5; + private float floatValueField; + private float cachedAngle6; + private String cachedText; + private float cachedAngle7; + private boolean stateFlag3; + private String cachedText2; + private float cachedAngle8; + private String cachedText3 = ""; + + private String supplyString() { + return resolveHelper(this.cachedText2); +} + + public void renderVisual(int value, int index, Color color, Color color2) { + double doubleVal = 0.0; + double doubleVal2; + int intVal; + cc.novoline.irc.AltStatusBanner altStatusBanner; + float floatVal; + float floatVal2; + boolean empty; + FontRenderer font; + FontRenderer font2; + String textStr; + double doubleVal19; + double doubleVal20; + int intVal7; + label199: { + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal21 = this.cachedAngle3 - 15.0F; + doubleVal19 = this.cachedAngle4 - 15.0F; + doubleVal20 = this.cachedAngle * 2.0F; + double doubleVal22 = this.cachedAngle8 * 2.0F; + double doubleVal23 = this.cachedAngle2 * 2.0F; + roundedTextureShader.drawRoundedRect(doubleVal21, doubleVal19, doubleVal20, doubleVal22, doubleVal23, 2.0, color, false); + FontFamily fontFam = FontFamilyIconFontAlt.FAMILY; + font = fontFam.ofSize(30); + FontFamily fontFam2 = FontFamilyPOSTERAMA.FAMILY; + font2 = fontFam2.ofSize(17); + textStr = this.cachedText3; + float floatVal3 = this.cachedAngle3; + String textStr2 = this.cachedText3; + doubleVal19 = floatVal3 - font.stringWidth(textStr2) / 2; + float floatVal4 = this.cachedAngle4; + doubleVal20 = floatVal4 - font.getHeight() / 2; + intVal7 = (this.stateFlag ? 1 : 0); + + if (this.stateFlag) { + Color awtColor = new Color(200, 200, 200); + intVal7 = awtColor.getRGB(); + break label199; + } + + intVal7 = (this.checkCondition2(value, index) ? 1 : 0); + + + if (intVal7 != 0) { + intVal7 = color2.getRGB(); + } else { + intVal7 = 16777215; + } + } + + double doubleVal3; + int intVal2; + String textStr3; + font.drawString(textStr, doubleVal19, doubleVal20, intVal7, false); + doubleVal3 = 0.0; + intVal2 = 0; + textStr3 = this.cachedText; + + if (this.cachedText != null) { + textStr3 = this.cachedText; + + if (!textStr3.isEmpty()) { + List itemList = this.resolveHelper(font2); + intVal2 = itemList.size(); + doubleVal3 = intVal2 * (font2.getHeight() + 3) / 2; + } + } + + textStr3 = this.cachedText; + + label186: { + label185: { + + if (textStr3 == null) { + break label185; + } + + textStr3 = this.cachedText; + + + if (!textStr3.isEmpty()) { + double doubleVal4 = 20.0 + doubleVal3; + doubleVal2 = Math.min(doubleVal4, 140.0); + break label186; + } + } + + doubleVal2 = 15.0; + } + + double doubleVal5; + label177: { + label202: { + doubleVal5 = doubleVal2; + String textStr4 = this.cachedText; + + if (this.cachedText == null) { + break label202; + } + + textStr4 = this.cachedText; + + + intVal = (textStr4.isEmpty() ? 1 : 0); + + if (intVal == 0) { + doubleVal = 120.0; + break label177; + } + } + + textStr = "Retrieving data..."; + intVal = (font2.stringWidth(textStr) + 35) / 2; + + doubleVal = intVal; + } + + label163: { + double doubleVal6 = doubleVal; + byte byteVal = (byte)(this.stateFlag3 ? 1 : 0); + if (this.stateFlag3) { + doubleVal19 = this.cachedAngle + (doubleVal6 - this.cachedAngle) * 0.025; + this.cachedAngle = (float)Math.min(doubleVal6, doubleVal19); + doubleVal19 = this.cachedAngle8 + (doubleVal5 - this.cachedAngle8) * 0.025; + this.cachedAngle8 = (float)Math.min(doubleVal5, doubleVal19); + break label163; + + } + + altStatusBanner = this; + + if (this.cachedAngle <= this.cachedAngle2) { + floatVal = this.cachedAngle8; + floatVal2 = this.cachedAngle2; + + if (!(this.cachedAngle8 > this.cachedAngle2)) { + break label163; + } + } + + this.cachedAngle = (float)(this.cachedAngle + (this.cachedAngle2 - this.cachedAngle) * 0.04); + altStatusBanner = this; + + altStatusBanner.cachedAngle8 = (float)(this.cachedAngle8 + (this.cachedAngle2 - this.cachedAngle8) * 0.04); + } + + floatVal = this.cachedAngle8 * 2.0F; + floatVal2 = 31.0F; + + double doubleVal7 = floatVal - floatVal2; + double doubleVal8 = this.cachedAngle8 * 2.0F - 5.0F - (this.cachedAngle4 - this.cachedAngle2); + double doubleVal9 = intVal2 * (font2.getHeight() + 3) + 8; + double doubleVal10 = doubleVal8 / doubleVal9 * doubleVal7; + double doubleVal11 = doubleVal7 - doubleVal10; + double doubleVal12 = doubleVal9 - doubleVal7; + double doubleVal13 = doubleVal12 / doubleVal11; + this.cachedAngle5 = (float)(this.cachedAngle5 + (this.floatValue - this.cachedAngle5) * 0.1); + this.floatValue = (float)(this.floatValueField * doubleVal13); + double doubleVal14; + int intVal3 = (doubleVal14 = doubleVal9 - doubleVal8) == 0.0 ? 0 : (doubleVal14 < 0.0 ? -1 : 1); + + if (intVal3 > 0) { + AltStatusBanner altStatusBanner2 = this; + + label138: + if (this.checkCondition(value, index)) { + int intVal4 = Mouse.getDWheel(); + int intVal5 = intVal4; + + if (intVal4 == 0) { + break label138; + } + + intVal5 = intVal4; + + + if (intVal5 < 0) { + this.floatValueField += 10.0F; + break label138; + } + + this.floatValueField -= 10.0F; + } + + altStatusBanner2 = this; + + + double doubleVal15 = this.floatValueField; + doubleVal20 = doubleVal7 - doubleVal10; + altStatusBanner2.floatValueField = (float)MathHelper.clamp_double(doubleVal15, 0.0, doubleVal20); + } + + intVal3 = (this.stateFlag3 ? 1 : 0); + + + + label96: + if (intVal3 != 0) { + AltStatusBanner altStatusBanner3 = this; + if (this.cachedText != null) { + textStr3 = this.cachedText; + empty = textStr3.isEmpty(); + + if (!empty) { + StencilUtil.initStencilToWrite(false); + float floatVal5 = this.cachedAngle3 - 6.0F; + float floatVal8 = this.cachedAngle4 + 15.0F; + float floatVal9 = this.cachedAngle3 - 6.0F + this.cachedAngle * 2.0F; + float floatVal10 = this.cachedAngle8 * 2.0F - 5.0F; + RenderUtils.drawRect(floatVal5, floatVal8, floatVal9, floatVal10, -1); + StencilUtil.readStencilBuffer(true); + List itemList2 = this.resolveHelper(font2); + int intVal6 = 0; + Iterator iter = itemList2.iterator(); + + while (true) { + if (iter.hasNext()) { + String textStr5 = (String)iter.next(); + doubleVal19 = this.cachedAngle3 - 5.0F; + float floatVal6 = this.cachedAngle4 + 15.0F; + doubleVal20 = floatVal6 + intVal6 * (font2.getHeight() + 3) - this.cachedAngle5; + font2.drawString(textStr5, doubleVal19, doubleVal20, -1, true); + intVal6++; + + continue; + } + + StencilUtil.uninitStencilBuffer(); + break; + } + + label109: { + if (!(doubleVal9 > doubleVal8)) { + break label109; + } + + RoundedTextureShader roundedTextureShader2 = RoundedTextureShader.getInstance(); + double doubleVal16 = this.cachedAngle3 - 23.0F + this.cachedAngle * 2.0F; + doubleVal19 = this.cachedAngle4; + double doubleVal24 = this.cachedAngle8 * 2.0F - 30.0F; + Color awtColor2 = new Color(25, 25, 25); + roundedTextureShader2.drawRoundedRect(doubleVal16, doubleVal19, 5.0, doubleVal24, 4.0, 3.0, awtColor2, false); + + RoundedTextureShader roundedTextureShader3 = RoundedTextureShader.getInstance(); + double doubleVal17 = this.cachedAngle3 - 22.5F + this.cachedAngle * 2.0F; + doubleVal19 = this.cachedAngle4 + 0.5F + this.floatValueField; + double doubleVal25 = (float)doubleVal10; + roundedTextureShader3.drawRoundedRect(doubleVal17, doubleVal19, 4.0, doubleVal25, 4.0, 2.0, color2, false); + } + + break label96; + } + } + + StencilUtil.initStencilToWrite(false); + altStatusBanner3 = this; + + float floatVal7 = altStatusBanner3.cachedAngle3 - this.cachedAngle2; + float floatVal11 = this.cachedAngle4 - this.cachedAngle2; + float floatVal12 = this.cachedAngle * 2.0F; + float floatVal13 = this.cachedAngle8 * 2.0F; + RenderUtils.drawRoundedRect(floatVal7, floatVal11, floatVal12, floatVal13, 25.0F, -1); + empty = true; + + StencilUtil.readStencilBuffer(empty); + textStr = "Retrieving data..."; + doubleVal19 = this.cachedAngle3 + 10.0F; + doubleVal20 = this.cachedAngle4 - 4.0F; + font2.drawString(textStr, doubleVal19, doubleVal20, -1, true); + StencilUtil.uninitStencilBuffer(); + } + + intVal3 = (this.stateFlag2 ? 1 : 0); + + + if (intVal3 == 0) { + return; + } + + if (index - this.cachedAngle6 != 0.0F) { + this.floatValueField = this.floatValueField + (index - this.cachedAngle6); + double doubleVal18 = this.floatValueField; + doubleVal20 = doubleVal7 - doubleVal10; + this.floatValueField = (float)MathHelper.clamp_double(doubleVal18, 0.0, doubleVal20); + this.cachedAngle6 = index; + } +} + + + + private void invokeCallback(String text, Throwable throwable) { + this.cachedText = text; +} + + public float getCachedAngle3() { + return this.cachedAngle3; +} + + public boolean checkCondition(int value, int index) { + if (value < (this.cachedAngle3 - 6.0F)) { + return false; + } + + if (value > (this.cachedAngle3 - 6.0F + this.cachedAngle * 2.0F)) { + return false; + } + + if (index < (this.cachedAngle4 + 15.0F)) { + return false; + } + + return index <= (this.cachedAngle8 * 2.0F - 5.0F); +} + + public boolean isReadyState() { + if (!this.stateFlag3) { + if (this.cachedAngle - this.cachedAngle2 <= 1.0F) { + return false; + } + + if (this.cachedAngle8 - this.cachedAngle2 <= 1.0F) { + return false; + } + } + + return true; +} + + public String getCachedText() { + return this.cachedText; +} + + public boolean checkCondition2(int value, int index) { + double doubleVal = this.cachedAngle3 - value; + doubleVal = Math.pow(doubleVal, 2.0); + double doubleVal2 = this.cachedAngle4 - index; + int intVal = (doubleVal + Math.pow(doubleVal2, 2.0) <= this.cachedAngle2 * this.cachedAngle2) ? 1 : 0; + + return ((((intVal & 1)) != 0)); +} + + public float getCachedAngle2() { + return this.cachedAngle2; +} + + public static String resolveHelper(String text) { + CloseableHttpClient closeableHttpClient = HttpClients.createDefault(); + HttpGet httpGet = new HttpGet(text); + StringBuilder sb = new StringBuilder(); + sb = sb.append("NovoProtect/1.0 "); + String textStr = ProtectionSession.k; + String textStr2 = sb.append(textStr).toString(); + httpGet.setHeader("User-Agent", textStr2); + CloseableHttpResponse closeableHttpResponse = null; + + try { + closeableHttpResponse = closeableHttpClient.execute(httpGet); + } catch (IOException ex) { + ex.printStackTrace(); + } + + try { + InputStream inputStream = closeableHttpResponse.getEntity().getContent(); + Charset charset = StandardCharsets.UTF_8; + return IOUtils.toString(inputStream, charset); + } catch (IOException ex2) { + ex2.printStackTrace(); + return ""; + } +} + + public void performAction() { + this.stateFlag2 = false; +} + + public float getCachedAngle4() { + return this.cachedAngle4; +} + + public List resolveHelper(FontRenderer font) { + CopyOnWriteArrayList copyOnWriteArrayList = new CopyOnWriteArrayList(); + String textStr = this.cachedText; + String[] stringArr = textStr.split("\n"); + int len = stringArr.length; + int intVal = 0; + + while (intVal < len) { + String textStr2 = stringArr[intVal]; + if (!textStr2.isEmpty()) { + float floatVal = this.cachedAngle * 2.0F - 35.0F; + float floatVal2; + int width = (floatVal2 = font.stringWidth(textStr2) - floatVal) == 0.0F ? 0 : (floatVal2 < 0.0F ? -1 : 1); + label36: { + if (width > 0) { + int intVal2 = (int)floatVal; + String textStr3 = font.trimStringToWidth(textStr2, intVal2, false); + String textStr4 = textStr2.replace(textStr3, ""); + copyOnWriteArrayList.add(textStr3); + if (!textStr4.isEmpty()) { + copyOnWriteArrayList.add(textStr4); + } + + break label36; + } + + copyOnWriteArrayList.add(textStr2); + } + } + + intVal++; + + } + + return copyOnWriteArrayList; +} + + public AltStatusBanner(GuiMainMenu guiMainMenu, float value, float amount, float factor, String text, String str) { + this.cachedText2 = ""; + this.cachedText = ""; + this.guiMainMenuField = guiMainMenu; + this.cachedAngle3 = value; + this.cachedAngle4 = amount; + this.cachedAngle2 = factor; + this.cachedAngle7 = factor; + this.cachedText3 = text; + this.cachedAngle = factor; + this.cachedAngle8 = factor; + this.cachedText2 = str; + this.cachedText = ""; +} + + public void resolveHelper(float value) { + this.cachedAngle2 = value; +} + + public void handleInt(int value, int index, int count) { + cc.novoline.irc.AltStatusBanner altStatusBanner; + int intVal = (this.stateFlag ? 1 : 0); + if (this.stateFlag) { + return; + } + + intVal = (this.checkCondition2(value, index) ? 1 : 0); + + if (intVal != 0) { + intVal = count; + + label196: + if (count == 0) { + AltStatusBanner altStatusBanner2 = this; + if (this.cachedText3.equals("P")) { + try { + Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler https://novoline.lol/flow/discord"); + break label196; + } catch (Exception ex) { + break label196; + } + } + + altStatusBanner2 = this; + + boolean flag = !this.stateFlag3; + + altStatusBanner2.stateFlag3 = flag; + AltStatusBanner altStatusBanner3 = this; + if (this.stateFlag3) { + List itemList = this.guiMainMenuField.obtainList(); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + AltStatusBanner altStatusBanner4 = (AltStatusBanner)iter.next(); + AltStatusBanner altStatusBanner5 = altStatusBanner4; + intVal = (altStatusBanner4.equals(this) ? 1 : 0); + + if (intVal != 0) { + continue; + } + + altStatusBanner5 = altStatusBanner4; + + altStatusBanner5.stateFlag = true; + } + + altStatusBanner = this; + + if (this.cachedText2 == null) { + break label196; + } + + CompletableFuture completableFuture = CompletableFuture.supplyAsync(this::supplyString, ForkJoinPool.commonPool()); + completableFuture.whenCompleteAsync(((java.util.function.BiConsumer) this::invokeCallback)); + break label196; + } + + this.cachedText = ""; + this.floatValueField = 0.0F; + altStatusBanner3 = this; + + List itemList2 = altStatusBanner3.guiMainMenuField.obtainList(); + Iterator iter2 = itemList2.iterator(); + + while (true) { + if (!iter2.hasNext()) { + break; + } + + AltStatusBanner altStatusBanner6 = (AltStatusBanner)iter2.next(); + AltStatusBanner altStatusBanner7 = altStatusBanner6; + + intVal = (altStatusBanner6.equals(this) ? 1 : 0); + + if (intVal != 0) { + continue; + } + + altStatusBanner7 = altStatusBanner6; + + + altStatusBanner7.stateFlag = false; + } + } + } + + altStatusBanner = this; + + intVal = (altStatusBanner.stateFlag3 ? 1 : 0); + + if (intVal != 0) { + intVal = (this.cachedText3.equals("N") ? 1 : 0); + + if (intVal != 0) { + intVal = (this.checkCondition(value, index) ? 1 : 0); + + if (intVal != 0) { + intVal = count; + + if (count == 0) { + try { + Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler https://discord.gg/rNPjX8HMnW"); + } catch (IOException ex2) { + ex2.printStackTrace(); + } + } + } + } + } + + intVal = (this.stateFlag3 ? 1 : 0); + + if (intVal == 0) { + return; + } + + if (value < (this.cachedAngle3 - 23.0F + this.cachedAngle * 2.0F)) { + return; + } + + if (value > (this.cachedAngle3 - 23.0F + this.cachedAngle * 2.0F + 5.0F)) { + return; + } + + if (index < this.cachedAngle4) { + return; + } + + if (index <= (this.cachedAngle4 + this.cachedAngle8 * 2.0F - 30.0F)) { + this.stateFlag2 = true; + this.cachedAngle6 = index; + } +} +} diff --git a/src/main/java/cc/novoline/irc/ClickGuiSearchBar.java b/src/main/java/cc/novoline/irc/ClickGuiSearchBar.java new file mode 100644 index 0000000..61044b9 --- /dev/null +++ b/src/main/java/cc/novoline/irc/ClickGuiSearchBar.java @@ -0,0 +1,354 @@ +package cc.novoline.irc; + +import cc.novoline.gui.alt.AltSortMode; +import cc.novoline.gui.screen.ClickGUI; +import cc.novoline.gui.screen.click.ConfigScriptTab; +import cc.novoline.gui.screen.click.ModuleCategoryTab; +import cc.novoline.modules.visual.ClickGui; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.StencilUtil; +import cc.novoline.utils.fonts.impl.DiscordConfigButton; +import cc.novoline.utils.fonts.impl.AltSortDropdown; +import cc.novoline.utils.fonts.impl.SearchTextField; +import java.awt.Color; +import java.util.Comparator; +import java.util.ConcurrentModificationException; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import net.minecraft.util.MathHelper; + +import net.skidunion.security.ProtectionSession; +import org.lwjgl.input.Mouse; + +public class ClickGuiSearchBar { + private double cachedValue; + private double cachedValue2; + private SearchTextField searchTextFieldField; + private double cachedValue3; + private double cachedValue4; + private AltSortDropdown altSortDropdownField; + private boolean stateFlag; + private double cachedValue5; + private double cachedValue6; + private boolean flagValue; + private boolean stateFlag2; + private List discordConfigButtonList = new CopyOnWriteArrayList<>(); + private boolean stateFlag3; + private boolean stateFlag4; + private ClickGUI clickGUIField; + private ConfigScriptTab configScriptTabField; + + public void renderClickGui(ClickGui clickGui, int value, int index, double amount, double offset) { + int height; + cc.novoline.irc.ClickGuiSearchBar clickGuiSearchBar; + double doubleVal; + this.cachedValue4 = amount; + this.cachedValue3 = offset; + StencilUtil.initStencilToWrite(false); + double doubleVal13 = amount + 130.0; + ConfigScriptTab configScriptTab = this.configScriptTabField; + double doubleVal14 = offset + configScriptTab.getHeight() + 20.0; + RenderUtils.drawRect(amount, offset, doubleVal13, doubleVal14, -1); + StencilUtil.readStencilBuffer(true); + doubleVal13 = amount + 130.0; + configScriptTab = this.configScriptTabField; + doubleVal14 = offset + configScriptTab.getHeight() + 20.0; + Color awtColor = new Color(55, 55, 55); + int color = awtColor.getRGB(); + RenderUtils.drawRect(amount, offset, doubleVal13, doubleVal14, color); + ConfigScriptTab configScriptTab2 = this.configScriptTabField; + double doubleVal2 = configScriptTab2.getHeight() + 20.0; + configScriptTab2 = this.configScriptTabField; + double doubleVal3 = configScriptTab2.getHeight() + 20.0; + List itemList = this.discordConfigButtonList; + double doubleVal4 = itemList.size() * 20; + int[] intArr = ModuleCategoryTab.getIntArrayValue(); + double doubleVal5 = doubleVal3 / doubleVal4 * doubleVal2; + double doubleVal6 = doubleVal2 - doubleVal5; + double doubleVal7 = doubleVal4 - doubleVal2; + int[] intArr2 = intArr; + double doubleVal8 = doubleVal7 / doubleVal6; + this.cachedValue2 = (int)(this.cachedValue6 * doubleVal8); + this.cachedValue5 = this.cachedValue5 + (this.cachedValue2 - this.cachedValue5) * 0.1; + + try { + double doubleVal9 = offset; + List itemList2 = this.discordConfigButtonList; + Iterator iter = itemList2.iterator(); + + do { + if (!iter.hasNext()) { + break; + } + + DiscordConfigButton discordConfigButton = (DiscordConfigButton)iter.next(); + discordConfigButton.handleClickGUI(this.clickGUIField, value, index, amount, doubleVal9 - this.cachedValue5); + doubleVal9 += 20.0; + + } while (intArr2 == null); + } catch (ConcurrentModificationException ex) { + } + + StencilUtil.uninitStencilBuffer(); + float floatVal = (float)amount + 130.0F - 5.0F; + float floatVal3 = (float)offset; + ConfigScriptTab configScriptTab3 = this.configScriptTabField; + float floatVal4 = (float)configScriptTab3.getHeight() + 20.0F; + int color2 = (new Color(45, 45, 45)).getRGB(); + RenderUtils.drawRoundedRect(floatVal, floatVal3, 5.0F, floatVal4, 0.0F, color2); + + label131: { + label112: { + if (doubleVal4 > doubleVal3) { + float floatVal2 = (float)(amount + 130.0 - 4.0); + float floatVal5 = (float)(offset + this.cachedValue6); + float floatVal6 = (float)doubleVal5 - 1.0F; + Color awtColor2 = new Color(50, 50, 50, 255); + int color3 = awtColor2.getRGB(); + RenderUtils.drawRoundedRect(floatVal2, floatVal5, 3.0F, floatVal6, 0.0F, color3); + if (value < amount) { + break label112; + } + + if (value > (amount + 120.0)) { + break label112; + } + + if (index < offset) { + break label112; + } + + double doubleVal10 = index; + ConfigScriptTab configScriptTab4 = this.configScriptTabField; + double doubleVal11; + height = (doubleVal11 = doubleVal10 - (offset + configScriptTab4.getHeight() + 20.0)) == 0.0 ? 0 : (doubleVal11 < 0.0 ? -1 : 1); + + if (height > 0) { + break label112; + } + + label107: { + label106: { + int intVal = Mouse.getDWheel(); + if (intVal >= 0) { + break label106; + } + + this.cachedValue6 += 10.0; + + break label107; + } + + this.cachedValue6 -= 10.0; + } + + double doubleVal12 = this.cachedValue6; + doubleVal14 = doubleVal2 - doubleVal5; + this.cachedValue6 = (int)MathHelper.clamp_double(doubleVal12, 0.0, doubleVal14); + if (intArr2 == null) { + break label112; + } + } + + this.cachedValue2 = 0.0; + + this.cachedValue6 = 0.0; + } + + clickGuiSearchBar = this; + if (intArr2 != null) { + break label131; + } + + height = (this.stateFlag2 ? 1 : 0); + + double doubleVal15; + label74: { + if (height != 0) { + doubleVal = index - this.cachedValue; + doubleVal15 = 0.0; + if (intArr2 != null) { + break label74; + } + + if (doubleVal != 0.0) { + this.cachedValue6 = this.cachedValue6 + (index - this.cachedValue); + doubleVal15 = this.cachedValue6; + doubleVal14 = doubleVal2 - doubleVal5; + this.cachedValue6 = (int)MathHelper.clamp_double(doubleVal15, 0.0, doubleVal14); + this.cachedValue = index; + } + } + + doubleVal = amount; + ConfigScriptTab configScriptTab5 = this.configScriptTabField; + doubleVal15 = offset + configScriptTab5.getHeight() + 20.0; + } + + doubleVal13 = amount + 130.0; + configScriptTab = this.configScriptTabField; + doubleVal14 = offset + configScriptTab.getHeight() + 60.0; + Color awtColor3 = new Color(45, 45, 45, 255); + int color4 = awtColor3.getRGB(); + RenderUtils.drawRect(doubleVal, doubleVal15, doubleVal13, doubleVal14, color4); + clickGuiSearchBar = this; + } + + SearchTextField searchTextField = clickGuiSearchBar.searchTextFieldField; + double doubleVal16 = amount + 2.0; + ConfigScriptTab configScriptTab6 = this.configScriptTabField; + doubleVal13 = offset + configScriptTab6.getHeight() + 23.0; + SearchTextField searchTextField2 = this.searchTextFieldField; + int intVal2 = (searchTextField2.applyUpdate(value, index) ? 1 : 0); + if (intArr2 == null) { + if (intVal2 != 0) { + Color awtColor4 = new Color(60, 60, 60); + intVal2 = awtColor4.getRGB(); + } else { + Color awtColor5 = new Color(54, 54, 54); + intVal2 = awtColor5.getRGB(); + } + } + + Color awtColor6 = new Color(50, 50, 50); + searchTextField.renderVisual(doubleVal16, doubleVal13, 15.0, 124.5, intVal2, awtColor6.getRGB(), value, value); + AltSortDropdown altSortDropdown = this.altSortDropdownField; + doubleVal16 = amount + 2.0; + ConfigScriptTab configScriptTab7 = this.configScriptTabField; + doubleVal13 = offset + configScriptTab7.getHeight() + 40.5; + int intVal3 = (this.altSortDropdownField.checkInt(value, index) ? 1 : 0); + if (intArr2 == null) { + if (intVal3 != 0) { + Color awtColor7 = new Color(60, 60, 60); + intVal3 = awtColor7.getRGB(); + } else { + Color awtColor8 = new Color(54, 54, 54); + intVal3 = awtColor8.getRGB(); + } + } + + awtColor6 = new Color(50, 50, 50); + ClickGuiSearchBarSupport.executeAltSortDropdown(altSortDropdown, doubleVal16, doubleVal13, 124.5, 17.0, intVal3, awtColor6.getRGB(), value, index); +} + + + + public void handleInt(int value, int index, int count) { + int[] intArr; + int intVal; + intArr = ModuleCategoryTab.getIntArrayValue(); + double doubleVal; + intVal = (doubleVal = index - this.cachedValue3) == 0.0 ? 0 : (doubleVal < 0.0 ? -1 : 1); + label73: + if (intArr == null) { + label71: { + if (intVal > 0) { + double doubleVal2 = index; + double doubleVal11 = this.cachedValue3; + ConfigScriptTab configScriptTab = this.configScriptTabField; + double doubleVal3; + intVal = (doubleVal3 = doubleVal2 - (doubleVal11 + configScriptTab.getHeight() + 20.0)) == 0.0 ? 0 : (doubleVal3 < 0.0 ? -1 : 1); + if (intArr != null) { + break label73; + } + + if (intVal < 0) { + double doubleVal4; + intVal = (doubleVal4 = value - (this.cachedValue4 + 115.0)) == 0.0 ? 0 : (doubleVal4 < 0.0 ? -1 : 1); + if (intArr != null) { + break label73; + } + + if (intVal < 0) { + List itemList = this.discordConfigButtonList; + Iterator iter = itemList.iterator(); + + do { + if (!iter.hasNext()) { + break; + } + + DiscordConfigButton discordConfigButton = (DiscordConfigButton)iter.next(); + discordConfigButton.handleInt(value, index, count); + if (intArr != null) { + break label71; + } + } while (intArr == null); + } + } + } + + this.altSortDropdownField.handleInt(count, value, index); + SearchTextField searchTextField = this.searchTextFieldField; + searchTextField.handleInt(count, value, index); + } + + double doubleVal5; + intVal = (doubleVal5 = value - (this.cachedValue4 + 120.0 - 8.0)) == 0.0 ? 0 : (doubleVal5 < 0.0 ? -1 : 1); + } + + if (intArr == null) { + if (intVal < 0) { + return; + } + + double doubleVal6; + intVal = (doubleVal6 = value - (this.cachedValue4 + 120.0)) == 0.0 ? 0 : (doubleVal6 < 0.0 ? -1 : 1); + } + + if (intArr == null) { + if (intVal > 0) { + return; + } + + double doubleVal7; + intVal = (doubleVal7 = index - this.cachedValue3) == 0.0 ? 0 : (doubleVal7 < 0.0 ? -1 : 1); + } + + if (intArr == null) { + if (intVal < 0) { + return; + } + + double doubleVal8 = index; + double doubleVal9 = this.cachedValue3; + ConfigScriptTab configScriptTab2 = this.configScriptTabField; + double doubleVal10; + intVal = (doubleVal10 = doubleVal8 - (doubleVal9 + configScriptTab2.getHeight() + 20.0)) == 0.0 ? 0 : (doubleVal10 < 0.0 ? -1 : 1); + } + + if (intVal <= 0) { + this.stateFlag2 = true; + this.cachedValue = index; + } +} + + private void lambdaImpl$new$0(String text) { + List itemList = this.discordConfigButtonList; + itemList.clear(); +} + + public void clearEntries() { + List itemList = this.discordConfigButtonList; + itemList.clear(); +} + + public void handleInt2(int value, int index, int count) { + this.stateFlag2 = false; +} + + public ClickGuiSearchBar(ClickGUI clickGUI, ConfigScriptTab configScriptTab) { + this.configScriptTabField = configScriptTab; + this.searchTextFieldField = new SearchTextField(); + this.clickGUIField = clickGUI; + this.altSortDropdownField = new AltSortDropdown("Sort by", this::lambdaImpl$new$0); +} + + public void handleChar(char ch, int value) { + this.searchTextFieldField.applyUpdate(ch, value); +} +} diff --git a/src/main/java/cc/novoline/irc/ClickGuiSearchBarSupport.java b/src/main/java/cc/novoline/irc/ClickGuiSearchBarSupport.java new file mode 100644 index 0000000..d70440a --- /dev/null +++ b/src/main/java/cc/novoline/irc/ClickGuiSearchBarSupport.java @@ -0,0 +1,24 @@ +package cc.novoline.irc; + + +import cc.novoline.gui.alt.AltSortMode; + +import cc.novoline.utils.fonts.impl.AltSortDropdown; + +public class ClickGuiSearchBarSupport { + public static void updateHelper(AltSortDropdown altSortDropdown, int value, int index, int count) { + altSortDropdown.handleInt(value, index, count); +} + + public static void executeAltSortDropdown(AltSortDropdown altSortDropdown, double value, double amount, double offset, double dist, int index, int count, int num, int value2) { + altSortDropdown.renderVisual(value, amount, offset, dist, index, count, num, value2); +} + + public static boolean checkCondition(AltSortDropdown altSortDropdown, int value, int index) { + return altSortDropdown.checkInt(value, index); +} + + public static AltSortMode resolveAltSortMode(AltSortDropdown altSortDropdown) { + return altSortDropdown.getAltSortMode(); +} +} diff --git a/src/main/java/cc/novoline/irc/CloudPacketRegistry.java b/src/main/java/cc/novoline/irc/CloudPacketRegistry.java new file mode 100644 index 0000000..79b5914 --- /dev/null +++ b/src/main/java/cc/novoline/irc/CloudPacketRegistry.java @@ -0,0 +1,108 @@ +package cc.novoline.irc; + + +import cc.novoline.irc.packet.CloudPacket; +import cc.novoline.irc.packet.ConnectedToCloudPacket; +import cc.novoline.irc.packet.DataCloudPacket; +import cc.novoline.irc.packet.MessageCloudPacket; +import cc.novoline.irc.packet.BroadcastCloudPacket; +import cc.novoline.irc.packet.TokenCloudPacket; +import cc.novoline.irc.packet.UsernameCloudPacket; +import com.google.gson.JsonObject; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; + + +public class CloudPacketRegistry { + private final Map> entryMap; + + public int evaluateInt(CloudPacket packet) { + java.lang.Object obj; + Map itemMap = this.entryMap; + Set itemSet = itemMap.entrySet(); + Iterator iter = itemSet.iterator(); + + while (true) { + if (iter.hasNext()) { + Entry entry = (Entry)iter.next(); + obj = packet.getClass(); + + if (obj == entry.getValue()) { + obj = entry.getKey(); + break; + } + + continue; + } + + throw new UnsupportedOperationException("Unsupported/Unknown packet"); + } + + Integer intVal = (Integer)obj; + return intVal; +} + + + + public CloudPacketRegistry() { + this.entryMap = new HashMap<>(); + Map itemMap3 = this.entryMap; + Integer intVal3 = 0; + itemMap3.put(intVal3, TokenCloudPacket.class); + itemMap3 = this.entryMap; + itemMap3.put(1, ConnectedToCloudPacket.class); + itemMap3 = this.entryMap; + itemMap3.put(2, BroadcastCloudPacket.class); + itemMap3 = this.entryMap; + itemMap3.put(3, MessageCloudPacket.class); + Map itemMap = this.entryMap; + Integer intVal = 4; + itemMap.put(intVal, UsernameCloudPacket.class); + Map itemMap2 = this.entryMap; + Integer intVal2 = 5; + itemMap2.put(intVal2, DataCloudPacket.class); +} + + public CloudPacket evaluateInt(JsonObject jsonObject) throws IllegalAccessException, InstantiationException { + int intVal = jsonObject.get("id").getAsInt(); + Class clazz = this.evaluateInt(intVal); + Object obj = clazz; + + if (clazz == null) { + StringBuilder sb2 = new StringBuilder().append("Couldn't find a packet by id "); + throw new UnsupportedOperationException(sb2.append(intVal).toString()); + } + + obj = clazz.newInstance(); + + + CloudPacket packet2 = (CloudPacket)obj; + JsonObject jsonObject2 = jsonObject.get("data").getAsJsonObject(); + return packet2.resolveCloudPacket(jsonObject2); +} + + public String resolveString(CloudPacket packet) { + JsonObject jsonObject = new JsonObject(); + Integer intVal = this.evaluateInt(packet); + jsonObject.addProperty("id", intVal); + JsonObject jsonObject2 = packet.getJsonObject(); + jsonObject.add("data", jsonObject2); + return jsonObject.toString(); +} + + public Class evaluateInt(int value) { + Map itemMap = this.entryMap; + Integer intVal = value; + if (!itemMap.containsKey(intVal)) { + throw new UnsupportedOperationException("Unknown packet"); + } + + itemMap = this.entryMap; + intVal = value; + + return (Class)itemMap.get(intVal); +} +} diff --git a/src/main/java/cc/novoline/irc/IrcPacketHandler.java b/src/main/java/cc/novoline/irc/IrcPacketHandler.java new file mode 100644 index 0000000..9201150 --- /dev/null +++ b/src/main/java/cc/novoline/irc/IrcPacketHandler.java @@ -0,0 +1,101 @@ +package cc.novoline.irc; + +import cc.novoline.Novoline; +import cc.novoline.utils.messages.IrcFormattedMessage; +import cc.novoline.utils.messages.IRCBroadcastMessage; +import cc.novoline.utils.messages.MeMessage; +import cc.novoline.utils.notifications.NotificationManager; +import cc.novoline.utils.notifications.NotificationType; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.skidunion.irc.events.AbstractIRCEventAdapter; +import net.skidunion.irc.events.ChatMessageEvent; +import net.skidunion.irc.entities.ChatEntity; +import net.skidunion.irc.entities.UserEntity; +import net.skidunion.irc.events.SystemMessageEvent; +import net.skidunion.irc.events.IRCConnectedEvent; +import net.skidunion.irc.events.IRCDisconnectEvent; +import net.skidunion.irc.events.IRCPingEvent; +import net.skidunion.irc.events.PrivateMessageEvent; +import org.jetbrains.annotations.NotNull; + +public class IrcPacketHandler extends AbstractIRCEventAdapter { + private String cachedText; + + @Override + public void a(@NotNull IRCDisconnectEvent event) { + if (event.b() == 4004) { + if (Minecraft.getMinecraft().thePlayer != null) { + Novoline novolineInst = Novoline.getInstance(); + NotificationManager notifManager = novolineInst.getNotificationManager(); + notifManager.pop("Could not connect to IRC", "The authorization token was invalid, please restart the client", 2000, NotificationType.ERROR); + } + } +} + + @Override + public void a(@NotNull PrivateMessageEvent event) { + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + if (player == null) { + return; + } + + UserEntity userEntity = event.a().d(); + this.cachedText = userEntity.e(); + player = Minecraft.getMinecraft().thePlayer; + + UserEntity userEntity2 = event.a().d(); + String textStr = event.a().a(); + MeMessage meMessage = MeMessage.resolveMeMessage2(userEntity2, textStr); + player.addChatComponentMessage(meMessage); +} + + public String a() { + return this.cachedText; +} + + @Override + public void a(@NotNull SystemMessageEvent event) { + if (Minecraft.getMinecraft().thePlayer != null) { + if (!event.a()) { + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + String textStr = event.b(); + IRCBroadcastMessage iRCBroadcastMessage = IRCBroadcastMessage.getAClB(textStr); + player.addChatComponentMessage(iRCBroadcastMessage); + } + } +} + + @Override + public void a(@NotNull ChatMessageEvent event) { + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + + if (player == null) { + return; + } + + player = Minecraft.getMinecraft().thePlayer; + + + ChatEntity chatEntity = event.a(); + IrcFormattedMessage ircFormattedMessage = IrcFormattedMessage.resolveIrcFormattedMessage(chatEntity); + player.addChatComponentMessage(ircFormattedMessage); +} + + @Override + public void a(@NotNull IRCPingEvent event) {} + + @Override + public void a(@NotNull IRCConnectedEvent event) { + System.out.println("Kicked by an administrator."); + System.exit(0); +} + + public static IrcPacketHandler getIrcPacketHandler() { + return IrcPacketHandlerHolder.resolveIrcPacketHandler(IrcPacketHandlerHolder.INSTANCE); +} + + public void a(String text) { + this.cachedText = text; +} +} diff --git a/src/main/java/cc/novoline/irc/IrcPacketHandlerHolder.java b/src/main/java/cc/novoline/irc/IrcPacketHandlerHolder.java new file mode 100644 index 0000000..f72cd8c --- /dev/null +++ b/src/main/java/cc/novoline/irc/IrcPacketHandlerHolder.java @@ -0,0 +1,12 @@ +package cc.novoline.irc; + +public enum IrcPacketHandlerHolder { + INSTANCE; + + private static final IrcPacketHandlerHolder[] ircPacketHandlerHolderArray = new IrcPacketHandlerHolder[]{IrcPacketHandlerHolder.INSTANCE}; + private final IrcPacketHandler ircPacketHandlerField = new IrcPacketHandler(); + + static IrcPacketHandler resolveIrcPacketHandler(IrcPacketHandlerHolder packet) { + return packet.ircPacketHandlerField; +} +} diff --git a/src/main/java/cc/novoline/irc/NovolineWebSocket.java b/src/main/java/cc/novoline/irc/NovolineWebSocket.java new file mode 100644 index 0000000..283b396 --- /dev/null +++ b/src/main/java/cc/novoline/irc/NovolineWebSocket.java @@ -0,0 +1,117 @@ +package cc.novoline.irc; + + +import cc.novoline.Novoline; +import cc.novoline.irc.packet.CloudPacket; +import cc.novoline.irc.packet.TokenCloudPacket; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; +import java.net.URI; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.function.Consumer; +import cc.novoline.irc.packet.DataCloudPacketSupport; + +import org.java_websocket.client.WebSocketClient; +import org.java_websocket.handshake.ServerHandshake; + +public class NovolineWebSocket +extends WebSocketClient { + private String cachedText; + private String cachedText2; +private final CloudPacketRegistry cloudPacketRegistryField = new CloudPacketRegistry(); + private Consumer consumerField; + private List dataCloudPacketSupportList = new ArrayList(); + private String cachedText3; + + @Override + public void onMessage(String string) { + try { + JsonParser jsonParser = new JsonParser(); + AesCipherUtil aESAESHelper = new AesCipherUtil(this.cachedText3); + JsonElement jsonElement = jsonParser.parse(aESAESHelper.createString(string, this.cachedText.getBytes())); + CloudPacket cloudPacket = this.cloudPacketRegistryField.evaluateInt(jsonElement.getAsJsonObject()); + cloudPacket.performAction(); + } + catch (NovolineWebSocketException | IllegalAccessException | InstantiationException throwable) { + throwable.printStackTrace(); + } +} + + @Override + public void onOpen(ServerHandshake serverHandshake) { + this.cachedText3 = WebSocketTrustUtil.resolveString((int)16); + this.cachedText = WebSocketTrustUtil.resolveString((int)16); + StringBuilder stringBuilder = new StringBuilder(); + StringBuilder stringBuilder2 = stringBuilder.append("HS_EC:"); + StringBuilder stringBuilder3 = stringBuilder2.append(this.cachedText3); + StringBuilder stringBuilder4 = stringBuilder3.append(":"); + this.send(stringBuilder4.append(this.cachedText).toString()); + this.consumerField.accept(null); +} + + private static void lambdaImpl$null$0(Novoline novoline, String string, Void void_) { + NovolineWebSocket novolineWebSocket = novoline.getWebSocket(); + StringBuilder stringBuilder = new StringBuilder(); + StringBuilder stringBuilder2 = stringBuilder.append("RT:"); + novolineWebSocket.applyUpdate((CloudPacket)new TokenCloudPacket(stringBuilder2.append(string).toString())); +} + + public void applyUpdate(CloudPacket cloudPacket) { + AesCipherUtil aESAESHelper = new AesCipherUtil(this.cachedText3); + String string = this.cloudPacketRegistryField.resolveString(cloudPacket); + try { + this.send(aESAESHelper.createString2(string, this.cachedText.getBytes())); + } + catch (NovolineWebSocketException novolineWebSocketException) { + novolineWebSocketException.printStackTrace(); + } +} + + public NovolineWebSocket applyUpdate(Consumer consumer) { + this.consumerField = consumer; + return this; +} + + public List getDataCloudPacketSupportList() { + return this.dataCloudPacketSupportList; +} + + @Override + public void onError(Exception exception) { + StringBuilder stringBuilder = new StringBuilder(); + StringBuilder stringBuilder2 = stringBuilder.append("Error in IRC connection: "); + String string = exception.getMessage(); + System.out.println(stringBuilder2.append(string).toString()); +} + + public void applyUpdate(List list) { + this.dataCloudPacketSupportList = list; +} + + public NovolineWebSocket(URI uRI) { + super(uRI); +} + + @Override + public void onClose(int n, String string, boolean bl) { + Novoline novoline = Novoline.getInstance(); + String string2 = this.cachedText2; + ScheduledExecutorService scheduledExecutorService = Executors.newSingleThreadScheduledExecutor(); + scheduledExecutorService.schedule(() -> NovolineWebSocket.invokeCallback2(novoline, string2), 5L, TimeUnit.SECONDS); +} + + private static void invokeCallback2(Novoline novoline, String string) { + NovolineWebSocket novolineWebSocket = new NovolineWebSocket(URI.create("ws://novoline.lol:2095")).applyUpdate(arg_0 -> NovolineWebSocket.lambdaImpl$null$0(novoline, string, arg_0)); + novoline.applyUpdate(novolineWebSocket); + novoline.getWebSocket().connect(); +} + + public void applyUpdate(String string) { + this.cachedText2 = string; +} +} + diff --git a/src/main/java/cc/novoline/irc/NovolineWebSocketException.java b/src/main/java/cc/novoline/irc/NovolineWebSocketException.java new file mode 100644 index 0000000..82d44e0 --- /dev/null +++ b/src/main/java/cc/novoline/irc/NovolineWebSocketException.java @@ -0,0 +1,7 @@ +package cc.novoline.irc; + +public class NovolineWebSocketException extends Throwable { + public NovolineWebSocketException(Throwable throwable) { + super(throwable); +} +} diff --git a/src/main/java/cc/novoline/irc/WebSocketTrustUtil.java b/src/main/java/cc/novoline/irc/WebSocketTrustUtil.java new file mode 100644 index 0000000..11576c3 --- /dev/null +++ b/src/main/java/cc/novoline/irc/WebSocketTrustUtil.java @@ -0,0 +1,92 @@ +package cc.novoline.irc; + +import java.util.concurrent.ThreadLocalRandom; + +public class WebSocketTrustUtil { + public static String resolveString(int value) { + java.lang.StringBuilder sb; + char[] charArr = new char[]{ + 'a', + 'b', + 'c', + 'd', + 'e', + 'f', + 'g', + 'h', + 'i', + 'j', + 'k', + 'l', + 'm', + 'n', + 'o', + 'p', + 'q', + 'r', + 's', + 't', + 'u', + 'v', + 'w', + 'x', + 'y', + 'z', + 'A', + 'B', + 'C', + 'D', + 'E', + 'F', + 'G', + 'H', + 'I', + 'J', + 'K', + 'L', + 'M', + 'N', + 'O', + 'P', + 'Q', + 'R', + 'S', + 'T', + 'U', + 'V', + 'W', + 'X', + 'Y', + 'Z', + '0', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9' + }; + StringBuilder sb2 = new StringBuilder(); + int intVal = 0; + + while (true) { + if (intVal < value) { + ThreadLocalRandom threadLocalRandom = ThreadLocalRandom.current(); + int len = charArr.length; + char ch = charArr[threadLocalRandom.nextInt(len)]; + sb = sb2.append(ch); + + intVal++; + continue; + } + + sb = sb2; + break; + } + + return sb.toString(); +} +} diff --git a/src/main/java/cc/novoline/irc/packet/BroadcastCloudPacket.java b/src/main/java/cc/novoline/irc/packet/BroadcastCloudPacket.java new file mode 100644 index 0000000..38bc55a --- /dev/null +++ b/src/main/java/cc/novoline/irc/packet/BroadcastCloudPacket.java @@ -0,0 +1,26 @@ +package cc.novoline.irc.packet; + +import com.google.gson.JsonObject; + +public class BroadcastCloudPacket extends CloudPacket { + private String cachedText; + + public CloudPacket resolveCloudPacket(JsonObject jsonObject) { + return null; +} + + public JsonObject getJsonObject() { + JsonObject jsonObject = new JsonObject(); + jsonObject.addProperty("message", this.cachedText); + + return jsonObject; +} + + public BroadcastCloudPacket(String text) { + this.cachedText = text; +} + + public void performAction() {} + + public BroadcastCloudPacket() {} +} diff --git a/src/main/java/cc/novoline/irc/packet/CloudPacket.java b/src/main/java/cc/novoline/irc/packet/CloudPacket.java new file mode 100644 index 0000000..ae6d4d8 --- /dev/null +++ b/src/main/java/cc/novoline/irc/packet/CloudPacket.java @@ -0,0 +1,29 @@ +package cc.novoline.irc.packet; + +import com.google.gson.JsonObject; + +public abstract class CloudPacket { + public final JsonObject jsonObjectField = new JsonObject(); + public int intValue; + private static int[] b; + + public static int[] getIntArrayValue() { + return b; +} + + public abstract void performAction(); + + public abstract JsonObject getJsonObject(); + + static { + if (getIntArrayValue() == null) { + processIntArray(new int[5]); + } + } + + public static void processIntArray(int[] intArray) { + b = intArray; +} + + public abstract CloudPacket resolveCloudPacket(JsonObject jsonObject); +} diff --git a/src/main/java/cc/novoline/irc/packet/ConnectedToCloudPacket.java b/src/main/java/cc/novoline/irc/packet/ConnectedToCloudPacket.java new file mode 100644 index 0000000..0ef4475 --- /dev/null +++ b/src/main/java/cc/novoline/irc/packet/ConnectedToCloudPacket.java @@ -0,0 +1,35 @@ +package cc.novoline.irc.packet; + +import cc.novoline.Novoline; +import cc.novoline.irc.NovolineWebSocket; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; + +public class ConnectedToCloudPacket extends CloudPacket { +private String cachedText; + + @Override + public void performAction() { + Novoline novolineInst = Novoline.getInstance(); + NovolineWebSocket novolineWebSocket = novolineInst.getWebSocket(); + novolineWebSocket.applyUpdate(this.cachedText); + System.out.println("Connected to Novoline IRC"); +} + + public ConnectedToCloudPacket() {} + + public ConnectedToCloudPacket(String text) { + this.cachedText = text; +} + + @Override + public JsonObject getJsonObject() { + return null; +} + + @Override + public CloudPacket resolveCloudPacket(JsonObject jsonObject) { + JsonElement jsonElement = jsonObject.get("refreshToken"); + return new ConnectedToCloudPacket(jsonElement.getAsString()); +} +} diff --git a/src/main/java/cc/novoline/irc/packet/DataCloudPacket.java b/src/main/java/cc/novoline/irc/packet/DataCloudPacket.java new file mode 100644 index 0000000..4d3db4e --- /dev/null +++ b/src/main/java/cc/novoline/irc/packet/DataCloudPacket.java @@ -0,0 +1,66 @@ +package cc.novoline.irc.packet; + +import cc.novoline.Novoline; +import cc.novoline.irc.NovolineWebSocket; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import java.util.ArrayList; + + +public class DataCloudPacket extends CloudPacket { + private String cachedText; + + @Override + public CloudPacket resolveCloudPacket(JsonObject jsonObject) { + JsonElement jsonElement = jsonObject.get("data"); + return new DataCloudPacket(jsonElement.getAsString()); +} + + @Override + public void performAction() { + ArrayList itemList = new ArrayList(); + String textStr2 = this.cachedText; + String textStr3 = ":"; + String[] stringArr = textStr2.split(textStr3); + String[] stringArr2 = stringArr; + int len = stringArr2.length; + int intVal = 0; + + while (true) { + if (intVal < len) { + String textStr = stringArr2[intVal]; + textStr2 = "-"; + String[] stringArr3 = textStr.split(textStr2); + DataCloudPacketSupport supportPacket = DataCloudPacketSupport.getDataCloudPacketSupport(); + textStr3 = stringArr3[0]; + DataCloudPacketSupport supportPacket2 = supportPacket.createDataCloudPacketSupport(textStr3); + textStr3 = stringArr3[1]; + DataCloudPacketSupport supportPacket3 = supportPacket2.resolveDataCloudPacketSupport(textStr3); + textStr3 = stringArr3[2]; + int intVal2 = Integer.parseInt(textStr3); + DataCloudPacketSupport supportPacket4 = supportPacket3.createDataCloudPacketSupport(intVal2); + itemList.add(supportPacket4); + System.out.println(stringArr3[0]); + intVal++; + + continue; + } + + Novoline novolineInst = Novoline.getInstance(); + NovolineWebSocket novolineWebSocket = novolineInst.getWebSocket(); + novolineWebSocket.applyUpdate(itemList); + break; + } +} + + public DataCloudPacket() {} + + @Override + public JsonObject getJsonObject() { + return null; +} + + public DataCloudPacket(String text) { + this.cachedText = text; +} +} diff --git a/src/main/java/cc/novoline/irc/packet/DataCloudPacketSupport.java b/src/main/java/cc/novoline/irc/packet/DataCloudPacketSupport.java new file mode 100644 index 0000000..962c232 --- /dev/null +++ b/src/main/java/cc/novoline/irc/packet/DataCloudPacketSupport.java @@ -0,0 +1,38 @@ +package cc.novoline.irc.packet; + +public class DataCloudPacketSupport { +private int stateTicks; + private String cachedText; + private String cachedText2; + + public static DataCloudPacketSupport getDataCloudPacketSupport() { + return new DataCloudPacketSupport(); +} + + public DataCloudPacketSupport createDataCloudPacketSupport(String text) { + this.cachedText = text; + return this; +} + + public DataCloudPacketSupport createDataCloudPacketSupport(int value) { + this.stateTicks = value; + return this; +} + + public String getCachedText() { + return this.cachedText; +} + + public String getCachedText2() { + return this.cachedText2; +} + + public int getStateTicks() { + return this.stateTicks; +} + + public DataCloudPacketSupport resolveDataCloudPacketSupport(String text) { + this.cachedText2 = text; + return this; +} +} diff --git a/src/main/java/cc/novoline/irc/packet/MessageCloudPacket.java b/src/main/java/cc/novoline/irc/packet/MessageCloudPacket.java new file mode 100644 index 0000000..f1f909e --- /dev/null +++ b/src/main/java/cc/novoline/irc/packet/MessageCloudPacket.java @@ -0,0 +1,30 @@ +package cc.novoline.irc.packet; + +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiIngame; +import net.minecraft.util.ChatComponentText; + +public class MessageCloudPacket extends CloudPacket { + private String cachedText; + + public JsonObject getJsonObject() { + return null; +} + + public CloudPacket resolveCloudPacket(JsonObject jsonObject) { + JsonElement jsonElement = jsonObject.get("message"); + return new MessageCloudPacket(jsonElement.getAsString()); +} + + public void performAction() { + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(this.cachedText)); +} + + public MessageCloudPacket(String text) { + this.cachedText = text; +} + + public MessageCloudPacket() {} +} diff --git a/src/main/java/cc/novoline/irc/packet/TokenCloudPacket.java b/src/main/java/cc/novoline/irc/packet/TokenCloudPacket.java new file mode 100644 index 0000000..37964e9 --- /dev/null +++ b/src/main/java/cc/novoline/irc/packet/TokenCloudPacket.java @@ -0,0 +1,41 @@ +package cc.novoline.irc.packet; +import com.google.gson.JsonObject; + + +public class TokenCloudPacket extends CloudPacket { + private String cachedText; + private static Object[] e; + + public static Object[] a() { + return e; +} + + public TokenCloudPacket() {} + + static { + if (a() != null) { + processObjectArray(new Object[4]); + } + } + + public JsonObject getJsonObject() { + JsonObject jsonObject = new JsonObject(); + jsonObject.addProperty("token", this.cachedText); + + return jsonObject; +} + + public static void processObjectArray(Object[] flowGuardArray) { + e = flowGuardArray; +} + + public CloudPacket resolveCloudPacket(JsonObject jsonObject) { + return null; +} + + public void performAction() {} + + public TokenCloudPacket(String text) { + this.cachedText = text; +} +} diff --git a/src/main/java/cc/novoline/irc/packet/UsernameCloudPacket.java b/src/main/java/cc/novoline/irc/packet/UsernameCloudPacket.java new file mode 100644 index 0000000..c391e4a --- /dev/null +++ b/src/main/java/cc/novoline/irc/packet/UsernameCloudPacket.java @@ -0,0 +1,25 @@ +package cc.novoline.irc.packet; + +import com.google.gson.JsonObject; + +public class UsernameCloudPacket extends CloudPacket { + private String cachedText; + + public UsernameCloudPacket(String name) { + this.cachedText = name; +} + + public void performAction() {} + + public UsernameCloudPacket() {} + + public JsonObject getJsonObject() { + JsonObject jsonObject = new JsonObject(); + jsonObject.addProperty("username", this.cachedText); + return jsonObject; +} + + public CloudPacket resolveCloudPacket(JsonObject jsonObject) { + return null; +} +} diff --git a/src/main/java/cc/novoline/modules/AbstractModule.java b/src/main/java/cc/novoline/modules/AbstractModule.java new file mode 100644 index 0000000..a10e81c --- /dev/null +++ b/src/main/java/cc/novoline/modules/AbstractModule.java @@ -0,0 +1,584 @@ +package cc.novoline.modules; + + +import cc.novoline.utils.messages.MessageMessage; +import cc.novoline.commands.NovoCommand; +import cc.novoline.events.events.ModuleStateEvent; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.modules.binds.KeyboardKeybind; +import cc.novoline.modules.binds.ModuleKeybind; +import cc.novoline.modules.configurations.property.object.KeyBindProperty; +import cc.novoline.modules.configurations.util.DelsyConfigSerializer; +import cc.novoline.utils.StringScrambler; +import cc.novoline.utils.Timer; +import cc.novoline.utils.anim.SmoothAnimation; +import cc.novoline.utils.helper.ModuleCategorySwitchMap; +import cc.novoline.utils.messages.TextMessage; +import cc.novoline.utils.notifications.NotificationManager; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.tasks.TaskManager; +import cc.novoline.utils.tasks.TaskStage; +import cc.novoline.utils.tasks.impl.AbstractModuleTask; + +import cc.novoline.Initializer; +import cc.novoline.Novoline; +import cc.novoline.events.Event; +import cc.novoline.events.EventManager; +import cc.novoline.modules.configurations.annotation.DelsyConfig; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.visual.HUD; +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; +import com.google.common.reflect.TypeToken; +import java.awt.Color; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.function.Predicate; +import java.util.stream.Stream; +import ninja.leaping.configurate.util.PlayerManagerConfigisnotlHelper; +import cc.novoline.modules.visual.ChestESPSupport; + +import ninja.leaping.configurate.objectmapping.serialize.TypeSerializerCollection; +import ninja.leaping.configurate.hocon.HoconConfigurationLoader; +import ninja.leaping.configurate.util.ConfigurateException; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.GuiIngame; +import net.minecraft.client.gui.GuiNewChat; +import net.minecraft.item.ItemStack; +import net.minecraft.network.Packet; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; +import net.skidunion.security.ProtectionSession; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@DelsyConfig +public class AbstractModule { + public String textValue; + private static int intState = 6; + public final Minecraft mc; + public Runnable callbackTask; + public Color colorField; + public String textValueField; + public Runnable callbackTask2; + private final Cache, AbstractModule> cacheField; + public Runnable callbackTask3; + public double doubleField; + @Property("enabled") + public final BooleanProperty enabledProperty; + public Runnable callbackTask4; + @Property("hidden") + public final BooleanProperty hiddenProperty; + public final ModuleManager moduleManager; + public Runnable callbackTask5; + public double[] doubleTable; + public double v; + private Timer timerField; + public Runnable callbackTask6; + private double doubleValue; + public ItemStack itemStack; + public final int intValue; + public final Logger logger; + public final EnumModuleType category; + public String textField; + @Property("display-name") + public final StringProperty displayNameProperty; + public final KeyBindProperty keyBindProperty; + public Initializer initializer; + public final String textValueField2; + public boolean[] fieldVal2; + public Timer timerField2; + public Color colorField2; + public final String name; + private SmoothAnimation smoothAnimation; + private Timer msTimer; + public int[] intTable; + public PlayerManagerConfigisnotlHelper playerManagerConfigisnotlHelper; + public final Novoline novoline; + + public AbstractModule(@NotNull ModuleManager manager, @NotNull EnumModuleType category, @NotNull String name) { + this(manager, name, name, 0, category, null, null); +} + + public AbstractModule(@NotNull ModuleManager manager, @NotNull EnumModuleType category, + @NotNull String name, @NotNull String displayName) { + this(manager, name, displayName, 0, category, null, null); +} + + public AbstractModule(@NotNull ModuleManager manager, @NotNull String name, @NotNull EnumModuleType category) { + this(manager, name, name, 0, category, null, null); +} + + public AbstractModule(@NotNull ModuleManager manager, @NotNull String name, @NotNull EnumModuleType category, + @Nullable String description) { + this(manager, name, name, 0, category, description, null); +} + + public AbstractModule(@NotNull ModuleManager manager, @NotNull String name, @NotNull EnumModuleType category, + @Nullable String description, @Nullable String configName) { + this(manager, name, name, 0, category, description, configName); +} + + public AbstractModule(@NotNull ModuleManager manager, @NotNull String name, @NotNull String displayName, + @NotNull EnumModuleType category, @Nullable String description) { + this(manager, name, displayName, 0, category, description, null); +} + + public AbstractModule(@NotNull ModuleManager manager, @NotNull String name, @NotNull String displayName, + int defaultKey, @NotNull EnumModuleType category) { + this(manager, name, displayName, defaultKey, category, null, null); +} + + public AbstractModule(@NotNull ModuleManager manager, @NotNull String name, @NotNull String displayName, + int defaultKey, @NotNull EnumModuleType category, @Nullable String description) { + this(manager, name, displayName, defaultKey, category, description, null); +} + + public AbstractModule(@NotNull ModuleManager manager, @NotNull String name, @NotNull String displayName, + @NotNull EnumModuleType category, @Nullable String description, @Nullable String configName) { + this(manager, name, displayName, 0, category, description, configName); +} + + public AbstractModule(@NotNull ModuleManager manager, @NotNull String name, @NotNull String displayName, + int defaultKey, @NotNull EnumModuleType category, @Nullable String description, + @Nullable String configName) { + initializer = Initializer.d(); + callbackTask3 = initializer.g; + callbackTask2 = initializer.h; + callbackTask = initializer.p; + callbackTask5 = initializer.d; + itemStack = initializer.f; + intTable = initializer.e; + doubleTable = initializer.q; + fieldVal2 = initializer.k; + + textField = "game.player.hurt.fall.small"; + logger = LogManager.getLogger(); + timerField2 = new Timer(); + enabledProperty = BooleanProperty.of(false); + hiddenProperty = BooleanProperty.of(false); + displayNameProperty = StringProperty.of(""); + ModuleKeybind unbound = KeyboardKeybind.of(0); + keyBindProperty = ChestESPSupport.of(unbound); + msTimer = new Timer(); + timerField = new Timer(); + smoothAnimation = new SmoothAnimation(); + doubleField = 0.0; + v = 0.0; + doubleValue = 0.0; + colorField2 = new Color(255, 0, 0); + colorField = new Color(0, 255, 255); + + CacheBuilder cache = CacheBuilder.newBuilder(); + cache.expireAfterAccess(1, TimeUnit.MINUTES); + cacheField = cache.build(); + + moduleManager = manager; + novoline = manager.getNovoline(); + mc = novoline.getMinecraft(); + this.name = name; + this.category = category; + intValue = defaultKey; + textValueField2 = description; + textValueField = displayName; + + Setting bindSetting = new Setting("MODULE_BIND", "Bind", SettingType.BINDABLE, this, keyBindProperty); + SettingManager.register(bindSetting); + + if (configName == null) return; + Path configDirectory = novoline.getDataFolder(); + playerManagerConfigisnotlHelper = PlayerManagerConfigisnotlHelper.a(configDirectory.resolve(append(append(new StringBuilder(), configName), ".novo").toString())); + + HoconConfigurationLoader configuration = playerManagerConfigisnotlHelper.d(); + TypeSerializerCollection serializers = configuration.a().e(); + Predicate> supportedConfigType = AbstractModule::isConfigType; + DelsyConfigSerializer serializer = new DelsyConfigSerializer(manager); + serializers.a(supportedConfigType, serializer); + handleTypeSerializerCollection(serializers); + try { + playerManagerConfigisnotlHelper.c(); + } catch (ConfigurateException exception) { + exception.printStackTrace(); + } +} + + private static boolean isConfigType(TypeToken token) { + Class type = token.getRawType(); + do { + boolean annotated = type.isAnnotationPresent(DelsyConfig.class); + if (!annotated) { + type = type.getSuperclass(); + } + if (annotated || type == null) return annotated; + } while (type.getSuperclass() != null); + return false; +} + + @NotNull public String getName() { return name; } + @NotNull public EnumModuleType getCategory() { return category; } + @NotNull public Novoline getNovoline() { return novoline; } + @NotNull public Logger getLogger() { return logger; } + @Nullable public String getTextValueField2() { return textValueField2; } + @NotNull public String getTextValue() { return textValueField; } + public int getIntValue25() { return intValue; } + public double getDoubleValue4() { return doubleValue; } + public Timer getTimer2() { return timerField; } + public Timer getMsTimer2() { return msTimer; } + public SmoothAnimation getSmoothAnimation2() { return smoothAnimation; } + public PlayerManagerConfigisnotlHelper getPlayerManagerConfigisnotlHelper() { return playerManagerConfigisnotlHelper; } + public KeyBindProperty getKeyBindProperty2() { return keyBindProperty; } + + public static int z() { return intState; } + public static int y() { return z() == 0 ? 98 : 0; } + public static void applyInt5(int guard) { intState = guard; } + + private static boolean readProperty(BooleanProperty property) { + Boolean value = property.get(); + return value; +} + + private static void writeProperty(BooleanProperty property, boolean value) { + Boolean boxed = value; + property.set(boxed); +} + + public final boolean isEnabled() { return readProperty(enabledProperty); } + public final boolean isHidden() { return readProperty(hiddenProperty); } + + public void setEnabled(boolean enabled) { + int guard = z(); + boolean active = readProperty(enabledProperty); + if (active == enabled) return; + writeProperty(enabledProperty, enabled); + active = enabled; + if (active) { + enable(); + if (guard != 0) return; + } + disable(); +} + + public boolean toggle() { + boolean active = readProperty(enabledProperty); + + boolean enabled = !active; + setEnabled(enabled); + Event update = new ModuleStateEvent(); + EventManager.call(update); + return enabled; +} + + public final void enable() { + EventManager.register(this); + onEnable(); + smoothAnimation.applyDouble(0.05); + timerField.performAction(); + timerField2.performAction(); + doubleValue = 0.0; +} + + public final void disable() { + EventManager.unregister(this); + onDisable(); + smoothAnimation.reset(); + timerField.performAction(); + timerField2.performAction(); +} + + public void onEnable() {} + public void onDisable() {} + public void handleTypeSerializerCollection(@NotNull TypeSerializerCollection serializers) {} + + public void setHidden(boolean hidden) { + writeProperty(hiddenProperty, hidden); + HUD hud = hud(); + hud.performAction(); +} + + @SuppressWarnings("unchecked") + public Module getModule(Class moduleClass) { + try { + return (Module) cacheField.get(moduleClass, () -> moduleManager.getByClass(moduleClass)); + } catch (ExecutionException exception) { + throw new RuntimeException(exception); + } +} + + public void applyInt5(@NotNull Class moduleClass) { + AbstractModule module = getModule(moduleClass); + boolean enabled = module.isEnabled(); + if (enabled) { + String message = append(append(new StringBuilder(), module.getName()), " was disabled to prevent flags/errors").toString(); + applyUpdate4(message, 1000, NotificationType.WARNING); + module.toggle(); + } +} + + @SuppressWarnings("unchecked") + public void handleClassArray(@NotNull Class... moduleClasses) { + for (Class moduleClass : moduleClasses) { + AbstractModule module = getModule(moduleClass); + + if (module.isEnabled()) { + module.toggle(); + String title = getTextValue2(); + String message = append(append(new StringBuilder(), module.name), " was disabled to prevent flags/errors").toString(); + applyUpdate5(title, message, 1000, NotificationType.WARNING); + } + } +} + + public boolean matchesModuleRegistryArray(ModuleRegistry... modules) { + Stream stream = Arrays.stream(modules); + Predicate enabled = registry -> { + return registry.obtainAbstractModule().isEnabled(); + }; + return stream.anyMatch(enabled); +} + + private static HUD hud() { + ModuleRegistry registry = ModuleRegistry.HUD; + return registry.getModule(); +} + + private static String lowercase(String value) { + return value.toLowerCase(); +} + + private static StringBuilder append(StringBuilder text, String value) { + return text.append(value); +} + + @NotNull + public String getTextValue2() { + String displayName = displayNameProperty.get(); + hud(); // Resolve the registered HUD before choosing the display name. + + if (displayName != null) { + if (!displayName.isEmpty()) return displayName; + } + return textValueField; +} + + public void applyInt5(@NotNull String displayName) { textValueField = displayName; } + + public void applyUpdate2(String displayName) { + displayNameProperty.set(displayName); +} + + @NotNull + public String getTextValue3() { + return y() == 0 && textValue == null ? "" : textValue; +} + + @NotNull + public String getTextValue4() { + String label = append(append(new StringBuilder(), getTextValue2()), getTextValue3()).toString(); + HUD hud = hud(); + StringProperty nameCaseProperty = hud.getStringPropertyValue6(); + String nameCase = lowercase(nameCaseProperty.get()); + int hash = nameCase.hashCode(); + int formatting = hash; + + switch (hash) { + case 93508654: formatting = nameCase.equals("basic") ? 0 : -1; break; + case 103164673: formatting = nameCase.equals("lower") ? 1 : -1; break; + case 111499426: formatting = nameCase.equals("upper") ? 2 : -1; break; + default: formatting = -1; + } + + if (formatting == 1) return lowercase(label); + if (formatting == 2) { + return label.toUpperCase(); + } + return label; +} + + public void handleString3(String suffix) { + int guard = y(); + if (suffix != null) { + if (suffix.isEmpty()) { + textValue = ""; + return; + } + } + + HUD hud = hud(); + StringProperty suffixStyleProperty = hud.getStringProperty16(); + String style = lowercase(suffixStyleProperty.get()); + int hash = style.hashCode(); + int formatting = hash; + + switch (hash) { + case 3387192: formatting = style.equals("none") ? 0 : -1; break; + case 93508654: formatting = style.equals("basic") ? 1 : -1; break; + case 3075986: formatting = style.equals("dash") ? 2 : -1; break; + case 137407656: formatting = style.equals("bracket") ? 3 : -1; break; + default: formatting = -1; + } + + // In the alternate guard state, the original switch falls through to the reset below. + switch (formatting) { + case 0: + textValue = ""; + if (guard == 0) return; + case 1: + textValue = append(append(new StringBuilder(), "\u00a77 "), suffix).toString(); + if (guard == 0) return; + case 2: + textValue = append(append(new StringBuilder(), "\u00a77 - "), suffix).toString(); + if (guard == 0) return; + case 3: + textValue = append(append(append(new StringBuilder(), "\u00a77 ["), suffix), "]").toString(); + if (guard == 0) return; + default: + textValue = ""; + } + if (guard != 0) textValue = ""; +} + + public float computeFloatValue() { + switch (ModuleCategorySwitchMap.SWITCH_MAP[category.ordinal()]) { + case 1: return 0.9F; + case 2: return 0.55F; + case 3: return 0.45F; + case 4: return 0.1F; + default: return 0.0F; + } +} + + public void handleModuleKeybind(ModuleKeybind binding) { keyBindProperty.set(binding); } + public void handleDouble(double value) { doubleValue = value; } + public void handleRunnable(Runnable callback) { smoothAnimation.renderVisual2(doubleField, v, 0.025, callback, 200L, 100L); } + + public boolean isStateReady() { + int guard = z(); + String value = ProtectionSession.c; + int number = Integer.parseInt(value); + // IRETURN narrows the integer to its low bit in the alternate branch. + return guard == 0 ? (number & 1) != 0 : number < 3; +} + + public void handlePacket(@NotNull Packet packet) { + EntityPlayerSP player = mc.thePlayer; + if (player == null) return; + player = mc.thePlayer; + player.sendQueue.applyPacket(packet); +} + + public void applyInt5(@NotNull Packet packet) { + EntityPlayerSP player = mc.thePlayer; + if (player == null) return; + player = mc.thePlayer; + player.sendQueue.applyS3BPacketScoreboardObjective(packet); +} + + public void handleObjectArray(Object... values) { + if (!initializer.b()) return; + String message = Arrays.toString(values); + String prefix = "\u00a73Novoline \u00a78>> \u00a7r"; + GuiIngame gui = mc.ingameGUI; + GuiNewChat chat = gui.getChatGUI(); + chat.printChatMessage(new ChatComponentText(append(append(new StringBuilder(), prefix), message).toString())); +} + + public void applyTextMessage(@Nullable TextMessage message, boolean prefix) { + IChatComponent component = message; + if (message == null) component = NovoCommand.EMPTY_COMPONENT; + else if (prefix) component = message.a(NovoCommand.PREFIX); + EntityPlayerSP player = mc.thePlayer; + player.addChatComponentMessage(component); +} + + public void handleTextMessage(@Nullable TextMessage message) { applyTextMessage(message, false); } + + public void applyString(@NotNull String message, boolean prefix) { + applyTextMessage(TextMessage.b(message), prefix); +} + + public void applyUpdate3(@NotNull String message) { + handleTextMessage(TextMessage.b(message)); +} + + public void updateHelper() { + EntityPlayerSP player = mc.thePlayer; + IChatComponent component = MessageMessage.obtainMessageMessage(); + player.addChatComponentMessage(component); +} + + public void applyString2(String reason, int duration) { + if (!readProperty(enabledProperty)) return; + setEnabled(false); + applyUpdate5(getTextValue2(), reason, duration, NotificationType.WARNING); + TaskManager tasks = novoline.getTaskManager(); + AbstractModuleTask task = new AbstractModuleTask(this, 40, TaskStage.TICK); + tasks.applyFutureTask(task); +} + + public void applyUpdate4(String message, int duration, NotificationType type) { + String title = lowercase(type.name()); + applyUpdate5(StringScrambler.resolveString3(title), message, 2000, type); +} + + public void applyUpdate4(String title, String message, NotificationType type) { applyUpdate5(title, message, 2000, type); } + + public void applyUpdate5(String title, String message, int duration, NotificationType type) { + NotificationManager notifications = novoline.getNotificationManager(); + notifications.pop(title, message, duration, type); +} + + public void setSuffix(String suffix) { + this.handleString3(suffix); +} + public boolean isEnabled(ModuleRegistry... modules) { + return this.matchesModuleRegistryArray(modules); +} + + public void sendPacket(@NotNull Packet packet) { + this.handlePacket(packet); +} + public void sendPacketNoEvent(@NotNull Packet packet) { + this.applyInt5(packet); +} + @NotNull + public String getDisplayName() { + return this.getTextValue2(); +} + public void setDisplayName(String displayName) { + this.applyUpdate2(displayName); +} + @NotNull + public String getSuffix() { + return this.getTextValue3(); +} + public void debug(Object... values) { + this.handleObjectArray(values); +} + public void sendMessage(@NotNull String message) { + this.applyUpdate3(message); +} + public void sendMessage(@NotNull String message, boolean prefix) { + this.applyString(message, prefix); +} + + @NotNull public String getRawDisplayName() { return this.getTextValue(); } + @Nullable public String getDescription() { return this.getTextValueField2(); } + @NotNull public String getFormattedDisplayName() { return this.getTextValue4(); } + public KeyBindProperty getKeyBindProperty() { return this.getKeyBindProperty2(); } + public void popNotification(String message, int duration, NotificationType type) { this.applyUpdate4(message, duration, type); } + public void popNotification(String title, String message, NotificationType type) { this.applyUpdate4(title, message, type); } + public void popNotification(String title, String message, int duration, NotificationType type) { this.applyUpdate5(title, message, duration, type); } + public void checkModule(@NotNull Class moduleClass) { this.applyInt5(moduleClass); } + @SafeVarargs public final void checkModule(@NotNull Class... moduleClasses) { this.handleClassArray(moduleClasses); } + + public cc.novoline.utils.Timer getMsTimer() { return this.getMsTimer2(); } +} diff --git a/src/main/java/cc/novoline/modules/EnumModuleType.java b/src/main/java/cc/novoline/modules/EnumModuleType.java new file mode 100644 index 0000000..f50a3e2 --- /dev/null +++ b/src/main/java/cc/novoline/modules/EnumModuleType.java @@ -0,0 +1,24 @@ +package cc.novoline.modules; + +public enum EnumModuleType { + COMBAT, + MOVEMENT, + PLAYER, + VISUALS, + EXPLOITS, + MISC; + + private static String b; + + static { + b("dto6Qc"); + } + + public static String b() { + return b; +} + + public static void b(String text) { + b = text; +} +} diff --git a/src/main/java/cc/novoline/modules/ModuleArrayMap.java b/src/main/java/cc/novoline/modules/ModuleArrayMap.java new file mode 100644 index 0000000..464bb45 --- /dev/null +++ b/src/main/java/cc/novoline/modules/ModuleArrayMap.java @@ -0,0 +1,148 @@ +package cc.novoline.modules; + +import cc.novoline.modules.exceptions.UnregisteredModuleException; + +import cc.novoline.modules.configurations.holder.ModuleHolder; +import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap; +import it.unimi.dsi.fastutil.objects.Object2ObjectMap; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import it.unimi.dsi.fastutil.objects.ObjectCollection; +import java.util.List; +import java.util.Optional; +import java.util.Map.Entry; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.function.Supplier; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public final class ModuleArrayMap extends Object2ObjectArrayMap> { + private static boolean invokeCallback(Class param, java.util.Map.Entry entry) { + ModuleHolder modHolder = (ModuleHolder)entry.getValue(); + return modHolder.getModule().getClass() == param; +} + + public Module getByName(@Nullable String name) { + return this.getByName(name, true); +} + + private static UnregisteredModuleException mapClass(Class param) { + StringBuilder sb = new StringBuilder(); + sb = sb.append("Module "); + String textStr = param.getCanonicalName(); + sb = sb.append(textStr); + return new UnregisteredModuleException(sb.append(" is not registered!").toString()); +} + + public ModuleArrayMap() {} + + public Module getByClass(@NotNull Class param) { + Stream stream2 = (Stream)this.entrySet().stream(); + Predicate predicate = ((Predicate) ((entry) -> ModuleArrayMap.invokeCallback(param, entry))); + stream2 = stream2.filter(predicate); + Optional optional = stream2.findFirst(); + Function mapper = ((java.util.function.Function) (arg) -> (cc.novoline.modules.configurations.holder.ModuleHolder) arg.getValue()); + Optional optional2 = optional.map(mapper); + Function mapper2 = ((java.util.function.Function) ModuleHolder::getModule); + Optional optional3 = optional2.map(mapper2); + Supplier supplier = ((Supplier) (() -> ModuleArrayMap.mapClass2(param))); + return (Module)optional3.orElseThrow(supplier); +} + + private static boolean invokeCallback2(Class param, java.util.Map.Entry entry) { + ModuleHolder modHolder = (ModuleHolder)entry.getValue(); + return modHolder.getModule().getClass() == param; +} + + @NotNull + public ModuleHolder getHolderByClass(@NotNull Class param) { + Stream stream2 = (Stream)this.entrySet().stream(); + Predicate predicate = ((Predicate) ((entry) -> ModuleArrayMap.invokeCallback2(param, entry))); + stream2 = stream2.filter(predicate); + Optional optional = stream2.findFirst(); + Function mapper = ((java.util.function.Function) (arg) -> (cc.novoline.modules.configurations.holder.ModuleHolder) arg.getValue()); + Optional optional2 = optional.map(mapper); + Supplier supplier = ((Supplier) (() -> ModuleArrayMap.mapClass(param))); + return (ModuleHolder)optional2.orElseThrow(supplier); +} + + private static UnregisteredModuleException mapClass2(Class param) { + StringBuilder sb = new StringBuilder(); + sb = sb.append("Module "); + String textStr = param.getCanonicalName(); + sb = sb.append(textStr); + return new UnregisteredModuleException(sb.append(" is not registered!").toString()); +} + + + private static boolean invokeCallback3(String name, ModuleHolder moduleHolder) { + AbstractModule mod = moduleHolder.getModule(); + return mod.getName().equals(name); +} + + private static boolean invokeCallback4(EnumModuleType enumModuleType, ModuleHolder moduleHolder) { + AbstractModule mod = moduleHolder.getModule(); + return mod.getCategory().equals(enumModuleType); +} + + public ModuleArrayMap(int value) { + super(value); +} + + @NotNull + public List getByCategory(EnumModuleType enumModuleType) { + ObjectCollection objectCollection = this.values(); + Stream stream2 = objectCollection.stream(); + Predicate predicate = ((Predicate) ((moduleHolder) -> ModuleArrayMap.invokeCallback4(enumModuleType, moduleHolder))); + Stream stream3 = stream2.filter(predicate); + Function mapper = ((java.util.function.Function) ModuleHolder::getModule); + Stream stream4 = stream3.map(mapper); + Supplier supplier = ObjectArrayList::new; + Collector collector = Collectors.toCollection(supplier); + return (java.util.List) stream4.collect(collector); +} + + public ModuleArrayMap(Object2ObjectMap> object2ObjectMap) { + super(object2ObjectMap); +} + + public Module getByName(@Nullable String name, boolean flag) { + if (StringUtils.isBlank(name)) { + return null; + } + + Stream stream2; + label21: { + label20: { + ObjectCollection objectCollection = this.values(); + stream2 = objectCollection.stream(); + if (!flag) { + break label20; + } + + Predicate predicate = ((Predicate) ((moduleHolder) -> ModuleArrayMap.invokeCallback5(name, moduleHolder))); + stream2 = stream2.filter(predicate); + + break label21; + } + + Predicate predicate2 = ((Predicate) ((moduleHolder2) -> ModuleArrayMap.invokeCallback3(name, moduleHolder2))); + stream2 = stream2.filter(predicate2); + } + + Optional optional = stream2.findAny(); + Function mapper = ((java.util.function.Function) ModuleHolder::getModule); + optional = optional.map(mapper); + return (Module)optional.orElse(null); +} + + private static boolean invokeCallback5(String name, ModuleHolder moduleHolder) { + AbstractModule mod = moduleHolder.getModule(); + String nameStr = mod.getName(); + return nameStr.equalsIgnoreCase(name); +} +} diff --git a/src/main/java/cc/novoline/modules/ModuleFactory.java b/src/main/java/cc/novoline/modules/ModuleFactory.java new file mode 100644 index 0000000..8962e0d --- /dev/null +++ b/src/main/java/cc/novoline/modules/ModuleFactory.java @@ -0,0 +1,8 @@ +package cc.novoline.modules; + +import org.jetbrains.annotations.NotNull; + +public interface ModuleFactory { + @NotNull + Module resolveAbstractModule(@NotNull ModuleManager moduleManager); +} diff --git a/src/main/java/cc/novoline/modules/ModuleManager.java b/src/main/java/cc/novoline/modules/ModuleManager.java new file mode 100644 index 0000000..f66b29b --- /dev/null +++ b/src/main/java/cc/novoline/modules/ModuleManager.java @@ -0,0 +1,117 @@ +package cc.novoline.modules; +import cc.novoline.modules.configurations.holder.StoringModuleHolder; +import cc.novoline.modules.exceptions.UnregisteredModuleException; + +import cc.novoline.Novoline; +import cc.novoline.modules.binds.BindManager; +import cc.novoline.modules.configurations.ConfigManager; +import com.google.common.reflect.TypeToken; +import cc.novoline.modules.configurations.holder.ModuleHolder; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.function.Predicate; +import java.util.stream.Stream; + +import cc.novoline.modules.configurations.holder.SavingModuleHolderSupport; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public final class ModuleManager { + private final BindManager bindManager; + private final ModuleArrayMap modules; + private final Novoline novoline; + private final ConfigManager configManager; + + public boolean contains(@NotNull Class clazz) { + try { + this.modules.getByClass(clazz); + return true; + } + catch (UnregisteredModuleException hI) { + return false; + } +} + + private static boolean matchesModuleRegistry(ModuleRegistry moduleRegistry) { + Object Module2 = moduleRegistry.getModule(); + return ((AbstractModule)Module2).isEnabled(); +} + + @NotNull + public ModuleArrayMap getModules() { + return this.modules; +} + + @NotNull + public ConfigManager getConfigManager() { + return this.configManager; +} + + public void remove(AbstractModule abstractModule) { + Collection collection = this.modules.values(); + Predicate predicate = arg_0 -> ModuleManager.invokeCallback(abstractModule, arg_0); + collection.removeIf(predicate); +} + + @NotNull + public Module getByClass(Class clazz) { + return this.modules.getByClass(clazz); +} + + @NotNull + public BindManager getBindManager() { + return this.bindManager; +} + + + + public boolean checkModuleRegistryArray(ModuleRegistry ... moduleRegistryArray) { + Stream stream = Arrays.stream(moduleRegistryArray); + Predicate predicate = ModuleManager::matchesModuleRegistry; + return stream.anyMatch(predicate); +} + + public void register(@NotNull String string, @NotNull ModuleFactory moduleFactory, boolean bl) { + SavingModuleHolderSupport.applyUpdate(string, "name"); + StoringModuleHolder a7w2 = StoringModuleHolder.updateState(this, string, moduleFactory); + Object object = this; + + TypeToken typeToken = a7w2.getTypeToken(); + if (((ModuleManager)object).contains(typeToken.getRawType()) && bl) { + StringBuilder stringBuilder = new StringBuilder(); + StringBuilder stringBuilder2 = stringBuilder.append("module may not be registered twice as holder "); + String string2 = a7w2.getName(); + StringBuilder stringBuilder3 = stringBuilder2.append(string2); + throw new IllegalStateException(stringBuilder3.append(" exists").toString()); + } + object = this.modules.put(string, a7w2); + +} + + @NotNull + public Novoline getNovoline() { + return this.novoline; +} + + private static boolean invokeCallback(AbstractModule abstractModule, ModuleHolder moduleHolder) { + return moduleHolder.getModule() == abstractModule; +} + + @Nullable + public Module getByName(String string) { + return this.modules.getByName(string); +} + + @NotNull + public List getByCategory(EnumModuleType enumModuleType) { + return this.modules.getByCategory(enumModuleType); +} + + public ModuleManager(@NotNull Novoline novoline, int n) { + this.modules = new ModuleArrayMap(); + this.novoline = novoline; + this.configManager = new ConfigManager(this, n); + this.bindManager = new BindManager(this, n); +} +} diff --git a/src/main/java/cc/novoline/modules/ModuleRegistry.java b/src/main/java/cc/novoline/modules/ModuleRegistry.java new file mode 100644 index 0000000..55dd906 --- /dev/null +++ b/src/main/java/cc/novoline/modules/ModuleRegistry.java @@ -0,0 +1,217 @@ +package cc.novoline.modules; + +import cc.novoline.Novoline; +import cc.novoline.modules.combat.AimAssist; +import cc.novoline.modules.combat.AntiBot; +import cc.novoline.modules.combat.AutoClicker; +import cc.novoline.modules.combat.AutoGApple; +import cc.novoline.modules.combat.AutoHead; +import cc.novoline.modules.combat.AutoPot; +import cc.novoline.modules.combat.Criticals; +import cc.novoline.modules.combat.HitBox; +import cc.novoline.modules.combat.KillAura; +import cc.novoline.modules.combat.Reach; +import cc.novoline.modules.combat.TargetHUD; +import cc.novoline.modules.combat.Velocity; +import cc.novoline.modules.exploits.Blink; +import cc.novoline.modules.exploits.ClickTeleport; +import cc.novoline.modules.exploits.Disabler; +import cc.novoline.modules.exploits.Fireball; +import cc.novoline.modules.exploits.NoFall; +import cc.novoline.modules.exploits.Phase; +import cc.novoline.modules.misc.AntiAlts; +import cc.novoline.modules.misc.AutoHypixel; +import cc.novoline.modules.misc.AutoTool; +import cc.novoline.modules.misc.ChatFutures; +import cc.novoline.modules.misc.FastPlace; +import cc.novoline.modules.misc.LightningTracker; +import cc.novoline.modules.misc.MiddleClick; +import cc.novoline.modules.misc.Notifier; +import cc.novoline.modules.misc.Optimization; +import cc.novoline.modules.misc.StaffAnalyzer; +import cc.novoline.modules.misc.UhcCrafts; +import cc.novoline.modules.move.FastSneak; +import cc.novoline.modules.move.Fly; +import cc.novoline.modules.move.GuiMove; +import cc.novoline.modules.move.HClip; +import cc.novoline.modules.move.LongJump; +import cc.novoline.modules.move.NoJumpDelay; +import cc.novoline.modules.move.NoSlowDown; +import cc.novoline.modules.move.SafeWalk; +import cc.novoline.modules.move.Speed; +import cc.novoline.modules.move.Sprint; +import cc.novoline.modules.move.Step; +import cc.novoline.modules.move.TargetStrafe; +import cc.novoline.modules.move.WaterWalk; +import cc.novoline.modules.player.AntiObbyTrap; +import cc.novoline.modules.player.AntiVoid; +import cc.novoline.modules.player.AutoArmor; +import cc.novoline.modules.player.BedBreaker; +import cc.novoline.modules.player.ChestStealer; +import cc.novoline.modules.player.Freecam; +import cc.novoline.modules.player.GameSpeed; +import cc.novoline.modules.player.InvManager; +import cc.novoline.modules.player.NoRotate; +import cc.novoline.modules.player.Respawn; +import cc.novoline.modules.player.Scaffold; +import cc.novoline.modules.player.SpeedMine; +import cc.novoline.modules.visual.Animations; +import cc.novoline.modules.visual.Arrows; +import cc.novoline.modules.visual.Atomsphere; +import cc.novoline.modules.visual.BlockOutline; +import cc.novoline.modules.visual.BreadCrumbs; +import cc.novoline.modules.visual.Brightness; +import cc.novoline.modules.visual.Camera; +import cc.novoline.modules.visual.Chams; +import cc.novoline.modules.visual.ChestESP; +import cc.novoline.modules.visual.ClickGui; +import cc.novoline.modules.visual.Crosshair; +import cc.novoline.modules.visual.CustomHitGlint; +import cc.novoline.modules.visual.DMGParticles; +import cc.novoline.modules.visual.Glint; +import cc.novoline.modules.visual.Glow; +import cc.novoline.modules.visual.HUD; +import cc.novoline.modules.visual.HypixelStats; +import cc.novoline.modules.visual.ItemESP; +import cc.novoline.modules.visual.ItemPhysic; +import cc.novoline.modules.visual.JumpCircle; +import cc.novoline.modules.visual.MoreBends; +import cc.novoline.modules.visual.Nametags; +import cc.novoline.modules.visual.NoEffects; +import cc.novoline.modules.visual.NoTitle; +import cc.novoline.modules.visual.PlayerESP; +import cc.novoline.modules.visual.Projectiles; +import cc.novoline.modules.visual.Radar; +import cc.novoline.modules.visual.Scoreboard; +import cc.novoline.modules.visual.SessionInfo; +import cc.novoline.modules.visual.SimsESP; +import cc.novoline.modules.visual.TabGui; +import cc.novoline.modules.visual.Tracers; +import cc.novoline.modules.visual.Trail; +import cc.novoline.modules.visual.Waypoints; +import cc.novoline.modules.visual.Wings; +import cc.novoline.modules.visual.XRay; +import org.jetbrains.annotations.NotNull; + +public enum ModuleRegistry { + HUD(HUD.class), + SPRINT(Sprint.class), + CLICKGUI(ClickGui.class), + SESSION(SessionInfo.class), + RADAR(Radar.class), + SCOREBOARD(Scoreboard.class), + ANTIBOT(AntiBot.class), + SPEEDMINE(SpeedMine.class), + AUTOPOT(AutoPot.class), + KILLAURA(KillAura.class), + CRITICALS(Criticals.class), + REACH(Reach.class), + STEP(Step.class), + WATERWALK(WaterWalk.class), + NOSLOWDOWN(NoSlowDown.class), + SPEED(Speed.class), + VELOCITY(Velocity.class), + GLOW(Glow.class), + CHAMS(Chams.class), + CHESTESP(ChestESP.class), + NAMETAGS(Nametags.class), + NOFALL(NoFall.class), + XRAY(XRay.class), + CHESTSTEALER(ChestStealer.class), + SCAFFOLD(Scaffold.class), + AUTOARMOR(AutoArmor.class), + INVMANAGER(InvManager.class), + AUTOHYPIXEL(AutoHypixel.class), + GUIMOVE(GuiMove.class), + PHASE(Phase.class), + AUTOTOOL(AutoTool.class), + ANIMATIONS(Animations.class), + GLINTCOLORIZE(Glint.class), + MIDDLECLICK(MiddleClick.class), + DMGPARTICLES(DMGParticles.class), + TRACERS(Tracers.class), + RESPAWN(Respawn.class), + BLINK(Blink.class), + NOEFFECTS(NoEffects.class), + BRIGHTNESS(Brightness.class), + ITEMPHYSIC(ItemPhysic.class), + ITEMESP(ItemESP.class), + AUTOCLICKER(AutoClicker.class), + AIMASSIST(AimAssist.class), + FASTPLACE(FastPlace.class), + PLAYERSFINDER(Notifier.class), + ATMOSPHERE(Atomsphere.class), + PLAYERESP(PlayerESP.class), + HITBOX(HitBox.class), + WAYPOINTS(Waypoints.class), + ANTIOBBYTRAP(AntiObbyTrap.class), + FREECAM(Freecam.class), + TABGUI(TabGui.class), + LIGHTNINGTRECKER(LightningTracker.class), + CAMERA(Camera.class), + FASTSNEAK(FastSneak.class), + ARROWS(Arrows.class), + BEDBREAKER(BedBreaker.class), + FLY(Fly.class), + ANTIVOID(AntiVoid.class), + LONGJUMP(LongJump.class), + ANTIALTS(AntiAlts.class), + BLOCKSOVERLAY(BlockOutline.class), + GAMESPEED(GameSpeed.class), + NOROTATE(NoRotate.class), + NOTITLE(NoTitle.class), + CLICKTELEPORT(ClickTeleport.class), + JUMPCIRCLE(JumpCircle.class), + CUSTOMHITGLINT(CustomHitGlint.class), + STAFFANALYZER(StaffAnalyzer.class), + TRAIN(Trail.class), + DISABLER(Disabler.class), + AUTOHEAD(AutoHead.class), + WINGS(Wings.class), + MOBENDS(MoreBends.class), + OPTIMIZATIONS(Optimization.class), + PROJECTILES(Projectiles.class), + SIMSESP(SimsESP.class), + BREADCRUMBS(BreadCrumbs.class), + HCLIP(HClip.class), + CHATFUTURES(ChatFutures.class), + TARGETSTRAFE(TargetStrafe.class), + TARGETHUD(TargetHUD.class), + NOJUMPDELAY(NoJumpDelay.class), + SAFEWALK(SafeWalk.class), + AUTOGAPPLE(AutoGApple.class), + HYPIXELSTATS(HypixelStats.class), + CROSSHAIR(Crosshair.class), + UHCCRAFTS(UhcCrafts.class), + FIREBALL(Fireball.class); + + private static String[] c; + + static { + b(null); + } + private final AbstractModule abstractModuleField; + + ModuleRegistry(Class param) { + Novoline novolineInst = Novoline.getInstance(); + ModuleManager modManager = novolineInst.getModuleManager(); + this.abstractModuleField = modManager.getByClass(param); +} + + public static String[] b() { + return c; +} + + public static void b(String[] args) { + c = args; +} + + @NotNull + public Module obtainAbstractModule() { + return (Module)this.abstractModuleField; +} + + public Module getModule() { + return this.obtainAbstractModule(); +} +} diff --git a/src/main/java/cc/novoline/modules/PlayerManager.java b/src/main/java/cc/novoline/modules/PlayerManager.java new file mode 100644 index 0000000..d390d6d --- /dev/null +++ b/src/main/java/cc/novoline/modules/PlayerManager.java @@ -0,0 +1,255 @@ +package cc.novoline.modules; + +import cc.novoline.Novoline; +import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.function.Supplier; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import ninja.leaping.configurate.util.PlayerManagerConfigisnotlHelper; + +import ninja.leaping.configurate.ConfigurationNode; +import ninja.leaping.configurate.hocon.HoconConfigurationLoader; +import cc.novoline.modules.configurations.holder.SavingModuleHolderSupport; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public final class PlayerManager { + private final PlayerManagerConfigisnotlHelper playerManagerConfigisnotlHelperField; + private final Map entryMap; + private final Logger log = LogManager.getLogger(); + + private void updateHelper() { + PlayerRelationType[] playerRelationTypeArr = PlayerRelationType.values(); + ConfigurationNode configurationNode = this.playerManagerConfigisnotlHelperField.e(); + Map itemMap = configurationNode.k(); + Set itemSet = itemMap.entrySet(); + Object2ObjectArrayMap object2ObjectArrayMap = new Object2ObjectArrayMap(); + Iterator iter = itemSet.iterator(); + + while (true) { + if (iter.hasNext()) { + Entry entry = (Entry)iter.next(); + String textStr = entry.getKey().toString(); + Locale locale = Locale.ROOT; + String lowerStr = textStr.toLowerCase(locale); + configurationNode = (ConfigurationNode)entry.getValue(); + PlayerRelationType playerRelationType = playerRelationTypeArr[configurationNode.r()]; + object2ObjectArrayMap.put(lowerStr, playerRelationType); + + continue; + } + + Map itemMap2 = this.entryMap; + itemMap2.putAll(object2ObjectArrayMap); + break; + } +} + + public boolean checkString(String text, @NotNull PlayerRelationType playerRelationType) { + String textStr2 = text; + if (PlayerManagerSupport.checkCharSequence(text)) { + return false; + } + + Locale locale = Locale.ROOT; + textStr2 = text.toLowerCase(locale); + + String textStr = textStr2; + Map itemMap = this.entryMap; + return itemMap.get(textStr) == playerRelationType; +} + + @Nullable + public PlayerRelationType resolvePlayerRelationType(String text) { + String textStr2 = text; + if (PlayerManagerSupport.checkCharSequence(text)) { + return null; + } + + Locale locale = Locale.ROOT; + textStr2 = text.toLowerCase(locale); + + String textStr = textStr2; + Map itemMap = this.entryMap; + return (PlayerRelationType)itemMap.get(textStr); +} + + public boolean checkCondition(String text, @NotNull PlayerRelationType playerRelationType) { + int intVal; + String textStr2 = text; + if (PlayerManagerSupport.checkCharSequence(text)) { + return false; + } + + Locale locale = Locale.ROOT; + textStr2 = text.toLowerCase(locale); + + label33: { + label32: { + String textStr = textStr2; + Map itemMap = this.entryMap; + PlayerRelationType playerRelationType2 = (PlayerRelationType)itemMap.get(textStr); + Object obj = playerRelationType2; + PlayerRelationType playerRelationType3 = playerRelationType; + if (playerRelationType2 != playerRelationType) { + break label32; + } + + Map itemMap2 = this.entryMap; + obj = itemMap2.remove(textStr); + playerRelationType3 = playerRelationType2; + + if (obj == playerRelationType3) { + intVal = 1; + break label33; + } + } + + intVal = 0; + } + + byte byteVal = ((byte)(intVal)); + byte byteVal2 = byteVal; + if (byteVal != 0) { + this.updateHelper2(); + } + + byteVal2 = byteVal; + + return ((((byteVal2 & 1)) != 0)); +} + + public boolean evaluateCheck(String text) { + SavingModuleHolderSupport.applyUpdate(text, "name"); + Locale locale = Locale.ROOT; + String lowerStr = text.toLowerCase(locale); + Map itemMap = this.entryMap; + int intVal = itemMap.remove(lowerStr) != null ? 1 : 0; + int intVal2 = intVal; + if (intVal != 0) { + this.updateHelper2(); + } + + intVal2 = intVal; + + return ((((intVal2 & 1)) != 0)); +} + + public List evaluateCheck(@NotNull PlayerRelationType playerRelationType) { + Map itemMap = this.entryMap; + Set itemSet = itemMap.entrySet(); + Stream stream2 = itemSet.stream(); + Predicate predicate = ((java.util.function.Predicate) (entry) -> entry.getValue() == playerRelationType); + Stream stream3 = stream2.filter(predicate); + Function mapper = ((java.util.function.Function) (arg) -> (java.lang.String) arg.getKey()); + Stream stream4 = stream3.map(mapper); + Supplier supplier = ObjectArrayList::new; + Collector collector = Collectors.toCollection(supplier); + return (java.util.List) stream4.collect(collector); +} + + public boolean evaluateCondition(String text, @NotNull PlayerRelationType playerRelationType) { + SavingModuleHolderSupport.applyUpdate(text, "name"); + Locale locale = Locale.ROOT; + String lowerStr = text.toLowerCase(locale); + Map itemMap = this.entryMap; + PlayerRelationType playerRelationType2 = (PlayerRelationType)itemMap.get(lowerStr); + Object obj = playerRelationType2; + PlayerRelationType playerRelationType3 = playerRelationType; + if (playerRelationType2 == playerRelationType) { + return false; + } + + Map itemMap2 = this.entryMap; + obj = itemMap2.put(lowerStr, playerRelationType); + playerRelationType3 = playerRelationType2; + + int intVal2 = obj == playerRelationType3 ? 1 : 0; + int intVal3 = intVal2; + + if (intVal2 != 0) { + this.updateHelper2(); + } + + intVal3 = intVal2; + + + return ((((intVal3 & 1)) != 0)); +} + + public Logger getLog2() { + return this.log; +} + + public PlayerManagerConfigisnotlHelper obtainPlayerManagerConfigisnotlHelper() { + return this.playerManagerConfigisnotlHelperField; +} + + public boolean evaluateCondition(@NotNull PlayerRelationType playerRelationType, @NotNull Predicate> predicate) { + Map itemMap = this.entryMap; + Set itemSet = itemMap.entrySet(); + boolean flag = itemSet.removeIf(predicate); + boolean flag2 = flag; + if (flag) { + this.updateHelper2(); + } + + flag2 = flag; + + return flag2; +} + + public PlayerManager(@NotNull Novoline novoline, @NotNull String text) { + this.entryMap = new Object2ObjectArrayMap<>(); + this.playerManagerConfigisnotlHelperField = PlayerManagerConfigisnotlHelper.a(novoline.getDataFolder().resolve(text)); + this.playerManagerConfigisnotlHelperField.c(); + this.updateHelper(); +} + + private void updateHelper2() { + HoconConfigurationLoader hoconConfigurationLoader = this.playerManagerConfigisnotlHelperField.d(); + ConfigurationNode configurationNode = hoconConfigurationLoader.d(); + Map itemMap = this.entryMap; + Set itemSet = itemMap.entrySet(); + Iterator iter = itemSet.iterator(); + + while (true) { + if (iter.hasNext()) { + Entry entry = (Entry)iter.next(); + String textStr = (String)entry.getKey(); + PlayerRelationType playerRelationType = (PlayerRelationType)entry.getValue(); + Object[] objArr = new Object[]{textStr}; + ConfigurationNode configurationNode2 = configurationNode.a(objArr); + int intVal = playerRelationType.ordinal(); + Integer intVal2 = intVal; + configurationNode2.b(intVal2); + + continue; + } + + this.playerManagerConfigisnotlHelperField.a(configurationNode); + break; + } +} + + public boolean hasType(String name, @NotNull PlayerRelationType type) { return this.checkString(name, type); } + @Nullable public PlayerRelationType getType(String name) { return this.resolvePlayerRelationType(name); } + public boolean setType(String name, @NotNull PlayerRelationType type) { return this.evaluateCondition(name, type); } + public boolean removeType(String name, @NotNull PlayerRelationType type) { return this.checkCondition(name, type); } + public boolean removePlayer(String name) { return this.evaluateCheck(name); } + public List whoHas(@NotNull PlayerRelationType type) { return this.evaluateCheck(type); } + + public org.apache.logging.log4j.Logger getLog() { return this.getLog2(); } +} diff --git a/src/main/java/cc/novoline/modules/PlayerManagerSupport.java b/src/main/java/cc/novoline/modules/PlayerManagerSupport.java new file mode 100644 index 0000000..888c519 --- /dev/null +++ b/src/main/java/cc/novoline/modules/PlayerManagerSupport.java @@ -0,0 +1,288 @@ +package cc.novoline.modules; + + +import cc.novoline.gui.widget.Iterator6FunctionHelper; +import cc.novoline.modules.configurations.holder.SavingModuleHolderSupport; +import java.util.Collection; +import java.util.Iterator; +import java.util.Objects; + +public final class PlayerManagerSupport { + + + public static int resolveHelper(CharSequence charSequence, char ch) { + int intVal3 = (evaluateCheck(charSequence) ? 1 : 0); + + if (intVal3 != 0) { + return 0; + } + + intVal3 = 0; + + + int intVal = intVal3; + int intVal2 = 0; + + while (true) { + if (intVal2 < charSequence.length()) { + intVal3 = charSequence.charAt(intVal2); + + if (intVal3 == ch) { + intVal++; + } + + intVal2++; + continue; + } + + intVal3 = intVal; + break; + } + + return intVal3; +} + + public static String resolveHelper(String text, int value) { + String textStr = text; + if (text == null) { + return null; + } + + SavingModuleHolderSupport.applyUpdate(value, "maxWidth"); + textStr = text; + + int len = textStr.length(); + + if (len <= value) { + return text; + } + + len = value; + + + if (len == 0) { + return ""; + } + + return text.substring(0, value); +} + + public static boolean resolveHelper(Collection collection, Collection collectionIn) { + Collection collection2 = collection; + + if (collection == collectionIn) { + return true; + } + + collection2 = collection; + + + + if (collection2 == null) { + return false; + } + + collection2 = collectionIn; + + + + if (collection2 == null) { + return false; + } + + collection2 = collection; + + + int size2 = collection2.size(); + + if (size2 != collectionIn.size()) { + return false; + } + + size2 = (collectionIn.containsAll(collection) ? 1 : 0); + + + return size2 != 0; +} + + public static boolean checkCondition(Collection collection, Collection collectionIn) { + boolean flag; + Collection collection2 = collection; + + if (collection == collectionIn) { + return true; + } + + collection2 = collection; + + + + if (collection2 == null) { + return false; + } + + collection2 = collectionIn; + + + + if (collection2 == null) { + return false; + } + + collection2 = collection; + + + + int size2 = collection2.size(); + if (size2 != collectionIn.size()) { + return false; + } + + collection2 = collection; + + + Iterator iter = collection2.iterator(); + Iterator iter2 = collectionIn.iterator(); + + while (true) { + if (iter.hasNext()) { + Object obj = iter.next(); + Object obj2 = iter2.next(); + flag = Objects.equals(obj, obj2); + + if (!flag) { + return false; + } + + continue; + } + + flag = true; + break; + } + + return flag; +} + + private PlayerManagerSupport() { + throw new UnsupportedOperationException("This is a utility class and cannot be instantiated"); +} + + public static boolean checkCharSequence(CharSequence charSequence) { + boolean flag; + byte byteVal = (byte)(evaluateCheck(charSequence) ? 1 : 0); + + if (byteVal != 0) { + return true; + } + + byteVal = 0; + + + int intVal = byteVal; + + while (true) { + if (intVal < charSequence.length()) { + char ch = charSequence.charAt(intVal); + flag = Character.isWhitespace(ch); + + if (!flag) { + return false; + } + + intVal++; + continue; + } + + flag = true; + break; + } + + return flag; +} + + public static boolean evaluateCheck(CharSequence charSequence) { + CharSequence charSequence2 = charSequence; + + if (charSequence == null) { + return true; + } + + charSequence2 = charSequence; + + + int len = charSequence2.length(); + return len == 0; +} + + public static boolean evaluateCheck(String text) { + boolean flag; + String textStr = text; + + if (evaluateCheck((CharSequence)text)) { + return false; + } + + textStr = text; + + + char[] charArr = textStr.toCharArray(); + int len = charArr.length; + int intVal = 0; + + while (true) { + if (intVal < len) { + char ch = charArr[intVal]; + + flag = Character.isDigit(ch); + + if (!flag) { + return false; + } + + intVal++; + + + continue; + } + + flag = true; + break; + } + + return flag; +} + + public static boolean checkCharSequence2(CharSequence charSequence) { + boolean flag; + byte byteVal = (byte)(evaluateCheck(charSequence) ? 1 : 0); + + if (byteVal != 0) { + return false; + } + + byteVal = 0; + + + int intVal = byteVal; + + while (true) { + if (intVal < charSequence.length()) { + char ch = charSequence.charAt(intVal); + flag = Character.isWhitespace(ch); + + if (flag) { + return true; + } + + intVal++; + continue; + } + + flag = false; + break; + } + + return flag; +} +} diff --git a/src/main/java/cc/novoline/modules/PlayerRelationType.java b/src/main/java/cc/novoline/modules/PlayerRelationType.java new file mode 100644 index 0000000..7cb3322 --- /dev/null +++ b/src/main/java/cc/novoline/modules/PlayerRelationType.java @@ -0,0 +1,8 @@ +package cc.novoline.modules; + +public enum PlayerRelationType { + FRIEND, + TARGET; + + private static final PlayerRelationType[] playerRelationTypeArray = new PlayerRelationType[]{PlayerRelationType.FRIEND, PlayerRelationType.TARGET}; +} diff --git a/src/main/java/cc/novoline/modules/binds/BindManager.java b/src/main/java/cc/novoline/modules/binds/BindManager.java new file mode 100644 index 0000000..2c320ec --- /dev/null +++ b/src/main/java/cc/novoline/modules/binds/BindManager.java @@ -0,0 +1,272 @@ +package cc.novoline.modules.binds; +import cc.novoline.modules.configurations.holder.HcBindManagerHelper; +import cc.novoline.modules.configurations.holder.hcTypeToken; +import cc.novoline.utils.helper.KeybindConfigSerializer; +import cc.novoline.utils.notifications.NotificationManager; +import cc.novoline.utils.notifications.NotificationType; + +import cc.novoline.Novoline; +import cc.novoline.modules.AbstractModule; +import com.google.common.reflect.TypeToken; +import cc.novoline.modules.configurations.holder.ModuleHolder; +import it.unimi.dsi.fastutil.objects.ObjectIterator; +import it.unimi.dsi.fastutil.objects.ObjectSet; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.LinkOption; +import java.nio.file.Path; +import java.nio.file.attribute.FileAttribute; +import java.util.Collections; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; +import java.util.function.Function; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import cc.novoline.modules.ModuleArrayMap; +import cc.novoline.modules.ModuleManager; +import ninja.leaping.configurate.objectmapping.ObjectMappingException; + +import ninja.leaping.configurate.ConfigurationNode; +import ninja.leaping.configurate.ConfigurationOptions; +import ninja.leaping.configurate.objectmapping.serialize.TypeSerializerCollection; +import ninja.leaping.configurate.hocon.HoconConfigurationLoader; +import org.apache.logging.log4j.Logger; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public final class BindManager { + private final int stateTicks; + private static ConfigurationOptions configurationOptionsField; + private final ModuleManager moduleManagerField; + private Path configPath; + + public void performAction() { + ModuleArrayMap moduleArrayMap = this.moduleManagerField.getModules(); + Map itemMap = this.getMap(); + Set itemSet = itemMap.entrySet(); + Iterator iter = itemSet.iterator(); + + label41: + while (true) { + boolean hasNext2 = iter.hasNext(); + + while (hasNext2) { + Entry entry = (Entry)iter.next(); + String textStr = (String)entry.getKey(); + ModuleKeybind keybind = (ModuleKeybind)entry.getValue(); + ObjectIterator objectIterator = moduleArrayMap.entrySet().iterator(); + + while (true) { + if (!objectIterator.hasNext()) { + break; + } + + label33: { + Entry entry2 = (Entry)objectIterator.next(); + Object obj = (String)entry2.getKey(); + + hasNext2 = ((java.lang.String) obj).equalsIgnoreCase(textStr); + + if (!hasNext2) { + break label33; + } + + obj = entry2.getValue(); + + + ModuleHolder modHolder = (ModuleHolder)obj; + AbstractModule mod = modHolder.getModule(); + mod.handleModuleKeybind(keybind); + } + + } + + continue label41; + } + + return; + } +} + + @NotNull + private Map getMap() { + Path filePath = this.getPath2(); + LinkOption[] linkOptionArr = new LinkOption[0]; + if (!Files.notExists(filePath, linkOptionArr)) { + ConfigurationOptions configurationOptions = this.getConfigurationOptions(); + HoconConfigurationLoader hoconConfigurationLoader = HoconConfigurationLoader.getConfigManagerSupport().a(configurationOptions).a(filePath).getHoconConfigurationLoader(); + + ConfigurationNode configurationNode; + try { + configurationNode = hoconConfigurationLoader.a(configurationOptions); + } catch (IOException ex) { + Logger log = Novoline.getLogger(); + log.error("An I/O error occurred while reading binds", ex); + return Collections.emptyMap(); + } + + Map itemMap = Collections.emptyMap(); + + try { + HcBindManagerHelper hcBindManagerHelper = new HcBindManagerHelper(this); + itemMap = configurationNode.a(hcBindManagerHelper); + Map itemMap2 = itemMap; + + if (itemMap == null) { + return Collections.emptyMap(); + } + + itemMap2 = itemMap; + + + return itemMap2; + } catch (ObjectMappingException ex2) { + Logger log2 = Novoline.getLogger(); + log2.error("An I/O error occurred while deserializing binds", ex2); + return itemMap; + } + } + + Logger log3 = Novoline.getLogger(); + log3.error("Binds file doesn't exist"); + + return Collections.emptyMap(); +} + + private static ModuleKeybind mapEntry(Entry entry) { + ModuleHolder modHolder = (ModuleHolder)entry.getValue(); + AbstractModule mod = modHolder.getModule(); + return mod.getKeyBindProperty().get(); +} + + @NotNull + private ConfigurationOptions getConfigurationOptions() { + int keyCode = KeyboardKeybind.c(); + ConfigurationOptions configurationOptions = configurationOptionsField; + if (keyCode == 0) { + if (configurationOptionsField == null) { + ConfigurationOptions configurationOptions2 = ConfigurationOptions.d(); + TypeSerializerCollection typeSerializerCollection = configurationOptions2.e(); + TypeToken typeToken = TypeToken.of(ModuleKeybind.class); + KeybindConfigSerializer keybindConfigSerializer = new KeybindConfigSerializer(); + typeSerializerCollection.a(typeToken, keybindConfigSerializer); + configurationOptionsField = configurationOptions2; + return configurationOptions2; + } + + configurationOptions = configurationOptionsField; + } + + return configurationOptions; +} + + @Nullable + private Path getPath() { + Path filePath = this.getPath2(); + Path filePath2 = filePath; + + LinkOption[] linkOptionArr = new LinkOption[0]; + if (Files.notExists(filePath, linkOptionArr)) { + try { + FileAttribute[] fileAttributeArr = new FileAttribute[0]; + Files.createFile(filePath, fileAttributeArr); + } catch (IOException ex) { + Logger log = Novoline.getLogger(); + log.warn("An I/O error occurred while creating binds file!", ex); + return null; + } + } + + filePath2 = filePath; + + + return filePath2; +} + + @NotNull + public Path getPath2() { + Path filePath = this.configPath; + if (this.configPath == null) { + Novoline novolineInst = this.moduleManagerField.getNovoline(); + return this.configPath = novolineInst.getDataFolder().resolve("binds.novo"); + } + + filePath = this.configPath; + + return filePath; +} + + public BindManager(@NotNull ModuleManager moduleManager, int value) { + this.moduleManagerField = moduleManager; + this.stateTicks = value; +} + + + + public boolean isReadyState() { + byte byteVal = 0; + + try { + Path filePath = this.getPath(); + if (filePath == null) { + return false; + } + + ModuleManager modManager = this.moduleManagerField; + ModuleArrayMap moduleArrayMap = modManager.getModules(); + ObjectSet objectSet = moduleArrayMap.entrySet(); + Stream stream2 = objectSet.stream(); + Function mapper = ((java.util.function.Function) (arg) -> (java.lang.String) arg.getKey()); + Function function2 = ((java.util.function.Function) BindManager::mapEntry); + Collector collector = Collectors.toMap(mapper, function2); + Map itemMap = (java.util.Map) stream2.collect(collector); + ConfigurationOptions configurationOptions = this.getConfigurationOptions(); + HoconConfigurationLoader hoconConfigurationLoader = HoconConfigurationLoader.getConfigManagerSupport().a(configurationOptions).a(filePath).getHoconConfigurationLoader(); + + ConfigurationNode configurationNode; + try { + configurationNode = hoconConfigurationLoader.a(configurationOptions); + } catch (IOException ex) { + Logger log = Novoline.getLogger(); + log.warn("An I/O error occurred while reading binds file!", ex); + byteVal = 1; + throw ex; + } + + try { + hcTypeToken val = new hcTypeToken(this); + configurationNode.resolveConfigurationNode(val, itemMap); + } catch (ObjectMappingException ex2) { + Logger log2 = Novoline.getLogger(); + log2.warn("An I/O error occurred while serializing binds!", ex2); + byteVal = 1; + throw ex2; + } + + try { + hoconConfigurationLoader.a(configurationNode); + } catch (IOException ex3) { + Logger log3 = Novoline.getLogger(); + log3.warn("An I/O error occurred while creating binds file!", ex3); + byteVal = 1; + throw ex3; + } + + return true; + } catch (Throwable ex4) { + Novoline novolineInst = Novoline.getInstance(); + NotificationManager notifManager = novolineInst.getNotificationManager(); + notifManager.pop("Cannot save binds!", 5000, NotificationType.ERROR); + byte byteVal2 = byteVal; + if (byteVal == 0) { + Logger log4 = Novoline.getLogger(); + log4.warn("An unexpected error occurred while deleting config file!", ex4); + } + + return false; + } +} +} diff --git a/src/main/java/cc/novoline/modules/binds/KeyboardKeybind.java b/src/main/java/cc/novoline/modules/binds/KeyboardKeybind.java new file mode 100644 index 0000000..4e123e6 --- /dev/null +++ b/src/main/java/cc/novoline/modules/binds/KeyboardKeybind.java @@ -0,0 +1,90 @@ +package cc.novoline.modules.binds; + +import java.util.Objects; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class KeyboardKeybind implements ModuleKeybind { + private int stateTicks; + private static int b; + + @Override + public int hashCode() { + Object[] objArr = new Object[1]; + int ticks = this.stateTicks; + objArr[0] = ticks; + return Objects.hash(objArr); +} + + public static int c() { + int intVal = d(); + return intVal == 0 ? 111 : 0; +} + + @Override + public int getStateTicks() { + return this.stateTicks; +} + + @Override + public boolean equals(Object obj) { + Object obj3 = this; + if (this == obj) { + return true; + } + + obj3 = obj; + + if (obj3 != null) { + Object obj2 = this.getClass(); + if (obj2 != obj.getClass()) { + return false; + } + + obj2 = obj; + + KeyboardKeybind kbBind = (KeyboardKeybind)obj2; + int ticks = this.stateTicks; + return this.stateTicks == kbBind.stateTicks; + } else { + return false; + } +} + + static { + if (c() != 0) { + b(81); + } + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder().append("KeyboardKeybind{key="); + int ticks = this.stateTicks; + sb = sb.append(ticks); + return sb.append('}').toString(); +} + + public static int d() { + return b; +} + + public void setStateTicks(int value) { + this.stateTicks = value; +} + + public static void b(int value) { + b = value; +} + + private KeyboardKeybind(int keyCode) { + this.stateTicks = keyCode; +} + + public static @NonNull KeyboardKeybind resolveKeyboardKeybind(int value) { + return new KeyboardKeybind(value); +} + + public static @NonNull KeyboardKeybind of(int keyCode) { return resolveKeyboardKeybind(keyCode); } + @Override public int getKey() { return this.getStateTicks(); } + public void setKey(int keyCode) { this.setStateTicks(keyCode); } +} diff --git a/src/main/java/cc/novoline/modules/binds/ModuleKeybind.java b/src/main/java/cc/novoline/modules/binds/ModuleKeybind.java new file mode 100644 index 0000000..5c3c8ea --- /dev/null +++ b/src/main/java/cc/novoline/modules/binds/ModuleKeybind.java @@ -0,0 +1,7 @@ +package cc.novoline.modules.binds; + +public interface ModuleKeybind { + int getStateTicks(); + + default int getKey() { return this.getStateTicks(); } +} diff --git a/src/main/java/cc/novoline/modules/binds/ModuleKeybindImpl.java b/src/main/java/cc/novoline/modules/binds/ModuleKeybindImpl.java new file mode 100644 index 0000000..94312a3 --- /dev/null +++ b/src/main/java/cc/novoline/modules/binds/ModuleKeybindImpl.java @@ -0,0 +1,102 @@ +package cc.novoline.modules.binds; +import cc.novoline.modules.binds.KeyboardKeybind; +import cc.novoline.modules.binds.ModuleKeybind; +import java.util.Objects; +import org.checkerframework.checker.nullness.qual.NonNull; + +/** + * Hooked Client/Minecraft Class (net.yA) + * Role: ModuleKeybindSerializer — Configurate Keybind Serialization Hook + */ +public final class ModuleKeybindImpl implements ModuleKeybind { + private int stateTicks; + private long lastTimestamp; + + public long getLong() { + return this.lastTimestamp; +} + + public boolean isReadyState() { + long timeMs; + int intVal = (timeMs = System.currentTimeMillis() - (this.lastTimestamp + 200L)) == 0L ? 0 : (timeMs < 0L ? -1 : 1); + + if (intVal > 0) { + this.lastTimestamp = System.currentTimeMillis(); + return true; + } + + intVal = 0; + + + return ((intVal & 1) != 0); +} + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb = sb.append("MouseKeybind{key="); + int ticks = this.stateTicks; + sb = sb.append(ticks).append(", lastTime="); + long timeMs = this.lastTimestamp; + sb = sb.append(timeMs); + return sb.append('}').toString(); +} + + public void applyUpdate(long time) { + this.lastTimestamp = time; +} + + @Override + public boolean equals(Object obj) { + Object obj3 = this; + + if (this == obj) { + return true; + } + + obj3 = obj; + + + if (obj3 != null) { + Object obj2 = this.getClass(); + + if (obj2 != obj.getClass()) { + return false; + } + + obj2 = obj; + + + ModuleKeybindImpl moduleKeybindImpl = (ModuleKeybindImpl)obj2; + int ticks = this.stateTicks; + return this.stateTicks == moduleKeybindImpl.stateTicks; + } else { + return false; + } +} + + @Override + public int getStateTicks() { + return this.stateTicks; +} + + public static @NonNull ModuleKeybindImpl applyUpdate(int value) { + return new ModuleKeybindImpl(value); +} + + @Override + public int hashCode() { + Object[] objArr = new Object[1]; + int ticks = this.stateTicks; + objArr[0] = ticks; + return Objects.hash(objArr); +} + + private ModuleKeybindImpl(int keyCode) { + this.stateTicks = keyCode; +} + + public void setStateTicks(int value) { + this.stateTicks = value; +} +} diff --git a/src/main/java/cc/novoline/modules/combat/AimAssist.java b/src/main/java/cc/novoline/modules/combat/AimAssist.java new file mode 100644 index 0000000..8cca20a --- /dev/null +++ b/src/main/java/cc/novoline/modules/combat/AimAssist.java @@ -0,0 +1,302 @@ +package cc.novoline.modules.combat; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.TimerUtil; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.render.RotationAngleUtil; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.LongProperty; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.function.Predicate; +import java.util.function.Supplier; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import net.minecraft.item.ItemIronSword; +import net.minecraft.item.ItemIronAxe; +import cc.novoline.modules.ModuleManager; +import net.minecraft.util.MathHelper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.entity.Entity; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import org.lwjgl.input.Mouse; + +public final class AimAssist extends AbstractModule { + @Property("aim-delay") + private final LongProperty aimDelay; + private static Entity entityField; + @Property("ray-trace") + private final BooleanProperty rayTrace; + private static List entityList; + private static float floatValue; + @Property("reach") + private final DoubleProperty reach; + @Property("vertical-up") + private final DoubleProperty verticalUp; + private final Comparator comparatorField; + @Property("vertical-down") + private final DoubleProperty verticalDown; + private final TimerUtil timer; + @Property("height") + private final DoubleProperty height; + @Property("horizontal-left") + private final DoubleProperty horizontalLeft; + @Property("only-axe-sword") + private final BooleanProperty onlyAxeSword; + private static float Z; + private int stateTicks; + @Property("horizontal-right") + private final DoubleProperty horizontalRight; + @Property("click-aim") + private final BooleanProperty clickAim; + + private double mapObject(Object obj) { + Entity entity = (Entity)obj; + EntityPlayerSP player = this.mc.thePlayer; + return entity.getDistanceToEntity(player); +} + + @EventTarget + private void onMotionUpdate(MotionUpdateEvent event) { + if (event.getState().equals(State.PRE)) { + entityList = this.getListC(); + List itemList2 = entityList; + Comparator comparator = this.comparatorField; + itemList2.sort(comparator); + if (entityField instanceof EntityPlayer || entityField instanceof EntityMob || entityField instanceof EntityAnimal) { + entityField = null; + } + + if (this.mc.thePlayer.ticksExisted % 50 == 0) { + itemList2 = entityList; + if (itemList2.size() > 1) { + this.stateTicks++; + } + } + + BooleanProperty boolProp = this.clickAim; + Boolean propFlag = boolProp.get(); + if (propFlag) { + if (!Mouse.isButtonDown(0)) { + return; + } + } + + itemList2 = entityList; + if (!itemList2.isEmpty()) { + int ticks = this.stateTicks; + List itemList = entityList; + if (ticks >= itemList.size()) { + this.stateTicks = 0; + } + + itemList2 = entityList; + int ticks2 = this.stateTicks; + entityField = (Entity)itemList2.get(ticks2); + double[] doubleArr = buildDoubleArray(entityField); + TimerUtil timerUtil = this.timer; + Long delayMs = this.aimDelay.get(); + long longVal = delayMs; + if (timerUtil.delay(longVal)) { + double doubleVal = doubleArr[1]; + DoubleProperty doubleProp = this.height; + Double propDouble = doubleProp.get(); + floatValue = (float)(doubleVal + propDouble); + Z = (float)doubleArr[0]; + TimerUtil timerUtil2 = this.timer; + timerUtil2.reset(); + } + + BooleanProperty boolProp2 = this.onlyAxeSword; + Boolean propFlag2 = boolProp2.get(); + boolean flag = !propFlag2; + BooleanProperty boolProp3 = this.rayTrace; + Boolean propFlag3 = boolProp3.get(); + if (propFlag3) { + EntityPlayerSP player = this.mc.thePlayer; + Entity entity = entityField; + if (player.matchesCriteria(entity)) { + if (!flag) { + EntityPlayerSP player2 = this.mc.thePlayer; + ItemStack stack = player2.getItemStack2(); + if (!(stack.getItem() instanceof ItemIronSword)) { + EntityPlayerSP player3 = this.mc.thePlayer; + ItemStack stack2 = player3.getItemStack2(); + if (!(stack2.getItem() instanceof ItemIronAxe)) { + return; + } + } + } + + this.performStep(); + } + } else if (flag) { + this.performStep(); + } else { + EntityPlayerSP player4 = this.mc.thePlayer; + ItemStack stack3 = player4.getItemStack2(); + if (!(stack3.getItem() instanceof ItemIronSword)) { + EntityPlayerSP player5 = this.mc.thePlayer; + ItemStack stack4 = player5.getItemStack2(); + if (!(stack4.getItem() instanceof ItemIronAxe)) { + return; + } + } + + this.performStep(); + } + } + } +} + + + private void performStep() { + EntityPlayerSP player = this.mc.thePlayer; + if (player.rotationYaw < Z) { + double doubleVal4 = player.rotationYaw; + Double propDouble = this.horizontalRight.get(); + float floatVal = (float)(doubleVal4 + propDouble); + float floatVal5 = Z; + player.rotationYaw = MathHelper.clamp_float(floatVal, -9999.0F, floatVal5); + } else if (player.rotationYaw > Z) { + double doubleVal = player.rotationYaw; + DoubleProperty doubleProp = this.horizontalRight; + Double propDouble2 = doubleProp.get(); + float floatVal2 = (float)(doubleVal - propDouble2); + float floatVal6 = Z; + player.rotationYaw = MathHelper.clamp_float(floatVal2, floatVal6, 9999.0F); + } + + if (player.rotationPitch < floatValue) { + double doubleVal2 = player.rotationPitch; + DoubleProperty doubleProp2 = this.verticalDown; + Double propDouble3 = doubleProp2.get(); + float floatVal3 = (float)(doubleVal2 + propDouble3); + float floatVal7 = floatValue; + player.rotationPitch = MathHelper.clamp_float(floatVal3, -9999.0F, floatVal7); + } else if (player.rotationPitch > floatValue) { + double doubleVal3 = player.rotationPitch; + DoubleProperty doubleProp3 = this.verticalUp; + Double propDouble4 = doubleProp3.get(); + float floatVal4 = (float)(doubleVal3 - propDouble4); + float floatVal8 = floatValue; + player.rotationPitch = MathHelper.clamp_float(floatVal4, floatVal8, 99999.0F); + } +} + + + private List getListC() { + List itemList = this.mc.theWorld.getLoadedEntityList(); + Stream stream2 = itemList.stream(); + Predicate predicate = this::matchesEntity; + Stream stream3 = stream2.filter(predicate); + Comparator comparator = Comparator.comparingDouble(this::mapObject).reversed(); + Stream stream4 = stream3.sorted(comparator); + Supplier supplier = ObjectArrayList::new; + Collector collector = Collectors.toCollection(supplier); + return (java.util.List) stream4.collect(collector); +} + + + public static double[] buildDoubleArray(Entity entity) { + if (entity == null) { + return null; + } + + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + double posX2 = entity.posX - player.posX; + double posY2 = entity.posY; + posY2 += entity.getEyeHeight() * 0.9; + double posY3 = player.posY; + double doubleVal = posY2 - (posY3 + player.getEyeHeight()); + double posZ2 = entity.posZ - player.posZ; + return RotationAngleUtil.computeFloatArray2(posX2, posZ2, doubleVal); +} + + static { + entityList = new ObjectArrayList<>(0); + } + + + private boolean checkEntity(Entity entity) { + if (entity != this.mc.thePlayer) { + if (entity.isConditionMet16()) { + return true; + } + } + + return false; +} + + private boolean matchesEntity(Entity entity) { + double dist = this.mc.thePlayer.getDistanceToEntity(entity); + Double propDouble = this.reach.get(); + return dist <= propDouble && this.checkEntity(entity); +} + + public AimAssist(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.timer = new TimerUtil(); + this.comparatorField = Comparator.comparingDouble((Entity entity) -> buildDoubleArray(entity)[0]); + DoubleProperty doubleProp = DoubleProperty.of(3.0); + Double doubleVal = 1.0; + DoubleProperty doubleProp2 = doubleProp.minimum(doubleVal); + this.reach = doubleProp2.maximum(6.0); + this.aimDelay = LongProperty.of(0L).minimum(0L).maximum(1000L); + DoubleProperty doubleProp3 = DoubleProperty.of(3.5); + DoubleProperty doubleProp4 = doubleProp3.minimum((-8.0)); + this.height = doubleProp4.maximum(8.0); + DoubleProperty doubleProp5 = DoubleProperty.of(1.0); + DoubleProperty doubleProp6 = doubleProp5.minimum(0.0); + this.horizontalLeft = doubleProp6.maximum(5.0); + DoubleProperty doubleProp7 = DoubleProperty.of(1.0); + DoubleProperty doubleProp8 = doubleProp7.minimum(0.0); + this.horizontalRight = doubleProp8.maximum(5.0); + DoubleProperty doubleProp9 = DoubleProperty.of(1.0); + DoubleProperty doubleProp10 = doubleProp9.minimum(0.0); + this.verticalUp = doubleProp10.maximum(5.0); + DoubleProperty doubleProp11 = DoubleProperty.of(1.0); + DoubleProperty doubleProp12 = doubleProp11.minimum(0.0); + this.verticalDown = doubleProp12.maximum(5.0); + this.onlyAxeSword = BooleanProperty.of(false); + this.rayTrace = BooleanProperty.of(false); + this.clickAim = BooleanProperty.of(false); + Setting setting = new Setting("REACH", "Reach", SettingType.SLIDER, this, this.reach, 0.1); + SettingManager.register(setting); + setting = new Setting("AIM_DELAY", "Aim Delay", SettingType.SLIDER, this, this.aimDelay, 50.0); + SettingManager.register(setting); + setting = new Setting("HEIGHT", "Height", SettingType.SLIDER, this, this.height, 1.0); + SettingManager.register(setting); + setting = new Setting("H_LEFT", "Horizontal Left", SettingType.SLIDER, this, this.horizontalLeft, 0.1); + SettingManager.register(setting); + setting = new Setting("H_RIGHT", "Horizontal Right", SettingType.SLIDER, this, this.horizontalRight, 0.1); + SettingManager.register(setting); + setting = new Setting("V_UP", "Vertical Up", SettingType.SLIDER, this, this.verticalUp, 0.1); + SettingManager.register(setting); + setting = new Setting("V_DOWN", "Vertical Down", SettingType.SLIDER, this, this.verticalDown, 0.1); + SettingManager.register(setting); + setting = new Setting("ONLY_AXESWORD", "Only Sword/Axe", SettingType.CHECKBOX, this, this.onlyAxeSword); + SettingManager.register(setting); + setting = new Setting("RAYTRACE", "Raytrace", SettingType.CHECKBOX, this, this.rayTrace); + SettingManager.register(setting); + setting = new Setting("CLICKAIM", "Click Aim", SettingType.CHECKBOX, this, this.clickAim); + SettingManager.register(setting); +} + +} diff --git a/src/main/java/cc/novoline/modules/combat/AntiBot.java b/src/main/java/cc/novoline/modules/combat/AntiBot.java new file mode 100644 index 0000000..2ee6125 --- /dev/null +++ b/src/main/java/cc/novoline/modules/combat/AntiBot.java @@ -0,0 +1,214 @@ +package cc.novoline.modules.combat; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.HypixelLobbyType; +import cc.novoline.utils.ListAction; +import cc.novoline.utils.ServerUtils; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.SpawnCheckEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.exploits.Blink; +import cc.novoline.modules.player.Freecam; +import com.mojang.authlib.GameProfile; +import cc.novoline.modules.ModuleRegistry; +import java.util.Iterator; +import java.util.List; +import java.util.UUID; +import java.util.function.Predicate; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.server.S18PacketEntityTeleport; +import net.minecraft.network.play.server.S0CPacketSpawnPlayer; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.GuiIngame; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.IChatComponent; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class AntiBot extends AbstractModule { + @Property("anti-staff") + private BooleanProperty antiStaff; + + @EventTarget + public void onPacket(PacketEvent event) { + if (ServerUtils.isHypixel()) { + if (ServerUtils.serverIs(HypixelLobbyType.LOBBY)) { + return; + } + } + + if (event.getState().equals(State.INCOMING)) { + if (event.getPacket() instanceof S18PacketEntityTeleport) { + S18PacketEntityTeleport entityTeleportPacket = (S18PacketEntityTeleport)event.getPacket(); + WorldClient world = this.mc.theWorld; + int intVal2 = entityTeleportPacket.computeInt3(); + EntityPlayer player = (EntityPlayer)world.getEntityByID(intVal2); + if (player instanceof EntityPlayer) { + if (player.isConditionMet23() && player.ticksExisted > 3) { + world = this.mc.theWorld; + List itemList = world.getPlayerEntities(); + if (itemList.contains(player) && !this.matchesEntityPlayer(player)) { + world = this.mc.theWorld; + world.removeEntityFromWorld(player); + } + } + } + } + + if (event.getPacket() instanceof S0CPacketSpawnPlayer) { + S0CPacketSpawnPlayer spawnPlayerPacket = (S0CPacketSpawnPlayer)event.getPacket(); + WorldClient world2 = this.mc.theWorld; + int intVal = spawnPlayerPacket.getEntityID(); + EntityPlayer player2 = (EntityPlayer)world2.getEntityByID(intVal); + double doubleVal = spawnPlayerPacket.computeInt() / 32.0; + double doubleVal2 = spawnPlayerPacket.computeInt3() / 32.0; + double doubleVal3 = spawnPlayerPacket.computeInt2() / 32.0; + double posX2 = this.mc.thePlayer.posX - doubleVal; + double posY2 = this.mc.thePlayer.posY - doubleVal2; + double posZ2 = this.mc.thePlayer.posZ - doubleVal3; + double doubleVal4 = posX2 * posX2 + posY2 * posY2 + posZ2 * posZ2; + double dist = Math.sqrt(doubleVal4); + world2 = this.mc.theWorld; + List itemList2 = world2.getPlayerEntities(); + if (itemList2.contains(player2) + && dist <= 17.0 + && !player2.equals(this.mc.thePlayer) + && doubleVal != this.mc.thePlayer.posX + && doubleVal2 != this.mc.thePlayer.posY + && doubleVal3 != this.mc.thePlayer.posZ) { + world2 = this.mc.theWorld; + world2.removeEntityFromWorld(player2); + } + } + } +} + + @Override + public void onEnable() { + this.handleString3(ServerUtils.isHypixel() ? "Hypixel" : "Packet"); +} + + private boolean matchesEntity(Entity entity) { + String displayName = entity.getDisplayName().getFormattedText(); + if (entity instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer)entity; + return player.intState17 < 150; + } + + if (!displayName.startsWith("\u00a7")) { + if (displayName.endsWith("\u00a7r")) { + return true; + } + } + + return displayName.contains("[NPC]"); +} + + private boolean matchesEntityPlayer(EntityPlayer player) { + List itemList = this.mc.ingameGUI.getTabList().obtainList(); + GameProfile gameProfile = player.getGameProfile(); + UUID uUID = gameProfile.getId(); + NetworkPlayerInfo networkPlayerInfo = NetHandlerPlayClient.applyS3BPacketScoreboardObjective(uUID); + return itemList.contains(networkPlayerInfo); +} + + + public AntiBot(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.antiStaff = BooleanProperty.of(true); + SettingManager.register(new Setting("AB_ANTI_STAFF", "Anti Staff", SettingType.CHECKBOX, this, this.antiStaff)); +} + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + this.handleString3(ServerUtils.isHypixel() ? "Hypixel" : "Packet"); + if (ServerUtils.isHypixel()) { + if (!ServerUtils.serverIs(HypixelLobbyType.LOBBY)) { + WorldClient world = this.mc.theWorld; + List itemList = world.getPlayerEntities(); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + EntityPlayer player = (EntityPlayer)iter.next(); + if (player != this.mc.thePlayer && player != null) { + IChatComponent chatComp = player.getDisplayName(); + String msgText = chatComp.getFormattedText(); + if (!this.matchesEntityPlayer(player)) { + String lowerStr = msgText.toLowerCase(); + String textStr = "[npc"; + if (!lowerStr.contains(textStr)) { + textStr = "\u00a7"; + if (msgText.startsWith(textStr)) { + if (player.isConditionMet16() && !this.matchesEntity((Entity)player)) { + if (player.isConditionMet23()) { + WorldClient world2 = this.mc.theWorld; + world2.removeEntityFromWorld(player); + } + } + } + } + } + } + } + } + } +} + + + @EventTarget + public void onSpawnCheck(SpawnCheckEvent event) { + Boolean propFlag = this.antiStaff.get(); + if (propFlag && event.getListAction() == ListAction.ADD && event.getTrackedEntity3() instanceof EntityPlayer && event.getTrackedEntity3() != this.mc.thePlayer) { + if (ServerUtils.getIntValue() > 40) { + HypixelLobbyType lobbyType = HypixelLobbyType.BW; + if (!ServerUtils.serverIs(lobbyType)) { + HypixelLobbyType lobbyType2 = HypixelLobbyType.UHC; + if (!ServerUtils.serverIs(lobbyType2)) { + EntityPlayerSP player = this.mc.thePlayer; + Entity entity = event.getTrackedEntity3(); + if (player.getDistanceToEntity(entity) < 16.0F && event.getTrackedEntity3().ticksExisted < 20) { + WorldClient world = this.mc.theWorld; + entity = event.getTrackedEntity3(); + world.removeEntityFromWorld(entity); + } + } + } + } + } +} + + + private List getList() { + ModuleRegistry modEntry = ModuleRegistry.BLINK; + Blink blink = modEntry.getModule(); + modEntry = ModuleRegistry.FREECAM; + Freecam freecam = modEntry.getModule(); + WorldClient world = this.mc.theWorld; + List itemList = world.getPlayerEntities(); + Stream stream2 = itemList.stream(); + Predicate predicate = ((java.util.function.Predicate) ((value0) -> !value0.equals(this.mc.thePlayer) && !value0.equals(blink.obtainAbstractModule()) && !value0.equals(freecam.obtainAbstractModule()))); + Stream stream3 = stream2.filter(predicate); + Collector collector = Collectors.toList(); + return (java.util.List) stream3.collect(collector); +} + +} diff --git a/src/main/java/cc/novoline/modules/combat/AutoClicker.java b/src/main/java/cc/novoline/modules/combat/AutoClicker.java new file mode 100644 index 0000000..6c12a7f --- /dev/null +++ b/src/main/java/cc/novoline/modules/combat/AutoClicker.java @@ -0,0 +1,127 @@ +package cc.novoline.modules.combat; + +import cc.novoline.events.events.ClickMouseEvent; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.TimerUtil; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import java.util.concurrent.ThreadLocalRandom; +import net.minecraft.item.ItemIronSword; +import net.minecraft.item.ItemIronAxe; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.settings.KeyBinding; +import cc.novoline.viaversion.MinecraftViaHelper; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.item.ItemStack; + +public final class AutoClicker extends AbstractModule { + private TimerUtil timer; + @Property("minimum-cps") + private IntProperty minimumCps; + @Property("only-swords-axe") + private BooleanProperty onlySwordsAxe; + private double cachedValue; + @Property("maximum-cps") + private IntProperty maximumCps; + + public IntProperty getMaximumCps() { + return this.maximumCps; +} + + public IntProperty getIntProperty() { + return this.getMaximumCps(); +} + + + public AutoClicker(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.timer = new TimerUtil(); + this.cachedValue = 0.0; + IntProperty intProp = IntProperty.of(8); + Integer intVal = 1; + IntProperty intProp2 = intProp.minimum(intVal); + this.minimumCps = intProp2.maximum(20); + IntProperty intProp3 = IntProperty.of(10); + IntProperty intProp4 = intProp3.minimum(1); + this.maximumCps = intProp4.maximum(20); + this.onlySwordsAxe = BooleanProperty.of(true); + Setting setting = new Setting("AC_MIN_CPS", "Min CPS", SettingType.SLIDER, this, this.minimumCps, 1.0); + SettingManager.register(setting); + setting = new Setting("AC_MAX_CPS", "Max CPS", SettingType.SLIDER, this, this.maximumCps, 1.0); + SettingManager.register(setting); + setting = new Setting("ONLY_SWORD_AXE", "Only Sword/Axe", SettingType.CHECKBOX, this, this.onlySwordsAxe); + SettingManager.register(setting); +} + + + public IntProperty getMinimumCps() { + return this.minimumCps; +} + + public IntProperty getIntPropertyB() { + return this.getMinimumCps(); +} + + + @EventTarget + public void handleClickMouseEvent(ClickMouseEvent event) { + boolean flag; + if (this.mc.gameSettings.keyBindAttack.isKeyDown()) { + label37: { + BooleanProperty boolProp = this.onlySwordsAxe; + Boolean propFlag = boolProp.get(); + label29: + if (propFlag) { + EntityPlayerSP player = this.mc.thePlayer; + if (player.getHeldItem() != null) { + EntityPlayerSP player2 = this.mc.thePlayer; + ItemStack stack = player2.getHeldItem(); + if (stack.getItem() instanceof ItemIronSword) { + break label29; + } + + EntityPlayerSP player3 = this.mc.thePlayer; + ItemStack stack2 = player3.getHeldItem(); + if (stack2.getItem() instanceof ItemIronAxe) { + break label29; + } + } + + flag = false; + break label37; + } + + flag = true; + } + + boolean flag2 = flag; + TimerUtil timerUtil = this.timer; + double doubleVal = this.cachedValue; + if (timerUtil.delay(doubleVal) && flag2) { + if (this.mc.objectMouseOver.entityHit != null) { + MinecraftViaHelper.executeEntityPlayer(this.mc.thePlayer, this.mc.objectMouseOver.entityHit); + } else { + EntityPlayerSP player4 = this.mc.thePlayer; + player4.swingItem(); + } + + ThreadLocalRandom threadLocalRandom = ThreadLocalRandom.current(); + Integer intVal = this.minimumCps.get(); + int intVal2 = intVal; + Integer intVal3 = this.maximumCps.get(); + int intVal4 = intVal3 + 1; + this.cachedValue = 1000L / threadLocalRandom.nextInt(intVal2, intVal4); + TimerUtil timerUtil2 = this.timer; + timerUtil2.reset(); + } + } +} + +} diff --git a/src/main/java/cc/novoline/modules/combat/AutoGApple.java b/src/main/java/cc/novoline/modules/combat/AutoGApple.java new file mode 100644 index 0000000..bb3ff39 --- /dev/null +++ b/src/main/java/cc/novoline/modules/combat/AutoGApple.java @@ -0,0 +1,104 @@ +package cc.novoline.modules.combat; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class AutoGApple extends AbstractModule { + @Property("health") + private DoubleProperty health; + private boolean stateFlag; + private int stateTicks; + @Property("force-absorption") + private BooleanProperty forceAbsorption; + + private int computeIntValue() { + return this.mc.thePlayer.findHotbarItemSlot(Items.golden_apple); +} + + private Boolean lambdaImpl$new$0() { + Boolean propFlag = this.forceAbsorption.get(); + return !propFlag; +} + + + public AutoGApple(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.forceAbsorption = BooleanProperty.of(false); + DoubleProperty doubleProp = DoubleProperty.of(14.0); + Double doubleVal = 0.5; + DoubleProperty doubleProp2 = doubleProp.minimum(doubleVal); + this.health = doubleProp2.maximum(20.0); + Setting setting = new Setting("AG_HEALTH", "Health", SettingType.SLIDER, this, this.health, 0.5, this::lambdaImpl$new$0); + SettingManager.register(setting); + setting = new Setting("AG_FORCE_ABSORPTION", "Force Absorption", SettingType.CHECKBOX, this, this.forceAbsorption); + SettingManager.register(setting); +} + + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + if (event.getState() == State.PRE) { + boolean flag; + boolean flag2; + label45: { + double doubleVal = this.mc.thePlayer.getHealth(); + Double propDouble = this.health.get(); + flag = doubleVal < propDouble; + BooleanProperty boolProp = this.forceAbsorption; + Boolean propFlag = boolProp.get(); + if (propFlag) { + EntityPlayerSP player = this.mc.thePlayer; + if (player.getFloat7() <= 0.0F) { + flag2 = true; + break label45; + } + } + + flag2 = false; + } + + boolean flag3 = flag2; + boolean flag4 = this.computeIntValue() != -1; + if (flag4 && (flag || flag3)) { + EntityPlayerSP player2 = this.mc.thePlayer; + if (player2.getHeldItem() != null) { + EntityPlayerSP player3 = this.mc.thePlayer; + ItemStack stack = player3.getHeldItem(); + if (stack.getItem() == Items.golden_apple) { + KeyBinding keyBinding = this.mc.gameSettings.keyBindUseItem; + boolean flag5 = this.stateFlag = true; + keyBinding.setPressed(flag5); + return; + } + } + + this.mc.thePlayer.inventory.currentItem = this.computeIntValue(); + } else if (this.stateFlag) { + KeyBinding keyBinding2 = this.mc.gameSettings.keyBindUseItem; + keyBinding2.setPressed(false); + this.mc.thePlayer.inventory.currentItem = this.stateTicks; + this.stateFlag = false; + } else { + this.stateTicks = this.mc.thePlayer.inventory.currentItem; + } + } +} + + +} diff --git a/src/main/java/cc/novoline/modules/combat/AutoHead.java b/src/main/java/cc/novoline/modules/combat/AutoHead.java new file mode 100644 index 0000000..088b78b --- /dev/null +++ b/src/main/java/cc/novoline/modules/combat/AutoHead.java @@ -0,0 +1,177 @@ +package cc.novoline.modules.combat; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.HypixelLobbyType; +import cc.novoline.utils.ServerUtils; +import cc.novoline.utils.TimerUtil; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.player.ChestStealer; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemSkull; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; + +public class AutoHead extends AbstractModule { + @Property("health") + private final DoubleProperty health; + @Property("force-absorption") + private final BooleanProperty forceAbsorption; + private TimerUtil timer; + @Property("check-regen") + private final BooleanProperty checkRegen; + + private boolean checkInt(int value) { + String textStr = ChestStealer.getFlowMarker(); + int intVal = value; + if (value == -1) { + return false; + } + + BooleanProperty boolProp = this.forceAbsorption; + Boolean propFlag = boolProp.get(); + intVal = (propFlag ? 1 : 0); + + if (intVal != 0) { + EntityPlayerSP player = this.mc.thePlayer; + if (player.getFloat7() <= 0.0F) { + return true; + } + + return false; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + double doubleVal = player2.getHealth(); + Double propDouble = this.health.get(); + if (doubleVal >= propDouble) { + return false; + } + + BooleanProperty boolProp2 = this.checkRegen; + Boolean propFlag2 = boolProp2.get(); + intVal = (propFlag2 ? 1 : 0); + + if (intVal == 0) { + return true; + } + + EntityPlayerSP player3 = this.mc.thePlayer; + Potion potion = Potion.regeneration; + boolean flag = player3.isPotionActive(potion); + return textStr != null ? flag : !flag; +} + + + private Boolean lambdaImpl$new$0() { + Boolean propFlag = this.forceAbsorption.get(); + boolean flag = propFlag; + flag = !flag; + + return flag; +} + + + public int computeIntValue() { + return this.mc.thePlayer.findHotbarItemSlot(Items.skull); +} + + @EventTarget + public void onPacket(PacketEvent event) { + cc.novoline.modules.combat.AutoHead autoHead; + PacketEvent packetEvent = event; + if (event.getState() != State.OUTGOING) { + return; + } + + packetEvent = event; + + boolean flag = packetEvent.getPacket() instanceof C03PacketPlayer; + if (!flag) { + return; + } + + HypixelLobbyType lobbyType = HypixelLobbyType.LOBBY; + flag = ServerUtils.serverIs(lobbyType); + + if (flag) { + return; + } + + HypixelLobbyType lobbyType2 = HypixelLobbyType.PRE; + flag = ServerUtils.serverIs(lobbyType2); + + if (flag) { + return; + } + + autoHead = this; + + flag = this.checkInt(this.computeIntValue()); + + if (!flag) { + return; + } + + autoHead = this; + + InventoryPlayer inventory2 = autoHead.mc.thePlayer.inventory; + int intVal = this.computeIntValue(); + ItemStack stack = inventory2.getStackInSlot(intVal); + ItemStack stack2 = stack; + if (stack == null) { + return; + } + + stack2 = stack; + + if (stack2.getItem() instanceof ItemSkull) { + this.sendPacket(new C09PacketHeldItemChange(this.computeIntValue())); + this.sendPacket(new C08PacketPlayerBlockPlacement(stack)); + this.sendPacket(new C09PacketHeldItemChange(this.mc.thePlayer.inventory.currentItem)); + } +} + + public AutoHead(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.timer = new TimerUtil(); + DoubleProperty doubleProp = DoubleProperty.of(14.0); + Double doubleVal = 1.0; + DoubleProperty doubleProp2 = doubleProp.minimum(doubleVal); + this.health = doubleProp2.maximum(20.0); + this.forceAbsorption = BooleanProperty.of(false); + this.checkRegen = BooleanProperty.of(false); + Setting setting = new Setting("AH_FORCE_ABS", "Force absorption", SettingType.CHECKBOX, this, this.forceAbsorption); + SettingManager.register(setting); + setting = new Setting("AH_CHECK_REGEN", "Check Regen", SettingType.CHECKBOX, this, this.checkRegen, this::lambdaImpl$new$0); + SettingManager.register(setting); + setting = new Setting("AH_HEALTH", "Health", SettingType.SLIDER, this, this.health, 1.0, this::supplyBoolean2); + SettingManager.register(setting); +} + + private Boolean supplyBoolean2() { + Boolean propFlag = this.forceAbsorption.get(); + boolean flag = propFlag; + flag = !flag; + + return flag; +} + + +} diff --git a/src/main/java/cc/novoline/modules/combat/AutoPot.java b/src/main/java/cc/novoline/modules/combat/AutoPot.java new file mode 100644 index 0000000..83090f1 --- /dev/null +++ b/src/main/java/cc/novoline/modules/combat/AutoPot.java @@ -0,0 +1,324 @@ +package cc.novoline.modules.combat; + +import cc.novoline.events.events.DisconnectEvent; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.TimerUtil; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.LoadWorldEvent; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.server.S30PacketWindowItems; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemPotion; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.server.S2FPacketSetSlot; +import net.minecraft.potion.PotionEffect; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class AutoPot extends AbstractModule { + private boolean stateFlag; + @Property("delay") + private final IntProperty delay; + @Property("potions") + private final ListProperty potions; + private TimerUtil timer; + @Property("over-pot") + private final BooleanProperty overPot; + @Property("health") + private final DoubleProperty health; + + private Boolean lambdaImpl$new$0() { + boolean flag; + label12: { + if (!this.potions.contains("Regen")) { + ListProperty listProp = this.potions; + if (!listProp.contains("Heal")) { + flag = false; + break label12; + } + } + + flag = true; + } + + return flag; +} + + @EventTarget(0) + public void onMotionUpdate(MotionUpdateEvent event) { + int[] intArr = this.computeArray(); + + for (int intVal : intArr) { + if (intVal != -1 && this.checkInt2(intVal)) { + TimerUtil timerUtil = this.timer; + Integer intVal2 = this.delay.get(); + long longVal = intVal2 - 10; + if (timerUtil.delay(longVal)) { + int intVal3 = this.calculateInt(intVal); + if (intVal3 != -1) { + if (event.getState() == State.PRE) { + event.setPitch(90.0F); + } else { + this.handleInt(intVal3); + this.applyInt(intVal3); + this.stateFlag = true; + timerUtil = this.timer; + timerUtil.reset(); + } + } + } + } + } +} + + private void applyInt(int value) { + ItemStack stack = this.mc.thePlayer.inventory.getStackInSlot(value); + if (stack != null) { + if (stack.stackSize == 1) { + this.mc.thePlayer.inventory.resolveItemStack2(value); + } else { + stack.stackSize--; + InventoryPlayer inventory2 = this.mc.thePlayer.inventory; + inventory2.setInventorySlotContents(value, stack); + } + } +} + + private int calculateInt(int value) { + int intVal = -1; + int intVal2 = -1; + ItemStack[] stackArr = this.mc.thePlayer.inventory.itemStackArray; + + for (int index = 0; index < stackArr.length; index++) { + ItemStack stack = stackArr[index]; + if (stack != null) { + if (stack.getItem() instanceof ItemPotion) { + if (ItemPotion.isSplash(stack.getMetadata())) { + ItemPotion potionItem = (ItemPotion)stack.getItem(); + List itemList = potionItem.getEffects(stack); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + PotionEffect potionEffect = (PotionEffect)iter.next(); + if (potionEffect.getPotionID() == value) { + if (intVal2 < potionEffect.getAmplifier()) { + intVal = index; + intVal2 = potionEffect.getAmplifier(); + } + } + } + } + } + } + } + + return intVal; +} + + private PotionEffect resolvePotionEffect(int value) { + PotionEffect potionEffect = null; + int intVal = -1; + + for (int index = 0; index < this.mc.thePlayer.inventory.itemStackArray.length; index++) { + ItemStack stack = this.mc.thePlayer.inventory.itemStackArray[index]; + if (stack != null) { + if (stack.getItem() instanceof ItemPotion) { + if (ItemPotion.isSplash(stack.getMetadata())) { + ItemPotion potionItem = (ItemPotion)stack.getItem(); + List itemList = potionItem.getEffects(stack); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + PotionEffect potionEffect2 = (PotionEffect)iter.next(); + if (potionEffect2.getPotionID() == value) { + if (intVal < potionEffect2.getAmplifier()) { + potionEffect = potionEffect2; + intVal = potionEffect2.getAmplifier(); + } + } + } + } + } + } + } + + return potionEffect; +} + + + @EventTarget + public void onPacket(PacketEvent event) { + if (event.getState() == cc.novoline.events.State.INCOMING) { + if (event.getPacket() instanceof S2FPacketSetSlot) { + if (this.stateFlag) { + S2FPacketSetSlot setSlotPacket = (S2FPacketSetSlot)event.getPacket(); + event.setCancelled(true); + if (setSlotPacket.getSlot() == this.mc.thePlayer.inventory.currentItem + 36) { + this.stateFlag = false; + } + } + } else { + if (event.getPacket() instanceof S30PacketWindowItems && this.stateFlag) { + event.setCancelled(true); + } + } + } +} + + + private boolean checkInt2(int value) { + EntityPlayerSP player = this.mc.thePlayer; + if (player.isPotionActive(value)) { + BooleanProperty boolProp = this.overPot; + Boolean propFlag = boolProp.get(); + if (propFlag) { + player = this.mc.thePlayer; + Map itemMap = player.getMap(); + Integer intVal2 = value; + if (itemMap.containsKey(intVal2)) { + player = this.mc.thePlayer; + PotionEffect potionEffect = player.resolvePotionEffect(value); + int intVal = potionEffect.getAmplifier(); + PotionEffect potionEffect2 = this.resolvePotionEffect(value); + if (intVal < potionEffect2.getAmplifier()) { + return true; + } + } + } + + return false; + } else { + return true; + } +} + + @EventTarget + public void handleDisconnectEvent(DisconnectEvent event) { + this.stateFlag = false; + this.timer.reset(); +} + + private void handleInt(int value) { + int intVal = value < 9 ? value + 36 : value; + EntityPlayerSP player = this.mc.thePlayer; + int slot = this.mc.thePlayer.inventory.currentItem; + player.swapHotbar(intVal, slot); + EntityPlayerSP player2 = this.mc.thePlayer; + this.sendPacketNoEvent(new C08PacketPlayerBlockPlacement(player2.getHeldItem())); + player = this.mc.thePlayer; + slot = this.mc.thePlayer.inventory.currentItem; + player.swapHotbar(intVal, slot); +} + + + public AutoPot(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.timer = new TimerUtil(); + DoubleProperty doubleProp = DoubleProperty.of(14.0); + Double doubleVal = 0.5; + DoubleProperty doubleProp2 = doubleProp.minimum(doubleVal); + this.health = doubleProp2.maximum(20.0); + this.delay = IntProperty.of(900).minimum(900).maximum(1500); + ListProperty listProp = ListProperty.of("Regen"); + String[] stringArr = new String[]{"Heal", "Regen", "Speed", "Fire"}; + this.potions = listProp.acceptableValues((Object[])stringArr); + this.overPot = BooleanProperty.of(false); + Setting setting = new Setting("AP_HEALTH", "Health", SettingType.SLIDER, this, this.health, 0.5, this::lambdaImpl$new$0); + SettingManager.register(setting); + setting = new Setting("AP_DELAY", "Throw Delay", SettingType.SLIDER, this, this.delay, 50.0, () -> !this.potions.isEmpty()); + SettingManager.register(setting); + setting = new Setting("AP_POTIONS", "Potions", SettingType.SELECTBOX, this, this.potions); + SettingManager.register(setting); + setting = new Setting("AP_OVER_POT", "Over Pot", SettingType.CHECKBOX, this, this.overPot); + SettingManager.register(setting); +} + + private int[] computeArray() { + byte byteVal; + int[] intArr; + label34: { + intArr = new int[4]; + ListProperty listProp = this.potions; + intArr[0] = listProp.contains("Speed") ? 1 : -1; + ListProperty listProp2 = this.potions; + if (listProp2.contains("Heal")) { + EntityPlayerSP player = this.mc.thePlayer; + double doubleVal = player.getHealth(); + DoubleProperty doubleProp = this.health; + Double propDouble = doubleProp.get(); + if (doubleVal <= propDouble) { + byteVal = 6; + break label34; + } + } + + byteVal = -1; + } + + label29: { + intArr[1] = byteVal; + ListProperty listProp3 = this.potions; + if (listProp3.contains("Regen")) { + EntityPlayerSP player2 = this.mc.thePlayer; + double doubleVal2 = player2.getHealth(); + DoubleProperty doubleProp2 = this.health; + Double propDouble2 = doubleProp2.get(); + if (doubleVal2 <= propDouble2) { + byteVal = 10; + break label29; + } + } + + byteVal = -1; + } + + label24: { + intArr[2] = byteVal; + ListProperty listProp4 = this.potions; + if (listProp4.contains("Fire")) { + EntityPlayerSP player3 = this.mc.thePlayer; + if (player3.isBurning()) { + byteVal = 12; + break label24; + } + } + + byteVal = -1; + } + + intArr[3] = byteVal; + return intArr; +} + + @EventTarget + public void onLoadWorld(LoadWorldEvent event) { + this.stateFlag = false; + this.timer.reset(); +} + +} diff --git a/src/main/java/cc/novoline/modules/combat/Criticals.java b/src/main/java/cc/novoline/modules/combat/Criticals.java new file mode 100644 index 0000000..d36344e --- /dev/null +++ b/src/main/java/cc/novoline/modules/combat/Criticals.java @@ -0,0 +1,292 @@ +package cc.novoline.modules.combat; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ServerUtils; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.LoadWorldEvent; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.MoveEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.SettingEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.exploits.Blink; +import cc.novoline.modules.move.Speed; +import cc.novoline.modules.player.Scaffold; +import cc.novoline.modules.ModuleRegistry; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.multiplayer.PlayerControllerMP; +import net.minecraft.network.play.client.C04PacketPlayerPosition; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.util.MathHelper; +import net.minecraft.network.play.client.C0APacketAnimation; +import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.network.play.client.C02PacketUseEntity$Action; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class Criticals extends AbstractModule { + @Property("fight-check") + private BooleanProperty fightCheck; + private boolean stateFlag; + @Property("mode") + private StringProperty mode; + private boolean stateFlag2; + @Property("spoof-tick") + private IntProperty spoofTick; + + + @EventTarget + public void onLoadWorld(LoadWorldEvent event) { + this.stateFlag = false; + this.stateFlag2 = false; +} + + @EventTarget + public void onPacket(PacketEvent event) { + if (event.getState().equals(State.OUTGOING)) { + StringProperty strProp = this.mode; + if (strProp.equals("Packet") && this.isReadyState()) { + if (event.getPacket() instanceof C0APacketAnimation && this.checkState()) { + double posX2 = this.mc.thePlayer.posX; + double posY2 = this.mc.thePlayer.posY; + double posZ2 = this.mc.thePlayer.posZ; + if (ServerUtils.isHypixel()) { + this.sendPacket(new C04PacketPlayerPosition(posX2, posY2 + MathHelper.randomDouble(5.0E-4, 7.0E-4), posZ2, false)); + this.sendPacket(new C04PacketPlayerPosition(posX2, posY2 + MathHelper.randomDouble(2.0E-4, 3.0E-4), posZ2, false)); + } else { + double doubleVal = MathHelper.randomDouble(0.004, 0.005); + this.sendPacket(new C04PacketPlayerPosition(posX2, posY2 + 0.0625 + doubleVal, posZ2, false)); + this.sendPacket(new C04PacketPlayerPosition(posX2, posY2 + 0.015625 + doubleVal, posZ2, false)); + } + } + } + + if (event.getPacket() instanceof C02PacketUseEntity) { + C02PacketUseEntity useEntityPacket = (C02PacketUseEntity)event.getPacket(); + if (useEntityPacket.getAction() == C02PacketUseEntity$Action.ATTACK) { + this.stateFlag = true; + } + } else { + if (event.getPacket() instanceof C03PacketPlayer) { + C03PacketPlayer playerPacket = (C03PacketPlayer)event.getPacket(); + strProp = this.mode; + if (strProp.equals("NoGround")) { + if (this.isEnabled(ModuleRegistry.SPEED, ModuleRegistry.LONGJUMP, ModuleRegistry.FLY, ModuleRegistry.SCAFFOLD)) { + this.stateFlag = false; + this.stateFlag2 = false; + return; + } + + if (!this.mc.thePlayer.onGround && this.mc.thePlayer.motionY < 0.0) { + EntityPlayerSP player = this.mc.thePlayer; + double motionY2 = -this.mc.thePlayer.motionY; + if (player.matchesDouble(motionY2)) { + playerPacket.setOnGround(true); + } + } + + if (!this.mc.thePlayer.onGround) { + this.stateFlag2 = true; + } else { + if (this.stateFlag2) { + int intVal = this.mc.thePlayer.intState8; + IntProperty intProp = this.spoofTick; + Integer intVal2 = intProp.get(); + if (intVal <= intVal2) { + BooleanProperty boolProp = this.fightCheck; + Boolean propFlag = boolProp.get(); + if (!propFlag || this.stateFlag) { + playerPacket.setOnGround(false); + return; + } + } + } + + this.stateFlag = false; + this.stateFlag2 = false; + } + } + } + } + } +} + + + public StringProperty getMode() { + return this.mode; +} + + public StringProperty getStringPropertyB() { + return this.getMode(); +} + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + if (event.getState() == cc.novoline.events.type.State.PRE) { + if (this.mode.equals("Edit") && this.isReadyState()) { + ModuleRegistry modEntry = ModuleRegistry.KILLAURA; + KillAura killAura = modEntry.getModule(); + EntityLivingBase living = (EntityLivingBase)killAura.getTrackedEntity(); + if (living.hurtTime == 9) { + double doubleVal = event.getY() + 0.03125; + double doubleVal2 = doubleVal + MathHelper.randomDouble(4.0E-4, 5.0E-4); + event.setY(doubleVal2); + event.setOnGround(false); + } else if (living.hurtTime == 8) { + double doubleVal3 = event.getY(); + double doubleVal4 = doubleVal3 + MathHelper.randomDouble(4.0E-4, 5.0E-4); + event.setY(doubleVal4); + event.setOnGround(false); + } + } + } +} + + public Criticals(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + StringProperty strProp = StringProperty.of("Edit"); + String[] stringArr = new String[]{"Edit", "Jump", "Packet", "NoGround"}; + this.mode = strProp.acceptableValues(stringArr); + this.spoofTick = IntProperty.of(30).minimum(5).maximum(30); + this.fightCheck = BooleanProperty.of(false); + Setting setting = new Setting("CRITICALS_MODE", "Mode", SettingType.COMBOBOX, this, this.mode); + SettingManager.register(setting); + setting = new Setting("CRITICALS_SPOOF_TICK", "Spoof Tick", SettingType.SLIDER, this, this.spoofTick, 1.0, () -> this.mode.equals("NoGround")); + SettingManager.register(setting); + setting = new Setting("CRITICALS_FIGHT_CHECK", "Fight Check", SettingType.CHECKBOX, this, this.fightCheck); + SettingManager.register(setting); +} + + public boolean isReadyState() { + ModuleRegistry modEntry = ModuleRegistry.BLINK; + Blink blink = modEntry.getModule(); + Speed speedMod = ModuleRegistry.SPEED.getModule(); + modEntry = ModuleRegistry.SCAFFOLD; + Scaffold scaffold = modEntry.getModule(); + modEntry = ModuleRegistry.KILLAURA; + KillAura killAura = modEntry.getModule(); + if (this.isEnabled()) { + if (killAura.isReadyState2()) { + Entity entity = killAura.getTrackedEntity(); + if (killAura.checkEntity2(entity)) { + PlayerControllerMP controller = this.mc.playerController; + if (!controller.evaluateCondition3() && this.mc.thePlayer.onGround) { + EntityPlayerSP player = this.mc.thePlayer; + if (!player.isConditionMet5() && this.mc.thePlayer.prevPosY - this.mc.thePlayer.posY == 0.0) { + EntityPlayerSP player2 = this.mc.thePlayer; + if (!player2.isConditionMet2()) { + EntityPlayerSP player3 = this.mc.thePlayer; + if (!player3.isInsideBlock()) { + EntityPlayerSP player4 = this.mc.thePlayer; + if (!player4.getMovementInput().isJump() && !blink.isEnabled()) { + if (speedMod.isEnabled()) { + EntityPlayerSP player5 = this.mc.thePlayer; + if (player5.isMoving()) { + return false; + } + } + + if (!ServerUtils.isHypixel() || !scaffold.isEnabled()) { + return true; + } + } + } + } + } + } + } + } + } + + return false; +} + + + @Override + public void onDisable() { + this.stateFlag = false; + this.stateFlag2 = false; +} + + + @Override + public void onEnable() { + this.handleString3(this.mode.get()); +} + + public void handleSettingEvent(SettingEvent event) { + if (event == null || event.getSettingName().equals("CRITICALS_MODE")) { + StringProperty strProp = this.mode; + String textStr = "Packet"; + if (!strProp.equals(textStr)) { + strProp = this.mode; + if (!strProp.equals("Edit")) { + return; + } + } + + textStr = this.getDisplayName(); + StringBuilder sb = new StringBuilder(); + sb = sb.append("Mode was set to NOGROUND due to unstable "); + StringProperty strProp2 = this.mode; + String propStr = strProp2.get(); + propStr = propStr.toUpperCase(); + sb = sb.append(propStr); + this.popNotification(textStr, sb.append(" bypass").toString(), 3500, NotificationType.WARNING); + strProp = this.mode; + strProp.set("NoGround"); + } +} + + @EventTarget + public void onMove(MoveEvent event) { + if (this.mode.equals("Jump") && this.isReadyState()) { + ModuleRegistry modEntry = ModuleRegistry.LONGJUMP; + if (modEntry.obtainAbstractModule().isEnabled()) { + return; + } + + ModuleRegistry modEntry2 = ModuleRegistry.SPEED; + if (modEntry2.obtainAbstractModule().isEnabled()) { + return; + } + + ModuleRegistry modEntry3 = ModuleRegistry.SCAFFOLD; + if (modEntry3.obtainAbstractModule().isEnabled()) { + return; + } + + ModuleRegistry modEntry4 = ModuleRegistry.FLY; + if (modEntry4.obtainAbstractModule().isEnabled()) { + return; + } + + event.setCachedValue32(this.mc.thePlayer.motionY = 0.419999986886978); + } +} + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + this.handleString3(this.mode.get()); +} + + private boolean checkState() { + KillAura killAura = ModuleRegistry.KILLAURA.getModule(); + Entity entity = killAura.getTrackedEntity(); + return entity.hurtResistantTime > 2 && entity.hurtResistantTime <= 4 || entity.hurtResistantTime >= 17; +} + +} diff --git a/src/main/java/cc/novoline/modules/combat/HitBox.java b/src/main/java/cc/novoline/modules/combat/HitBox.java new file mode 100644 index 0000000..c3c12bd --- /dev/null +++ b/src/main/java/cc/novoline/modules/combat/HitBox.java @@ -0,0 +1,33 @@ +package cc.novoline.modules.combat; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.FloatProperty; +import cc.novoline.modules.ModuleManager; + +public final class HitBox extends AbstractModule { + @Property("size") + private final FloatProperty size; + + + public HitBox(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.size = FloatProperty.of(0.3F).minimum(0.1F).maximum(1.0F); + SettingManager.register(new Setting("ENTITY_BOX", "Box Size", SettingType.SLIDER, this, this.size, 0.1F)); +} + + public FloatProperty getSize() { + return this.size; +} + + public FloatProperty getFloatProperty() { + return this.getSize(); +} + + +} diff --git a/src/main/java/cc/novoline/modules/combat/KillAura.java b/src/main/java/cc/novoline/modules/combat/KillAura.java new file mode 100644 index 0000000..8536d10 --- /dev/null +++ b/src/main/java/cc/novoline/modules/combat/KillAura.java @@ -0,0 +1,2020 @@ +package cc.novoline.modules.combat; +import cc.novoline.events.events.ClickMouseEvent; +import cc.novoline.events.events.SlowdownEvent; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.modules.PlayerRelationType; +import cc.novoline.modules.configurations.util.RotationVector; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.HypixelLobbyType; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.ServerUtils; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.render.ColorPaletteUtil; +import cc.novoline.utils.render.RotationAngleUtil; + +import cc.novoline.Novoline; +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.LoadWorldEvent; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.Render3DEvent; +import cc.novoline.events.events.SettingEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.exploits.Blink; +import cc.novoline.modules.move.Sprint; +import cc.novoline.modules.move.TargetStrafe; +import cc.novoline.modules.ModuleRegistry; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import it.unimi.dsi.fastutil.objects.ObjectListIterator; +import java.awt.Color; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ThreadLocalRandom; +import java.util.function.Consumer; +import java.util.function.Predicate; +import java.util.function.Supplier; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import net.minecraft.entity.EntityCreatureSupport; +import net.minecraft.item.ItemIronSword; +import cc.novoline.viaversion.ViaSupportUtil; +import cc.novoline.modules.ModuleManager; +import cc.novoline.modules.player.ChestStealerSupport; +import net.minecraft.network.play.server.S45PacketTitle; + +import net.minecraft.util.MathHelper; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.network.play.client.C0APacketAnimation; + +import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.IAttribute; +import net.minecraft.entity.ai.attributes.IAttributeInstance; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.monster.EntitySlime; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemBow; +import net.minecraft.item.ItemStack; +import net.minecraft.network.Packet; +import net.minecraft.network.play.client.C02PacketUseEntity$Action; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.DamageSource; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class KillAura extends AbstractModule { + @Property("prediction") + private BooleanProperty prediction; + private float cachedAngle; + @Property("min-aps") + private IntProperty minAps; + @Property("no-swing") + private BooleanProperty noSwing; + private List entityList; + @Property("attack-event") + private StringProperty attackEvent; + @Property("server-lag-check") + private BooleanProperty serverLagCheck; + @Property("switch-delay") + private IntProperty switchDelay; + private float cachedAngle2; + private RotationVector rotationVectorField; + private float floatValue; + @Property("enchant-particles") + private BooleanProperty enchantParticles; + @Property("show-autoblock-settings") + private BooleanProperty showAutoblockSettings; + @Property("ray-trace") + private BooleanProperty rayTrace; + private TimerUtil timer; + @Property("ticks-existed") + private IntProperty ticksExisted; + private int stateTicks; + @Property("esp-color") + private ColorProperty espColor; + @Property("show-target-settings") + private BooleanProperty showTargetSettings; + @Property("target-esp") + private BooleanProperty targetEsp; + @Property("range") + private DoubleProperty range; + private List packetList; + @Property("mode") + private StringProperty mode; + @Property("auto-block-mode") + private StringProperty autoBlockMode; + @Property("show-render-settings") + private BooleanProperty showRenderSettings; + @Property("wall-range") + private DoubleProperty wallRange; + private long lastTimestamp; + @Property("limit-angle") + private BooleanProperty limitAngle; + private boolean stateFlag; + private float cachedAngle3; + @Property("show-combat-settings") + private BooleanProperty showCombatSettings; + @Property("fov-check") + private IntProperty fovCheck; + private int stateTicks2; + @Property("max-aps") + private IntProperty maxAps; + @Property("filters") + private ListProperty filters; + @Property("aura-sort") + private StringProperty auraSort; + private TimerUtil timer2; + @Property("attack-method") + private StringProperty attackMethod; + @Property("block-range") + private DoubleProperty blockRange; + @Property("assistance") + private BooleanProperty assistance; + @Property("auto-block") + private BooleanProperty autoBlock; + private static Object[] objectArray; + @Property("auto-disable") + private BooleanProperty autoDisable; + @Property("show-assistance-settings") + private BooleanProperty showAssistanceSettings; + @Property("rotations") + private BooleanProperty rotations; + private TimerUtil timer3; + @Property("show-rotations-settings") + private BooleanProperty showRotationsSettings; + @Property("rotations-mode") + private StringProperty rotationsMode; + @Property("esp-color-type") + private StringProperty espColorType; + private float cachedAngle4; + @Property("max-targets") + private IntProperty maxTargets; + private float cachedAngle5; + private Entity trackedEntity; + @Property("targets") + private ListProperty targets; + @Property("max-angle") + private IntProperty maxAngle; + @Property("show-features-settings") + private BooleanProperty showFeaturesSettings; + @Property("critical-particles") + private BooleanProperty criticalParticles; + + @EventTarget + public void onMotionUpdate1(MotionUpdateEvent event) { + if (event.getState() == State.PRE && this.checkState2()) { + float[] floatArr = RotationAngleUtil.getRotationsEntity(this.trackedEntity); + Boolean propFlag = this.limitAngle.get(); + float floatVal = propFlag ? this.rotationVectorField.evaluateFloat(floatArr[0], this.maxAngle) : floatArr[0]; + float floatVal2 = floatArr[1]; + StringProperty strProp = this.rotationsMode; + if (strProp.equals("GCD")) { + floatVal = RotationAngleUtil.evaluateFloat3(floatVal); + floatVal2 = RotationAngleUtil.evaluateFloat2(floatVal2); + } + + this.cachedAngle3 = this.cachedAngle2; + this.floatValue = this.cachedAngle4; + float floatVal3 = this.cachedAngle2 = floatVal; + event.setYaw(floatVal3); + float floatVal4 = this.cachedAngle4 = floatVal2; + event.setPitch(floatVal4); + } +} + + private float[] computeArray(Entity entity) { + if (entity == null) { + return null; + } + + EntityPlayerSP player = this.mc.thePlayer; + double posX2 = entity.posX; + BooleanProperty boolProp = this.prediction; + Boolean propFlag = boolProp.get(); + double motionX2 = posX2 + (propFlag ? entity.motionX : 0.0); + posX2 = entity.posY; + boolProp = this.prediction; + Boolean propFlag2 = boolProp.get(); + double motionY2 = posX2 + (propFlag2 ? entity.motionY : 0.0); + posX2 = entity.posZ; + boolProp = this.prediction; + Boolean propFlag3 = boolProp.get(); + double motionZ2 = posX2 + (propFlag3 ? entity.motionZ : 0.0); + double posX3 = motionX2 - player.posX; + posX2 = motionY2 + entity.getEyeHeight() * 0.9; + double posY2 = player.posY; + double doubleVal = posX2 - (posY2 + player.getEyeHeight()); + double posZ2 = motionZ2 - player.posZ; + posX2 = posX3 * posX3 + posZ2 * posZ2; + double dist = MathHelper.sqrt_double(posX2); + float floatVal = (float)(Math.atan2(posZ2, posX3) * 180.0 / Math.PI) - 90.0F; + float floatVal2 = (float)(-(Math.atan2(doubleVal, dist) * 180.0 / Math.PI)); + float[] floatArr = new float[2]; + float yaw = player.rotationYaw; + float yaw2 = floatVal - player.rotationYaw; + floatArr[0] = yaw + MathHelper.wrapAngleTo180_float(yaw2); + yaw = player.rotationPitch; + yaw2 = floatVal2 - player.rotationPitch; + floatArr[1] = yaw + MathHelper.wrapAngleTo180_float(yaw2); + return floatArr; +} + + private Boolean supplyBoolean() { + boolean flag; + label12: { + Boolean propFlag = this.showRotationsSettings.get(); + if (propFlag) { + BooleanProperty boolProp = this.rotations; + propFlag = boolProp.get(); + if (propFlag) { + flag = true; + break label12; + } + } + + flag = false; + } + + return flag; +} + + + public boolean matchesBooleanArray(Boolean... booleanArray) { + Stream stream2 = Arrays.stream(booleanArray); + Predicate predicate = (Boolean flag) -> flag; + return stream2.allMatch(predicate) && this.isReadyState3(); +} + + private static Float mapEntity(Entity entity) { + float health = ((EntityLivingBase)entity).getHealth(); + return health; +} + + public float getCachedAngle4() { + return this.cachedAngle4; +} + + public boolean checkEntity2(@NonNull Entity entity) { + if (entity.isConditionMet16()) { + if (entity.isConditionMet23()) { + if (!this.targets.contains("Invisibles")) { + return false; + } + } + + if (entity instanceof EntityMob || entity instanceof EntitySlime || entity instanceof EntityCreatureSupport) { + ListProperty listProp = this.targets; + return listProp.contains("Mobs"); + } + + if (entity instanceof EntityAnimal || entity instanceof EntityVillager) { + ListProperty listProp2 = this.targets; + return listProp2.contains("Animals"); + } + + if (entity instanceof EntityPlayer) { + boolean flag; + label63: { + if (ServerUtils.isHypixel()) { + HypixelLobbyType lobbyType = HypixelLobbyType.BW; + if (ServerUtils.serverIs(lobbyType)) { + flag = true; + break label63; + } + } + + flag = false; + } + + label58: { + boolean flag2 = flag; + if (flag2) { + IChatComponent chatComp = entity.getDisplayName(); + String msgText = chatComp.getFormattedText(); + if (msgText.replace("\u00a7r", "").equals(entity.getName())) { + flag = false; + break label58; + } + } + + flag = true; + } + + boolean flag3 = flag; + ListProperty listProp3 = this.targets; + String textStr = "Players"; + if (listProp3.contains(textStr) && entity != this.mc.thePlayer && flag3) { + Novoline novolineInst = this.novoline; + if (!novolineInst.getPlayerManager().checkString(entity.getName(), PlayerRelationType.FRIEND)) { + ListProperty listProp4 = this.filters; + textStr = "Armor"; + if (!listProp4.contains(textStr) || this.matchesEntityPlayer((EntityPlayer)entity)) { + ListProperty listProp5 = this.filters; + textStr = "Teams"; + if (!listProp5.contains(textStr) || !ColorPaletteUtil.checkICommandSender(entity)) { + return true; + } + } + } + } + + return false; + } + } + + return false; +} + + public void handleSettingEvent(SettingEvent event) { + if (event == null || event.getSettingName().equals("KA_ATTACK_EVENT")) { + StringProperty strProp = this.attackEvent; + if (strProp.equals("Post")) { + this.popNotification(this.getDisplayName(), "Attack Event was set to PRE due to unstable POST bypass", 3500, NotificationType.WARNING); + strProp = this.attackEvent; + strProp.set("Pre"); + } + } + + if (event == null || event.getSettingName().equals("KA_ATTACK_METHOD")) { + StringProperty strProp2 = this.attackMethod; + String textStr = "Auto"; + if (!strProp2.equals(textStr)) { + textStr = this.getDisplayName(); + StringBuilder sb = new StringBuilder(); + sb = sb.append("Attack Method was set to AUTO due to unstable "); + StringProperty strProp3 = this.attackMethod; + String propStr = strProp3.get(); + propStr = propStr.toUpperCase(); + sb = sb.append(propStr); + this.popNotification(textStr, sb.append(" bypass").toString(), 3500, NotificationType.WARNING); + strProp2 = this.attackMethod; + textStr = "Auto"; + strProp2.set(textStr); + } + } + + if (event == null || event.getSettingName().equals("KA_AUTOBLOCK_MODE")) { + StringProperty strProp4 = this.autoBlockMode; + String textStr2 = "Hypixel"; + if (!strProp4.equals(textStr2)) { + strProp4 = this.autoBlockMode; + textStr2 = "Fake"; + if (!strProp4.equals(textStr2)) { + textStr2 = this.getDisplayName(); + StringBuilder sb2 = new StringBuilder(); + String textStr3 = "Autoblock Method was set to HYPIXEL due to unstable "; + sb2 = sb2.append(textStr3); + StringProperty strProp5 = this.autoBlockMode; + textStr3 = strProp5.get(); + textStr3 = textStr3.toUpperCase(); + sb2 = sb2.append(textStr3); + textStr3 = " bypass"; + this.popNotification(textStr2, sb2.append(textStr3).toString(), 4000, NotificationType.WARNING); + strProp4 = this.autoBlockMode; + textStr2 = "Hypixel"; + strProp4.set(textStr2); + } + } + } + + if (event == null || event.getSettingName().equals("KA_ROTATIONS")) { + BooleanProperty boolProp = this.rotations; + Boolean propFlag = boolProp.get(); + if (!propFlag) { + this.popNotification(this.getDisplayName(), "Rotations keept enabled for your safety", 2500, NotificationType.WARNING); + boolProp = this.rotations; + Boolean flag = true; + boolProp.set(flag); + } + } +} + + public IntProperty getSwitchDelay() { + return this.switchDelay; +} + + public IntProperty getIntProperty() { + return this.getSwitchDelay(); +} + + public EntityPlayer getEntityPlayerW() { + return this.trackedEntity instanceof EntityPlayer ? (EntityPlayer)this.trackedEntity : null; +} + + private void handleEntity(Entity entity) { + BooleanProperty boolProp = this.criticalParticles; + Boolean propFlag = boolProp.get(); + if (propFlag) { + EntityPlayerSP player = this.mc.thePlayer; + player.resolveFloat12(entity); + } + + boolProp = this.enchantParticles; + Boolean propFlag2 = boolProp.get(); + if (propFlag2) { + EntityPlayerSP player2 = this.mc.thePlayer; + player2.applyFlag(entity); + } +} + + private boolean isStateReady2() { + int ticks = this.mc.thePlayer.ticksExisted; + IntProperty intProp = this.ticksExisted; + Integer intVal = intProp.get(); + if (ticks >= intVal) { + ticks = this.trackedEntity.ticksExisted; + intProp = this.ticksExisted; + Integer intVal2 = intProp.get(); + if (ticks <= intVal2) { + return false; + } + } + + return true; +} + + private boolean isStateReady3() { + EntityPlayerSP player = this.mc.thePlayer; + if (player.getHeldItem() != null) { + player = this.mc.thePlayer; + ItemStack stack = player.getHeldItem(); + if (stack.getItem() instanceof ItemBow) { + KeyBinding keyBinding = this.mc.gameSettings.keyBindUseItem; + if (keyBinding.isKeyDown()) { + return true; + } + } + } + + return false; +} + + public List getListF() { + return this.entityList; +} + + public float getFloatValue() { + return this.floatValue; +} + + public void performStep2() { + TimerUtil timerUtil = this.timer3; + long timeMs = this.lastTimestamp; + if (timerUtil.delay(timeMs)) { + StringProperty strProp = this.mode; + if (strProp.equals("Multi")) { + this.handleList(this.getList()); + } else { + this.applyUpdate2(this.trackedEntity); + } + + ThreadLocalRandom threadLocalRandom = ThreadLocalRandom.current(); + Integer intVal = this.minAps.get(); + int intVal2 = intVal; + Integer intVal3 = this.maxAps.get(); + int intVal4 = intVal3 + 1; + this.lastTimestamp = 1000L / threadLocalRandom.nextInt(intVal2, intVal4); + timerUtil = this.timer3; + timerUtil.reset(); + } +} + + @EventTarget + public void onMotionUpdate3(MotionUpdateEvent event) { + if (event.getState() == State.PRE) { + if (this.computeIntValue() > 0) { + this.entityList = this.getList(); + } else { + this.entityList = this.getListB(this.auraSort.get()); + } + + if (this.trackedEntity != null) { + if (!this.trackedEntity.isConditionMet16()) { + this.trackedEntity = null; + } + } + + if (this.entityList == null) { + return; + } + + StringProperty strProp = this.mode; + if (strProp.equals("Multi")) { + List itemList = this.entityList; + this.trackedEntity = (Entity)itemList.get(0); + return; + } + + TimerUtil timerUtil = this.timer; + IntProperty intProp = this.switchDelay; + Integer intVal = intProp.get(); + long longVal = intVal.intValue(); + if (timerUtil.delay(longVal)) { + this.performStep3(); + } + + if (!this.matchesFlag(this.getStringValue().equals("Switch"))) { + if (this.trackedEntity == null) { + List itemList2 = this.entityList; + int ticks = this.getStringValue().equals("Switch") ? this.stateTicks2 : 0; + this.trackedEntity = (Entity)itemList2.get(ticks); + return; + } + + EntityPlayerSP player = this.mc.thePlayer; + Entity entity = this.trackedEntity; + if (player.getDistanceToEntity(entity) > this.computeDoubleValue2() && this.computeIntValue() > 0) { + this.trackedEntity = this.getEntityK(); + } else { + EntityPlayerSP player2 = this.mc.thePlayer; + Entity entity2 = this.trackedEntity; + if (player2.getDistanceToEntity(entity2) > this.computeDoubleValue()) { + this.trackedEntity = null; + this.performStep3(); + } else { + Entity entity3 = this.trackedEntity; + if (!entity3.isConditionMet16()) { + EntityLivingBase living = (EntityLivingBase)this.trackedEntity; + if (living.getHealth() <= 0.0F) { + this.trackedEntity = null; + this.performStep3(); + return; + } + } + + if (this.getStringValue().equals("Switch")) { + List itemList3 = this.entityList; + int ticks2 = this.stateTicks2; + this.trackedEntity = (Entity)itemList3.get(ticks2); + } + } + } + + return; + } + + List itemList4 = this.entityList; + Iterator iter = itemList4.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + Entity entity4 = (Entity)iter.next(); + Novoline novolineInst = this.novoline; + if (novolineInst.getPlayerManager().checkString(entity4.getName(), PlayerRelationType.TARGET)) { + this.trackedEntity = entity4; + } + } + } +} + + public DoubleProperty getBlockRange() { + return this.blockRange; +} + + public DoubleProperty getDoubleProperty() { + return this.getBlockRange(); +} + + private float computeFloat(ItemStack[] itemStackArray) { + float floatVal = 0.0F; + ItemStack[] stackArr = itemStackArray; + + for (ItemStack stack : stackArr) { + if (stack != null) { + if (stack.getItem() instanceof ItemArmor) { + ItemArmor armorItem = (ItemArmor)stack.getItem(); + double doubleVal = floatVal; + double doubleVal2 = armorItem.damageReduceAmount; + int intVal6 = 100 - armorItem.damageReduceAmount; + int intVal7 = Enchantment.protection.effectId; + floatVal = (float)(doubleVal + (doubleVal2 + intVal6 * ChestStealerSupport.evaluateInt3(intVal7, stack) * 0.0075)); + doubleVal = floatVal; + int intVal = Enchantment.blastProtection.effectId; + floatVal = (float)(doubleVal + ChestStealerSupport.evaluateInt3(intVal, stack) / 100.0); + doubleVal = floatVal; + int intVal2 = Enchantment.fireProtection.effectId; + floatVal = (float)(doubleVal + ChestStealerSupport.evaluateInt3(intVal2, stack) / 100.0); + doubleVal = floatVal; + int intVal3 = Enchantment.thorns.effectId; + floatVal = (float)(doubleVal + ChestStealerSupport.evaluateInt3(intVal3, stack) / 100.0); + doubleVal = floatVal; + int intVal4 = Enchantment.unbreaking.effectId; + floatVal = (float)(doubleVal + ChestStealerSupport.evaluateInt3(intVal4, stack) / 50.0); + doubleVal = floatVal; + int intVal5 = Enchantment.projectileProtection.effectId; + floatVal = (float)(doubleVal + ChestStealerSupport.evaluateInt3(intVal5, stack) / 100.0); + } + } + } + + return floatVal; +} + + private Boolean supplyBoolean2() { + boolean flag; + label12: { + Boolean propFlag = this.showRotationsSettings.get(); + if (propFlag) { + BooleanProperty boolProp = this.rotations; + propFlag = boolProp.get(); + if (propFlag) { + flag = true; + break label12; + } + } + + flag = false; + } + + return flag; +} + + private boolean isFlagO() { + Boolean propFlag = this.serverLagCheck.get(); + if (propFlag) { + TimerUtil timerUtil = this.timer2; + if (timerUtil.delay(100L)) { + return true; + } + } + + return false; +} + + + public BooleanProperty getRotations() { + return this.rotations; +} + + public BooleanProperty getBooleanProperty() { + return this.getRotations(); +} + + public void applyUpdate2(SettingEvent event) { + if (event == null || event.getSettingName().equals("KA_MINIMUM_APS") || event.getSettingName().equals("KA_MAXIMUM_APS")) { + IntProperty intProp = this.maxAps; + Integer intVal = intProp.get(); + int intVal2 = intVal; + IntProperty intProp2 = this.minAps; + Integer intVal3 = intProp2.get(); + if (intVal2 < intVal3) { + intProp = this.minAps; + intProp2 = this.maxAps; + Integer intVal4 = intProp2.get(); + intProp.set(intVal4); + } else { + intProp = this.minAps; + Integer intVal5 = intProp.get(); + int intVal6 = intVal5; + intProp2 = this.maxAps; + Integer intVal7 = intProp2.get(); + if (intVal6 > intVal7) { + intProp = this.maxAps; + intProp2 = this.minAps; + Integer intVal8 = intProp2.get(); + intProp.set(intVal8); + } + } + } + + if (event == null || event.getSettingName().equals("KA_ATTACK_RANGE") || event.getSettingName().equals("KA_WALL_RANGE") || event.getSettingName().equals("KA_AUTOBLOCK_RANGE")) { + DoubleProperty doubleProp = this.range; + Double propDouble = doubleProp.get(); + double doubleVal = propDouble; + DoubleProperty doubleProp2 = this.wallRange; + Double propDouble2 = doubleProp2.get(); + if (doubleVal < propDouble2) { + doubleProp = this.wallRange; + doubleProp2 = this.range; + Double propDouble3 = doubleProp2.get(); + doubleProp.set(propDouble3); + } else { + doubleProp = this.wallRange; + Double propDouble4 = doubleProp.get(); + double doubleVal2 = propDouble4; + doubleProp2 = this.range; + Double propDouble5 = doubleProp2.get(); + if (doubleVal2 > propDouble5) { + doubleProp = this.range; + doubleProp2 = this.wallRange; + Double propDouble6 = doubleProp2.get(); + doubleProp.set(propDouble6); + } + } + + BooleanProperty boolProp = this.autoBlock; + Boolean propFlag = boolProp.get(); + if (propFlag) { + doubleProp = this.blockRange; + Double propDouble7 = doubleProp.get(); + double doubleVal3 = propDouble7; + doubleProp2 = this.range; + Double propDouble8 = doubleProp2.get(); + if (doubleVal3 < propDouble8) { + doubleProp = this.range; + doubleProp2 = this.blockRange; + Double propDouble9 = doubleProp2.get(); + doubleProp.set(propDouble9); + } else { + doubleProp = this.range; + Double propDouble10 = doubleProp.get(); + double doubleVal4 = propDouble10; + doubleProp2 = this.blockRange; + Double propDouble11 = doubleProp2.get(); + if (doubleVal4 > propDouble11) { + doubleProp = this.blockRange; + doubleProp2 = this.range; + Double propDouble12 = doubleProp2.get(); + doubleProp.set(propDouble12); + } + } + } + } + + if (event == null || event.getSettingName().equals("KA_AUTOBLOCK")) { + BooleanProperty boolProp2 = this.autoBlock; + Boolean propFlag2 = boolProp2.get(); + if (propFlag2) { + DoubleProperty doubleProp3 = this.blockRange; + Double propDouble13 = doubleProp3.get(); + double doubleVal5 = propDouble13; + DoubleProperty doubleProp4 = this.range; + Double propDouble14 = doubleProp4.get(); + if (doubleVal5 < propDouble14) { + DoubleProperty doubleProp5 = this.range; + doubleProp4 = this.blockRange; + Double propDouble15 = doubleProp4.get(); + doubleProp5.set(propDouble15); + } else { + DoubleProperty doubleProp6 = this.range; + Double propDouble16 = doubleProp6.get(); + double doubleVal6 = propDouble16; + doubleProp4 = this.blockRange; + Double propDouble17 = doubleProp4.get(); + if (doubleVal6 > propDouble17) { + DoubleProperty doubleProp7 = this.blockRange; + doubleProp4 = this.range; + Double propDouble18 = doubleProp4.get(); + doubleProp7.set(propDouble18); + } + } + } + } +} + + public boolean matchesStringArray(String... args) { + return this.autoBlockMode.equals(args) && this.isReadyState3(); +} + + public ListProperty getFilters() { + return this.filters; +} + + public ListProperty getListPropertyS() { + return this.getFilters(); +} + + private double applyInt5(Entity entity) { + float[] floatArr = this.computeArray(entity); + float floatVal = (int)floatArr[0]; + return this.mc.thePlayer.rotationYaw > floatVal ? this.mc.thePlayer.rotationYaw - floatVal : floatVal - this.mc.thePlayer.rotationYaw; +} + + @EventTarget + public void onRender3D(Render3DEvent event) { + Boolean propFlag = this.targetEsp.get(); + if (propFlag && (this.isReadyState3() || this.isReadyState2())) { + StringProperty strProp = this.mode; + if (strProp.equals("Multi")) { + short shortVal = 0; + List itemList = this.getList(); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + Entity entity = (Entity)iter.next(); + int intVal = this.computeEntityInt(this.trackedEntity, shortVal); + RenderUtils.drawElement12(entity, intVal); + shortVal -= 600; + } + } else { + Entity entity2 = this.trackedEntity; + int intVal2 = this.computeEntityInt(this.trackedEntity, 0); + RenderUtils.drawElement12(entity2, intVal2); + } + } +} + + @EventTarget + public void onLoadWorld(LoadWorldEvent event) { + Boolean propFlag = this.autoDisable.get(); + if (propFlag) { + this.popNotification(this.getDisplayName(), "Module was disabled due to world change", 3000, NotificationType.WARNING); + this.toggle(); + } +} + + + public ListProperty getTargets() { + return this.targets; +} + + public ListProperty getListProperty() { + return this.getTargets(); +} + + private Boolean supplyBoolean3() { + boolean flag; + label14: { + Boolean propFlag = this.showRotationsSettings.get(); + if (propFlag) { + BooleanProperty boolProp = this.rotations; + propFlag = boolProp.get(); + if (propFlag) { + BooleanProperty boolProp2 = this.limitAngle; + propFlag = boolProp2.get(); + if (propFlag) { + flag = true; + break label14; + } + } + } + + flag = false; + } + + return flag; +} + + public static Object[] K() { + return objectArray; +} + + public boolean evaluateFlag(String text) { + return this.autoBlockMode.equals(text) && this.isReadyState3(); +} + + private Boolean supplyBoolean4() { + boolean flag; + label12: { + Boolean propFlag = this.showAutoblockSettings.get(); + if (propFlag) { + BooleanProperty boolProp = this.autoBlock; + propFlag = boolProp.get(); + if (propFlag) { + flag = true; + break label12; + } + } + + flag = false; + } + + return flag; +} + + private boolean isStateReady4() { + TargetStrafe targetStrafe = ModuleRegistry.TARGETSTRAFE.getModule(); + BooleanProperty boolProp = this.rotations; + Boolean propFlag = boolProp.get(); + if (propFlag) { + StringProperty strProp = this.mode; + if (!strProp.equals("Multi")) { + boolProp = this.rayTrace; + Boolean propFlag2 = boolProp.get(); + if (propFlag2 && this.getMovingObjectPositionY() == null) { + Novoline novolineInst = this.novoline; + if (!novolineInst.getPlayerManager().checkString(this.trackedEntity.getName(), PlayerRelationType.TARGET) && (!targetStrafe.applyUpdate3(false) || !this.isEnabled(ModuleRegistry.FLY))) { + return false; + } + } + } + } + + return true; +} + + private Boolean supplyBoolean5() { + boolean flag; + label12: { + Boolean propFlag = this.showRotationsSettings.get(); + if (propFlag) { + BooleanProperty boolProp = this.rotations; + propFlag = boolProp.get(); + if (propFlag) { + flag = true; + break label12; + } + } + + flag = false; + } + + return flag; +} + + public MovingObjectPosition getMovingObjectPositionY() { + Entity entity = this.trackedEntity; + float floatVal = entity.getCollisionBorderSize(); + Vec3 vec = RotationAngleUtil.getEyesPos(); + Vec3 vec2 = RotationAngleUtil.getVectorForRotation(this.cachedAngle4, this.cachedAngle2); + double posX = vec2.xCoord * this.computeDoubleValue2(); + double posY = vec2.yCoord * this.computeDoubleValue2(); + double posZ = vec2.zCoord * this.computeDoubleValue2(); + Vec3 vec3 = vec.addVector(posX, posY, posZ); + entity = this.trackedEntity; + AxisAlignedBB boundingBox = entity.getAxisAlignedBB(); + posX = floatVal; + posY = floatVal; + posZ = floatVal; + AxisAlignedBB boundingBox2 = boundingBox.expand(posX, posY, posZ); + return boundingBox2.calculateIntercept(vec, vec3); +} + + public DoubleProperty getRange() { + return this.range; +} + + public DoubleProperty getDoublePropertyA() { + return this.getRange(); +} + + public KillAura(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + this.packetList = new ArrayList<>(); + this.entityList = new ArrayList<>(); + this.timer3 = new TimerUtil(); + this.timer = new TimerUtil(); + this.timer2 = new TimerUtil(); + StringProperty strProp = StringProperty.of("Switch"); + String[] stringArr = new String[]{"Multi", "Switch", "Single"}; + this.mode = strProp.acceptableValues(stringArr); + this.maxTargets = IntProperty.of(1).minimum(1).maximum(20); + StringProperty strProp2 = StringProperty.of("Distance"); + stringArr = new String[]{"Distance", "Health", "Armor", "FOV", "HurtTime"}; + this.auraSort = strProp2.acceptableValues(stringArr); + this.switchDelay = IntProperty.of(400).minimum(50).maximum(1000); + StringProperty strProp3 = StringProperty.of("Pre"); + stringArr = new String[]{"Pre", "Post", "Tick"}; + this.attackEvent = strProp3.acceptableValues(stringArr); + StringProperty strProp4 = StringProperty.of("Auto"); + stringArr = new String[]{"Auto", "1.8.X", "1.9+"}; + this.attackMethod = strProp4.acceptableValues(stringArr); + this.minAps = IntProperty.of(5).minimum(1).maximum(20); + this.maxAps = IntProperty.of(5).minimum(1).maximum(20); + this.range = DoubleProperty.of(3.5).minimum(3.0).maximum(7.0); + this.wallRange = DoubleProperty.of(3.5).minimum(3.0).maximum(7.0); + this.noSwing = BooleanProperty.of(false); + ListProperty listProp = ListProperty.of("Players"); + String[] stringArr2 = new String[]{"Players", "Animals", "Mobs", "Invisibles"}; + this.targets = listProp.acceptableValues((Object[])stringArr2); + ListProperty listProp2 = ListProperty.of("Teams"); + String[] stringArr3 = new String[]{"Teams", "Armor"}; + this.filters = listProp2.acceptableValues((Object[])stringArr3); + this.fovCheck = IntProperty.of(180).minimum(30).maximum(180); + this.ticksExisted = IntProperty.of(50).minimum(0).maximum(100); + this.rotations = BooleanProperty.of(false); + StringProperty strProp5 = StringProperty.of("Basic"); + String[] stringArr4 = new String[]{"Basic", "GCD"}; + this.rotationsMode = strProp5.acceptableValues(stringArr4); + this.prediction = BooleanProperty.of(false); + this.rayTrace = BooleanProperty.of(false); + this.limitAngle = BooleanProperty.of(false); + this.maxAngle = IntProperty.of(30).minimum(5).maximum(90); + this.autoBlock = BooleanProperty.of(false); + StringProperty strProp6 = StringProperty.of("Post"); + String[] stringArr5 = new String[]{"Pre", "Post", "Hypixel", "Fake"}; + this.autoBlockMode = strProp6.acceptableValues(stringArr5); + this.blockRange = DoubleProperty.of(3.5).minimum(3.0).maximum(7.0); + this.assistance = BooleanProperty.of(false); + this.serverLagCheck = BooleanProperty.of(false); + this.autoDisable = BooleanProperty.of(true); + this.targetEsp = BooleanProperty.of(true); + this.criticalParticles = BooleanProperty.of(true); + this.enchantParticles = BooleanProperty.of(true); + StringProperty strProp7 = StringProperty.of("Custom"); + String[] stringArr6 = new String[]{"Custom", "Synced", "Team"}; + this.espColorType = strProp7.acceptableValues(stringArr6); + Color awtColor = Color.WHITE; + int color = awtColor.getRGB(); + Integer intVal = color; + this.espColor = ColorProperty.e(intVal); + this.showTargetSettings = BooleanProperty.of(true); + this.showCombatSettings = BooleanProperty.of(true); + this.showFeaturesSettings = BooleanProperty.of(true); + this.showRotationsSettings = BooleanProperty.of(true); + this.showAutoblockSettings = BooleanProperty.of(true); + this.showRenderSettings = BooleanProperty.of(true); + this.showAssistanceSettings = BooleanProperty.of(true); + Setting setting = new Setting("KA_MODE", "Mode", SettingType.COMBOBOX, this, this.mode); + SettingManager.register(setting); + Setting setting2 = new Setting("KA_MAXIMUM_TARGETS", "Maximum Targets", SettingType.SLIDER, this, this.maxTargets, 1.0, () -> this.mode.equals("Multi")); + SettingManager.register(setting2); + Setting setting3 = new Setting("KA_SORT_TYPE", "Sort Type", SettingType.COMBOBOX, this, this.auraSort, () -> this.mode.equals("Single")); + SettingManager.register(setting3); + Setting setting4 = new Setting("KA_SWITCH_DELAY", "Switch Delay", SettingType.SLIDER, this, this.switchDelay, 50.0, () -> this.mode.equals("Switch")); + SettingManager.register(setting4); + Setting setting5 = new Setting("KA_TARGET_SECTION", "TARGET", SettingType.SEPARATOR, this, this.showTargetSettings); + SettingManager.register(setting5); + Setting setting6 = new Setting("KA_TARGET_LIST", "List", SettingType.SELECTBOX, this, this.targets, this.showTargetSettings::get); + SettingManager.register(setting6); + Setting setting7 = new Setting("KA_TARGET_FILTER", "Filter", SettingType.SELECTBOX, this, this.filters, this.showTargetSettings::get); + SettingManager.register(setting7); + Setting setting8 = new Setting("KA_TARGET_TICKS_EXISTED", "Ticks Existed", SettingType.SLIDER, this, this.ticksExisted, 5.0, this.showTargetSettings::get); + SettingManager.register(setting8); + Setting setting9 = new Setting("KA_FOV_CHECK", "Fov", SettingType.SLIDER, this, this.fovCheck, 5.0, this.showTargetSettings::get); + SettingManager.register(setting9); + Setting setting10 = new Setting("KA_COMBAT_SECTION", "COMBAT", SettingType.SEPARATOR, this, this.showCombatSettings); + SettingManager.register(setting10); + Setting setting11 = new Setting("KA_ATTACK_EVENT", "Attack Event", SettingType.COMBOBOX, this, this.attackEvent, this.showCombatSettings::get); + SettingManager.register(setting11); + Setting setting12 = new Setting("KA_ATTACK_METHOD", "Attack Method", SettingType.COMBOBOX, this, this.attackMethod, this.showCombatSettings::get); + SettingManager.register(setting12); + Setting setting13 = new Setting("KA_MINIMUM_APS", "Minimum APS", SettingType.SLIDER, this, this.minAps, 1.0, this.showCombatSettings::get); + SettingManager.register(setting13); + Setting setting14 = new Setting("KA_MAXIMUM_APS", "Maximum APS", SettingType.SLIDER, this, this.maxAps, 1.0, this.showCombatSettings::get); + SettingManager.register(setting14); + Setting setting15 = new Setting("KA_ATTACK_RANGE", "Attack Range", SettingType.SLIDER, this, this.range, 0.1, this.showCombatSettings::get); + SettingManager.register(setting15); + Setting setting16 = new Setting("KA_WALL_RANGE", "Wall Range", SettingType.SLIDER, this, this.wallRange, 0.1, this.showCombatSettings::get); + SettingManager.register(setting16); + setting16 = new Setting("KA_NO_SWING", "No Swing", SettingType.CHECKBOX, this, this.noSwing, this.showCombatSettings::get); + SettingManager.register(setting16); + setting16 = new Setting("KA_FEATURES", "FEATURES", SettingType.SEPARATOR, this, this.showFeaturesSettings); + SettingManager.register(setting16); + setting16 = new Setting("KA_ROTATIONS", "Rotations", SettingType.CHECKBOX, this, this.rotations, this.showFeaturesSettings::get); + SettingManager.register(setting16); + setting16 = new Setting("KA_AUTOBLOCK", "Autoblock", SettingType.CHECKBOX, this, this.autoBlock, this.showFeaturesSettings::get); + SettingManager.register(setting16); + setting16 = new Setting("KA_ASSISTANCE", "Assistance", SettingType.CHECKBOX, this, this.assistance, this.showFeaturesSettings::get); + SettingManager.register(setting16); + setting16 = new Setting("KA_ROTATIONS_SECTION", "ROTATIONS", SettingType.SEPARATOR, this, this.showRotationsSettings, this.rotations::get); + SettingManager.register(setting16); + setting16 = new Setting("KA_ROTATIONS_MODE", "Method", SettingType.COMBOBOX, this, this.rotationsMode, this::supplyBoolean5); + SettingManager.register(setting16); + setting16 = new Setting("KA_ROTATIONS_RAY_TRACE", "Ray Trace", SettingType.CHECKBOX, this, this.rayTrace, this::supplyBoolean10); + SettingManager.register(setting16); + setting16 = new Setting("KA_ROTATIONS_PREDICTION", "Prediction", SettingType.CHECKBOX, this, this.prediction, this::supplyBoolean); + SettingManager.register(setting16); + setting16 = new Setting("KA_ROTATIONS_LIMIT_ANGLE", "Limit Angle Change", SettingType.CHECKBOX, this, this.limitAngle, this::supplyBoolean2); + SettingManager.register(setting16); + setting16 = new Setting("KA_ROTATIONS_MAX_ANGLE", "Max Angle", SettingType.SLIDER, this, this.maxAngle, 5.0, this::supplyBoolean3); + SettingManager.register(setting16); + setting16 = new Setting("KA_AUTOBLOCK_SECTION", "AUTOBLOCK", SettingType.SEPARATOR, this, this.showAutoblockSettings, this.autoBlock::get); + SettingManager.register(setting16); + setting16 = new Setting("KA_AUTOBLOCK_MODE", "Method", SettingType.COMBOBOX, this, this.autoBlockMode, this::supplyBoolean4); + SettingManager.register(setting16); + setting16 = new Setting("KA_AUTOBLOCK_RANGE", "Block Range", SettingType.SLIDER, this, this.blockRange, 0.1, this::supplyBoolean11); + SettingManager.register(setting16); + setting16 = new Setting("KA_RENDER", "RENDER", SettingType.SEPARATOR, this, this.showRenderSettings); + SettingManager.register(setting16); + setting16 = new Setting("KA_CRITICAL_PARTICLES", "Critical Particles", SettingType.CHECKBOX, this, this.criticalParticles, this.showRenderSettings::get); + SettingManager.register(setting16); + setting16 = new Setting("KA_ENCHANT_PARTICLES", "Enchant Particles", SettingType.CHECKBOX, this, this.enchantParticles, this.showRenderSettings::get); + SettingManager.register(setting16); + setting16 = new Setting("KA_TARGET_ESP", "Target ESP", SettingType.CHECKBOX, this, this.targetEsp, this.showRenderSettings::get); + SettingManager.register(setting16); + setting16 = new Setting("KA_ESP_COLOR_TYPE", "ESP Color Type", SettingType.COMBOBOX, this, this.espColorType, this::supplyBoolean7); + SettingManager.register(setting16); + setting16 = new Setting("KA_ESP_COLOR", "ESP Color", SettingType.COLOR_PICKER, this, this.espColor, null, this::supplyBoolean9); + SettingManager.register(setting16); + setting16 = new Setting("KA_ASSITANCE_SECTION", "ASSISTANCE", SettingType.SEPARATOR, this, this.showAssistanceSettings, this.assistance::get); + SettingManager.register(setting16); + setting16 = new Setting("KA_SERVER_LAG_CHECK", "Server Lag Check", SettingType.CHECKBOX, this, this.serverLagCheck, this::supplyBoolean6); + SettingManager.register(setting16); + setting16 = new Setting("KA_AUTO_DISABLE", "Auto Disable", SettingType.CHECKBOX, this, this.autoDisable, this::supplyBoolean8); + SettingManager.register(setting16); +} + + private boolean isFlagR() { + if (this.trackedEntity == null) { + return false; + } + + float[] floatArr = RotationAngleUtil.getRotationsEntity(this.trackedEntity); + int intVal = (int)floatArr[1]; + int intVal2 = (int)floatArr[0]; + int intVal3 = (int)this.mc.thePlayer.rotationYaw; + int intVal4 = (int)this.mc.thePlayer.rotationPitch; + int intVal9 = intVal3 - intVal2; + int intVal5 = Math.abs(intVal9); + intVal9 = intVal4 - intVal; + int intVal6 = Math.abs(intVal9); + ModuleRegistry modEntry = ModuleRegistry.TARGETSTRAFE; + TargetStrafe targetStrafe = modEntry.getModule(); + IntProperty intProp = this.fovCheck; + Integer intVal7 = intProp.get(); + if (intVal5 <= intVal7) { + intProp = this.fovCheck; + Integer intVal8 = intProp.get(); + if (intVal6 <= intVal8) { + return true; + } + } + + return targetStrafe.applyUpdate3(false) && this.isEnabled(ModuleRegistry.FLY); +} + + public Entity getTrackedEntity2() { + return this.trackedEntity; +} + + private Boolean supplyBoolean6() { + boolean flag; + label12: { + Boolean propFlag = this.assistance.get(); + if (propFlag) { + BooleanProperty boolProp = this.showAssistanceSettings; + propFlag = boolProp.get(); + if (propFlag) { + flag = true; + break label12; + } + } + + flag = false; + } + + return flag; +} + + public List getList2() { + double doubleVal = this.isReadyState3() ? this.computeDoubleValue() : this.computeDoubleValue2(); + List itemList = this.getListB(this.auraSort.get()); + Stream stream2 = itemList.stream(); + Predicate predicate = ((java.util.function.Predicate) ((value0) -> this.mc.thePlayer.computeFloat3(value0) <= doubleVal)); + Stream stream3 = stream2.filter(predicate); + Collector collector = Collectors.toList(); + return (java.util.List) stream3.collect(collector); +} + + static { + Object[] objArr = new Object[3]; + applyInt5(objArr); + } + + public StringProperty getMode() { + return this.mode; +} + + public StringProperty getStringProperty() { + return this.getMode(); +} + + private double getDoubleValue() { + Double propDouble = this.wallRange.get(); + return propDouble; +} + + public BooleanProperty getAutoBlock() { + return this.autoBlock; +} + + public BooleanProperty getBooleanPropertyI() { + return this.getAutoBlock(); +} + + private Float mapEntity2(Entity entity) { + EntityPlayerSP player = this.mc.thePlayer; + float distanceF = entity.getDistanceToEntity(player); + return distanceF; +} + + private void updateHelper2() { + Boolean propFlag = this.noSwing.get(); + if (propFlag) { + this.sendPacket(new C0APacketAnimation()); + } else { + this.mc.thePlayer.swingItem(); + } +} + + public boolean isReadyState2() { + boolean flag; + label44: { + Blink blink = ModuleRegistry.BLINK.getModule(); + if (blink.isEnabled()) { + StringProperty strProp = blink.getStringPropertyValue(); + if (strProp.equals("Basic")) { + flag = true; + break label44; + } + } + + flag = false; + } + + boolean flag2 = flag; + if (this.isEnabled() && !this.isEnabled(ModuleRegistry.SCAFFOLD) && !flag2 && !this.isFlagO() && !this.isStateReady3() && this.trackedEntity != null) { + Entity entity = this.trackedEntity; + if (entity.isConditionMet16() && this.isStateReady2() && this.isFlagR() && this.isStateReady4()) { + EntityPlayerSP player = this.mc.thePlayer; + Entity entity2 = this.trackedEntity; + double dist = player.getDistanceToEntity(entity2); + entity2 = this.mc.thePlayer; + Entity entity3 = this.trackedEntity; + if (dist <= (((EntityPlayerSP)entity2).matchesCriteria(entity3) ? this.computeDoubleValue2() : this.getDoubleValue())) { + return true; + } + } + } + + return false; +} + + private boolean checkEntity3(Entity entity) { + double doubleVal = this.mc.thePlayer.computeFloat3(entity); + EntityPlayerSP player = this.mc.thePlayer; + double doubleVal2; + if (player.matchesCriteria(entity)) { + double doubleVal3 = this.computeDoubleValue2(); + double doubleVal4 = this.computeDoubleValue(); + doubleVal2 = Math.max(doubleVal3, doubleVal4); + } else { + doubleVal2 = this.getDoubleValue(); + } + + return doubleVal <= doubleVal2; +} + + @Override + public void onEnable() { + this.handleString3(this.mode.get()); + this.cachedAngle2 = this.mc.thePlayer.rotationYaw; + this.cachedAngle3 = this.mc.thePlayer.prevRotationYaw; + this.cachedAngle4 = this.mc.thePlayer.rotationPitch; + this.floatValue = this.mc.thePlayer.prevRotationPitch; + this.rotationVectorField = new RotationVector(this.cachedAngle2); + ThreadLocalRandom threadLocalRandom = ThreadLocalRandom.current(); + Integer intVal = this.minAps.get(); + int intVal2 = intVal; + Integer intVal3 = this.maxAps.get(); + int intVal4 = intVal3 + 1; + this.lastTimestamp = 1000L / threadLocalRandom.nextInt(intVal2, intVal4); + this.stateTicks = 0; +} + + @EventTarget + public void onPacket(PacketEvent event) { + if (event.getState() == cc.novoline.events.State.OUTGOING) { + if (event.getPacket() instanceof C07PacketPlayerDigging) { + C07PacketPlayerDigging playerDiggingPacket = (C07PacketPlayerDigging)event.getPacket(); + if (this.isReadyState3()) { + if (playerDiggingPacket.getStatus2() == net.minecraft.network.play.client.C07PacketPlayerDigging$Action.RELEASE_USE_ITEM) { + event.setCancelled(true); + } + } + } else { + if (event.getPacket() instanceof C08PacketPlayerBlockPlacement) { + C08PacketPlayerBlockPlacement playerBlockPlacementPacket = (C08PacketPlayerBlockPlacement)event.getPacket(); + if (this.isReadyState3() && playerBlockPlacementPacket.getPlacedBlockDirection2() == 255 && playerBlockPlacementPacket.getStack2() != null) { + ItemStack stack = playerBlockPlacementPacket.getStack2(); + if (stack.getItem() instanceof ItemIronSword) { + event.setCancelled(true); + } + } + } + } + } else { + TimerUtil timerUtil = this.timer2; + timerUtil.reset(); + if (event.getPacket() instanceof S45PacketTitle) { + S45PacketTitle titlePacket = (S45PacketTitle)event.getPacket(); + IChatComponent chatComp = titlePacket.getMessage(); + if (chatComp.getFormattedText().equals("\u00a7cYOU DIED\u00a7r")) { + this.popNotification(this.getDisplayName(), "Module was disabled due to Death", 2000, NotificationType.WARNING); + this.toggle(); + } + } + } +} + + private boolean matchesFlag(boolean flag) { + List itemList = this.getListB(this.auraSort.get()); + Stream stream2 = itemList.stream(); + Predicate predicate = (Entity entity3) -> this.mc.thePlayer.computeFloat3(entity3) < this.computeDoubleValue2(); + Stream stream3 = stream2.filter(predicate); + Supplier supplier = ObjectArrayList::new; + Collector collector = Collectors.toCollection(supplier); + ObjectListIterator objectListIterator = ((ObjectArrayList)stream3.collect(collector)).iterator(); + + Entity entity2; + Novoline novolineInst; + do { + if (!objectListIterator.hasNext()) { + return false; + } + + entity2 = (Entity)objectListIterator.next(); + novolineInst = this.novoline; + } while (!novolineInst.getPlayerManager().checkString(entity2.getName(), PlayerRelationType.TARGET)); + + return true; +} + + private Entity getEntityK() { + List itemList = this.getListB(this.auraSort.get()); + Iterator iter = itemList.iterator(); + + Entity entity; + EntityPlayerSP player; + do { + if (!iter.hasNext()) { + return null; + } + + entity = (Entity)iter.next(); + player = this.mc.thePlayer; + } while (!(player.getDistanceToEntity(entity) <= this.computeDoubleValue2())); + + return entity; +} + + public boolean evaluateFlag2(String text) { + return this.attackEvent.equals(text) && this.isReadyState2(); +} + + private Boolean supplyBoolean7() { + boolean flag; + label12: { + Boolean propFlag = this.targetEsp.get(); + if (propFlag) { + BooleanProperty boolProp = this.showRenderSettings; + propFlag = boolProp.get(); + if (propFlag) { + flag = true; + break label12; + } + } + + flag = false; + } + + return flag; +} + + public boolean isReadyState3() { + boolean flag; + label44: { + Blink blink = ModuleRegistry.BLINK.getModule(); + if (blink.isEnabled()) { + StringProperty strProp = blink.getStringPropertyValue(); + if (strProp.equals("Basic")) { + flag = true; + break label44; + } + } + + flag = false; + } + + boolean flag2 = flag; + if (this.isEnabled() && !this.isEnabled(ModuleRegistry.SCAFFOLD) && !flag2) { + BooleanProperty boolProp = this.autoBlock; + Boolean propFlag = boolProp.get(); + if (propFlag && this.trackedEntity != null) { + Entity entity = this.trackedEntity; + if (entity.isConditionMet16() && this.isStateReady2() && this.isFlagR()) { + EntityPlayerSP player = this.mc.thePlayer; + if (player.getHeldItem() != null) { + EntityPlayerSP player2 = this.mc.thePlayer; + ItemStack stack = player2.getHeldItem(); + if (stack.getItem() instanceof ItemIronSword) { + EntityPlayerSP player3 = this.mc.thePlayer; + Entity entity2 = this.trackedEntity; + double dist = player3.getDistanceToEntity(entity2); + entity2 = this.mc.thePlayer; + Entity entity3 = this.trackedEntity; + if (dist <= (((EntityPlayerSP)entity2).matchesCriteria(entity3) ? this.computeDoubleValue() : this.getDoubleValue())) { + return true; + } + } + } + } + } + } + + return false; +} + + public boolean checkState2() { + boolean flag; + label42: { + Blink blink = ModuleRegistry.BLINK.getModule(); + if (blink.isEnabled()) { + StringProperty strProp = blink.getStringPropertyValue(); + if (strProp.equals("Basic")) { + flag = true; + break label42; + } + } + + flag = false; + } + + boolean flag2 = flag; + if (this.isEnabled() && !this.isEnabled(ModuleRegistry.SCAFFOLD) && !flag2) { + BooleanProperty boolProp = this.rotations; + Boolean propFlag = boolProp.get(); + if (propFlag && !this.isStateReady3() && this.trackedEntity != null) { + Entity entity = this.trackedEntity; + if (entity.isConditionMet16() && this.isStateReady2() && this.isFlagR()) { + EntityPlayerSP player = this.mc.thePlayer; + Entity entity2 = this.trackedEntity; + double dist = player.getDistanceToEntity(entity2); + entity2 = this.mc.thePlayer; + Entity entity3 = this.trackedEntity; + if (dist <= (((EntityPlayerSP)entity2).matchesCriteria(entity3) ? this.computeDoubleValue2() : this.getDoubleValue())) { + return true; + } + } + } + } + + return false; +} + + private int computeIntValue() { + int intVal = 0; + StringProperty strProp = this.auraSort; + List itemList = this.getListB(strProp.get()); + if (itemList.isEmpty()) { + return 0; + } + + strProp = this.auraSort; + itemList = this.getListB(strProp.get()); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + return intVal; + } + + Entity entity = (Entity)iter.next(); + EntityPlayerSP player = this.mc.thePlayer; + if (player.getDistanceToEntity(entity) <= this.computeDoubleValue2()) { + intVal++; + } + } +} + + public boolean matchesString(String text, Boolean... booleanArray) { + Stream stream2 = Arrays.stream(booleanArray); + Predicate predicate = (Boolean flag) -> flag; + return stream2.allMatch(predicate) && this.evaluateFlag(text); +} + + private Boolean supplyBoolean8() { + boolean flag; + label12: { + Boolean propFlag = this.assistance.get(); + if (propFlag) { + BooleanProperty boolProp = this.showAssistanceSettings; + propFlag = boolProp.get(); + if (propFlag) { + flag = true; + break label12; + } + } + + flag = false; + } + + return flag; +} + + public String getStringValue() { + TargetStrafe targetStrafe = ModuleRegistry.TARGETSTRAFE.getModule(); + String textStr; + if (targetStrafe.checkState15()) { + textStr = "Single"; + } else { + StringProperty strProp = this.mode; + textStr = strProp.get(); + } + + return textStr; +} + + private Boolean supplyBoolean9() { + boolean flag; + label14: { + Boolean propFlag = this.targetEsp.get(); + if (propFlag) { + BooleanProperty boolProp = this.showRenderSettings; + propFlag = boolProp.get(); + if (propFlag) { + StringProperty strProp = this.espColorType; + if (strProp.equals("Custom")) { + flag = true; + break label14; + } + } + } + + flag = false; + } + + return flag; +} + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + this.handleString3(this.mode.get()); +} + + private List getListB(String text) { + List itemList = this.mc.theWorld.obtainList3(); + Stream stream2 = itemList.stream(); + Predicate predicate = this::checkEntity2; + Stream stream3 = stream2.filter(predicate); + Collector collector = Collectors.toList(); + List itemList2 = (java.util.List) stream3.collect(collector); + String textStr = this.getStringValue(); + if (textStr.equalsIgnoreCase("Single")) { + switch (resolveAuraSortIndex(text)) { + case 0: + ; + Stream stream4 = itemList2.stream(); + Comparator comparator = Comparator.comparing(this::mapEntity2); + Stream stream5 = stream4.sorted(comparator); + Supplier supplier = ObjectArrayList::new; + Collector collector2 = Collectors.toCollection(supplier); + itemList2 = (java.util.List) stream5.collect(collector2); + break; + case 1: + ; + Stream stream6 = itemList2.stream(); + Comparator comparator2 = Comparator.comparing(this::mapEntity3); + Stream stream7 = stream6.sorted(comparator2); + Supplier supplier2 = ObjectArrayList::new; + Collector collector3 = Collectors.toCollection(supplier2); + itemList2 = (java.util.List) stream7.collect(collector3); + break; + case 2: + ; + Stream stream8 = itemList2.stream(); + Comparator comparator3 = Comparator.comparing(KillAura::mapEntity); + Stream stream9 = stream8.sorted(comparator3); + Supplier supplier3 = ObjectArrayList::new; + Collector collector4 = Collectors.toCollection(supplier3); + itemList2 = (java.util.List) stream9.collect(collector4); + break; + case 3: + ; + Stream stream10 = itemList2.stream(); + Comparator comparator4 = Comparator.comparing(((java.util.function.Function) this::applyInt5)); + Stream stream11 = stream10.sorted(comparator4); + Supplier supplier4 = ObjectArrayList::new; + Collector collector5 = Collectors.toCollection(supplier4); + itemList2 = (java.util.List) stream11.collect(collector5); + break; + case 4: + ; + Stream stream12 = itemList2.stream(); + Comparator comparator5 = Comparator.comparing((Entity entity2) -> entity2.hurtResistantTime); + Stream stream13 = stream12.sorted(comparator5); + Supplier supplier5 = ObjectArrayList::new; + Collector collector6 = Collectors.toCollection(supplier5); + itemList2 = (java.util.List) stream13.collect(collector6); + } + } + + Stream stream14 = itemList2.stream(); + Predicate predicate2 = this::checkEntity3; + Stream stream15 = stream14.filter(predicate2); + Collector collector7 = Collectors.toList(); + List itemList3 = (java.util.List) stream15.collect(collector7); + if (this.getStringValue().equals("Multi")) { + int size2 = itemList3.size(); + Integer intVal = this.maxTargets.get(); + int intVal2 = intVal; + int intVal3 = Math.min(size2, intVal2); + return itemList3.subList(0, intVal3); + } else { + return itemList3; + } +} + + private double computeDoubleValue() { + Double propDouble = this.blockRange.get(); + return propDouble; +} + + private void applyUpdate2(Entity entity) { + label24: { + label23: { + ViaSupportUtil viaSupport = ViaSupportUtil.getViaSupportUtil(); + if (viaSupport.getStateTicks() > 47) { + StringProperty strProp = this.attackMethod; + if (strProp.equals("Auto")) { + break label23; + } + } + + StringProperty strProp2 = this.attackMethod; + if (!strProp2.equals("1.9+")) { + this.updateHelper2(); + this.sendPacket(new C02PacketUseEntity(entity, C02PacketUseEntity$Action.ATTACK)); + break label24; + } + } + + this.sendPacket(new C02PacketUseEntity(entity, C02PacketUseEntity$Action.ATTACK)); + this.updateHelper2(); + } + + BooleanProperty boolProp = this.criticalParticles; + Boolean propFlag = boolProp.get(); + if (propFlag) { + EntityPlayerSP player = this.mc.thePlayer; + player.resolveFloat12(entity); + } + + boolProp = this.enchantParticles; + Boolean propFlag2 = boolProp.get(); + if (propFlag2) { + EntityPlayerSP player2 = this.mc.thePlayer; + player2.applyFlag(entity); + } +} + + private boolean matchesBlockPos(BlockPos pos) { + IBlockState blockState = this.mc.theWorld.getBlockState(pos); + Block block = blockState.getBlock(); + return block == Blocks.furnace + || block == Blocks.crafting_table + || block == Blocks.chest + || block == Blocks.ender_chest + || block == Blocks.trapped_chest + || block == Blocks.dropper + || block == Blocks.hopper + || block == Blocks.dispenser; +} + + public float getFloatX() { + return this.cachedAngle2; +} + + @EventTarget + public void handleClickMouseEvent(ClickMouseEvent event) { + if (this.evaluateFlag2("Tick")) { + this.performStep2(); + } +} + + public IntProperty getMinAps() { + return this.minAps; +} + + public IntProperty getIntProperty2() { + return this.getMinAps(); +} + + public IntProperty getMaxAps() { + return this.maxAps; +} + + public IntProperty getIntPropertyZ() { + return this.getMaxAps(); +} + + public static void applyInt5(Object[] flowGuardArray) { + objectArray = flowGuardArray; +} + + @EventTarget + public void handleSlowdownEvent(SlowdownEvent event) { + if (this.isReadyState3()) { + event.setCancelled(true); + } +} + + private Float mapEntity3(Entity entity) { + float floatVal = entity instanceof EntityPlayer ? this.computeFloat(((EntityPlayer)entity).inventory.armorInventory) : 99999.0F; + return floatVal; +} + + public StringProperty getAuraSort() { + return this.auraSort; +} + + public StringProperty getStringProperty2() { + return this.getAuraSort(); +} + + private boolean isValidEntity(Entity entity) { + String displayName = entity.getDisplayName().getFormattedText(); + int len2 = displayName.length() - 2; + String textStr = displayName.substring(0, len2); + boolean flag = !textStr.contains("\u00a7"); + int len = displayName.length() - 2; + textStr = displayName.substring(len); + boolean flag2 = textStr.contains("\u00a7"); + if (ServerUtils.isHypixel()) { + HypixelLobbyType lobbyType = HypixelLobbyType.BW; + if (ServerUtils.serverIs(lobbyType) && flag && flag2) { + return true; + } + } + + return false; +} + + public List getList() { + List itemList = this.getListB(this.auraSort.get()); + Stream stream2 = itemList.stream(); + Predicate predicate = (Entity entity2) -> this.mc.thePlayer.computeFloat3(entity2) <= this.computeDoubleValue2(); + Stream stream3 = stream2.filter(predicate); + Collector collector = Collectors.toList(); + return (java.util.List) stream3.collect(collector); +} + + public DoubleProperty getWallRange() { + return this.wallRange; +} + + public DoubleProperty getDoubleProperty2() { + return this.getWallRange(); +} + + public void handleEntity2(Entity entity) { + this.trackedEntity = entity; +} + + public StringProperty getAutoBlockMode() { + return this.autoBlockMode; +} + + public StringProperty getStringProperty3() { + return this.getAutoBlockMode(); +} + + @EventTarget + public void onSetting(SettingEvent event) { + if (event.getSettingName().equals("KA_FILTER")) { + if (this.filters.contains("Teams") && this.trackedEntity != null) { + this.trackedEntity = null; + } + } +} + + private void handleList(List list) { + ViaSupportUtil viaSupport = ViaSupportUtil.getViaSupportUtil(); + if (viaSupport.getStateTicks() > 47) { + Consumer consumer = (Entity entity5) -> { this.sendPacket(new C02PacketUseEntity(entity5, C02PacketUseEntity$Action.ATTACK)); }; + list.forEach(consumer); + this.updateHelper2(); + } else { + this.updateHelper2(); + Consumer consumer2 = (Entity entity6) -> { this.sendPacket(new C02PacketUseEntity(entity6, C02PacketUseEntity$Action.ATTACK)); }; + list.forEach(consumer2); + } + + List itemList = this.getList(); + Consumer consumer3 = this::handleEntity; + itemList.forEach(consumer3); +} + + private void performStep3() { + int ticks = this.stateTicks2 + 1; + List itemList = this.entityList; + this.stateTicks2 = ticks % itemList.size(); + this.timer.reset(); +} + + public IntProperty getFovCheck() { + return this.fovCheck; +} + + public IntProperty getIntProperty3() { + return this.getFovCheck(); +} + + private int computeEntityInt(Entity entity, int value) { + StringProperty strProp = this.espColorType; + if (strProp.equals("Synced")) { + long longVal = value; + return ColorTheme.getHudColor(longVal); + } else { + strProp = this.espColorType; + if (strProp.equals("Custom")) { + ColorProperty colorProp = this.espColor; + Integer color = colorProp.getColorInt(); + return color; + } else if (entity instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer)entity; + Color awtColor = ColorPaletteUtil.checkNetworkPlayerInfo(player); + return awtColor.getRGB(); + } else { + ColorTheme colorTheme = ColorTheme.WHITE; + return colorTheme.getRGB(); + } + } +} + + private void handleSprint(Sprint sprint) { + Entity entity = this.trackedEntity; + EntityPlayerSP player = this.mc.thePlayer; + if (!entity.hitByEntity(player)) { + byte byteVal = 0; + player = this.mc.thePlayer; + int intVal = byteVal + ChestStealerSupport.computeIntFromEntityLivingBase5(player); + entity = this.mc.thePlayer; + if (entity.isConditionMet20()) { + intVal++; + } + + entity = this.mc.thePlayer; + IAttribute iAttribute = SharedMonsterAttributes.attackDamage; + IAttributeInstance iAttributeInstance = ((EntityPlayerSP)entity).getEntityAttribute(iAttribute); + float floatVal = (float)iAttributeInstance.getAttributeValue(); + entity = this.trackedEntity; + player = this.mc.thePlayer; + DamageSource damageSource = DamageSource.causePlayerDamage(player); + boolean flag = entity.attackEntityFrom(damageSource, floatVal); + if (flag && intVal > 0 && !sprint.isReadyState10()) { + this.mc.thePlayer.motionX *= 0.6; + this.mc.thePlayer.motionZ *= 0.6; + entity = this.mc.thePlayer; + entity.applyFlag(false); + } + } +} + + @EventTarget + public void onMotionUpdate2(MotionUpdateEvent event) { + if (event.getState() == State.POST && this.evaluateFlag2("Post")) { + this.performStep2(); + } + + if (this.isReadyState3()) { + StringProperty strProp = this.autoBlockMode; + this.stateFlag = !strProp.equals("Fake"); + StringProperty strProp2 = this.autoBlockMode; + if (strProp2.equals("Pre")) { + if (event.getState() == State.PRE) { + EntityPlayerSP player = this.mc.thePlayer; + this.sendPacketNoEvent(new C08PacketPlayerBlockPlacement(player.getHeldItem())); + } + } else { + strProp2 = this.autoBlockMode; + if (strProp2.equals("Post")) { + if (event.getState() == State.PRE) { + this.callbackTask.run(); + } else { + EntityPlayerSP player2 = this.mc.thePlayer; + this.sendPacketNoEvent(new C08PacketPlayerBlockPlacement(player2.getHeldItem())); + } + } else { + strProp2 = this.autoBlockMode; + if (strProp2.equals("Hypixel")) { + if (event.getState() == State.POST) { + this.sendPacketNoEvent(new C08PacketPlayerBlockPlacement(this.itemStack)); + } + } + } + } + } else if (this.stateFlag) { + StringProperty strProp3 = this.autoBlockMode; + if (strProp3.equals("Hypixel")) { + this.callbackTask2.run(); + } else { + this.callbackTask.run(); + } + + this.stateFlag = false; + } + + if (event.getState() == State.PRE && this.evaluateFlag2("Pre")) { + this.performStep2(); + } +} + + @Override + public void onDisable() { + this.cachedAngle2 = this.mc.thePlayer.rotationYaw; + this.cachedAngle4 = this.mc.thePlayer.rotationPitch; + this.trackedEntity = null; + List itemList = this.entityList; + itemList.clear(); + if (this.stateFlag) { + this.callbackTask2.run(); + this.stateFlag = false; + } + + itemList = this.packetList; + if (!itemList.isEmpty()) { + itemList = this.packetList; + Consumer> consumer = this::handlePacket; + itemList.forEach(consumer); + itemList = this.packetList; + itemList.clear(); + } +} + + private Boolean supplyBoolean10() { + boolean flag; + label12: { + Boolean propFlag = this.showRotationsSettings.get(); + if (propFlag) { + BooleanProperty boolProp = this.rotations; + propFlag = boolProp.get(); + if (propFlag) { + flag = true; + break label12; + } + } + + flag = false; + } + + return flag; +} + + private Boolean supplyBoolean11() { + boolean flag; + label12: { + Boolean propFlag = this.showAutoblockSettings.get(); + if (propFlag) { + BooleanProperty boolProp = this.autoBlock; + propFlag = boolProp.get(); + if (propFlag) { + flag = true; + break label12; + } + } + + flag = false; + } + + return flag; +} + + private double computeDoubleValue2() { + Double propDouble = this.range.get(); + return propDouble; +} + + private boolean matchesEntityPlayer(@NonNull EntityPlayer player) { + return player.inventory.armorInventory[0] != null || player.inventory.armorInventory[1] != null || player.inventory.armorInventory[2] != null || player.inventory.armorInventory[3] != null; +} + + public float getCachedAngle3() { + return this.cachedAngle3; +} + + private static int resolveAuraSortIndex(String value) { + switch (value.hashCode()) { + case 353103893: return value.equals("Distance") ? 0 : -1; + case 63533343: return value.equals("Armor") ? 1 : -1; + case -2137395588: return value.equals("Health") ? 2 : -1; + case 69805: return value.equals("FOV") ? 3 : -1; + case 765499292: return value.equals("HurtTime") ? 4 : -1; + default: return -1; + } +} + + + public net.minecraft.entity.Entity getTrackedEntity() { return this.getTrackedEntity2(); } +} diff --git a/src/main/java/cc/novoline/modules/combat/Killsults.java b/src/main/java/cc/novoline/modules/combat/Killsults.java new file mode 100644 index 0000000..88c5079 --- /dev/null +++ b/src/main/java/cc/novoline/modules/combat/Killsults.java @@ -0,0 +1,296 @@ +package cc.novoline.modules.combat; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.HypixelLobbyType; +import cc.novoline.utils.ServerUtils; +import cc.novoline.utils.StringScrambler; +import cc.novoline.utils.TimerUtil; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.Novoline; +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.LoadWorldEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.PlayerUpdateEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.StringProperty; +import com.google.common.collect.Lists; +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.LinkOption; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.attribute.FileAttribute; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.ThreadLocalRandom; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.util.IChatComponent; + +public class Killsults extends AbstractModule { + @Property("sult-order") + private StringProperty sultOrder; + private List stringList; + private List stringList2; + private Path configPath; + private int stateTicks; + private TimerUtil timer; + + + + @EventTarget + public void onPlayerUpdate(PlayerUpdateEvent event) { + List itemList3 = this.stringList; + Iterator iter = itemList3.iterator(); + + while (true) { + if (!iter.hasNext()) { + return; + } + + String textStr5 = (String)iter.next(); + TimerUtil timerUtil = this.timer; + long longVal = this.computeIntValue(); + if (timerUtil.delay(longVal)) { + StringProperty strProp = this.sultOrder; + String textStr = "Random"; + int intVal; + if (strProp.equals(textStr)) { + ThreadLocalRandom threadLocalRandom = ThreadLocalRandom.current(); + int size2 = this.stringList2.size(); + intVal = threadLocalRandom.nextInt(0, size2); + } else { + intVal = this.stateTicks; + } + + int intVal2 = intVal; + List itemList = this.stringList2; + String textStr2 = (String)itemList.get(intVal2); + String textStr3 = textStr2.replace("%s", textStr5); + StringBuilder sb = new StringBuilder(); + + for (char ch : textStr3.toCharArray()) { + sb.append(ch); + sb.append("\u0702"); + } + + EntityPlayerSP player = this.mc.thePlayer; + String textStr4 = sb.toString(); + player.sendChatMessage(textStr4); + List itemList2 = this.stringList; + itemList2.remove(textStr5); + timerUtil = this.timer; + timerUtil.reset(); + this.stateTicks++; + int ticks = this.stateTicks; + itemList3 = this.stringList2; + if (ticks > itemList3.size() - 1) { + this.stateTicks = 0; + } + } + } +} + + public Killsults(ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + StringProperty strProp = StringProperty.of("Queue"); + String[] stringArr = new String[]{"Queue", "Random"}; + this.sultOrder = strProp.acceptableValues(stringArr); + StringBuilder sb = new StringBuilder(); + Novoline novolineInst = this.novoline; + String pathStr = novolineInst.getDataFolderString(); + StringBuilder sb2 = sb.append(pathStr); + this.configPath = Paths.get(sb2.append("Killsults.novo").toString()); + this.stringList = new ArrayList<>(); + this.timer = new TimerUtil(); + this.stateTicks = 0; + String[] stringArr2 = new String[]{ + "%s aren't u fucking tired of losing? You might as well check out novoline․lol", + "novoline․lol! novoline․lol! novoline․lol!", + "%s how did you click the install button with an aim that bad?", + "%s just got enslaved by novoline․lol", + "Uh-oh, that was kinda fast. see us @ novoline․lol", + "oops mate I was afk sorry for killing you though", + "%s seems like you never checked out novoline․lol, consider doing that", + "%s got beamed by novoline․lol", + "%s wait sorry I didn't notice you there" + }; + this.stringList2 = Lists.newArrayList(stringArr2); + SettingManager.register(new Setting("KS_SULT_ORDER", "Sult Order", SettingType.COMBOBOX, this, this.sultOrder)); + this.performStep5(); +} + + private List getListE() { + File fileObj = new File(this.configPath.toString()); + FileReader fileReader = null; + + try { + fileReader = new FileReader(fileObj); + } catch (FileNotFoundException ex) { + ex.printStackTrace(); + } + + BufferedReader bufferedReader = new BufferedReader(fileReader); + Stream stream = bufferedReader.lines(); + Collector collector = Collectors.toList(); + return (java.util.List) stream.collect(collector); +} + + + private void performStep4() { + File fileObj = new File(this.configPath.toString()); + FileWriter fileWriter = null; + + try { + fileWriter = new FileWriter(fileObj); + } catch (IOException ex) { + ex.printStackTrace(); + } + + BufferedWriter bufferedWriter = new BufferedWriter(fileWriter); + + try { + bufferedWriter.flush(); + Iterator iter = this.stringList2.iterator(); + + while (true) { + if (!iter.hasNext()) { + bufferedWriter.close(); + break; + } + + String textStr = (String)iter.next(); + bufferedWriter.write(new StringBuilder().append(textStr).append("\n").toString()); + } + } catch (IOException ex2) { + ex2.printStackTrace(); + } +} + + private boolean checkString(String text, String[] args) { + return text.contains("KILL!") && args.length < 3; +} + + + private void performStep5() { + Path filePath = this.configPath; + LinkOption[] linkOptionArr = new LinkOption[0]; + if (!Files.exists(filePath, linkOptionArr)) { + try { + filePath = this.configPath; + FileAttribute[] fileAttributeArr = new FileAttribute[0]; + Files.createFile(filePath, fileAttributeArr); + } catch (IOException ex) { + ex.printStackTrace(); + } + } else { + List itemList = this.getListE(); + if (itemList.isEmpty()) { + this.performStep4(); + } else { + this.stringList2 = this.getListE(); + } + } +} + + + @Override + public void onEnable() { + this.performStep5(); +} + + @EventTarget + public void onPacket(PacketEvent event) { + if (event.getState() == State.INCOMING) { + if (event.getPacket() instanceof S02PacketChat) { + S02PacketChat chatPacket = (S02PacketChat)event.getPacket(); + IChatComponent chatComp = chatPacket.getChatComponent(); + String msgText = chatComp.getFormattedText(); + chatComp = chatPacket.getChatComponent(); + String textStr = chatComp.getUnformattedText(); + String textStr2 = StringScrambler.createString(textStr); + String[] strArr = textStr2.split(" "); + String textStr3 = "\u00a7"; + if (msgText.contains(textStr3)) { + HypixelLobbyType lobbyType = HypixelLobbyType.PIT; + if (ServerUtils.serverIs(lobbyType) && this.checkString(msgText, strArr)) { + List itemList = this.stringList; + textStr3 = strArr[0]; + itemList.add(textStr3); + } else { + HypixelLobbyType lobbyType2 = HypixelLobbyType.SW; + if (ServerUtils.serverIs(lobbyType2) && this.checkCondition(msgText, strArr)) { + List itemList2 = this.stringList; + textStr3 = strArr[0]; + itemList2.add(textStr3); + } + } + } + } + } else { + if (event.getPacket() instanceof C01PacketChatMessage) { + TimerUtil timerUtil = this.timer; + timerUtil.reset(); + } + } +} + + private boolean checkCondition(String text, String[] args) { + String nameStr = this.mc.thePlayer.getName(); + if (text.contains(nameStr) && !args[0].equals(this.mc.thePlayer.getName())) { + if (text.contains("was killed by")) { + return true; + } + + if (text.contains("was thrown into the void by")) { + return true; + } + } + + return false; +} + + @Override + public void onDisable() { + List itemList = this.stringList; + itemList.clear(); + this.stateTicks = 0; +} + + @EventTarget + public void onLoadWorld(LoadWorldEvent event) { + List itemList = this.stringList; + itemList.clear(); + this.stateTicks = 0; +} + + private int computeIntValue() { + IChatComponent chatComp = this.mc.thePlayer.getDisplayName(); + String msgText = chatComp.getFormattedText(); + if (!msgText.contains("VIP")) { + if (!msgText.contains("MVP")) { + return 3050; + } + } + + return 1050; +} + +} diff --git a/src/main/java/cc/novoline/modules/combat/Reach.java b/src/main/java/cc/novoline/modules/combat/Reach.java new file mode 100644 index 0000000..05fcad9 --- /dev/null +++ b/src/main/java/cc/novoline/modules/combat/Reach.java @@ -0,0 +1,32 @@ +package cc.novoline.modules.combat; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.FloatProperty; +import cc.novoline.modules.ModuleManager; + +public final class Reach extends AbstractModule { + private boolean stateFlag; + @Property("range") + private final FloatProperty range; + + + public float getFloatValue() { + Float propFloat = this.range.get(); + return propFloat; +} + + + public Reach(ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + this.range = FloatProperty.of(5.0F).minimum(3.0F).maximum(5.0F); + SettingManager.register(new Setting("Reach_Distance", "Range", SettingType.SLIDER, this, this.range, 0.1)); +} + + +} diff --git a/src/main/java/cc/novoline/modules/combat/TargetHUD.java b/src/main/java/cc/novoline/modules/combat/TargetHUD.java new file mode 100644 index 0000000..73662ba --- /dev/null +++ b/src/main/java/cc/novoline/modules/combat/TargetHUD.java @@ -0,0 +1,544 @@ +package cc.novoline.modules.combat; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.modules.configurations.util.TargetHudCard; +import cc.novoline.modules.configurations.util.TargetHudParticle; +import cc.novoline.modules.configurations.util.AnimatedColorBar; +import cc.novoline.utils.RenderUtils; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.PlayerUpdateEvent; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.events.events.RenderGuiEvent; +import cc.novoline.events.events.ShaderEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.ModuleRegistry; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Toolkit; +import javax.vecmath.Vector4d; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; + +public class TargetHUD extends AbstractModule { + @Property("shaders") + private ListProperty shaders; + @Property("pos-x") + private DoubleProperty posX; + @Property("roundness") + private IntProperty roundness; + @Property("drop-effect-quantity") + private IntProperty dropEffectQuantity; + private double cachedValue; + private Dimension dimensionField; + @Property("draw-drop-effect") + private BooleanProperty drawDropEffect; + private TargetHudParticle targetHudParticleField; + @Property("color") + private ColorProperty color; + @Property("follow-player") + private BooleanProperty followPlayer; + @Property("color-type") + private StringProperty colorType; + @Property("show-health-value") + private BooleanProperty showHealthValue; + @Property("smoothness") + private IntProperty smoothness; + @Property("pos-y") + private DoubleProperty posY; + private TargetHudCard targetHudCardField; + @Property("color-end") + private ColorProperty colorEnd; + @Property("alpha") + private IntProperty alpha; + private double cachedValue2; + @Property("drop-effect-mode") + private StringProperty dropEffectMode; + private double cachedValue3; + private boolean stateFlag; + @Property("color-begin") + private ColorProperty colorBegin; + private double cachedValue4; + @Property("style") + private StringProperty style; + private KillAura killAuraModule; + private AnimatedColorBar animatedColorBarField; + + public static Minecraft resolveMinecraft(TargetHUD targetHUD) { + return targetHUD.mc; +} + + public void performStep6() { + StringProperty strProp = this.style; + if (strProp.equals("Fancy")) { + this.targetHudParticleField.performAction2(); + } else { + strProp = this.style; + if (strProp.equals("Basic")) { + this.animatedColorBarField.performAction(); + } else { + strProp = this.style; + if (strProp.equals("Legacy")) { + this.targetHudCardField.performAction3(); + } + } + } +} + + public static boolean checkTargetHUD(TargetHUD targetHUD) { + return targetHUD.stateFlag; +} + + private boolean isReadyState4() { + KillAura killAura = this.killAuraModule; + if (!killAura.isReadyState2()) { + killAura = this.killAuraModule; + if (!killAura.isReadyState3()) { + return false; + } + } + + killAura = this.killAuraModule; + return killAura.getEntityPlayerW() != null; +} + + public static Minecraft resolveMinecraft2(TargetHUD targetHUD) { + return targetHUD.mc; +} + + public static Minecraft resolveMinecraft3(TargetHUD targetHUD) { + return targetHUD.mc; +} + + private Boolean supplyBoolean() { + StringProperty strProp = this.colorType; + return !strProp.equals("Fade"); +} + + public static Minecraft resolveMinecraft4(TargetHUD targetHUD) { + return targetHUD.mc; +} + + + public void handleEntityPlayer(EntityPlayer player) { + StringProperty strProp = this.style; + if (strProp.equals("Fancy")) { + this.targetHudParticleField.applyEntityPlayer(player); + } else { + strProp = this.style; + if (strProp.equals("Basic")) { + this.animatedColorBarField.applyEntityPlayer(player); + } else { + strProp = this.style; + if (strProp.equals("Legacy")) { + this.targetHudCardField.applyEntityPlayer(player); + } + } + } +} + + @EventTarget + public void onPlayerUpdate(PlayerUpdateEvent event) { + if (this.isReadyState4()) { + this.handleEntityPlayer(this.killAuraModule.getEntityPlayerW()); + } +} + + private boolean checkState3() { + return true; +} + + public void updateHelper2() { + StringProperty strProp = this.style; + if (strProp.equals("Fancy")) { + this.targetHudParticleField.performAction5(); + } else { + strProp = this.style; + if (strProp.equals("Basic")) { + this.animatedColorBarField.performAction2(); + } else { + strProp = this.style; + if (strProp.equals("Legacy")) { + this.targetHudCardField.performAction2(); + } + } + } +} + + public void handleKillAura(KillAura killAura) { + this.killAuraModule = killAura; +} + + public static Minecraft resolveMinecraft5(TargetHUD targetHUD) { + return targetHUD.mc; +} + + public static Minecraft resolveMinecraft6(TargetHUD targetHUD) { + return targetHUD.mc; +} + + public static boolean checkTargetHUD2(TargetHUD targetHUD) { + return targetHUD.isReadyState4(); +} + + public static DoubleProperty resolveDoubleProperty(TargetHUD targetHUD) { + return targetHUD.posY; +} + + public static Minecraft resolveMinecraft7(TargetHUD targetHUD) { + return targetHUD.mc; +} + + public static IntProperty resolveIntProperty(TargetHUD targetHUD) { + return targetHUD.roundness; +} + + public void performStep7() { + StringProperty strProp = this.style; + if (strProp.equals("Fancy")) { + this.targetHudParticleField.performAction4(); + } else { + strProp = this.style; + if (strProp.equals("Basic")) { + this.animatedColorBarField.performAction5(); + } + } +} + + public void handleRenderGuiEvent(RenderGuiEvent event) { + StringProperty strProp = this.style; + if (strProp.equals("Fancy")) { + this.targetHudParticleField.applyUpdate(event); + } else { + strProp = this.style; + if (strProp.equals("Basic")) { + this.animatedColorBarField.evaluateInt(event); + } else { + strProp = this.style; + if (strProp.equals("Legacy")) { + this.targetHudCardField.evaluateDouble(event); + } + } + } +} + + private Boolean supplyBoolean2() { + boolean flag; + label12: { + if (!this.style.equals("Basic")) { + StringProperty strProp = this.style; + if (!strProp.equals("Fancy")) { + flag = false; + break label12; + } + } + + flag = true; + } + + return flag; +} + + @Override + public void onDisable() { + this.performStep8(); +} + + public static Minecraft resolveMinecraft13(TargetHUD targetHUD) { + return targetHUD.mc; +} + + public void performStep8() { + StringProperty strProp = this.style; + if (strProp.equals("Fancy")) { + this.targetHudParticleField.performAction3(); + } else { + strProp = this.style; + if (strProp.equals("Basic")) { + this.animatedColorBarField.performAction4(); + } else { + strProp = this.style; + if (strProp.equals("Legacy")) { + this.targetHudCardField.performAction4(); + } + } + } +} + + public static IntProperty resolveIntProperty2(TargetHUD targetHUD) { + return targetHUD.dropEffectQuantity; +} + + @EventTarget + public void onRender2D2(Render2DEvent event) { + if (this.mc.currentScreen instanceof GuiChat) { + DoubleProperty doubleProp = this.posX; + Double propDouble = doubleProp.get(); + this.cachedValue = propDouble; + doubleProp = this.posY; + Double propDouble2 = doubleProp.get(); + this.cachedValue3 = propDouble2; + } else if (this.isReadyState4()) { + KillAura killAura = ModuleRegistry.KILLAURA.getModule(); + ScaledResolution scaledRes = new ScaledResolution(this.mc); + Entity entity = killAura.getTrackedEntity(); + int intVal = scaledRes.getScaleFactor(); + Vector4d vector4d = RenderUtils.projectEntity2D(entity, intVal); + if (vector4d != null) { + BooleanProperty boolProp = this.followPlayer; + Boolean propFlag = boolProp.get(); + if (propFlag) { + this.cachedValue = (int)vector4d.z; + this.cachedValue3 = (int)(vector4d.w - (vector4d.w - vector4d.y) * 0.5); + return; + } + } + + DoubleProperty doubleProp2 = this.posX; + Double propDouble3 = doubleProp2.get(); + this.cachedValue = propDouble3; + DoubleProperty doubleProp3 = this.posY; + Double propDouble4 = doubleProp3.get(); + this.cachedValue3 = propDouble4; + } +} + + public static Minecraft resolveMinecraft8(TargetHUD targetHUD) { + return targetHUD.mc; +} + + private Boolean lambdaImpl$new$0() { + boolean flag; + label12: { + if (!this.style.equals("Basic")) { + StringProperty strProp = this.style; + if (!strProp.equals("Fancy")) { + flag = false; + break label12; + } + } + + flag = true; + } + + return flag; +} + + private Boolean supplyBoolean4() { + StringProperty strProp = this.style; + return !strProp.equals("Legacy"); +} + + public static Minecraft resolveMinecraft9(TargetHUD targetHUD) { + return targetHUD.mc; +} + + public TargetHUD(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.dimensionField = Toolkit.getDefaultToolkit().getScreenSize(); + this.cachedValue2 = this.dimensionField.getWidth() * 0.5; + this.cachedValue4 = this.dimensionField.getHeight() * 0.5; + this.targetHudParticleField = new TargetHudParticle(this, null); + this.animatedColorBarField = new AnimatedColorBar(this, null); + this.targetHudCardField = new TargetHudCard(this, null); + double doubleVal8 = this.cachedValue2 * 0.5 - 40.0; + Double doubleVal = doubleVal8; + DoubleProperty doubleProp2 = DoubleProperty.of(doubleVal).minimum(0.0); + double doubleVal2 = this.cachedValue2; + Double doubleVal3 = doubleVal2; + this.posX = doubleProp2.maximum(doubleVal3); + double doubleVal4 = this.cachedValue4 - 140.0; + Double doubleVal5 = doubleVal4; + DoubleProperty doubleProp4 = DoubleProperty.of(doubleVal5).minimum(0.0); + double doubleVal6 = this.cachedValue4; + Double doubleVal7 = doubleVal6; + this.posY = doubleProp4.maximum(doubleVal7); + StringProperty strProp = StringProperty.of("Fancy"); + String[] stringArr = new String[]{"Basic", "Fancy", "Legacy"}; + this.style = strProp.acceptableValues(stringArr); + ListProperty listProp = ListProperty.of("Glow", "Blur"); + String[] stringArr2 = new String[]{"Glow", "Blur"}; + this.shaders = listProp.acceptableValues((Object[])stringArr2); + this.alpha = IntProperty.of(100).minimum(50).maximum(255); + this.roundness = IntProperty.of(8).minimum(0).maximum(16); + this.smoothness = IntProperty.of(8).minimum(0).maximum(16); + StringProperty strProp2 = StringProperty.of("Fade"); + String[] stringArr3 = new String[]{"Static", "Breath", "Fade"}; + this.colorType = strProp2.acceptableValues(stringArr3); + Color awtColor = new Color(150, 200, 0, 255); + int color2 = awtColor.getRGB(); + Integer intVal = color2; + this.color = ColorProperty.e(intVal); + Color awtColor2 = new Color(150, 200, 0, 255); + int color3 = awtColor2.getRGB(); + Integer intVal2 = color3; + this.colorBegin = ColorProperty.e(intVal2); + Color awtColor3 = new Color(200, 150, 0, 255); + int color4 = awtColor3.getRGB(); + Integer intVal3 = color4; + this.colorEnd = ColorProperty.e(intVal3); + this.drawDropEffect = BooleanProperty.of(true); + StringProperty strProp3 = StringProperty.of("Circle"); + String[] stringArr4 = new String[]{"Circle", "Square"}; + this.dropEffectMode = strProp3.acceptableValues(stringArr4); + this.dropEffectQuantity = IntProperty.of(6).minimum(4).maximum(16); + this.showHealthValue = BooleanProperty.of(true); + this.followPlayer = BooleanProperty.of(false); + Setting setting = new Setting("TH_STYLE", "Style", SettingType.COMBOBOX, this, this.style); + SettingManager.register(setting); + Setting setting2 = new Setting("TH_FOLLOW_PLAYER", "Follow Player", SettingType.CHECKBOX, this, this.followPlayer); + SettingManager.register(setting2); + Setting setting3 = new Setting("TH_BACKGROUND_ALPHA", "Background Alpha", SettingType.SLIDER, this, this.alpha, 5.0, this::lambdaImpl$new$0); + SettingManager.register(setting3); + Setting setting4 = new Setting("TH_BACKGROUND_ROUNDNESS", "Roundness", SettingType.SLIDER, this, this.roundness, 1.0, this::supplyBoolean4); + SettingManager.register(setting4); + Setting setting5 = new Setting("TH_SHOW_HEALTH_VALUE", "Health Value", SettingType.CHECKBOX, this, this.showHealthValue, () -> this.style.equals("Fancy")); + SettingManager.register(setting5); + Setting setting6 = new Setting("TH_BACKGROUND_SMOOTHNESS", "Smoothness", SettingType.SLIDER, this, this.smoothness, 1.0, () -> this.style.equals("Basic")); + SettingManager.register(setting6); + Setting setting7 = new Setting("TH_COLOR_TYPE", "Color Type", SettingType.COMBOBOX, this, this.colorType); + SettingManager.register(setting7); + Setting setting8 = new Setting("TH_COLOR_STATIC", "Color", SettingType.COLOR_PICKER, this, this.color, null, this::supplyBoolean); + SettingManager.register(setting8); + setting8 = new Setting("TH_COLOR_BEGIN", "Fade Begin Color", SettingType.COLOR_PICKER, this, this.colorBegin, null, () -> this.colorType.equals("Fade")); + SettingManager.register(setting8); + setting8 = new Setting("TH_COLOR_END", "Fade End Color", SettingType.COLOR_PICKER, this, this.colorEnd, null, () -> this.colorType.equals("Fade")); + SettingManager.register(setting8); + setting8 = new Setting("TH_SHADERS", "Shaders", SettingType.SELECTBOX, this, this.shaders, this::supplyBoolean2); + SettingManager.register(setting8); + setting8 = new Setting("TH_DROP_EFFECT", "Drop Effect", SettingType.CHECKBOX, this, this.drawDropEffect); + SettingManager.register(setting8); + setting8 = new Setting("TH_DROP_EFFECT_TYPE", "Drop Type", SettingType.COMBOBOX, this, this.dropEffectMode, this::supplyBoolean5); + SettingManager.register(setting8); + setting8 = new Setting("TH_DROP_EFFECT_SIZE", "Drop Size", SettingType.SLIDER, this, this.dropEffectQuantity, 1.0, this.drawDropEffect::get); + SettingManager.register(setting8); +} + + public static Minecraft resolveMinecraft10(TargetHUD targetHUD) { + return targetHUD.mc; +} + + + public static BooleanProperty resolveBooleanProperty(TargetHUD targetHUD) { + return targetHUD.showHealthValue; +} + + @EventTarget + public void onRenderGui(RenderGuiEvent event) { + this.handleRenderGuiEvent(event); +} + + @EventTarget + public void onRender2D1(Render2DEvent event) { + if (this.isReadyState4()) { + if (!this.stateFlag) { + this.performStep6(); + } + + this.updateHelper2(); + this.stateFlag = true; + } else if (this.stateFlag && !(this.mc.currentScreen instanceof GuiChat)) { + this.performStep8(); + this.updateHelper2(); + this.stateFlag = false; + } + + this.updateHelper3(); +} + + public static Minecraft resolveMinecraft11(TargetHUD targetHUD) { + return targetHUD.mc; +} + + public static StringProperty resolveStringProperty(TargetHUD targetHUD) { + return targetHUD.colorType; +} + + public static ColorProperty resolveColorProperty(TargetHUD targetHUD) { + return targetHUD.color; +} + + private Boolean supplyBoolean5() { + boolean flag; + label12: { + Boolean propFlag = this.drawDropEffect.get(); + if (propFlag) { + StringProperty strProp = this.style; + if (!strProp.equals("Legacy")) { + flag = true; + break label12; + } + } + + flag = false; + } + + return flag; +} + + public void updateHelper3() { + StringProperty strProp = this.style; + if (strProp.equals("Fancy") && this.targetHudParticleField.getSmoothAnimation().getCachedValue2() <= 0.05) { + this.targetHudParticleField.performAction(); + } else { + strProp = this.style; + if (strProp.equals("Basic") && this.animatedColorBarField.getSmoothAnim().getCachedValue2() <= 0.05) { + this.animatedColorBarField.performAction3(); + } else { + strProp = this.style; + if (strProp.equals("Legacy") && this.targetHudCardField.getSmoothAnim().getCachedValue2() <= 0.05) { + this.targetHudCardField.performAction(); + } + } + } +} + + public static Minecraft resolveMinecraft12(TargetHUD targetHUD) { + return targetHUD.mc; +} + + @EventTarget + public void onShader(ShaderEvent event) { + if (this.shaders.contains("Blur")) { + this.performStep7(); + } +} + + + public static DoubleProperty resolveDoubleProperty2(TargetHUD targetHUD) { + return targetHUD.posX; +} + + + public cc.novoline.modules.configurations.property.object.IntProperty getSmoothness() { return this.smoothness; } + public boolean getStateFlag() { return this.stateFlag; } + public cc.novoline.modules.configurations.property.object.ListProperty getShaders() { return this.shaders; } + public cc.novoline.modules.configurations.property.object.ColorProperty getColorBegin() { return this.colorBegin; } + public cc.novoline.modules.configurations.property.object.BooleanProperty getDrawDropEffect() { return this.drawDropEffect; } + public cc.novoline.modules.configurations.property.object.StringProperty getDropEffectMode() { return this.dropEffectMode; } + public cc.novoline.modules.configurations.property.object.IntProperty getAlpha() { return this.alpha; } + public cc.novoline.modules.configurations.property.object.DoubleProperty getPosY() { return this.posY; } + public cc.novoline.modules.configurations.property.object.IntProperty getRoundness() { return this.roundness; } + public double getCachedValue() { return this.cachedValue; } + public cc.novoline.modules.configurations.property.object.IntProperty getDropEffectQuantity() { return this.dropEffectQuantity; } + public double getCachedValue3() { return this.cachedValue3; } + public cc.novoline.modules.configurations.property.object.ColorProperty getColorEnd() { return this.colorEnd; } + public cc.novoline.modules.configurations.property.object.BooleanProperty getShowHealthValue() { return this.showHealthValue; } + public cc.novoline.modules.configurations.property.object.StringProperty getColorType() { return this.colorType; } + public cc.novoline.modules.configurations.property.object.ColorProperty getColor() { return this.color; } + public cc.novoline.modules.configurations.property.object.DoubleProperty getPosX() { return this.posX; } +} diff --git a/src/main/java/cc/novoline/modules/combat/Velocity.java b/src/main/java/cc/novoline/modules/combat/Velocity.java new file mode 100644 index 0000000..690acf9 --- /dev/null +++ b/src/main/java/cc/novoline/modules/combat/Velocity.java @@ -0,0 +1,188 @@ +package cc.novoline.modules.combat; + +import cc.novoline.events.events.JumpEvent; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.TimerUtil; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.SettingEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.exploits.NoFall; +import cc.novoline.modules.ModuleRegistry; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.client.entity.EntityPlayerSP; + +public final class Velocity extends AbstractModule { + @Property("horizontal") + private IntProperty horizontal; + @Property("mode") + private StringProperty mode; + @Property("velocity-delay") + private IntProperty velocityDelay; + private double cachedValue; + @Property("vertical") + private IntProperty vertical; + private double cachedValue2; + private TimerUtil timer; + private double cachedValue3; + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + StringBuilder sb = new StringBuilder(); + Object obj = this.horizontal.get(); + sb = sb.append((Object)obj); + obj = "% "; + sb = sb.append((String)obj); + IntProperty intProp = this.vertical; + obj = intProp.get(); + sb = sb.append(obj); + obj = "%"; + this.handleString3(sb.append((String)obj).toString()); +} + + + @Override + public void onEnable() { + StringBuilder sb = new StringBuilder(); + Object obj = this.horizontal.get(); + sb = sb.append((Object)obj); + obj = "% "; + sb = sb.append((String)obj); + IntProperty intProp = this.vertical; + obj = intProp.get(); + sb = sb.append(obj); + obj = "%"; + this.handleString3(sb.append((String)obj).toString()); +} + + + public StringProperty getMode() { + return this.mode; +} + + public StringProperty getStringProperty() { + return this.getMode(); +} + + + @EventTarget + private void onPacket(PacketEvent event) { + if (event.getState().equals(State.INCOMING)) { + if (event.getPacket() instanceof S12PacketEntityVelocity) { + S12PacketEntityVelocity entityVelocityPacket = (S12PacketEntityVelocity)event.getPacket(); + int intVal5 = entityVelocityPacket.getEntityID(); + EntityPlayerSP player = this.mc.thePlayer; + if (intVal5 == player.getEntityId()) { + this.cachedValue = this.cachedValue3 = this.cachedValue2 = 0.0; + event.setCancelled(true); + ModuleRegistry modEntry = ModuleRegistry.NOFALL; + NoFall noFall = modEntry.getModule(); + if (noFall.isEnabled() && noFall.checkState6() || this.isEnabled(ModuleRegistry.LONGJUMP) || this.isEnabled(ModuleRegistry.FIREBALL)) { + return; + } + + IntProperty intProp = this.horizontal; + Integer intVal = intProp.get(); + int intVal2 = intVal; + IntProperty intProp2 = this.vertical; + intVal = intProp2.get(); + int intVal3 = intVal; + this.cachedValue = intVal2 == 0 ? this.mc.thePlayer.motionX : entityVelocityPacket.computeDouble3() / 100.0 * intVal2; + this.cachedValue3 = intVal3 == 0 ? this.mc.thePlayer.motionY : entityVelocityPacket.computeDouble() / 100.0 * intVal3; + this.cachedValue2 = intVal2 == 0 ? this.mc.thePlayer.motionZ : entityVelocityPacket.computeDouble2() / 100.0 * intVal2; + StringProperty strProp = this.mode; + switch (resolveVelocityModeIndex((String)strProp.get())) { + case 0: + TimerUtil timerUtil = this.timer; + IntProperty intProp3 = this.velocityDelay; + Integer intVal4 = intProp3.get(); + long longVal = intVal4 - 10; + if (timerUtil.delay(longVal)) { + this.mc.thePlayer.motionX = this.cachedValue; + this.mc.thePlayer.motionY = this.cachedValue3; + this.mc.thePlayer.motionZ = this.cachedValue2; + TimerUtil timerUtil2 = this.timer; + timerUtil2.reset(); + } + break; + case 1: + if (this.mc.thePlayer.onGround) { + this.mc.thePlayer.motionX = this.cachedValue; + this.mc.thePlayer.motionY = this.cachedValue3; + this.mc.thePlayer.motionZ = this.cachedValue2; + this.cachedValue3 = 0.0; + } + break; + case 2: + this.mc.thePlayer.motionX = this.cachedValue; + this.mc.thePlayer.motionY = this.cachedValue3; + this.mc.thePlayer.motionZ = this.cachedValue2; + } + } + } + } +} + + @EventTarget + public void handleJumpEvent(JumpEvent event) { + if (this.mode.equals("OnGround") && this.cachedValue3 > 0.0) { + if (this.mc.thePlayer.intState9 < 12) { + event.applyUpdate(this.cachedValue3); + } + + this.cachedValue3 = 0.0; + } +} + + public Velocity(ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + StringProperty strProp = StringProperty.of("Basic"); + String[] stringArr = new String[]{"Delay", "Basic", "OnGround"}; + this.mode = strProp.acceptableValues(stringArr); + this.velocityDelay = IntProperty.of(400).minimum(200).maximum(1000); + this.horizontal = IntProperty.of(0).minimum(-100).maximum(100); + this.vertical = IntProperty.of(100).minimum(0).maximum(100); + this.timer = new TimerUtil(); + Setting setting = new Setting("VEL_MODE", "Mode", SettingType.COMBOBOX, this, this.mode); + SettingManager.register(setting); + setting = new Setting("VEL_DELAY", "Velocity Tick", SettingType.SLIDER, this, this.velocityDelay, 50.0, "ms", () -> this.mode.equals("Delay")); + SettingManager.register(setting); + setting = new Setting("VEL_HOR", "Horizontal", SettingType.SLIDER, this, this.horizontal, 5.0, "%"); + SettingManager.register(setting); + setting = new Setting("VEL_VER", "Vertical", SettingType.SLIDER, this, this.vertical, 5.0, "%"); + SettingManager.register(setting); +} + + + public void handleSettingEvent(SettingEvent event) { + if (event == null || event.getSettingName().equals("VEL_VER")) { + IntProperty intProp = this.vertical; + Integer intVal = intProp.get(); + if (intVal < 100) { + intProp = this.vertical; + Integer intVal2 = 100; + intProp.set(intVal2); + } + } +} + + private static int resolveVelocityModeIndex(String value) { + switch (value.hashCode()) { + case 65915235: return value.equals("Delay") ? 0 : -1; + case 1225593958: return value.equals("OnGround") ? 1 : -1; + case 63955982: return value.equals("Basic") ? 2 : -1; + default: return -1; + } +} + +} diff --git a/src/main/java/cc/novoline/modules/configurations/ConfigManager.java b/src/main/java/cc/novoline/modules/configurations/ConfigManager.java new file mode 100644 index 0000000..5f69fcc --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/ConfigManager.java @@ -0,0 +1,654 @@ +package cc.novoline.modules.configurations; + +import cc.novoline.commands.util.ConfigReadWriteException; +import cc.novoline.commands.util.ConfigCommandException; +import cc.novoline.modules.configurations.holder.GenericRmTypeToken; +import cc.novoline.modules.configurations.holder.StoringModuleHolder; +import cc.novoline.modules.configurations.util.PropertyFieldBinding; +import cc.novoline.modules.configurations.util.ModuleMapSerializer; +import cc.novoline.modules.configurations.util.ConfigRootSnapshot; +import cc.novoline.modules.configurations.util.DelsyConfigSerializer; + +import cc.novoline.Novoline; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.DelsyConfig; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.visual.ClickGui; +import cc.novoline.modules.visual.HUD; +import com.google.common.reflect.TypeToken; +import cc.novoline.modules.configurations.holder.ModuleHolder; +import cc.novoline.modules.ModuleRegistry; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import it.unimi.dsi.fastutil.objects.ObjectCollection; +import it.unimi.dsi.fastutil.objects.ObjectIterator; +import java.io.BufferedWriter; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.StringWriter; +import java.nio.file.CopyOption; +import java.nio.file.FileAlreadyExistsException; +import java.nio.file.FileVisitOption; +import java.nio.file.Files; +import java.nio.file.LinkOption; +import java.nio.file.Path; +import java.nio.file.attribute.FileAttribute; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.function.Supplier; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import cc.novoline.modules.ModuleArrayMap; +import cc.novoline.modules.ModuleManager; +import ninja.leaping.configurate.objectmapping.serialize.TypeSerializerUnabletodeseJsonAdapter; +import ninja.leaping.configurate.util.ConfigurateCodec; +import ninja.leaping.configurate.objectmapping.ObjectMappingException; +import ninja.leaping.configurate.ConfigurationNode; +import ninja.leaping.configurate.ConfigurationOptions; +import ninja.leaping.configurate.objectmapping.serialize.TypeSerializerCollection; +import ninja.leaping.configurate.hocon.HoconConfigurationLoader; +import cc.novoline.modules.configurations.holder.SavingModuleHolderSupport; +import ninja.leaping.configurate.util.PlayerManagerTypeSerializerHelper; +import org.apache.logging.log4j.Logger; +import org.jetbrains.annotations.NotNull; + +public final class ConfigManager { + private final int stateTicks; + private static String[] b; + private static final String CONST_STRING = ".novo"; + private final ModuleManager moduleManagerField; + public boolean c; + private static final long XOR_KEY = 47318893455125L; + private static ConfigurationOptions d; + + static { + if (d() == null) { + b(new String[3]); + } + } + + public ConfigManager(@NotNull ModuleManager moduleManager, int value) { + this.moduleManagerField = moduleManager; + this.stateTicks = value; + } + + private static boolean lambdaImpl$defaultOptions$4(TypeToken typeToken) { + String[] stringArr = d(); + Class clazz = typeToken.getRawType(); + String[] stringArr2 = stringArr; + + label35: + while (true) { + boolean flag2; + if (!(flag2 = clazz.isAnnotationPresent(DelsyConfig.class))) { + clazz = clazz.getSuperclass(); + } + + boolean flag3 = flag2; + + while (stringArr2 != null) { + label30: + if (!flag3) { + Class clazz2 = clazz; + if (clazz == null) { + break label30; + } + + clazz2 = clazz.getSuperclass(); + + if (clazz2 != null) { + continue label35; + } + } + + flag3 = flag2; + return flag2; + } + + return flag3; + } + } + + private static boolean lambdaImpl$getConfigs$1(Path path) { + LinkOption[] linkOptionArr = new LinkOption[0]; + return Files.isRegularFile(path, linkOptionArr); + } + + @NotNull + private ConfigurationOptions c() { + ConfigurationOptions configurationOptions = d; + if (d == null) { + ConfigurationOptions configurationOptions2 = ConfigurationOptions.d().a(new ConfigurateCodec()); + TypeSerializerCollection typeSerializerCollection = PlayerManagerTypeSerializerHelper.a(); + GenericRmTypeToken genericRmTypeToken = new GenericRmTypeToken(this); + TypeSerializerUnabletodeseJsonAdapter val = new TypeSerializerUnabletodeseJsonAdapter(); + typeSerializerCollection.a(genericRmTypeToken, val); + TypeToken typeToken = TypeToken.of(ModuleArrayMap.class); + ModuleManager modManager = this.moduleManagerField; + ModuleMapSerializer moduleMapSerializer = new ModuleMapSerializer(modManager); + typeSerializerCollection.a(typeToken, moduleMapSerializer); + Predicate predicate = ConfigManager::lambdaImpl$defaultOptions$4; + DelsyConfigSerializer delsyConfigSerializer = new DelsyConfigSerializer(this.moduleManagerField); + typeSerializerCollection.a((java.util.function.Predicate) predicate, delsyConfigSerializer); + TypeSerializerCollection typeSerializerCollection2 = PlayerManagerTypeSerializerHelper.b(); + typeSerializerCollection = typeSerializerCollection2.a(typeSerializerCollection); + configurationOptions2 = configurationOptions2.a(typeSerializerCollection); + d = configurationOptions2; + return configurationOptions2; + } + + configurationOptions = d; + + return configurationOptions; + } + + public String a(@NotNull String text) throws IOException, ObjectMappingException { + Path filePath = this.d(text); + StringWriter stringWriter = new StringWriter(); + ConfigurationOptions configurationOptions = this.c(); + HoconConfigurationLoader hoconConfigurationLoader = HoconConfigurationLoader.getConfigManagerSupport().a(configurationOptions).a(filePath).a($lambdaCapture$1(stringWriter)).getHoconConfigurationLoader(); + + ConfigurationNode configurationNode; + try { + configurationNode = hoconConfigurationLoader.a(configurationOptions); + } catch (IOException ex) { + throw new ConfigReadWriteException(ex); + } + + ConfigRootSnapshot configRootSnapshot3 = ConfigRootSnapshot.resolveConfigRootSnapshot2(this, text); + TypeToken typeToken = TypeToken.of(ConfigRootSnapshot.class); + configurationNode.resolveConfigurationNode(typeToken, configRootSnapshot3); + hoconConfigurationLoader.a(configurationNode); + return stringWriter.toString(); + } + + public static String b() { + return ".novo"; + } + + private static String lambdaImpl$getConfigs$3(String text) { + int intVal = text.length(); + String textStr = ".novo"; + intVal -= textStr.length(); + return text.substring(0, intVal); + } + + public boolean c(@NotNull String text) throws IOException { + Path filePath = this.d(text); + LinkOption[] linkOptionArr2 = new LinkOption[0]; + boolean flag4 = Files.notExists(filePath, linkOptionArr2); + if (flag4) { + throw new FileNotFoundException(); + } + + Files.deleteIfExists(filePath); + flag4 = true; + + return flag4; + } + + public void a(@NotNull String text, boolean flag, EnumModuleType[] enumModuleTypeArray) throws IOException, ObjectMappingException { + Path filePath = this.d(text); + this.a(filePath, flag, enumModuleTypeArray); + ModuleRegistry modEntry = ModuleRegistry.CLICKGUI; + ClickGui clickGuiMod = modEntry.getModule(); + modEntry = ModuleRegistry.HUD; + HUD hudMod = modEntry.getModule(); + DoubleProperty doubleProp = clickGuiMod.getDoublePropertyW(); + Double val2 = doubleProp.get(); + clickGuiMod.applyInt5(val2); + this.c = true; + } + + @NotNull + public ModuleManager g() { + return this.moduleManagerField; + } + + public static void b(String[] args) { + b = args; + } + + public void a(@NotNull String text, boolean flag) throws IOException, ObjectMappingException { + label17: { + Path filePath = this.d(text); + this.a(filePath, flag); + ModuleRegistry modEntry = ModuleRegistry.CLICKGUI; + ClickGui clickGuiMod = modEntry.getModule(); + ModuleRegistry modEntry2 = ModuleRegistry.HUD; + HUD hudMod = modEntry2.getModule(); + ClickGui clickGuiMod2 = clickGuiMod; + StringProperty strProp = clickGuiMod.getStringProperty7(); + if (strProp.equals("Crystal")) { + DoubleProperty doubleProp = clickGuiMod.getDoublePropertyK(); + Double val3 = doubleProp.get(); + clickGuiMod.applyInt5(val3); + break label17; + } + + clickGuiMod2 = clickGuiMod; + + DoubleProperty doubleProp2 = clickGuiMod.getDoublePropertyW(); + Double val4 = doubleProp2.get(); + clickGuiMod2.applyInt5(val4); + } + + this.c = true; + } + + @NotNull + public Path d(@NotNull String text) { + SavingModuleHolderSupport.applyUpdate(text, "name"); + Path filePath = this.f(); + StringBuilder sb = new StringBuilder(); + StringBuilder sb2 = sb.append(text); + return filePath.resolve(sb2.append(".novo").toString()); + } + + + + public void a(@NotNull Path path, boolean flag, EnumModuleType[] enumModuleTypeArray) throws IOException, ObjectMappingException { + ObjectIterator objectIterator; + String[] stringArr = d(); + LinkOption[] linkOptionArr3 = new LinkOption[0]; + if (Files.notExists(path, linkOptionArr3)) { + throw new FileNotFoundException("file doesn't exist"); + } + + ConfigurationOptions configurationOptions = this.c(); + HoconConfigurationLoader hoconConfigurationLoader = HoconConfigurationLoader.getConfigManagerSupport().a(configurationOptions).a(path).getHoconConfigurationLoader(); + + ConfigurationNode configurationNode; + try { + configurationNode = hoconConfigurationLoader.a(configurationOptions); + } catch (IOException ex) { + throw new ConfigReadWriteException(ex); + } + + TypeToken typeToken = TypeToken.of(ConfigRootSnapshot.class); + ConfigRootSnapshot configRootSnapshot = (ConfigRootSnapshot) configurationNode.a(typeToken); + ConfigRootSnapshot configRootSnapshot2 = configRootSnapshot; + if (configRootSnapshot == null) { + return; + } + + configRootSnapshot2 = configRootSnapshot; + + if (configRootSnapshot2.getIntValue() != this.stateTicks) { + throw new ConfigCommandException(); + } + + ModuleArrayMap moduleArrayMap; + ModuleManager modManager = this.moduleManagerField; + moduleArrayMap = modManager.getModules(); + if (flag) { + ObjectCollection objectCollection = moduleArrayMap.values(); + ObjectIterator objectIterator2 = objectCollection.iterator(); + + do { + if (!objectIterator2.hasNext()) { + break; + } + + objectIterator = objectIterator2; + + + ModuleHolder modHolder = (ModuleHolder)objectIterator2.next(); + List list = Arrays.asList(enumModuleTypeArray); + AbstractModule mod = modHolder.getModule(); + EnumModuleType modCategory = mod.getCategory(); + if (list.contains(modCategory)) { + AbstractModule mod2 = modHolder.getModule(); + mod2.setEnabled(false); + } + } while (stringArr != null); + } + + objectIterator = configRootSnapshot.getModuleArrayMap().entrySet().iterator(); + + ObjectIterator objectIterator3 = objectIterator; + + while (true) { + if (!objectIterator3.hasNext()) { + break; + } + + label72: { + Entry entry = (Entry)objectIterator3.next(); + String textStr2 = (String)entry.getKey(); + ModuleHolder modHolder2 = (ModuleHolder)entry.getValue(); + Object val5 = Arrays.asList(enumModuleTypeArray); + AbstractModule mod3 = modHolder2.getModule(); + EnumModuleType modCategory2 = mod3.getCategory(); + if (!((java.util.List) val5).contains(modCategory2)) { + break label72; + } + + val5 = moduleArrayMap.get(textStr2); + + StoringModuleHolder storingModuleHolder; + if ((storingModuleHolder = (StoringModuleHolder)val5) != null) { + int intVal2 = 0; + int intVal3 = 0; + Map map2 = storingModuleHolder.obtainMap(); + Set set = map2.entrySet(); + Iterator iter = set.iterator(); + + do { + if (!iter.hasNext()) { + break; + } + + Entry entry2 = (Entry)iter.next(); + String textStr3 = (String)entry2.getKey(); + PropertyFieldBinding propertyFieldBinding = (PropertyFieldBinding)entry2.getValue(); + + try { + propertyFieldBinding.handleAbstractModule(modHolder2.getModule(), storingModuleHolder.getModule(), flag); + intVal2++; + } catch (Throwable ex2) { + Logger log = Novoline.getLogger(); + StringBuilder sb = new StringBuilder(); + String textStr4 = "An error occurred while updating property: value: "; + StringBuilder sb2 = sb.append(textStr4); + StringBuilder sb3 = sb2.append(textStr3); + textStr4 = ", module: "; + StringBuilder sb4 = sb3.append(textStr4); + textStr4 = storingModuleHolder.getName(); + String textStr5 = sb4.append(textStr4).toString(); + log.warn(textStr5, ex2); + intVal3++; + continue; + } + + + } while (stringArr != null); + } + } + + + } + } + + + @NotNull + public Path f() { + Path filePath; + int intVal4; + Novoline novolineInst = this.moduleManagerField.getNovoline(); + Path filePath2 = novolineInst.getConfigPath(); + filePath = filePath2.resolve("configs"); + LinkOption[] linkOptionArr4 = new LinkOption[0]; + intVal4 = (Files.isRegularFile(filePath, linkOptionArr4) ? 1 : 0); + if (intVal4 != 0) { + byte byteVal = 0; + int intVal5 = 1; + + while (true) { + intVal4 = intVal5; + + + label49: + if (intVal5 < Integer.MAX_VALUE) { + try { + Path path2 = filePath2.resolve(new StringBuilder().append("configs-").append(intVal5).toString()); + CopyOption[] copyOptionArr = new CopyOption[0]; + Files.move(filePath, path2, copyOptionArr); + byteVal = 1; + break label49; + } catch (FileAlreadyExistsException ex) { + } catch (IOException ex3) { + Logger log = Novoline.getLogger(); + String textStr6 = "An I/O error occurred while creating configs folder"; + log.error(textStr6, ex3); + } + + intVal5++; + continue; + } + + intVal4 = byteVal; + break; + } + + + + if (intVal4 == 0) { + Logger log2 = Novoline.getLogger(); + String textStr7 = "User created 2.147.483.648 configs-# files. Cannot create configs folder"; + log2.error(textStr7); + } + } + + + + linkOptionArr4 = new LinkOption[0]; + intVal4 = (Files.notExists(filePath, linkOptionArr4) ? 1 : 0); + + if (intVal4 != 0) { + try { + FileAttribute[] fileAttributeArr = new FileAttribute[0]; + Files.createDirectories(filePath, fileAttributeArr); + } catch (IOException ex4) { + Logger log3 = Novoline.getLogger(); + String textStr8 = "An I/O error occurred while creating configs folder"; + log3.error(textStr8, ex4); + ex4.printStackTrace(); + } + } + + return filePath; + } + + public boolean b(@NotNull String text) throws IOException, ObjectMappingException { + Path filePath; + label27: { + filePath = this.d(text); + Path filePath2 = filePath; + byte byteVal2 = 0; + LinkOption[] linkOptionArr5 = new LinkOption[0]; + if (!Files.notExists(filePath, linkOptionArr5)) { + break label27; + } + + filePath2 = filePath; + byteVal2 = 0; + + FileAttribute[] fileAttributeArr2 = new FileAttribute[byteVal2]; + Files.createFile(filePath2, fileAttributeArr2); + } + + ConfigurationOptions configurationOptions = this.c(); + HoconConfigurationLoader hoconConfigurationLoader = HoconConfigurationLoader.getConfigManagerSupport().a(configurationOptions).a(filePath).getHoconConfigurationLoader(); + + ConfigurationNode configurationNode; + try { + configurationNode = hoconConfigurationLoader.a(configurationOptions); + } catch (IOException ex) { + throw new ConfigReadWriteException(ex); + } + + ConfigRootSnapshot configRootSnapshot4 = ConfigRootSnapshot.resolveConfigRootSnapshot2(this, text); + TypeToken typeToken = TypeToken.of(ConfigRootSnapshot.class); + configurationNode.resolveConfigurationNode(typeToken, configRootSnapshot4); + hoconConfigurationLoader.a(configurationNode); + + return true; + } + + private static BufferedWriter lambdaImpl$saveToString$0(StringWriter stringWriter) throws Exception { + return new BufferedWriter(stringWriter); + } + + public int a() { + return this.stateTicks; + } + + public static String[] d() { + return b; + } + + public void a(@NotNull Path path, boolean flag) throws IOException, ObjectMappingException { + ObjectIterator objectIterator; + String[] stringArr = d(); + LinkOption[] linkOptionArr6 = new LinkOption[0]; + if (Files.notExists(path, linkOptionArr6)) { + throw new FileNotFoundException("file doesn't exist"); + } + + ConfigurationOptions configurationOptions = this.c(); + HoconConfigurationLoader hoconConfigurationLoader = HoconConfigurationLoader.getConfigManagerSupport().a(configurationOptions).a(path).getHoconConfigurationLoader(); + + ConfigurationNode configurationNode; + try { + configurationNode = hoconConfigurationLoader.a(configurationOptions); + } catch (IOException ex) { + throw new ConfigReadWriteException(ex); + } + + TypeToken typeToken = TypeToken.of(ConfigRootSnapshot.class); + ConfigRootSnapshot configRootSnapshot = (ConfigRootSnapshot) configurationNode.a(typeToken); + ConfigRootSnapshot configRootSnapshot2 = configRootSnapshot; + if (configRootSnapshot == null) { + return; + } + + configRootSnapshot2 = configRootSnapshot; + + if (configRootSnapshot2.getIntValue() != this.stateTicks) { + throw new ConfigCommandException(); + } + + ModuleArrayMap moduleArrayMap; + ModuleManager modManager = this.moduleManagerField; + moduleArrayMap = modManager.getModules(); + if (flag) { + ObjectCollection objectCollection = moduleArrayMap.values(); + ObjectIterator objectIterator2 = objectCollection.iterator(); + + do { + if (!objectIterator2.hasNext()) { + break; + } + + objectIterator = objectIterator2; + + + ModuleHolder modHolder = (ModuleHolder)objectIterator2.next(); + AbstractModule mod = modHolder.getModule(); + mod.setEnabled(false); + } while (stringArr != null); + } + + objectIterator = configRootSnapshot.getModuleArrayMap().entrySet().iterator(); + + ObjectIterator objectIterator3 = objectIterator; + + while (true) { + if (!objectIterator3.hasNext()) { + break; + } + + Entry entry = (Entry)objectIterator3.next(); + String textStr9 = (String)entry.getKey(); + ModuleHolder modHolder2 = (ModuleHolder)entry.getValue(); + StoringModuleHolder storingModuleHolder; + if ((storingModuleHolder = (StoringModuleHolder)moduleArrayMap.get(textStr9)) != null) { + int intVal6 = 0; + int intVal7 = 0; + Map map3 = storingModuleHolder.obtainMap(); + Set set2 = map3.entrySet(); + Iterator iter = set2.iterator(); + + do { + if (!iter.hasNext()) { + break; + } + + Entry entry2 = (Entry)iter.next(); + String textStr10 = (String)entry2.getKey(); + PropertyFieldBinding propertyFieldBinding = (PropertyFieldBinding)entry2.getValue(); + + try { + propertyFieldBinding.handleAbstractModule(modHolder2.getModule(), storingModuleHolder.getModule(), flag); + intVal6++; + } catch (Throwable ex5) { + Logger log = Novoline.getLogger(); + StringBuilder sb = new StringBuilder(); + String textStr11 = "An error occurred while updating property: value: "; + StringBuilder sb2 = sb.append(textStr11); + StringBuilder sb3 = sb2.append(textStr10); + textStr11 = ", module: "; + StringBuilder sb4 = sb3.append(textStr11); + textStr11 = storingModuleHolder.getName(); + String textStr12 = sb4.append(textStr11).toString(); + log.warn(textStr12, ex5); + intVal7++; + continue; + } + + + } while (stringArr != null); + } + + + } + } + + private static boolean lambdaImpl$getConfigs$2(String text) { + return text.endsWith(".novo"); + } + + @NotNull + public List e() { + Stream stream; + try { + Path filePath = this.f(); + FileVisitOption[] fileVisitOptionArr = new FileVisitOption[0]; + stream = Files.walk(filePath, fileVisitOptionArr); + } catch (IOException ex6) { + Logger log = Novoline.getLogger(); + log.error("An I/O error occurred while getting contents of configs folder", ex6); + return Collections.emptyList(); + } + + Predicate predicate = ConfigManager::lambdaImpl$getConfigs$1; + Stream stream2 = stream.filter(predicate); + Function mapper = ((java.util.function.Function) Path::getFileName); + stream2 = stream2.map(mapper); + Function mapper2 = ((java.util.function.Function) Path::toString); + stream2 = stream2.map(mapper2); + java.util.function.Predicate var11Next = ((java.util.function.Predicate) ConfigManager::lambdaImpl$getConfigs$2); + stream2 = stream2.filter(var11Next); + Function mapper3 = ConfigManager::lambdaImpl$getConfigs$3; + stream2 = stream2.map(mapper3); + Supplier supplier = ObjectArrayList::new; + Collector collector = Collectors.toCollection(supplier); + return (java.util.List) stream2.collect(collector); + } + + + private static java.util.concurrent.Callable $lambdaCapture$1(java.io.StringWriter captured0) { return () -> ConfigManager.lambdaImpl$saveToString$0(captured0); } + + public boolean save(@NotNull String name) throws IOException, ObjectMappingException { return this.b(name); } + public String saveToString(@NotNull String name) throws IOException, ObjectMappingException { return this.a(name); } + public boolean delete(@NotNull String name) throws IOException { return this.c(name); } + public void load(@NotNull String name, boolean disableUnmentioned) throws IOException, ObjectMappingException { this.a(name, disableUnmentioned); } + public void load(@NotNull String name, boolean disableUnmentioned, EnumModuleType[] categories) throws IOException, ObjectMappingException { this.a(name, disableUnmentioned, categories); } + public void load(@NotNull Path path, boolean disableUnmentioned) throws IOException, ObjectMappingException { this.a(path, disableUnmentioned); } + public void load(@NotNull Path path, boolean disableUnmentioned, EnumModuleType[] categories) throws IOException, ObjectMappingException { this.a(path, disableUnmentioned, categories); } + @NotNull public Path getConfigPath(@NotNull String name) { return this.d(name); } + @NotNull public Path getConfigsFolder() { return this.f(); } + @NotNull public List getConfigs() { return this.e(); } + @NotNull public ModuleManager getModuleManager() { return this.g(); } + public static String getExtension() { return b(); } +} diff --git a/src/main/java/cc/novoline/modules/configurations/annotation/DelsyConfig.java b/src/main/java/cc/novoline/modules/configurations/annotation/DelsyConfig.java new file mode 100644 index 0000000..cb46365 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/annotation/DelsyConfig.java @@ -0,0 +1,11 @@ +package cc.novoline.modules.configurations.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface DelsyConfig { +} diff --git a/src/main/java/cc/novoline/modules/configurations/annotation/Property.java b/src/main/java/cc/novoline/modules/configurations/annotation/Property.java new file mode 100644 index 0000000..02525a6 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/annotation/Property.java @@ -0,0 +1,12 @@ +package cc.novoline.modules.configurations.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface Property { + String value(); +} diff --git a/src/main/java/cc/novoline/modules/configurations/holder/EKTypeToken.java b/src/main/java/cc/novoline/modules/configurations/holder/EKTypeToken.java new file mode 100644 index 0000000..acc9d8f --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/holder/EKTypeToken.java @@ -0,0 +1,14 @@ +package cc.novoline.modules.configurations.holder; + +import cc.novoline.modules.configurations.util.WaypointEntry; +import cc.novoline.modules.visual.Waypoints; +import com.google.common.reflect.TypeToken; +import java.util.List; + +public class EKTypeToken extends TypeToken> { + final Waypoints waypointsField; + + public EKTypeToken(Waypoints waypoints) { + this.waypointsField = waypoints; +} +} diff --git a/src/main/java/cc/novoline/modules/configurations/holder/EKWaypointsHelper.java b/src/main/java/cc/novoline/modules/configurations/holder/EKWaypointsHelper.java new file mode 100644 index 0000000..84945e5 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/holder/EKWaypointsHelper.java @@ -0,0 +1,14 @@ +package cc.novoline.modules.configurations.holder; + +import cc.novoline.modules.configurations.util.WaypointEntry; +import cc.novoline.modules.visual.Waypoints; +import com.google.common.reflect.TypeToken; +import java.util.List; + +public class EKWaypointsHelper extends TypeToken> { + final Waypoints waypointsField; + + public EKWaypointsHelper(Waypoints waypoints) { + this.waypointsField = waypoints; +} +} diff --git a/src/main/java/cc/novoline/modules/configurations/holder/GenericRmTypeToken.java b/src/main/java/cc/novoline/modules/configurations/holder/GenericRmTypeToken.java new file mode 100644 index 0000000..1b2f373 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/holder/GenericRmTypeToken.java @@ -0,0 +1,13 @@ +package cc.novoline.modules.configurations.holder; + +import cc.novoline.modules.configurations.ConfigManager; +import cc.novoline.modules.configurations.property.Property; +import com.google.common.reflect.TypeToken; + +public class GenericRmTypeToken extends TypeToken> { + final ConfigManager configManagerField; + + public GenericRmTypeToken(ConfigManager configManager) { + this.configManagerField = configManager; +} +} diff --git a/src/main/java/cc/novoline/modules/configurations/holder/HcBindManagerHelper.java b/src/main/java/cc/novoline/modules/configurations/holder/HcBindManagerHelper.java new file mode 100644 index 0000000..f76abab --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/holder/HcBindManagerHelper.java @@ -0,0 +1,14 @@ +package cc.novoline.modules.configurations.holder; + +import cc.novoline.modules.binds.BindManager; +import cc.novoline.modules.binds.ModuleKeybind; +import com.google.common.reflect.TypeToken; +import java.util.Map; + +public class HcBindManagerHelper extends TypeToken> { + final BindManager bindManagerField; + + public HcBindManagerHelper(BindManager bindManager) { + this.bindManagerField = bindManager; +} +} diff --git a/src/main/java/cc/novoline/modules/configurations/holder/ModuleHolder.java b/src/main/java/cc/novoline/modules/configurations/holder/ModuleHolder.java new file mode 100644 index 0000000..c8a3d7f --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/holder/ModuleHolder.java @@ -0,0 +1,58 @@ +package cc.novoline.modules.configurations.holder; + +import cc.novoline.modules.AbstractModule; +import com.google.common.reflect.TypeToken; +import org.jetbrains.annotations.NotNull; + +public abstract class ModuleHolder implements Cloneable { + public Module module; +public final String name; + public TypeToken type; + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb = sb.append("ModuleHolder{name='"); + String textStr = this.name; + sb = sb.append(textStr).append('\''); + sb = sb.append(", module="); + AbstractModule mod = this.module; + sb = sb.append(mod); + return sb.append('}').toString(); +} + + @Override + public Object clone() throws CloneNotSupportedException { + return super.clone(); +} + + @NotNull + public String getName() { + return this.name; +} + + public ModuleHolder(@NotNull String text, @NotNull Module moduleIn) { + this.name = text; + this.module = (Module)moduleIn; +} + + @NotNull + public TypeToken getTypeToken() { + ModuleHolder modHolder = this; + + if (this.type != null) { + return this.type; + } + + modHolder = this; + + + Class clazz = this.module.getClass(); + return modHolder.type = TypeToken.of(clazz); +} + + @NotNull + public Module getModule() { + return this.module; +} +} diff --git a/src/main/java/cc/novoline/modules/configurations/holder/SavingModuleHolder.java b/src/main/java/cc/novoline/modules/configurations/holder/SavingModuleHolder.java new file mode 100644 index 0000000..ad78594 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/holder/SavingModuleHolder.java @@ -0,0 +1,22 @@ +package cc.novoline.modules.configurations.holder; + +import cc.novoline.modules.AbstractModule; + +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class SavingModuleHolder extends ModuleHolder { + private SavingModuleHolder(@NonNull String text, @NonNull Module module) { + super(text, (Module)module); +} + + public static @NonNull SavingModuleHolder resolveSavingModuleHolder(@NonNull String text, @NonNull Module module) { + SavingModuleHolderSupport.applyUpdate(text, "name"); + SavingModuleHolderSupport.applyUpdate(module, "module"); + return new SavingModuleHolder<>(text, (Module)module); +} + + public void updateHelper(@NonNull Module moduleIn) { + SavingModuleHolderSupport.applyUpdate(moduleIn, "module"); + this.module = (Module)moduleIn; +} +} diff --git a/src/main/java/cc/novoline/modules/configurations/holder/SavingModuleHolderSupport.java b/src/main/java/cc/novoline/modules/configurations/holder/SavingModuleHolderSupport.java new file mode 100644 index 0000000..8d54820 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/holder/SavingModuleHolderSupport.java @@ -0,0 +1,138 @@ +package cc.novoline.modules.configurations.holder; + + +import cc.novoline.gui.widget.Iterator6FunctionHelper; +import cc.novoline.modules.PlayerManagerSupport; +import java.util.Collection; +import java.util.function.Consumer; + +public final class SavingModuleHolderSupport { + public static void processHelper(int value, String text) { + if (value <= 0) { + StringBuilder sb = new StringBuilder().append(text); + throw new IllegalArgumentException(sb.append(" may not be negative or zero").toString()); + } +} + + public static void applyUpdate(Object[] objectArray, String text) { + applyUpdate(objectArray, text); + Object[] objArr = objectArray; + int len = objArr.length; + int intVal = 0; + + while (intVal < len) { + Object obj = objArr[intVal]; + applyUpdate(obj, text); + intVal++; + + } +} + + public static String applyUpdate(String text, String str) { + applyUpdate((Object)text, str); + String textStr = text; + + if (PlayerManagerSupport.checkCharSequence(text)) { + StringBuilder sb = new StringBuilder().append(str); + throw new IllegalArgumentException(sb.append(" may not be blank").toString()); + } + + textStr = text; + + + return textStr; +} + + private SavingModuleHolderSupport() { + throw new UnsupportedOperationException("This is a utility class and cannot be instantiated"); +} + + public static void processHelper(CharSequence charSequence, String text) { + applyUpdate((Object)charSequence, text); + if (PlayerManagerSupport.evaluateCheck(charSequence)) { + StringBuilder sb = new StringBuilder().append(text); + throw new IllegalArgumentException(sb.append(" may not be empty").toString()); + } +} + + public static void applyUpdate(long time, String text) { + if (time < 0L) { + StringBuilder sb = new StringBuilder().append(text); + throw new IllegalArgumentException(sb.append(" may not be negative").toString()); + } +} + + public static void applyUpdate(CharSequence charSequence, String text) { + applyUpdate((Object)charSequence, text); + if (PlayerManagerSupport.checkCharSequence2(charSequence)) { + StringBuilder sb = new StringBuilder().append(text); + throw new IllegalArgumentException(sb.append(" may not contain blanks").toString()); + } +} + + public static void applyUpdate2(boolean flag, String text, Object obj) { + if (!flag) { + Object[] objArr = new Object[]{obj}; + throw new IllegalArgumentException(String.format(text, objArr)); + } +} + + public static void applyUpdate2(boolean flag, String text, Object... objectArray) { + if (!flag) { + throw new IllegalArgumentException(String.format(text, objectArray)); + } +} + + public static void processHelper(Collection collection, String text) { + applyUpdate((Object)collection, text); + Consumer consumer = ((java.util.function.Consumer) (string) -> { applyUpdate(string, text); }); + collection.forEach(consumer); +} + + public static void applyUpdate(Collection collection, String text) { + applyUpdate((Object)collection, text); + if (collection.isEmpty()) { + StringBuilder sb = new StringBuilder().append(text); + throw new IllegalArgumentException(sb.append(" may not be empty").toString()); + } +} + + + + public static void applyUpdate(boolean flag, String text) { + if (!flag) { + throw new IllegalArgumentException(text); + } +} + + public static void processHelper(Object[] objectArray, String text) { + applyUpdate(objectArray, text); + if (objectArray.length == 0) { + StringBuilder sb = new StringBuilder().append(text); + throw new IllegalArgumentException(sb.append(" may not be empty").toString()); + } +} + + public static void applyUpdate(Object obj, String text) { + if (obj == null) { + StringBuilder sb = new StringBuilder().append(text); + throw new IllegalArgumentException(sb.append(" may not be null").toString()); + } +} + + public static void applyUpdate(int value, String text) { + if (value < 0) { + StringBuilder sb = new StringBuilder().append(text); + throw new IllegalArgumentException(sb.append(" may not be negative").toString()); + } +} + + public static void processHelper(long time, String text) { + if (time <= 0L) { + StringBuilder sb = new StringBuilder().append(text); + throw new IllegalArgumentException(sb.append(" may not be negative or zero").toString()); + } +} + + public static void notNull(Object value, String name) { applyUpdate(value, name); } +} diff --git a/src/main/java/cc/novoline/modules/configurations/holder/StoringModuleHolder.java b/src/main/java/cc/novoline/modules/configurations/holder/StoringModuleHolder.java new file mode 100644 index 0000000..45fa17f --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/holder/StoringModuleHolder.java @@ -0,0 +1,101 @@ +package cc.novoline.modules.configurations.holder; + +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.ModuleFactory; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.util.PropertyFieldBinding; +import cc.novoline.modules.configurations.util.MutablePropertyFieldBinding; +import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap; +import java.lang.reflect.Field; +import java.util.Map; +import java.util.function.BiFunction; +import cc.novoline.modules.ModuleManager; +import ninja.leaping.configurate.objectmapping.ObjectMapperSupport; + +import net.optifine.FieldReflectionAccess; + +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class StoringModuleHolder extends ModuleHolder { + private final @NonNull ModuleManager moduleManager2; + private final @NonNull ModuleFactory moduleFactory2; + private final @NonNull Map<@NonNull String, @NonNull PropertyFieldBinding> entryMap; + + private Map getMap() { + Object2ObjectArrayMap object2ObjectArrayMap = new Object2ObjectArrayMap(); + Class clazz = this.module.getClass(); + Field[] fieldArr = AbstractModule.class.getDeclaredFields(); + int len = fieldArr.length; + int intVal = 0; + + while (true) { + if (intVal < len) { + Field field = fieldArr[intVal]; + this.updateState(object2ObjectArrayMap, field, StoringModuleHolder::invokeCallback2); + intVal++; + + continue; + } + + fieldArr = clazz.getDeclaredFields(); + len = fieldArr.length; + break; + } + + int intVal2 = 0; + + while (intVal2 < len) { + Field field2 = fieldArr[intVal2]; + this.updateState(object2ObjectArrayMap, field2, StoringModuleHolder::invokeCallback); + intVal2++; + + } + + return object2ObjectArrayMap; +} + + public @NonNull Module getAbstractModuleC() { + return this.moduleFactory2.resolveAbstractModule(this.moduleManager2); +} + + private void updateState(Map<@NonNull String, @NonNull PropertyFieldBinding> map, @NonNull Field field, @NonNull BiFunction biFunction) { + Property property = (Property)FieldReflectionAccess.resolveAnnotation(field, Property.class); + if (property == null) { + return; + } + + FieldReflectionAccess.updateState(field, true); + + String textStr = ObjectMapperSupport.a(field, property); + PropertyFieldBinding propertyFieldBinding = (PropertyFieldBinding)biFunction.apply(textStr, field); + map.put(textStr, propertyFieldBinding); +} + + public @NonNull Map<@NonNull String, @NonNull PropertyFieldBinding> obtainMap() { + return this.entryMap; +} + + private StoringModuleHolder(@NonNull ModuleManager moduleManager, @NonNull String text, @NonNull ModuleFactory moduleFactory) { + super(text, (Module)moduleFactory.resolveAbstractModule(moduleManager)); + this.moduleManager2 = moduleManager; + this.moduleFactory2 = moduleFactory; + this.entryMap = this.getMap(); +} + + public static @NonNull StoringModuleHolder updateState( + @NonNull ModuleManager moduleManager, @NonNull String text, @NonNull ModuleFactory moduleFactory + ) { + SavingModuleHolderSupport.applyUpdate(moduleManager, "module manager"); + SavingModuleHolderSupport.applyUpdate(text, "name"); + SavingModuleHolderSupport.applyUpdate(moduleFactory, "module creator"); + return new StoringModuleHolder<>(moduleManager, text, moduleFactory); +} + + private static PropertyFieldBinding invokeCallback(String text, Field field) { + return new PropertyFieldBinding(text, field, null); +} + + private static PropertyFieldBinding invokeCallback2(String text, Field field) { + return text.equalsIgnoreCase("enabled") ? new MutablePropertyFieldBinding(text, field, null) : new PropertyFieldBinding(text, field, null); +} +} diff --git a/src/main/java/cc/novoline/modules/configurations/holder/hcTypeToken.java b/src/main/java/cc/novoline/modules/configurations/holder/hcTypeToken.java new file mode 100644 index 0000000..f89f126 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/holder/hcTypeToken.java @@ -0,0 +1,14 @@ +package cc.novoline.modules.configurations.holder; + +import cc.novoline.modules.binds.BindManager; +import cc.novoline.modules.binds.ModuleKeybind; +import com.google.common.reflect.TypeToken; +import java.util.Map; + +public class hcTypeToken extends TypeToken> { + final BindManager bindManagerField; + + public hcTypeToken(BindManager bindManager) { + this.bindManagerField = bindManager; +} +} diff --git a/src/main/java/cc/novoline/modules/configurations/property/AbstractNumberProperty.java b/src/main/java/cc/novoline/modules/configurations/property/AbstractNumberProperty.java new file mode 100644 index 0000000..cbdefbc --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/property/AbstractNumberProperty.java @@ -0,0 +1,221 @@ +package cc.novoline.modules.configurations.property; +import cc.novoline.modules.configurations.util.OutOfBoundsPropertyException; + +import java.util.Objects; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public abstract class AbstractNumberProperty, Type extends Number> extends AbstractProperty { + public Type a; + public Type d; + private static int e; + + protected boolean isGreaterThanOrEqual(Type type) { + int[] intArr = AbstractProperty.getIntArrayValue(); + boolean flag = this.isGreaterThan((Type)type); + if (intArr != null) { + if (!flag) { + Number number = type; + if (intArr != null) { + if (type == null && this.value == null) { + return false; + } + + number = type; + } + + Object val = this.value; + return Objects.equals(number, val); + } + + flag = true; + } + + return flag; + } + + protected boolean isLessThanOrEqual(Type type2) { + int[] intArr2 = AbstractProperty.getIntArrayValue(); + boolean flag2 = this.isLessThan((Type)type2); + if (intArr2 != null) { + if (!flag2) { + Number number2 = type2; + if (intArr2 != null) { + if (type2 == null) { + return false; + } + + number2 = type2; + } + + Object val2 = this.value; + return Objects.equals(number2, val2); + } + + flag2 = true; + } + + return flag2; + } + + protected abstract boolean isLessThan(Type type3); + + public Self setMinimum(@Nullable Type type4) { + if (this.value != null && this.isLessThan((Type)type4)) { + StringBuilder stringBuilder = new StringBuilder().append("minimum is greater than current value: "); + Object currentValue = this.value; + stringBuilder = stringBuilder.append(currentValue); + String textStr = ", min: "; + stringBuilder = stringBuilder.append(textStr); + throw new IllegalArgumentException(stringBuilder.append(type4).toString()); + } else { + this.d = (Type)type4; + return this.self(); + } + } + + + + protected abstract void subtract(Type type5); + + protected abstract boolean isWithinBounds(@NotNull Type type6); + + static { + if (b() != 0) { + a(88); + } + } + + protected abstract void add(Type type7); + + public static void a(int intVal) { + e = intVal; + } + + public void i(@Nullable Type type8) { + int[] intArr3; + int intVal2; + label47: { + label52: { + intArr3 = AbstractProperty.getIntArrayValue(); + if (intArr3 != null) { + if (type8 != null) { + intVal2 = (this.isWithinBounds((Type)type8) ? 1 : 0); + if (intArr3 == null) { + break label47; + } + + if (intVal2 == 0) { + break label52; + } + } + + super.set((Type)type8); + } + + if (intArr3 != null) { + return; + } + + } + + double doubleVal; + intVal2 = (doubleVal = type8.doubleValue() - this.a().doubleValue()) == 0.0 ? 0 : (doubleVal < 0.0 ? -1 : 1); + } + + if (intArr3 != null) { + if (intVal2 > 0) { + super.set(this.a()); + if (intArr3 != null) { + return; + } + } + + double doubleVal2; + intVal2 = (doubleVal2 = type8.doubleValue() - this.e().doubleValue()) == 0.0 ? 0 : (doubleVal2 < 0.0 ? -1 : 1); + } + + if (intVal2 < 0) { + super.set(this.e()); + if (intArr3 != null) { + return; + } + } + + StringBuilder stringBuilder2 = new StringBuilder(); + String textStr2 = "Unable to set "; + stringBuilder2 = stringBuilder2.append(textStr2); + stringBuilder2 = stringBuilder2.append(type8); + textStr2 = " (min:"; + stringBuilder2 = stringBuilder2.append(textStr2); + Number number3 = this.d; + stringBuilder2 = stringBuilder2.append(number3); + textStr2 = ", max:"; + stringBuilder2 = stringBuilder2.append(textStr2); + Number number4 = this.a; + stringBuilder2 = stringBuilder2.append(number4); + textStr2 = ")"; + throw new OutOfBoundsPropertyException(stringBuilder2.append(textStr2).toString(), this); + } + + protected abstract boolean isGreaterThan(Type type9); + + public Self h(@Nullable Type type10) { + if (this.value != null && this.isGreaterThan((Type)type10)) { + StringBuilder stringBuilder3 = new StringBuilder().append("current value is greater than maximum: "); + Object currentValue = this.value; + stringBuilder3 = stringBuilder3.append(currentValue); + String textStr3 = ", max: "; + stringBuilder3 = stringBuilder3.append(textStr3); + throw new IllegalArgumentException(stringBuilder3.append(type10).toString()); + } else { + this.a = (Type)type10; + return this.self(); + } + } + + public AbstractNumberProperty(Type type11) { + super((Type)type11); + } + + public static int b() { + return e; + } + + public static int d() { + int intVal3 = b(); + return intVal3 == 0 ? 44 : 0; + } + + protected AbstractNumberProperty() { + } + + protected abstract Self self(); + + public Type e() { + return this.d; + } + + public Type a() { + return this.a; + } + + @Override + public void set(Type value) { + this.i(value); + } + + public Self minimum(@Nullable Type value) { + return this.setMinimum(value); + } + public Self maximum(@Nullable Type value) { + return this.h(value); + } + public Type getMinimum() { + return this.e(); + } + public Type getMaximum() { + return this.a(); + } +} diff --git a/src/main/java/cc/novoline/modules/configurations/property/AbstractProperty.java b/src/main/java/cc/novoline/modules/configurations/property/AbstractProperty.java new file mode 100644 index 0000000..8f065c6 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/property/AbstractProperty.java @@ -0,0 +1,55 @@ +package cc.novoline.modules.configurations.property; + +import org.jetbrains.annotations.Nullable; + +public abstract class AbstractProperty implements Property { + public Type value; + private static int[] b; + + public static int[] getIntArrayValue() { + return b; + } + + static { + if (getIntArrayValue() == null) { + b(new int[1]); + } + } + + public AbstractProperty(@Nullable Type type) { + this.set((Type)type); + } + + public static void b(int[] intArray) { + b = intArray; + } + + @Override + public String toString() { + int[] intArr = getIntArrayValue(); + Object val = this.value; + if (intArr != null) { + if (this.value == null) { + return "null"; + } + + val = this.value; + } + + return val.toString(); + } + + @Override + public Type get() { + return this.value; + } + + @Override + public void set(@Nullable Type type) { + this.value = (Type)type; + } + + public AbstractProperty() { + this(null); + } +} diff --git a/src/main/java/cc/novoline/modules/configurations/property/Property.java b/src/main/java/cc/novoline/modules/configurations/property/Property.java new file mode 100644 index 0000000..5138c02 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/property/Property.java @@ -0,0 +1,10 @@ +package cc.novoline.modules.configurations.property; + +import org.jetbrains.annotations.Nullable; + +public interface Property { + @Nullable + Type get(); + + void set(@Nullable Type type); +} diff --git a/src/main/java/cc/novoline/modules/configurations/property/object/BooleanProperty.java b/src/main/java/cc/novoline/modules/configurations/property/object/BooleanProperty.java new file mode 100644 index 0000000..0a11c49 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/property/object/BooleanProperty.java @@ -0,0 +1,102 @@ +package cc.novoline.modules.configurations.property.object; + +import cc.novoline.utils.lazy.LazySupplier; + +import cc.novoline.modules.configurations.property.AbstractProperty; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class BooleanProperty extends AbstractProperty { + private static final LazySupplier d = LazySupplier.resolveLazySupplier4(BooleanProperty::lambdaImpl$static$1); + private static final LazySupplier a = LazySupplier.resolveLazySupplier4(BooleanProperty::lambdaImpl$static$0); + + public static BooleanProperty c() { + return d.get(); + } + + public void b() { + boolean flag; + label21: { + label23: { + Object val = this.value; + if (this.value == null) { + break label23; + } + + val = this.value; + + Boolean val2 = (Boolean)val; + flag = val2; + + + if (flag) { + flag = false; + break label21; + } + } + + flag = true; + } + + this.value = flag; + } + + public void e() { + this.set(true); + } + + private static BooleanProperty lambdaImpl$static$0() { + return new ImmutableBooleanProperty(true, null); + } + + public BooleanProperty() { + this(false); + } + + public void d() { + this.set(false); + } + + public BooleanProperty(@Nullable Boolean param) { + super(param != null ? param : false); + } + + public static BooleanProperty f() { + return a.get(); + } + + private static BooleanProperty lambdaImpl$static$1() { + return new ImmutableBooleanProperty(false, null); + } + + @NotNull + public static BooleanProperty a() { + return new BooleanProperty(); + } + + @NotNull + public static BooleanProperty a(@Nullable Boolean param) { + return new BooleanProperty(param); + } + + @NotNull + public static BooleanProperty of() { + return a(); + } + @NotNull + public static BooleanProperty of(@Nullable Boolean value) { + return a(value); + } + public void toggle() { + this.b(); + } + public static BooleanProperty alwaysTrue() { + return f(); + } + public static BooleanProperty alwaysFalse() { + return c(); + } + + public void setTrue() { this.e(); } + public void setFalse() { this.d(); } +} diff --git a/src/main/java/cc/novoline/modules/configurations/property/object/ColorProperty.java b/src/main/java/cc/novoline/modules/configurations/property/object/ColorProperty.java new file mode 100644 index 0000000..6bc7110 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/property/object/ColorProperty.java @@ -0,0 +1,247 @@ +package cc.novoline.modules.configurations.property.object; + +import java.awt.Color; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public final class ColorProperty extends IntProperty { + public float[] getFloatArrayValue() { + float floatVal; + float floatVal2; + int intVal = IntProperty.getIntValue(); + if (this.value == null) { + return new float[]{0.0F, 0.0F, 0.0F}; + } + + float[] floatArr = new float[3]; + Integer integer = this.value; + int intVal2 = integer >>> 16 & 0xFF; + Integer integer2 = this.value; + int intVal3 = integer2 >>> 8 & 0xFF; + int intVal4 = Math.max(intVal2, intVal3); + Integer integer3 = this.value; + int intVal5 = integer3 & 0xFF; + int intVal6 = intVal4; + if (intVal == 0) { + if (intVal5 > intVal4) { + integer3 = this.value; + intVal4 = integer3 & 0xFF; + } + + integer3 = this.value; + intVal5 = integer3 >>> 16 & 0xFF; + Integer integer4 = this.value; + intVal6 = integer4 >>> 8 & 0xFF; + } + + int intVal7 = Math.min(intVal5, intVal6); + integer3 = this.value; + int intVal8 = integer3 & 0xFF; + if (intVal == 0) { + if (intVal8 < intVal7) { + integer3 = this.value; + intVal7 = integer3 & 0xFF; + } + + intVal8 = intVal4; + } + + float floatVal3; + label64: { + floatVal3 = intVal8 / 255.0F; + int intVal9 = intVal4; + if (intVal == 0) { + if (intVal4 == 0) { + floatVal = 0.0F; + break label64; + } + + intVal9 = intVal4 - intVal7; + } + + floatVal = (float)intVal9 / intVal4; + } + + float floatVal4; + float floatVal5; + label71: { + floatVal4 = floatVal; + float floatVal6; + int intVal10 = (floatVal6 = floatVal4 - 0.0F) == 0.0F ? 0 : (floatVal6 < 0.0F ? -1 : 1); + if (intVal == 0) { + if (intVal10 == 0) { + floatVal5 = 0.0F; + if (intVal == 0) { + break label71; + } + } + + Integer integer5 = this.value; + intVal10 = intVal4 - (integer5 >>> 16 & 0xFF); + } + + label50: { + float floatVal7 = (float)intVal10 / (intVal4 - intVal7); + Integer integer6 = this.value; + float floatVal8 = (float)(intVal4 - (integer6 >>> 8 & 0xFF)) / (intVal4 - intVal7); + integer6 = this.value; + float floatVal9 = (float)(intVal4 - (integer6 & 0xFF)) / (intVal4 - intVal7); + integer3 = this.value; + int intVal11 = integer3 >>> 16 & 0xFF; + int intVal12 = intVal4; + if (intVal == 0) { + if (intVal11 == intVal4) { + floatVal2 = floatVal9 - floatVal8; + break label50; + } + + integer3 = this.value; + intVal11 = integer3 >>> 8 & 0xFF; + intVal12 = intVal4; + } + + floatVal2 = intVal11 == intVal12 ? 2.0F + floatVal7 - floatVal9 : 4.0F + floatVal8 - floatVal7; + } + + floatVal5 = floatVal2 / 6.0F; + if (intVal != 0) { + return floatArr; + } + + if (floatVal5 < 0.0F) { + floatVal5++; + } + } + + floatArr[0] = floatVal5; + floatArr[1] = floatVal4; + floatArr[2] = floatVal3; + return floatArr; + } + + @Nullable + public Integer getIntegerValue() { + return this.value; + } + + public ColorProperty(@Nullable Integer integer7) { + super(integer7); + } + + public void d(@Nullable Integer integer8) { + this.c(integer8); + } + + public Integer getIntegerB() { + return this.getIntegerValue(); + } + + public int f() { + int intVal13 = IntProperty.getIntValue(); + Integer integer9 = this.value; + if (intVal13 == 0) { + if (this.value == null) { + return 0; + } + + integer9 = this.value; + } + + return integer9 >>> 16 & 0xFF; + } + + @Nullable + public Color getColorA() { + if (this.value == null) { + return null; + } + + Integer integer10 = this.value; + return new Color(integer10, true); + } + + @NotNull + public static ColorProperty e(@Nullable Integer integer11) { + return new ColorProperty(integer11); + } + + public int j() { + Integer integer12 = this.value; + if (this.value == null) { + return 0; + } + + integer12 = this.value; + + return integer12 >>> 8 & 0xFF; + } + + public void c(@Nullable Integer integer13) { + this.value = integer13; + } + + public int h() { + int intVal14 = IntProperty.getIntValue(); + Integer integer14 = this.value; + if (intVal14 == 0) { + if (this.value == null) { + return 0; + } + + integer14 = this.value; + } + + return integer14 >>> 24; + } + + public void applyInteger(@Nullable Integer integer15) { + int intVal15 = IntProperty.getIntValue(); + if (intVal15 == 0) { + if (integer15 == null) { + this.value = integer15; + return; + } + + int intVal16 = integer15 >>> 8; + intVal16 |= (integer15 & 0xFF) << 24; + this.value = intVal16; + } + } + + public int i() { + Integer integer16 = this.value; + if (this.value == null) { + return 0; + } + + integer16 = this.value; + + return integer16 & 0xFF; + } + + @Override + public void i(java.lang.Integer value) { + this.d(value); + } + + @Override + public java.lang.Integer get() { + return this.getIntegerB(); + } + + @Override + public void set(java.lang.Integer value) { + this.d(value); + } + + @NotNull public static ColorProperty of(@Nullable Integer color) { return e(color); } + @Nullable public Color getAwtColor() { return this.getColorA(); } + @Nullable public Integer getColorInt() { return this.getIntegerB(); } + public float[] getHSB() { return this.getFloatArrayValue(); } + public int getRed() { return this.f(); } + public int getGreen() { return this.j(); } + public int getBlue() { return this.i(); } + public int getAlpha() { return this.h(); } + + public void setColor(@Nullable Integer color) { this.d(color); } +} diff --git a/src/main/java/cc/novoline/modules/configurations/property/object/CustomAbstractProperty.java b/src/main/java/cc/novoline/modules/configurations/property/object/CustomAbstractProperty.java new file mode 100644 index 0000000..5468ab9 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/property/object/CustomAbstractProperty.java @@ -0,0 +1,12 @@ +package cc.novoline.modules.configurations.property.object; + +import cc.novoline.modules.configurations.property.AbstractProperty; +import cc.novoline.modules.configurations.util.TriedToApi; +import org.checkerframework.checker.nullness.qual.Nullable; + +public abstract class CustomAbstractProperty extends AbstractProperty implements TriedToApi { + @Override + public final void set(@Nullable T param) { + super.set(param); +} +} diff --git a/src/main/java/cc/novoline/modules/configurations/property/object/DoubleProperty.java b/src/main/java/cc/novoline/modules/configurations/property/object/DoubleProperty.java new file mode 100644 index 0000000..e97559c --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/property/object/DoubleProperty.java @@ -0,0 +1,185 @@ +package cc.novoline.modules.configurations.property.object; +import cc.novoline.modules.configurations.property.AbstractNumberProperty; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public final class DoubleProperty extends AbstractNumberProperty { + private static Object[] f; + + public static void b(Object[] objArr) { + f = objArr; + } + + static { + if (getAeHArrayA() != null) { + b(new Object[1]); + } + } + + protected boolean f(@Nullable Double val) { + Double val2 = val; + if (val == null) { + return false; + } + + val2 = this.value; + + if (val2 == null) { + return true; + } + + val2 = this.value; + + double doubleVal = val2; + double doubleVal2; + int intVal = (doubleVal2 = doubleVal - val) == 0.0 ? 0 : (doubleVal2 < 0.0 ? -1 : 1); + intVal = intVal < 0 ? 1 : 0; + + return ((intVal & 1) != 0); + } + + @NotNull + public static DoubleProperty a(@Nullable Double val3) { + return new DoubleProperty(val3); + } + + protected void d(@Nullable Double val4) { + DoubleProperty doubleProperty = this; + Double val5 = doubleProperty.value; + double doubleVal3 = val5; + doubleVal3 += val4; + doubleProperty.value = doubleVal3; + } + + public DoubleProperty(@Nullable Double val6) { + super(val6); + } + + public DoubleProperty() { + super(0.0); + } + + public static Object[] getAeHArrayA() { + return f; + } + + @NotNull + public static DoubleProperty getDoublePropertyC() { + return new DoubleProperty(); + } + + protected boolean c(@Nullable Double val7) { + int intVal2 = IntProperty.getIntValue(); + Double val8 = val7; + if (intVal2 == 0) { + if (val7 == null) { + return this.value != null; + } + + val8 = this.value; + } + + if (intVal2 == 0) { + if (val8 == null) { + return true; + } + + val8 = this.value; + } + + double doubleVal4 = val8; + double doubleVal5; + int intVal3 = (doubleVal5 = doubleVal4 - val7) == 0.0 ? 0 : (doubleVal5 < 0.0 ? -1 : 1); + if (intVal2 == 0) { + intVal3 = intVal3 > 0 ? 1 : 0; + } + + return ((intVal3 & 1) != 0); + } + + protected boolean e(@NotNull Double val9) { + int intVal4; + Number number; + intVal4 = IntProperty.getIntValue(); + number = this.d; + label29: + if (intVal4 == 0) { + if (this.d != null) { + number = val9; + if (intVal4 != 0) { + break label29; + } + + double doubleVal6 = val9; + Double val10 = this.d; + if (!(doubleVal6 >= val10)) { + return false; + } + } + + number = this.a; + } + + if (number == null) { + return true; + } + + double doubleVal7 = val9; + Double val11 = this.a; + double doubleVal8; + int intVal5 = (doubleVal8 = doubleVal7 - val11) == 0.0 ? 0 : (doubleVal8 < 0.0 ? -1 : 1); + return (boolean)(intVal4 != 0 ? intVal5 : intVal5 <= 0); + } + + protected DoubleProperty getDoublePropertyB() { + return this; + } + + protected void b(@Nullable Double val12) { + DoubleProperty doubleProperty2 = this; + Double val13 = doubleProperty2.value; + double doubleVal9 = val13; + doubleVal9 -= val12; + doubleProperty2.value = doubleVal9; + } + + @Override + protected boolean isLessThan(java.lang.Double value) { + return this.f(value); + } + + @Override + protected void subtract(java.lang.Double value) { + this.d(value); + } + + @Override + protected boolean isWithinBounds(java.lang.Double value) { + return this.e(value); + } + + @Override + protected void add(java.lang.Double value) { + this.b(value); + } + + @Override + protected boolean isGreaterThan(java.lang.Double value) { + return this.c(value); + } + + @Override + protected cc.novoline.modules.configurations.property.object.DoubleProperty self() { + return this.getDoublePropertyB(); + } + + @NotNull + public static DoubleProperty of(@Nullable Double value) { + return a(value); + } + @NotNull + public static DoubleProperty of() { + return new DoubleProperty(); + } +} diff --git a/src/main/java/cc/novoline/modules/configurations/property/object/FloatProperty.java b/src/main/java/cc/novoline/modules/configurations/property/object/FloatProperty.java new file mode 100644 index 0000000..a7b1857 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/property/object/FloatProperty.java @@ -0,0 +1,169 @@ +package cc.novoline.modules.configurations.property.object; + +import cc.novoline.modules.configurations.property.AbstractNumberProperty; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public final class FloatProperty extends AbstractNumberProperty { + protected void c(@Nullable Float val) { + FloatProperty floatProperty = this; + Float val2 = floatProperty.value; + float floatVal = val2; + floatVal += val; + floatProperty.value = floatVal; + } + + protected boolean e(@NotNull Float val3) { + int intVal; + Number number; + intVal = IntProperty.g(); + number = this.d; + label29: + if (intVal != 0) { + if (this.d != null) { + number = val3; + if (intVal == 0) { + break label29; + } + + float floatVal2 = val3; + Float val4 = this.d; + if (!(floatVal2 >= val4)) { + return false; + } + } + + number = this.a; + } + + if (number == null) { + return true; + } + + float floatVal3 = val3; + Float val5 = this.a; + float floatVal4; + int intVal2 = (floatVal4 = floatVal3 - val5) == 0.0F ? 0 : (floatVal4 < 0.0F ? -1 : 1); + return (boolean)(intVal == 0 ? intVal2 : intVal2 <= 0); + } + + protected boolean d(@Nullable Float val6) { + int intVal3 = IntProperty.getIntValue(); + Float val7 = val6; + if (intVal3 == 0) { + if (val6 == null) { + return false; + } + + val7 = this.value; + } + + if (intVal3 == 0) { + if (val7 == null) { + return true; + } + + val7 = this.value; + } + + float floatVal5 = val7; + float floatVal6; + int intVal4 = (floatVal6 = floatVal5 - val6) == 0.0F ? 0 : (floatVal6 < 0.0F ? -1 : 1); + if (intVal3 == 0) { + intVal4 = intVal4 < 0 ? 1 : 0; + } + + return ((intVal4 & 1) != 0); + } + + public FloatProperty(@Nullable Float val8) { + super(val8); + } + + protected boolean f(@Nullable Float val9) { + Float val10 = val9; + if (val9 == null) { + return this.value != null; + } + + val10 = this.value; + + if (val10 == null) { + return true; + } + + val10 = this.value; + + float floatVal7 = val10; + float floatVal8; + int intVal5 = (floatVal8 = floatVal7 - val9) == 0.0F ? 0 : (floatVal8 < 0.0F ? -1 : 1); + intVal5 = intVal5 > 0 ? 1 : 0; + + return ((intVal5 & 1) != 0); + } + + @NotNull + public static FloatProperty a(@Nullable Float val11) { + return new FloatProperty(val11); + } + + protected void b(@Nullable Float val12) { + FloatProperty floatProperty2 = this; + Float val13 = floatProperty2.value; + float floatVal9 = val13; + floatVal9 -= val12; + floatProperty2.value = floatVal9; + } + + @NotNull + public static FloatProperty getFloatPropertyB() { + return new FloatProperty(); + } + + protected FloatProperty getFloatPropertyA() { + return this; + } + + public FloatProperty() { + this(0.0F); + } + + @Override + protected void subtract(java.lang.Float value) { + this.c(value); + } + + @Override + protected cc.novoline.modules.configurations.property.object.FloatProperty self() { + return this.getFloatPropertyA(); + } + + @Override + protected void add(java.lang.Float value) { + this.b(value); + } + + @Override + protected boolean isLessThan(java.lang.Float value) { + return this.d(value); + } + + @Override + protected boolean isWithinBounds(java.lang.Float value) { + return this.e(value); + } + + @Override + protected boolean isGreaterThan(java.lang.Float value) { + return this.f(value); + } + + @NotNull + public static FloatProperty of(@Nullable Float value) { + return a(value); + } + @NotNull + public static FloatProperty of() { + return new FloatProperty(); + } +} diff --git a/src/main/java/cc/novoline/modules/configurations/property/object/ImmutableBooleanProperty.java b/src/main/java/cc/novoline/modules/configurations/property/object/ImmutableBooleanProperty.java new file mode 100644 index 0000000..3056fc1 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/property/object/ImmutableBooleanProperty.java @@ -0,0 +1,23 @@ +package cc.novoline.modules.configurations.property.object; + +import cc.novoline.modules.configurations.util.ImmutableBooleanTag; +import org.jetbrains.annotations.Nullable; + +public final class ImmutableBooleanProperty extends BooleanProperty { + public ImmutableBooleanProperty(Boolean param, ImmutableBooleanTag immutableBooleanTag) { + this(param); +} + + private ImmutableBooleanProperty(@Nullable Boolean param) { + super(param); +} + + public void runVoidA(@Nullable Boolean param) { + throw new UnsupportedOperationException("Tried to change immutable property"); +} + + @Override + public void set(@Nullable Boolean param) { + this.runVoidA(param); +} +} diff --git a/src/main/java/cc/novoline/modules/configurations/property/object/IntProperty.java b/src/main/java/cc/novoline/modules/configurations/property/object/IntProperty.java new file mode 100644 index 0000000..e1b6ad6 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/property/object/IntProperty.java @@ -0,0 +1,231 @@ +package cc.novoline.modules.configurations.property.object; + +import cc.novoline.modules.configurations.property.AbstractNumberProperty; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class IntProperty extends AbstractNumberProperty { + private static int f; + + public static void b(int intVal) { + f = intVal; + } + + public static int g() { + return f; + } + + public IntProperty(@Nullable Integer integer) { + super(integer); + } + + public void a(@Nullable Integer integer2) { + label18: { + int intVal2 = getIntValue(); + IntProperty intProperty = this; + if (intVal2 == 0) { + if (this.value != null) { + break label18; + } + + intProperty = this; + } + + intProperty.value = integer2; + if (intVal2 == 0) { + return; + } + } + + if (integer2 != null) { + Integer integer3 = this.value; + int intVal3 = integer3; + intVal3 -= integer2; + this.i(intVal3); + } + } + + @NotNull + public static IntProperty f(@Nullable Integer integer4) { + return new IntProperty(integer4); + } + + public IntProperty() { + this(0); + } + + protected boolean is6FlagC(@NotNull Integer integer5) { + int intVal4; + Number number; + intVal4 = getIntValue(); + number = this.d; + label29: + if (intVal4 == 0) { + if (this.d != null) { + number = integer5; + if (intVal4 != 0) { + break label29; + } + + int intVal5 = integer5; + Integer integer6 = this.d; + if (intVal5 < integer6) { + return false; + } + } + + number = this.a; + } + + if (number == null) { + return true; + } + + int intVal6 = integer5; + if (intVal4 != 0) { + return ((intVal6 & 1) != 0); + } + + Integer integer7 = this.a; + return intVal6 <= integer7; + } + + public void runVoid3E(@Nullable Integer integer8) { + label18: { + int intVal7 = getIntValue(); + IntProperty intProperty2 = this; + if (intVal7 == 0) { + if (this.value != null) { + break label18; + } + + intProperty2 = this; + } + + intProperty2.value = integer8; + if (intVal7 == 0) { + return; + } + } + + if (integer8 != null) { + Integer integer9 = this.value; + int intVal8 = integer9; + intVal8 += integer8; + this.i(intVal8); + } + } + + public boolean is2FlagD(@Nullable Integer integer10) { + int intVal9 = getIntValue(); + Integer integer11 = integer10; + if (intVal9 == 0) { + if (integer10 == null) { + return false; + } + + integer11 = this.value; + } + + if (intVal9 == 0) { + if (integer11 == null) { + return true; + } + + integer11 = this.value; + } + + int intVal10 = integer11; + if (intVal9 == 0) { + intVal10 = intVal10 < integer10 ? 1 : 0; + } + + return ((intVal10 & 1) != 0); + } + + public static int getIntValue() { + int intVal11 = g(); + return intVal11 == 0 ? 85 : 0; + } + + static { + if (g() == 0) { + b(85); + } + } + + @NotNull + public static IntProperty getIntPropertyA() { + return new IntProperty(); + } + + protected IntProperty getIntPropertyF() { + return this; + } + + public boolean b(@Nullable Integer integer12) { + int intVal12 = getIntValue(); + Integer integer13 = integer12; + if (intVal12 == 0) { + if (integer12 == null) { + return this.value != null; + } + + integer13 = this.value; + } + + if (intVal12 == 0) { + if (integer13 == null) { + return true; + } + + integer13 = this.value; + } + + int intVal13 = integer13; + if (intVal12 == 0) { + intVal13 = intVal13 > integer12 ? 1 : 0; + } + + return ((intVal13 & 1) != 0); + } + + @Override + protected cc.novoline.modules.configurations.property.object.IntProperty self() { + return this.getIntPropertyF(); + } + + @Override + public boolean isGreaterThan(java.lang.Integer value) { + return this.b(value); + } + + @Override + public boolean isLessThan(java.lang.Integer value) { + return this.is2FlagD(value); + } + + @Override + protected boolean isWithinBounds(java.lang.Integer value) { + return this.is6FlagC(value); + } + + @Override + public void add(java.lang.Integer value) { + this.a(value); + } + + @Override + public void subtract(java.lang.Integer value) { + this.runVoid3E(value); + } + + @NotNull + public static IntProperty of(@Nullable Integer value) { + return f(value); + } + @NotNull + public static IntProperty of() { + return new IntProperty(); + } +} diff --git a/src/main/java/cc/novoline/modules/configurations/property/object/KeyBindProperty.java b/src/main/java/cc/novoline/modules/configurations/property/object/KeyBindProperty.java new file mode 100644 index 0000000..00e605d --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/property/object/KeyBindProperty.java @@ -0,0 +1,32 @@ +package cc.novoline.modules.configurations.property.object; + +import cc.novoline.modules.binds.KeyboardKeybind; +import cc.novoline.modules.binds.ModuleKeybind; +import cc.novoline.modules.configurations.property.AbstractProperty; +import org.jetbrains.annotations.Nullable; +import org.lwjgl.input.Keyboard; + +public final class KeyBindProperty extends AbstractProperty { + public KeyBindProperty(@Nullable ModuleKeybind moduleKeybind) { + super(moduleKeybind); +} + + public boolean isStateReady() { + ModuleKeybind keybind = this.value; + int keyCode = keybind.getStateTicks(); + boolean flag = keybind instanceof KeyboardKeybind; + + if (!flag) { + throw new UnsupportedOperationException(); + } + + flag = Keyboard.isKeyDown(keyCode); + + + return flag; +} + + + + public boolean isHeld() { return this.isStateReady(); } +} diff --git a/src/main/java/cc/novoline/modules/configurations/property/object/ListProperty.java b/src/main/java/cc/novoline/modules/configurations/property/object/ListProperty.java new file mode 100644 index 0000000..bc357ff --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/property/object/ListProperty.java @@ -0,0 +1,372 @@ +package cc.novoline.modules.configurations.property.object; +import cc.novoline.modules.exceptions.NumberPropertyException; + +import cc.novoline.modules.configurations.property.AbstractProperty; +import com.google.common.collect.Collections2; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import java.io.PrintStream; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.Range; + +public final class ListProperty extends AbstractProperty> { + protected List a; + + public ListProperty(@Nullable Type type, @Nullable Type type2, @Nullable Type type3) { + this(IntProperty.getIntValue(), true, initialValues(type, type2, type3)); + } + + public ListProperty b(@NotNull Collection collection) { + this.a = new ObjectArrayList<>(collection); + return this; + } + + public boolean b(@Nullable Type type4) { + int intVal; + Object val; + intVal = IntProperty.g(); + val = this.a; + label29: + if (intVal != 0) { + if (this.a != null) { + val = this.a; + if (intVal == 0) { + break label29; + } + + if (!this.a.contains(type4)) { + return false; + } + } + + val = this.value; + } + + if (intVal != 0) { + if (val == null) { + this.c(new ObjectArrayList<>()); + } + + val = this.value; + } + + return ((List)val).add(type4); + } + + public boolean a(Type type5) { + int intVal2 = IntProperty.getIntValue(); + Object val2 = this.value; + if (intVal2 == 0) { + if (this.value == null) { + return false; + } + + val2 = this.value; + } + + return ((List)val2).contains(type5); + } + + public ListProperty() { + this(new ObjectArrayList<>()); + } + + @SafeVarargs + public ListProperty(@NotNull Type... typeArr) { + this(new ObjectArrayList<>((Type[])typeArr)); + } + + public Type a(@Range(from = 0L, to = 2147483647L) int intVal3) { + Object val3 = this.value; + val3 = this.value != null ? this.value.get(intVal3) : null; + + return (Type)val3; + } + + public int b() { + Object val4 = this.value; + if (this.value == null) { + return 0; + } + + val4 = this.value; + + return ((List)val4).size(); + } + + public ListProperty(@Nullable Type type6, @Nullable Type type7) { + this(IntProperty.getIntValue(), false, initialValues(type6, type7)); + } + + + + @NotNull + public static ListProperty a(@Nullable Type type8, @Nullable Type type9) { + return new ListProperty<>((Type)type8, (Type)type9); + } + + public ListProperty(@NotNull List list) { + super(list); + } + + @NotNull + public static ListProperty a(@NotNull Collection collection2) { + return new ListProperty<>(new ObjectArrayList<>(collection2)); + } + + public ListProperty(@NotNull Collection collection3) { + this(new ObjectArrayList<>(collection3)); + } + + @SafeVarargs + public final ListProperty b(@NotNull Type... typeArr2) { + this.a = new ObjectArrayList<>((Type[])typeArr2); + return this; + } + + @SafeVarargs + @NotNull + public static ListProperty a(@NotNull Type... typeArr3) { + return new ListProperty<>((Type[])typeArr3); + } + + private boolean a(@NotNull List list2) { + boolean flag; + int intVal4; + List list3; + label74: { + intVal4 = IntProperty.getIntValue(); + List list4 = this.a; + if (intVal4 == 0) { + if (this.a == null) { + return true; + } + + list4 = list2; + } + + boolean flag2 = list4.isEmpty(); + if (intVal4 != 0) { + return flag2; + } + + if (!flag2) { + list3 = this.a; + if (intVal4 != 0) { + break label74; + } + + if (!this.a.isEmpty()) { + list3 = list2; + break label74; + } + } + + return true; + } + + Iterator iterator2 = list3.iterator(); + + while (true) { + if (iterator2.hasNext()) { + Object val5 = iterator2.next(); + flag = this.a.contains(val5); + if (intVal4 != 0) { + break; + } + + if (intVal4 != 0) { + return flag; + } + + if (!flag) { + return false; + } + + if (intVal4 == 0) { + continue; + } + } + + flag = true; + break; + } + + return flag; + } + + public boolean d() { + int intVal5 = IntProperty.getIntValue(); + Object val6 = this.value; + if (intVal5 == 0) { + if (this.value == null) { + return true; + } + + val6 = this.value; + } + + return ((List)val6).isEmpty(); + } + + @NotNull + public static ListProperty b(@NotNull List list5) { + return new ListProperty<>(list5); + } + + private boolean lambdaImpl$set$0(Object val7) { + boolean flag3 = this.a.contains(val7); + flag3 = !flag3; + + return flag3; + } + + public void c(@Nullable List list6) { + label26: { + ListProperty listProperty; + List list7; + if (list6 != null) { + listProperty = this; + list7 = list6; + + + if (!this.a(list6)) { + break label26; + } + } + + listProperty = this; + list7 = list6; + + super.set(list7); + + return; + } + + PrintStream printStream = System.out; + StringBuilder stringBuilder = new StringBuilder().append("VALUES: "); + List list8 = this.a(); + printStream.println(stringBuilder.append(list8).toString()); + StringBuilder stringBuilder2 = new StringBuilder(); + String textStr = "Unable to set "; + StringBuilder stringBuilder3 = stringBuilder2.append(textStr); + StringBuilder stringBuilder4 = stringBuilder3.append(list6); + textStr = " as it contains unacceptable value(s): "; + StringBuilder stringBuilder5 = stringBuilder4.append(textStr); + Collection collection4 = Collections2.filter(list6, this::lambdaImpl$set$0); + throw new NumberPropertyException(stringBuilder5.append(collection4).toString(), this); + } + + @NotNull + public static ListProperty c() { + return new ListProperty<>(); + } + + public ListProperty(@Nullable Type type10) { + this(new ObjectArrayList<>(singletonValue(type10))); + } + + @NotNull + public static ListProperty c(@Nullable Type type11) { + return new ListProperty<>((Type)type11); + } + + public List a() { + return this.a; + } + + @NotNull + public static ListProperty a(@Nullable Type type12, @Nullable Type type13, @Nullable Type type14) { + return new ListProperty<>((Type)type12, (Type)type13, (Type)type14); + } + + public boolean d(@Nullable Type type15) { + int intVal6 = IntProperty.getIntValue(); + Object val8 = this.value; + if (intVal6 == 0) { + if (this.value == null) { + return false; + } + + val8 = this.value; + } + + return ((List)val8).remove(type15); + } + + private static List singletonValue(Value value) { + return Collections.singletonList(value); + } + + @SafeVarargs + private static List initialValues(Value... values) { + return new ObjectArrayList<>(Arrays.asList(values)); + } + + private ListProperty(int guard, boolean threeValues, List values) { + this(values); + if (threeValues) { + if (guard != 0) {} + } else if (((Object[])null) != null) { + IntProperty.b(guard + 1); + } + } + + @Override + public void set(List value) { + this.c(value); + } + + @SafeVarargs + @NotNull + public static ListProperty of(@NotNull Type... values) { + return a(values); + } + @NotNull + public static ListProperty of(@Nullable Type v1, @Nullable Type v2) { + return a(v1, v2); + } + @NotNull + public static ListProperty of(@Nullable Type v1, @Nullable Type v2, @Nullable Type v3) { + return a(v1, v2, v3); + } + @NotNull + public static ListProperty of(@Nullable Type v1) { + return c(v1); + } + @SafeVarargs + public final ListProperty acceptableValues(@NotNull Type... values) { + return this.b(values); + } + public ListProperty acceptableValues(@NotNull Collection values) { + return this.b(values); + } + public boolean contains(Type value) { + return this.a(value); + } + public boolean isEmpty() { + return this.d(); + } + public int size() { + return this.b(); + } + public boolean add(@Nullable Type value) { + return this.b(value); + } + public boolean remove(@Nullable Type value) { + return this.d(value); + } + + public List getAcceptableValues() { return this.a(); } + + @NotNull public static ListProperty ofList(@NotNull List values) { return b(values); } + @NotNull public static ListProperty ofCollection(@NotNull Collection values) { return a(values); } + @NotNull public static ListProperty empty() { return c(); } + public Type getAt(int index) { return this.a(index); } +} diff --git a/src/main/java/cc/novoline/modules/configurations/property/object/LongProperty.java b/src/main/java/cc/novoline/modules/configurations/property/object/LongProperty.java new file mode 100644 index 0000000..1fcca8d --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/property/object/LongProperty.java @@ -0,0 +1,156 @@ +package cc.novoline.modules.configurations.property.object; + +import cc.novoline.modules.configurations.property.AbstractNumberProperty; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public final class LongProperty extends AbstractNumberProperty { + @NotNull + public static LongProperty getLongPropertyA() { + return new LongProperty(); + } + + @NotNull + public static LongProperty f(@Nullable Long val) { + return new LongProperty(val); + } + + protected boolean e(@Nullable Long val2) { + Long val3 = val2; + if (val2 == null) { + return false; + } + + val3 = this.value; + + if (val3 == null) { + return true; + } + + val3 = this.value; + + long longVal = val3; + long longVal2; + int intVal = (longVal2 = longVal - val2) == 0L ? 0 : (longVal2 < 0L ? -1 : 1); + intVal = intVal < 0 ? 1 : 0; + + return ((intVal & 1) != 0); + } + + protected boolean a(@NotNull Long val4) { + int intVal2; + Number number; + intVal2 = IntProperty.g(); + number = this.d; + label29: + if (intVal2 != 0) { + if (this.d != null) { + number = val4; + if (intVal2 == 0) { + break label29; + } + + long longVal3 = val4; + Long val5 = this.d; + if (longVal3 < val5) { + return false; + } + } + + number = this.a; + } + + if (number == null) { + return true; + } + + long longVal4 = val4; + Long val6 = this.a; + long longVal5; + int intVal3 = (longVal5 = longVal4 - val6) == 0L ? 0 : (longVal5 < 0L ? -1 : 1); + return (boolean)(intVal2 == 0 ? intVal3 : intVal3 <= 0); + } + + protected void d(@Nullable Long val7) { + LongProperty longProperty = this; + Long val8 = longProperty.value; + long longVal6 = val8; + longVal6 += val7; + longProperty.value = longVal6; + } + + public LongProperty(@Nullable Long val9) { + super(val9); + } + + protected boolean b(@Nullable Long val10) { + Long val11 = val10; + if (val10 == null) { + return this.value != null; + } + + val11 = this.value; + + if (val11 == null) { + return true; + } + + val11 = this.value; + + long longVal7 = val11; + long longVal8; + int intVal4 = (longVal8 = longVal7 - val10) == 0L ? 0 : (longVal8 < 0L ? -1 : 1); + intVal4 = intVal4 > 0 ? 1 : 0; + + return ((intVal4 & 1) != 0); + } + + protected void c(@Nullable Long val12) { + LongProperty longProperty2 = this; + Long val13 = longProperty2.value; + long longVal9 = val13; + longVal9 -= val12; + longProperty2.value = longVal9; + } + + protected LongProperty getLongPropertyB() { + return this; + } + + public LongProperty() { + this(0L); + } + + @Override + protected void subtract(java.lang.Long value) { + this.d(value); + } + + @Override + protected boolean isLessThan(java.lang.Long value) { + return this.e(value); + } + + @Override + protected cc.novoline.modules.configurations.property.object.LongProperty self() { + return this.getLongPropertyB(); + } + + @Override + protected boolean isGreaterThan(java.lang.Long value) { + return this.b(value); + } + + @Override + protected boolean isWithinBounds(java.lang.Long value) { + return this.a(value); + } + + @Override + protected void add(java.lang.Long value) { + this.c(value); + } + + @NotNull public static LongProperty of(@Nullable Long value) { return f(value); } + @NotNull public static LongProperty of() { return getLongPropertyA(); } +} diff --git a/src/main/java/cc/novoline/modules/configurations/property/object/StringProperty.java b/src/main/java/cc/novoline/modules/configurations/property/object/StringProperty.java new file mode 100644 index 0000000..a5d6273 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/property/object/StringProperty.java @@ -0,0 +1,203 @@ +package cc.novoline.modules.configurations.property.object; + +import cc.novoline.modules.exceptions.NumberPropertyException; + +import cc.novoline.modules.configurations.property.AbstractProperty; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.function.Predicate; +import java.util.stream.Stream; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public final class StringProperty extends AbstractProperty { + private List a; + + public boolean c(@Nullable String textStr) { + int intVal = IntProperty.getIntValue(); + String textStr2 = textStr; + if (intVal == 0) { + if (textStr == null) { + return this.value == null; + } + + textStr2 = textStr; + } + + return textStr2.equalsIgnoreCase(this.value); + } + + @NotNull + public static StringProperty e(@Nullable String textStr3) { + return new StringProperty(textStr3); + } + + public boolean b(@Nullable String... strArr) { + String[] strArr2 = strArr; + if (strArr == null) { + return this.value == null; + } + + strArr2 = strArr; + + Stream stream2 = Arrays.stream(strArr2); + Predicate predicate = this::lambdaImpl$equals$0; + return stream2.anyMatch(predicate); + } + + @NotNull + public static StringProperty a() { + return new StringProperty(); + } + + public void d(@Nullable String textStr4) { + label26: { + int intVal2 = IntProperty.getIntValue(); + if (intVal2 == 0) { + StringProperty stringProperty; + String textStr5; + label23: { + if (textStr4 != null) { + stringProperty = this; + textStr5 = textStr4; + if (intVal2 != 0) { + break label23; + } + + if (!this.a(textStr4)) { + break label26; + } + } + + stringProperty = this; + textStr5 = textStr4; + } + + super.set(textStr5); + } + + if (intVal2 == 0) { + return; + } + } + + StringBuilder stringBuilder = new StringBuilder(); + String textStr6 = "Unable to set "; + stringBuilder = stringBuilder.append(textStr6); + stringBuilder = stringBuilder.append(textStr4); + textStr6 = " as it's unacceptable value: "; + stringBuilder = stringBuilder.append(textStr6); + throw new NumberPropertyException(stringBuilder.append(textStr4).toString(), this); + } + + public boolean b(@Nullable String textStr7) { + int intVal3 = IntProperty.getIntValue(); + String textStr8 = textStr7; + if (intVal3 == 0) { + if (textStr7 == null) { + return this.value == null; + } + + textStr8 = textStr7; + } + + return textStr8.equals(this.value); + } + + + + private boolean lambdaImpl$equals$0(String textStr9) { + return textStr9.equals(this.value); + } + + private boolean a(@NotNull String textStr10) { + int intVal4 = IntProperty.getIntValue(); + List list = this.a; + if (intVal4 == 0) { + if (this.a == null) { + return true; + } + + list = this.a; + } + + boolean flag = list.isEmpty(); + if (intVal4 == 0) { + if (flag) { + return true; + } + + list = this.a; + flag = list.contains(textStr10); + } + + return flag; + } + + public StringProperty a(@NotNull Collection collection) { + this.a = new ObjectArrayList<>(collection); + return this; + } + + public StringProperty a(@Nullable Object val) { + StringBuilder stringBuilder2 = new StringBuilder(); + String textStr11 = this.get(); + stringBuilder2 = stringBuilder2.append(textStr11); + this.d(stringBuilder2.append(val).toString()); + return this; + } + + public StringProperty() { + this(""); + } + + public final StringProperty a(@NotNull String... strArr3) { + this.a = new ObjectArrayList<>(strArr3); + return this; + } + + public StringProperty(@Nullable String textStr12) { + super(textStr12); + } + + public List b() { + return this.a; + } + + @Override + public void set(java.lang.String value) { + this.d(value); + } + + @NotNull + public static StringProperty of(@Nullable String value) { + return e(value); + } + @NotNull + public static StringProperty of() { + return a(); + } + public boolean equalsIgnoreCase(@Nullable String value) { + return this.c(value); + } + public boolean equalsAny(@Nullable String... values) { + return this.b(values); + } + + public boolean equals(@Nullable String value) { + return this.b(value); + } + public final StringProperty acceptableValues(@NotNull String... values) { + return this.a(values); + } + public StringProperty acceptableValues(@NotNull Collection values) { + return this.a(values); + } + public List getAcceptableValues() { + return this.b(); + } + + public StringProperty append(@Nullable Object value) { return this.a(value); } +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/AnimatedColorBar.java b/src/main/java/cc/novoline/modules/configurations/util/AnimatedColorBar.java new file mode 100644 index 0000000..187e5a0 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/AnimatedColorBar.java @@ -0,0 +1,440 @@ +package cc.novoline.modules.configurations.util; + + +import net.minecraft.client.gui.Gui; +import cc.novoline.events.EventManager; +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.events.events.RenderGuiEvent; +import cc.novoline.events.type.GuiState; +import cc.novoline.modules.combat.TargetHUD; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.visual.HUD; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.MovementUtils; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.Timer; +import cc.novoline.utils.anim.SmoothAnimation; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.shader.GaussianBlurShader; +import cc.novoline.utils.shader.RoundedTextureShader; +import cc.novoline.utils.shader.HudNotificationBox; +import cc.novoline.modules.ModuleRegistry; +import java.awt.Color; +import java.util.UUID; +import net.minecraft.client.gui.GuiChat; +import cc.novoline.utils.fonts.holders.FontFamilySF_REGULAR; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.MathHelper; +import cc.novoline.utils.fonts.api.FontFamily; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.DefaultPlayerSkin; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class AnimatedColorBar { + private int stateTicks; + private boolean stateFlag; + private double cachedValue; + private double cachedValue2; + private SmoothAnimation smoothAnim; + private double cachedValue3; + private double cachedValue4; + private EntityPlayer entityPlayer; + private float floatValue; + private HudNotificationBox hudNotificationBoxField; + private Timer msTimer; + private double cachedValue5; + final TargetHUD targetHUD; + private double cachedValue6; + + public void performAction() { + this.smoothAnim.applyDouble(0.2); + this.msTimer.reset(); + this.stateTicks = -1; + EventManager.unregister(this); +} + + public void applyEntityPlayer(EntityPlayer player) { + this.entityPlayer = player; + BooleanProperty boolProp = this.targetHUD.getDrawDropEffect(); + Boolean propFlag = boolProp.get(); + if (propFlag && this.entityPlayer != null && this.entityPlayer.hurtTime == 9) { + StringProperty strProp = this.targetHUD.getColorType(); + if (strProp.equals("Fade")) { + HudNotificationBox hudNotificationBox = this.hudNotificationBoxField; + ColorProperty colorProp = this.targetHUD.getColorBegin(); + Integer color = colorProp.getColorInt(); + int intVal = color; + ColorProperty colorProp2 = this.targetHUD.getColorEnd(); + Integer color2 = colorProp2.getColorInt(); + int intVal3 = color2; + IntProperty intProp = this.targetHUD.getDropEffectQuantity(); + Integer intVal4 = intProp.get(); + hudNotificationBox.applyUpdate2(intVal, intVal3, 20.0, intVal4); + } else { + StringProperty strProp2 = this.targetHUD.getColorType(); + if (strProp2.equals("Static")) { + HudNotificationBox hudNotificationBox2 = this.hudNotificationBoxField; + ColorProperty colorProp3 = this.targetHUD.getColor(); + Integer color3 = colorProp3.getColorInt(); + int intVal2 = color3; + IntProperty intProp2 = this.targetHUD.getDropEffectQuantity(); + Integer intVal5 = intProp2.get(); + hudNotificationBox2.applyUpdate(intVal2, 20.0, intVal5); + } else { + HudNotificationBox hudNotificationBox3 = this.hudNotificationBoxField; + IntProperty intProp3 = this.targetHUD.getDropEffectQuantity(); + Integer intVal6 = intProp3.get(); + hudNotificationBox3.applyUpdate3(20.0, intVal6); + } + } + } +} + + private int evaluateInt(int value) { + boolean flag = this.smoothAnim.isStateFlag(); + double doubleVal = this.msTimer.getScaledElapsed(flag ? 800L : 500L, 1.0); + int intVal = (int)(value * (flag ? 1.0 - doubleVal : doubleVal)); + return MathHelper.clamp(intVal, 35, 255); +} + + private double evaluateInt(double value) { + boolean flag = this.smoothAnim.isStateFlag(); + double doubleVal = this.msTimer.getScaledElapsed(flag ? 800L : 500L, 1.0); + double doubleVal2 = value * (flag ? 1.0 - doubleVal : doubleVal); + return MathHelper.clamp_double(doubleVal2, 0.05, 1.0); +} + + private void updateTargetHUDState() { + double doubleVal = this.targetHUD.getCachedValue(); + double doubleVal2 = this.targetHUD.getCachedValue3(); + double doubleVal3 = this.cachedValue6; + double doubleVal4 = this.cachedValue3; + IntProperty intProp = this.targetHUD.getRoundness(); + Integer intVal = intProp.get(); + double doubleVal5 = intVal.intValue() * 0.5; + int color = ColorTheme.BLACK.getRGB(); + RenderUtils.drawRoundedRect(doubleVal, doubleVal2, doubleVal3, doubleVal4, doubleVal5, color); +} + + public void performAction2() { + if (this.entityPlayer != null) { + double doubleVal = MovementUtils.evaluateDouble(true); + this.evaluateInt(this.entityPlayer); + MovementUtils.unscale(doubleVal); + } +} + + private AnimatedColorBar(TargetHUD targetHUD) { + this.targetHUD = targetHUD; + this.smoothAnim = new SmoothAnimation(); + this.msTimer = new Timer(); + this.hudNotificationBoxField = new HudNotificationBox(); +} + + private void renderElement(EntityPlayer player, HUD hUD, double value, double amount, double offset, double dist, double value2, int index, int count, int num) { + float health = player.getHealth(); + float floatVal = player.computeFloat(); + Minecraft mcClient = TargetHUD.resolveMinecraft2(this.targetHUD); + float floatVal2 = 2000 / mcClient.getDebugFPS(); + if (this.stateTicks != player.getEntityId()) { + this.floatValue = health; + this.stateTicks = player.getEntityId(); + } else if (this.floatValue > health) { + float floatVal3 = this.floatValue - 0.00625F * floatVal2; + this.floatValue = MathHelper.clamp(floatVal3, health, 999.0F); + } else if (this.floatValue < health) { + float floatVal4 = this.floatValue + 0.00625F * floatVal2; + this.floatValue = MathHelper.clamp(floatVal4, 0.0F, health); + } + + int intVal = this.evaluateInt(50); + int color = ColorTheme.getColor(0, 0, 0, intVal); + RenderUtils.drawRoundedRect(value, amount, offset, dist, value2, color); + double doubleVal = offset / floatVal * this.floatValue; + StringProperty strProp = this.targetHUD.getColorType(); + if (strProp.equals("Fade")) { + RenderUtils.drawElement5(value, amount, doubleVal, dist, value2, count, num); + } else { + StringProperty strProp2 = this.targetHUD.getColorType(); + if (strProp2.equals("Static")) { + RenderUtils.drawRoundedRect(value, amount, doubleVal, dist, value2, index); + } else { + color = ColorTheme.evaluateInt4(index); + int intVal2 = this.evaluateInt(255); + color = ColorTheme.reAlpha(color, intVal2); + RenderUtils.drawRoundedRect(value, amount, doubleVal, dist, value2, color); + } + } +} + + @EventTarget + public void onRender2D(Render2DEvent event) { + if (this.smoothAnim.getValue() <= 0.05) { + EventManager.unregister(this); + } else { + this.performAction2(); + } +} + + public void updateHelper(EntityPlayer player) { + double doubleVal = MovementUtils.evaluateDouble(true); + this.evaluateInt(player); + MovementUtils.unscale(doubleVal); +} + + public void performAction3() { + StringProperty strProp = this.targetHUD.getColorType(); + if (strProp.equals("Breath")) { + HudNotificationBox hudNotificationBox = this.hudNotificationBoxField; + ListProperty listProp = this.targetHUD.getShaders(); + boolean flag = listProp.contains("Glow"); + ColorProperty colorProp = this.targetHUD.getColor(); + Integer color = colorProp.getColorInt(); + int intVal = color; + StringProperty strProp2 = this.targetHUD.getDropEffectMode(); + hudNotificationBox.applyUpdate(flag, intVal, strProp2.equals("Square")); + } else { + HudNotificationBox hudNotificationBox2 = this.hudNotificationBoxField; + ListProperty listProp2 = this.targetHUD.getShaders(); + boolean flag2 = listProp2.contains("Glow"); + StringProperty strProp3 = this.targetHUD.getDropEffectMode(); + hudNotificationBox2.applyUpdate3(flag2, strProp3.equals("Square")); + } +} + + private float evaluateInt(float value) { + boolean flag = this.smoothAnim.isStateFlag(); + double doubleVal = this.msTimer.getScaledElapsed(flag ? 800L : 500L, 1.0); + float floatVal = (float)(value * (flag ? 1.0 - doubleVal : doubleVal)); + return MathHelper.clamp(floatVal, 0.05F, 1.0F); +} + + public void evaluateInt(Runnable runnable) { + this.smoothAnim.renderVisual2(this.cachedValue5, this.cachedValue2, 0.1, runnable, 200L, 300L); +} + + public AnimatedColorBar(TargetHUD targetHUD, TargetHudTag targetHudTag) { + this(targetHUD); +} + + private void evaluateInt(EntityPlayer player) { + HUD hUD = ModuleRegistry.HUD.getModule(); + FontRenderer font = FontFamilySF_REGULAR.FAMILY.ofSize(19); + double[] doubleArr = new double[]{this.targetHUD.getCachedValue()}; + double[] doubleArr2 = new double[]{this.targetHUD.getCachedValue3()}; + String nameStr = player.getName(); + int width = 78 + font.stringWidth(nameStr); + this.cachedValue6 = Math.max(105, width); + this.cachedValue3 = 50.0; + this.cachedValue5 = doubleArr[0] + this.cachedValue6 * 0.5; + this.cachedValue2 = doubleArr2[0] + this.cachedValue3 * 0.5; + ColorProperty colorProp = this.targetHUD.getColor(); + Integer color = colorProp.getColorInt(); + int intVal = color; + int intVal4 = this.evaluateInt(255); + int color4 = ColorTheme.reAlpha(intVal, intVal4); + ColorProperty colorProp2 = this.targetHUD.getColorBegin(); + Integer color2 = colorProp2.getColorInt(); + int intVal2 = color2; + int intVal5 = this.evaluateInt(255); + int color5 = ColorTheme.reAlpha(intVal2, intVal5); + ColorProperty colorProp3 = this.targetHUD.getColorEnd(); + Integer color3 = colorProp3.getColorInt(); + int intVal3 = color3; + int intVal6 = this.evaluateInt(255); + int color6 = ColorTheme.reAlpha(intVal3, intVal6); + this.evaluateInt(((Runnable) (() -> this.invokeCallback(doubleArr, doubleArr2)))); + this.hudNotificationBoxField.doubleField2 = doubleArr[0] + 21.0; + this.hudNotificationBoxField.doubleField = doubleArr2[0] + 21.0; + this.performAction3(); + this.evaluateInt(((Runnable) (() -> this.invokeCallback2(player, doubleArr, doubleArr2, font)))); + ListProperty listProp = this.targetHUD.getShaders(); + if (listProp.contains("Glow")) { + GaussianBlurShader gaussianBlurShader = GaussianBlurShader.getGaussianBlurShader(); + width = this.evaluateInt(255); + Runnable runnable = ((Runnable) (() -> { this.evaluateInt(((java.lang.Runnable) () -> { this.renderElement(player, hUD, doubleArr[0] + 5.0, doubleArr2[0] + this.cachedValue3 - 9.0, this.cachedValue6 - 10.0, 5.0, 0.0, color4, color5, color6); })); })); + gaussianBlurShader.renderVisual(12, width, true, runnable, null); + } + + this.evaluateInt(((Runnable) (() -> { this.renderElement(player, hUD, doubleArr[0] + 5.0, doubleArr2[0] + this.cachedValue3 - 9.0, this.cachedValue6 - 10.0, 5.0, 0.0, color4, color5, color6); }))); +} + + public void performAction4() { + this.smoothAnim.reset(); + this.msTimer.reset(); + EventManager.register(this); +} + + private void renderElement2(EntityPlayer player, double value, double amount, double offset, double dist) { + UUID uUID = player.getUUID2(); + NetworkPlayerInfo networkPlayerInfo = NetHandlerPlayClient.applyS3BPacketScoreboardObjective(uUID); + ResourceLocation resLoc; + if (networkPlayerInfo == null) { + resLoc = DefaultPlayerSkin.getDefaultSkin(player.getUUID2()); + } else { + resLoc = networkPlayerInfo.getLocationSkin(); + } + + value -= offset * 0.5; + amount -= offset * 0.5; + Minecraft mcClient = TargetHUD.resolveMinecraft(this.targetHUD); + TextureManager texManager = mcClient.getTextureManager(); + texManager.bindTexture(resLoc); + GlStateManager.enableBlend(); + GlStateManager.alphaFunc(516, 0.0F); + GL11.glColor4d(1.0, 1.0, 1.0, dist); + Gui.renderStep(value, amount, 8.0F, 8.0F, 8, 8, offset, offset, 64.0F, 64.0F); + double doubleVal = value + offset; + double doubleVal2 = amount + offset; + int hurtTime2 = 10 * player.hurtTime; + int color = ColorTheme.getColor(255, 0, 0, hurtTime2); + RenderUtils.drawRect(value, amount, doubleVal, doubleVal2, color); +} + + public void performAction5() { + if (this.entityPlayer != null) { + double doubleVal = MovementUtils.evaluateDouble(true); + this.evaluateInt(this::updateTargetHUDState); + MovementUtils.unscale(doubleVal); + } +} + + private void invokeCallback(double[] doubleArray, double[] values) { + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal = doubleArray[0]; + double doubleVal2 = values[0]; + double doubleVal3 = this.cachedValue6; + double doubleVal4 = this.cachedValue3; + IntProperty intProp = this.targetHUD.getRoundness(); + Integer intVal = intProp.get(); + double doubleVal5 = intVal.intValue(); + IntProperty intProp2 = this.targetHUD.getSmoothness(); + Integer intVal2 = intProp2.get(); + double doubleVal6 = intVal2.intValue(); + IntProperty intProp3 = this.targetHUD.getAlpha(); + Integer intVal3 = intProp3.get(); + Color awtColor = new Color(0, 0, 0, this.evaluateInt(intVal3)); + roundedTextureShader.drawRoundedRect(doubleVal, doubleVal2, doubleVal3, doubleVal4, doubleVal5, doubleVal6, awtColor, true); +} + + private void invokeCallback2(EntityPlayer player, double[] doubleArray, double[] values, FontRenderer font) { + this.renderElement2(player, doubleArray[0] + 21.0, values[0] + 21.0, 32.0 - 0.2 * player.hurtTime, this.evaluateInt(1.0)); + String nameStr = player.getName(); + String textStr = "Name: "; + boolean flag = this.smoothAnim.getValue() != 1.0; + double doubleVal = doubleArray[0] + 41.0; + double doubleVal2 = values[0] + 7.0; + int intVal = this.evaluateInt(255); + font.drawElement3(textStr, doubleVal, doubleVal2, ColorTheme.reAlpha(268435455, intVal), true, flag); + doubleVal = doubleArray[0] + 41.0; + doubleVal += font.stringWidth(textStr); + doubleVal2 = values[0] + 7.0; + intVal = this.evaluateInt(255); + font.drawElement3(nameStr, doubleVal, doubleVal2, ColorTheme.reAlpha(268435455, intVal), true, flag); + StringBuilder sb = new StringBuilder().append("Disance: "); + EntityPlayerSP player2 = TargetHUD.resolveMinecraft11(this.targetHUD).thePlayer; + doubleVal = player2.getDistanceToEntity(player); + doubleVal = MathHelper.roundToDecimal(doubleVal, 1); + String textStr2 = sb.append(doubleVal).toString(); + doubleVal = doubleArray[0] + 41.0; + doubleVal2 = values[0] + 18.0; + intVal = this.evaluateInt(255); + font.drawElement3(textStr2, doubleVal, doubleVal2, ColorTheme.reAlpha(268435455, intVal), true, flag); + sb = new StringBuilder(); + sb = sb.append("Health: "); + doubleVal = player.getHealth(); + doubleVal = MathHelper.roundToDecimal(doubleVal, 1); + String textStr3 = sb.append(doubleVal).toString(); + doubleVal = doubleArray[0] + 41.0; + doubleVal2 = values[0] + 29.0; + intVal = this.evaluateInt(255); + font.drawElement3(textStr3, doubleVal, doubleVal2, ColorTheme.reAlpha(268435455, intVal), true, flag); +} + + public static SmoothAnimation evaluateInt(AnimatedColorBar animatedColorBar) { + return animatedColorBar.smoothAnim; +} + + public void evaluateInt(RenderGuiEvent event) { + if (event.getGuiScreen() instanceof GuiChat) { + int intVal = event.getMouseX(); + double doubleVal = MovementUtils.evaluateDouble(intVal); + intVal = event.getMouseY(); + double doubleVal2 = MovementUtils.scaleYInt(intVal); + DoubleProperty doubleProp = this.targetHUD.getPosX(); + Double propDouble = doubleProp.get(); + double doubleVal3 = propDouble; + DoubleProperty doubleProp2 = TargetHUD.resolveDoubleProperty(this.targetHUD); + Double propDouble2 = doubleProp2.get(); + double doubleVal12 = propDouble2; + boolean flag = doubleVal > doubleVal3 && doubleVal <= doubleVal3 + this.cachedValue6 && doubleVal2 > doubleVal12 && doubleVal2 <= doubleVal12 + this.cachedValue3; + if (event.getState() == GuiState.CLICK) { + if (event.getMouseButton() == 0 && flag) { + this.cachedValue = doubleVal3 - doubleVal; + this.cachedValue4 = doubleVal12 - doubleVal2; + this.stateFlag = true; + } + } else if (event.getState() == GuiState.RENDER) { + if (this.stateFlag) { + DoubleProperty doubleProp3 = TargetHUD.resolveDoubleProperty2(this.targetHUD); + double doubleVal13 = this.cachedValue + doubleVal; + DoubleProperty doubleProp4 = TargetHUD.resolveDoubleProperty2(this.targetHUD); + Double doubleVal4 = doubleProp4.getMinimum(); + double doubleVal14 = doubleVal4; + DoubleProperty doubleProp5 = TargetHUD.resolveDoubleProperty2(this.targetHUD); + Double doubleVal5 = doubleProp5.getMaximum(); + double doubleVal15 = doubleVal5; + doubleVal13 = MathHelper.clamp_double(doubleVal13, doubleVal14, doubleVal15); + Double doubleVal6 = doubleVal13; + doubleProp3.set(doubleVal6); + DoubleProperty doubleProp6 = TargetHUD.resolveDoubleProperty(this.targetHUD); + double doubleVal7 = this.cachedValue4 + doubleVal2; + doubleProp4 = TargetHUD.resolveDoubleProperty(this.targetHUD); + Double doubleVal8 = doubleProp4.getMinimum(); + double doubleVal16 = doubleVal8; + doubleProp5 = TargetHUD.resolveDoubleProperty(this.targetHUD); + Double doubleVal9 = doubleProp5.getMaximum(); + double doubleVal17 = doubleVal9; + doubleVal7 = MathHelper.clamp_double(doubleVal7, doubleVal16, doubleVal17); + Double doubleVal10 = doubleVal7; + doubleProp6.set(doubleVal10); + } + + if (!TargetHUD.checkTargetHUD2(this.targetHUD)) { + this.updateHelper(this.entityPlayer = TargetHUD.resolveMinecraft8(this.targetHUD).thePlayer); + } + + if (flag) { + double doubleVal11 = MovementUtils.evaluateDouble(true); + double doubleVal18 = this.cachedValue6; + double doubleVal19 = this.cachedValue3; + int color = ColorTheme.getColor(0, 0, 0, 100); + int color2 = ColorTheme.WHITE.getRGB(); + RenderUtils.drawBorderedRoundedRect(doubleVal3, doubleVal12, doubleVal18, doubleVal19, 0.0, 2.5F, color, color2); + MovementUtils.unscale(doubleVal11); + } + } else if (event.getState() == GuiState.RELEASE && event.getMouseButton() == 0) { + this.stateFlag = false; + } else if (event.getState() == GuiState.INITIAL && !TargetHUD.checkTargetHUD2(this.targetHUD)) { + this.performAction(); + } else if (event.getState() == GuiState.CLOSE && !TargetHUD.checkTargetHUD(this.targetHUD)) { + this.performAction4(); + } + } +} + + public cc.novoline.utils.anim.SmoothAnimation getSmoothAnim() { return this.smoothAnim; } +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/ClickGuiSettingRow.java b/src/main/java/cc/novoline/modules/configurations/util/ClickGuiSettingRow.java new file mode 100644 index 0000000..6763365 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/ClickGuiSettingRow.java @@ -0,0 +1,3605 @@ +package cc.novoline.modules.configurations.util; +import cc.novoline.events.EventManager; +import cc.novoline.events.events.BindKeyEvent; +import cc.novoline.events.events.SettingEvent; +import cc.novoline.gui.click.ClickGuiModuleRow; +import cc.novoline.gui.click.GuiBlurFramebuffer; +import cc.novoline.gui.screen.ClickGUI; +import cc.novoline.gui.screen.click.Tab; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.binds.KeyboardKeybind; +import cc.novoline.modules.binds.ModuleKeybind; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.visual.ClickGui; +import cc.novoline.modules.visual.HUD; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontFamilySF_MEDIUM; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.utils.shader.RoundedTextureShader; +import cc.novoline.modules.ModuleRegistry; +import java.awt.Color; +import java.util.Iterator; +import java.util.List; +import java.util.function.Consumer; + +import cc.novoline.utils.fonts.holders.FontFamilySF_BOLD; +import net.minecraft.client.renderer.GlStateManager; + +import net.minecraft.util.MathHelper; +import cc.novoline.utils.fonts.api.FontFamily; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +public class ClickGuiSettingRow { + private boolean stateFlag; + private double cachedValue; + private double cachedValue2; + private TimerUtil timer = new TimerUtil(); + private float cachedAngle; + private float cachedAngle2; + private boolean stateFlag2; + private boolean flagValue; + private TimerUtil timer2; + private boolean stateFlag3; + private float rowProgress; + private int stateTicks = 20; + private float y; + private ClickGuiModuleRow clickGuiModuleRowField; + private static boolean z; + private Color accentColor; + private double cachedValue3; + private boolean stateFlag4; + public boolean flagField; + private float cachedAngle3; + private boolean stateFlag5; + private boolean flagValueField; + private double cachedValue4; + private Setting settingField; + private boolean stateFlag6; + private float cachedAngle4; + + public void drawElement(ClickGui clickGui, int value) { + cc.novoline.modules.configurations.util.ClickGuiSettingRow settingRow; + cc.novoline.modules.configurations.util.ClickGuiSettingRow settingRow2; + HUD hudMod = ModuleRegistry.HUD.getModule(); + GL11.glEnable(3089); + ClickGuiModuleRow modRow = this.clickGuiModuleRowField; + Tab guiTab = modRow.getTab(); + float floatVal = (float)guiTab.getPosX() + 6.0F; + float floatVal2 = this.rowProgress; + Tab guiTab2 = this.clickGuiModuleRowField.getTab(); + GuiBlurFramebuffer.renderPanel(floatVal, floatVal2, (float)(guiTab2.getPosX() + 80.0), this.rowProgress + 20.0F); + modRow = this.clickGuiModuleRowField; + Tab guiTab3 = modRow.getTab(); + ClickGUI clickGuiScreen = guiTab3.getClickGUI(); + FontFamily fontFam = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font = fontFam.ofSize(20); + String displayName2 = this.settingField.getDisplayName(); + Tab guiTab4 = this.clickGuiModuleRowField.getTab(); + clickGuiScreen.drawScaledString(font, displayName2, guiTab4.getPosX() - this.cachedValue4, this.rowProgress + 6.5, -1, true); + GL11.glDisable(3089); + ClickGui clickGuiMod = clickGui; + + StringProperty strProp = clickGui.getStringPropertyR(); + String textStr = "Basic"; + label102: + if (strProp.equals(textStr)) { + FontFamily fontFam2 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font2 = fontFam2.ofSize(20); + String displayName = this.settingField.getDisplayName(); + int width = font2.stringWidth(displayName); + if (width <= 75) { + break label102; + } + + GlStateManager.disableTexture2D(); + GL11.glShadeModel(7425); + GL11.glBegin(5); + width = -2; + + int intVal = width; + + while (true) { + FontFamily fontFam3 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font3 = fontFam3.ofSize(18); + if (intVal < font3.getHeight() + 4) { + Color awtColor = new Color(55, 55, 55, 255); + int color = awtColor.getRGB(); + RenderUtils.glColor(color); + ClickGuiModuleRow modRow2 = this.clickGuiModuleRowField; + Tab guiTab5 = modRow2.getTab(); + GL11.glVertex2d(guiTab5.getPosX() + 80.0, this.rowProgress + 5.0F + intVal); + Color awtColor2 = new Color(55, 55, 55, 0); + int color2 = awtColor2.getRGB(); + RenderUtils.glColor(color2); + ClickGuiModuleRow modRow3 = this.clickGuiModuleRowField; + Tab guiTab6 = modRow3.getTab(); + GL11.glVertex2d(guiTab6.getPosX() + 60.0, this.rowProgress + 5.0F + intVal); + intVal++; + + continue; + } + + GL11.glEnd(); + break; + } + + GlStateManager.enableTexture2D(); + } + + clickGuiMod = clickGui; + + + double doubleVal; + label95: { + label94: { + doubleVal = clickGuiMod.getDoubleValue(); + StringProperty strProp2 = clickGui.getStringPropertyR(); + if (!strProp2.equals("Basic")) { + break label94; + } + + ClickGuiModuleRow modRow4 = this.clickGuiModuleRowField; + Tab guiTab7 = modRow4.getTab(); + double doubleVal2 = (float)(guiTab7.getPosX() + 86.0); + double doubleVal7 = this.rowProgress + 3.0F; + int color3 = (new Color(45, 45, 45)).getRGB(); + int color4 = (new Color(40, 40, 40)).getRGB(); + RenderUtils.drawBorderedRoundedRect(doubleVal2, doubleVal7, 35.0, 13.0, 6.0, 2.0F, color3, color4); + + + break label95; + + } + + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + modRow = this.clickGuiModuleRowField; + Tab guiTab8 = modRow.getTab(); + double doubleVal3 = (float)(guiTab8.getPosX() + 86.0); + double doubleVal8 = this.rowProgress + 3.0F; + Color awtColor5 = new Color(0, 0, 0, (int)(200.0 * doubleVal)); + roundedTextureShader.drawRoundedRect(doubleVal3, doubleVal8, 35.0, 13.0, 12.0, 1.5, awtColor5, true); + } + + label86: { + StringProperty strProp3 = clickGui.getStringPropertyR(); + if (strProp3.equals("Basic")) { + ClickGuiModuleRow modRow5 = this.clickGuiModuleRowField; + Tab guiTab9 = modRow5.getTab(); + double doubleVal4 = guiTab9.getPosX() + 92.5 + this.cachedAngle3; + double doubleVal9 = this.rowProgress + 9.5; + double doubleVal10 = 11.0 * clickGui.getCachedValue(); + Color awtColor3 = new Color(55, 55, 55); + Color awtColor6 = new Color(value); + double doubleVal11 = this.cachedAngle4; + int intVal2 = RenderUtils.interpolateColor(awtColor3, awtColor6, doubleVal11); + RenderUtils.renderVisual5(doubleVal4, doubleVal9, doubleVal10, intVal2); + break label86; + } + + ClickGuiModuleRow modRow6 = this.clickGuiModuleRowField; + Tab guiTab10 = modRow6.getTab(); + double doubleVal5 = guiTab10.getPosX() + 92.5 + this.cachedAngle3; + double doubleVal12 = this.rowProgress + 9.5; + double doubleVal13 = 11.0 * clickGui.getCachedValue(); + Color awtColor4 = new Color(0, 0, 0, (int)(200.0 * doubleVal)); + Color awtColor7 = new Color(value); + double doubleVal14 = this.cachedAngle4; + int intVal3 = RenderUtils.interpolateColor(awtColor4, awtColor7, doubleVal14); + RenderUtils.renderVisual5(doubleVal5, doubleVal12, doubleVal13, intVal3); + } + + double doubleVal6 = this.cachedAngle3; + Boolean flag3 = this.settingField.getBoolean(); + byte byteVal = (byte)(flag3 ? 1 : 0); + byteVal = (byte)(byteVal != 0 ? 22 : 0); + + label80: { + this.cachedAngle3 = (float)(doubleVal6 + (byteVal - this.cachedAngle3) * 0.1); + Boolean flag4 = this.settingField.getBoolean(); + if (flag4) { + settingRow = this; + + if (!(this.cachedAngle4 < 1.0F)) { + settingRow = this; + + if (!(this.y < 1.0F)) { + break label80; + } + } + + double doubleVal15 = this.cachedAngle4 + 0.05; + this.cachedAngle4 = (float)Math.min(1.0, doubleVal15); + settingRow = this; + + double doubleVal16 = this.y + 0.05; + settingRow.y = (float)Math.min(1.0, doubleVal16); + break label80; + } + + settingRow2 = this; + + if (this.cachedAngle4 <= 0.0F) { + settingRow2 = this; + + if (!(this.y > 0.0F)) { + break label80; + } + } + + double doubleVal17 = this.cachedAngle4 - 0.05; + this.cachedAngle4 = (float)Math.max(0.0, doubleVal17); + settingRow2 = this; + + double doubleVal18 = this.y - 0.05; + settingRow2.y = (float)Math.max(0.0, doubleVal18); + } +} + + public boolean isStateFlag() { + return this.stateFlag; +} + + public boolean isStateFlag6() { + return this.stateFlag6; +} + + public void renderElement(ClickGui clickGui, int value, int index, int count) { + double doubleVal; + double doubleVal5; + int intVal3 = (a() ? 1 : 0); + HUD hudMod = ModuleRegistry.HUD.getModule(); + boolean flag = (intVal3 != 0); + GL11.glEnable(3089); + ClickGuiModuleRow modRow = this.clickGuiModuleRowField; + Tab guiTab = modRow.getTab(); + float floatVal = (float)guiTab.getPosX() + 6.0F; + float floatVal5 = this.rowProgress; + ClickGuiModuleRow modRow2 = this.clickGuiModuleRowField; + Tab guiTab2 = modRow2.getTab(); + GuiBlurFramebuffer.renderPanel(floatVal, floatVal5, (float)(guiTab2.getPosX() + 95.0), this.rowProgress + 20.0F); + ClickGuiModuleRow modRow3 = this.clickGuiModuleRowField; + Tab guiTab3 = modRow3.getTab(); + if (flag) { + ClickGUI clickGuiScreen = guiTab3.getClickGUI(); + FontFamily fontFam = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font = fontFam.ofSize(20); + String displayName2 = this.settingField.getDisplayName(); + Tab guiTab4 = this.clickGuiModuleRowField.getTab(); + clickGuiScreen.drawScaledString(font, displayName2, guiTab4.getPosX() - this.cachedValue4, this.rowProgress + 6.0F, -1, true); + GL11.glDisable(3089); + StringProperty strProp = clickGui.getStringPropertyR(); + String textStr = "Basic"; + label102: + if (strProp.equals(textStr)) { + FontFamily fontFam2 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font2 = fontFam2.ofSize(20); + String displayName = this.settingField.getDisplayName(); + int width = font2.stringWidth(displayName); + if (flag) { + if (width <= 100) { + break label102; + } + + GlStateManager.disableTexture2D(); + GL11.glShadeModel(7425); + GL11.glBegin(5); + width = -2; + } + + int intVal = width; + + while (true) { + FontFamily fontFam3 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font3 = fontFam3.ofSize(18); + if (intVal < font3.getHeight() + 3) { + Color awtColor = new Color(55, 55, 55, 255); + intVal3 = awtColor.getRGB(); + RenderUtils.glColor(intVal3); + ClickGuiModuleRow modRow4 = this.clickGuiModuleRowField; + Tab guiTab5 = modRow4.getTab(); + GL11.glVertex2d(guiTab5.getPosX() + 90.0, this.rowProgress + 5.0F + intVal); + Color awtColor2 = new Color(55, 55, 55, 0); + intVal3 = awtColor2.getRGB(); + RenderUtils.glColor(intVal3); + ClickGuiModuleRow modRow5 = this.clickGuiModuleRowField; + Tab guiTab6 = modRow5.getTab(); + GL11.glVertex2d(guiTab6.getPosX() + 40.0, this.rowProgress + 5.0F + intVal); + intVal++; + if (!flag) { + break; + } + + if (flag) { + continue; + } + } + + GL11.glEnd(); + break; + } + + GlStateManager.enableTexture2D(); + } + + ClickGuiModuleRow modRow6 = this.clickGuiModuleRowField; + guiTab3 = modRow6.getTab(); + } + + double doubleVal6; + label95: { + doubleVal = guiTab3.getPosX() + 117.0; + doubleVal5 = this.rowProgress + 8.5; + ClickGuiSettingRow settingRow = this; + if (flag) { + if (this.flagValueField) { + doubleVal6 = 90.0 - this.settingField.getMsTimer().computeDoubleFromLong(100L, 90.0); + break label95; + } + + settingRow = this; + } + + doubleVal6 = settingRow.settingField.getMsTimer().computeDoubleFromLong(100L, 90.0); + } + + RenderUtils.drawElement(doubleVal, doubleVal5, 2.5F, -1, 6.0, doubleVal6); + ClickGuiSettingRow settingRow2 = this; + if (flag) { + if (!this.flagValueField) { + return; + } + + settingRow2 = this; + } + + label83: { + float floatVal2; + float floatVal6; + label82: { + floatVal6 = settingRow2.rowProgress + 20.0F; + float floatVal3 = this.rowProgress + 20.0F; + ListProperty listProp = this.settingField.getListProperty(); + List itemList = listProp.getAcceptableValues(); + floatVal2 = floatVal3 + itemList.size() * 15; + if (flag) { + StringProperty strProp2 = clickGui.getStringPropertyR(); + if (!strProp2.equals("Basic")) { + break label82; + } + + ClickGuiModuleRow modRow7 = this.clickGuiModuleRowField; + Tab guiTab7 = modRow7.getTab(); + double doubleVal2 = guiTab7.getPosX(); + double doubleVal7 = floatVal6; + modRow2 = this.clickGuiModuleRowField; + Tab guiTab8 = modRow2.getTab(); + double doubleVal8 = guiTab8.getPosX() + 130.0; + double doubleVal9 = floatVal2; + int color = (new Color(40, 40, 40)).getRGB(); + RenderUtils.drawRect(doubleVal2, doubleVal7, doubleVal8, doubleVal9, color); + ClickGuiModuleRow modRow8 = this.clickGuiModuleRowField; + Tab guiTab9 = modRow8.getTab(); + float floatVal4 = (float)(guiTab9.getPosX() + 6.0); + float floatVal7 = floatVal2 - floatVal6; + Color awtColor3 = new Color(45, 45, 45); + int color2 = awtColor3.getRGB(); + RenderUtils.drawElement(floatVal4, floatVal6, 113.0F, floatVal7, 5.0F, color2); + } + + if (flag) { + break label83; + } + } + + ClickGuiModuleRow modRow9 = this.clickGuiModuleRowField; + Tab guiTab10 = modRow9.getTab(); + double doubleVal3 = guiTab10.getPosX(); + double doubleVal10 = floatVal6; + modRow2 = this.clickGuiModuleRowField; + Tab guiTab11 = modRow2.getTab(); + double doubleVal11 = guiTab11.getPosX() + 130.0; + double doubleVal12 = floatVal2; + Color awtColor4 = new Color(0, 0, 0, (int)(120.0 * clickGui.getDoubleValue())); + int color3 = awtColor4.getRGB(); + RenderUtils.drawRect(doubleVal3, doubleVal10, doubleVal11, doubleVal12, color3); + } + + int intVal2 = 0; + + do { + ListProperty listProp2 = this.settingField.getListProperty(); + List itemList2 = listProp2.getAcceptableValues(); + if (intVal2 >= itemList2.size()) { + break; + } + + label120: { + double doubleVal4 = this.rowProgress + 20.0F + intVal2 * 15; + ListProperty listProp3 = this.settingField.getListProperty(); + List itemList3 = listProp3.getAcceptableValues(); + String textStr2 = (String)itemList3.get(intVal2); + StringProperty strProp3 = clickGui.getStringPropertyR(); + if (strProp3.equals("Basic")) { + ClickGuiModuleRow modRow10 = this.clickGuiModuleRowField; + Tab guiTab12 = modRow10.getTab(); + ClickGUI clickGuiScreen2 = guiTab12.getClickGUI(); + FontFamily fontFam4 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font4 = fontFam4.ofSize(25); + String textStr3 = "."; + ClickGuiModuleRow modRow11 = this.clickGuiModuleRowField; + Tab guiTab13 = modRow11.getTab(); + double doubleVal13 = guiTab13.getPosX() + 12.0; + double doubleVal14 = doubleVal4 - 0.5; + ListProperty listProp4 = this.settingField.getListProperty(); + List itemList4 = (List)listProp4.get(); + int intVal4 = (itemList4.contains(textStr2) ? 1 : 0); + if (flag) { + if (intVal4 != 0) { + intVal4 = ColorTheme.evaluateInt(count, 1.0); + } else { + Color awtColor5 = new Color(120, 120, 120); + intVal4 = awtColor5.getRGB(); + } + } + + clickGuiScreen2.drawScaledString(font4, textStr3, doubleVal13, doubleVal14, intVal4, true); + ClickGuiModuleRow modRow12 = this.clickGuiModuleRowField; + Tab guiTab14 = modRow12.getTab(); + ClickGUI clickGuiScreen3 = guiTab14.getClickGUI(); + FontFamily fontFam5 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font5 = fontFam5.ofSize(18); + modRow11 = this.clickGuiModuleRowField; + Tab guiTab15 = modRow11.getTab(); + double doubleVal15 = guiTab15.getPosX() + 18.0; + doubleVal14 = doubleVal4 + 5.0; + ListProperty listProp5 = this.settingField.getListProperty(); + List itemList5 = (List)listProp5.get(); + int intVal5 = (itemList5.contains(textStr2) ? 1 : 0); + if (flag) { + if (intVal5 != 0) { + intVal5 = ColorTheme.evaluateInt(count, 1.0); + } else { + Color awtColor6 = new Color(120, 120, 120); + intVal5 = awtColor6.getRGB(); + } + } + + clickGuiScreen3.drawScaledString(font5, textStr2, doubleVal15, doubleVal14, intVal5, true); + if (flag) { + break label120; + } + } + + ClickGuiModuleRow modRow13 = this.clickGuiModuleRowField; + Tab guiTab16 = modRow13.getTab(); + ClickGUI clickGuiScreen4 = guiTab16.getClickGUI(); + FontFamily fontFam6 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font6 = fontFam6.ofSize(25); + String textStr4 = "."; + ClickGuiModuleRow modRow14 = this.clickGuiModuleRowField; + Tab guiTab17 = modRow14.getTab(); + double doubleVal16 = guiTab17.getPosX() + 12.0; + double doubleVal17 = doubleVal4 - 0.5; + ListProperty listProp6 = this.settingField.getListProperty(); + List itemList6 = (List)listProp6.get(); + int intVal6 = (itemList6.contains(textStr2) ? 1 : 0); + if (flag) { + if (intVal6 != 0) { + intVal6 = ColorTheme.evaluateInt(count, 1.0); + } else { + Color awtColor7 = new Color(160, 160, 160); + intVal6 = awtColor7.getRGB(); + } + } + + clickGuiScreen4.drawScaledString(font6, textStr4, doubleVal16, doubleVal17, intVal6, true); + ClickGuiModuleRow modRow15 = this.clickGuiModuleRowField; + Tab guiTab18 = modRow15.getTab(); + ClickGUI clickGuiScreen5 = guiTab18.getClickGUI(); + FontFamily fontFam7 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font7 = fontFam7.ofSize(18); + modRow14 = this.clickGuiModuleRowField; + Tab guiTab19 = modRow14.getTab(); + double doubleVal18 = guiTab19.getPosX() + 18.0; + doubleVal17 = doubleVal4 + 5.0; + ListProperty listProp7 = this.settingField.getListProperty(); + List itemList7 = (List)listProp7.get(); + int intVal7 = (itemList7.contains(textStr2) ? 1 : 0); + if (flag) { + if (intVal7 != 0) { + intVal7 = ColorTheme.evaluateInt(count, 1.0); + } else { + Color awtColor8 = new Color(160, 160, 160); + intVal7 = awtColor8.getRGB(); + } + } + + clickGuiScreen5.drawScaledString(font7, textStr2, doubleVal18, doubleVal17, intVal7, true); + } + + intVal2++; + } while (flag); +} + + public void setStateFlag6(boolean flag) { + this.stateFlag6 = flag; +} + + public void setStateFlag(boolean flag) { + this.stateFlag = flag; +} + + public void processHelper(ClickGui clickGui, int value, int index) { + double doubleVal; + float floatVal4; + double doubleVal7; + float floatVal5; + boolean flag; + int intVal; + HUD hudMod = ModuleRegistry.HUD.getModule(); + int intVal2 = (a() ? 1 : 0); + GL11.glEnable(3089); + ClickGuiModuleRow modRow = this.clickGuiModuleRowField; + Tab guiTab = modRow.getTab(); + float floatVal = (float)guiTab.getPosX() + 6.0F; + float floatVal6 = this.rowProgress; + ClickGuiModuleRow modRow2 = this.clickGuiModuleRowField; + Tab guiTab2 = modRow2.getTab(); + GuiBlurFramebuffer.renderPanel(floatVal, floatVal6, (float)(guiTab2.getPosX() + 60.0), this.rowProgress + 20.0F); + flag = (boolean)((intVal2) != 0); + ClickGuiModuleRow modRow3 = this.clickGuiModuleRowField; + Tab guiTab3 = modRow3.getTab(); + ClickGUI clickGuiScreen = guiTab3.getClickGUI(); + FontFamily fontFam = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font = fontFam.ofSize(20); + String displayName2 = this.settingField.getDisplayName(); + modRow2 = this.clickGuiModuleRowField; + Tab guiTab4 = modRow2.getTab(); + clickGuiScreen.drawScaledString(font, displayName2, guiTab4.getPosX() - this.cachedValue4, this.rowProgress + 5.0F, -1, true); + GL11.glDisable(3089); + StringProperty strProp = clickGui.getStringPropertyR(); + intVal = (strProp.equals("Basic") ? 1 : 0); + label109: + if (flag) { + if (intVal != 0) { + FontFamily fontFam2 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font2 = fontFam2.ofSize(20); + String displayName = this.settingField.getDisplayName(); + intVal = font2.stringWidth(displayName); + if (!flag) { + break label109; + } + + if (intVal > 55) { + GlStateManager.disableTexture2D(); + GL11.glShadeModel(7425); + GL11.glBegin(5); + int intVal3 = -2; + + label102: { + do { + FontFamily fontFam3 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font3 = fontFam3.ofSize(18); + if (intVal3 >= font3.getHeight() + 3) { + break; + } + + Color awtColor = new Color(55, 55, 55, 255); + intVal2 = awtColor.getRGB(); + RenderUtils.glColor(intVal2); + ClickGuiModuleRow modRow4 = this.clickGuiModuleRowField; + Tab guiTab5 = modRow4.getTab(); + GL11.glVertex2d(guiTab5.getPosX() + 60.0, this.rowProgress + 5.0F + intVal3); + Color awtColor2 = new Color(55, 55, 55, 0); + intVal2 = awtColor2.getRGB(); + RenderUtils.glColor(intVal2); + ClickGuiModuleRow modRow5 = this.clickGuiModuleRowField; + Tab guiTab6 = modRow5.getTab(); + GL11.glVertex2d(guiTab6.getPosX() + 45.0, this.rowProgress + 5.0F + intVal3); + intVal3++; + if (!flag) { + break label102; + } + } while (flag); + + GL11.glEnd(); + } + + GlStateManager.enableTexture2D(); + } + } + + double doubleVal2 = value; + modRow = this.clickGuiModuleRowField; + Tab guiTab7 = modRow.getTab(); + double doubleVal3; + intVal = (doubleVal3 = doubleVal2 - (guiTab7.getPosX() + 55.0)) == 0.0 ? 0 : (doubleVal3 < 0.0 ? -1 : 1); + } + + label90: { + label114: { + if (flag) { + if (intVal < 0) { + break label114; + } + + double doubleVal4 = value; + modRow = this.clickGuiModuleRowField; + Tab guiTab8 = modRow.getTab(); + double doubleVal5; + intVal = (doubleVal5 = doubleVal4 - (guiTab8.getPosX() + 112.0)) == 0.0 ? 0 : (doubleVal5 < 0.0 ? -1 : 1); + } + + if (flag) { + if (intVal > 0) { + break label114; + } + + float floatVal2; + intVal = (floatVal2 = index - (this.rowProgress + 2.0F)) == 0.0F ? 0 : (floatVal2 < 0.0F ? -1 : 1); + } + + if (flag) { + if (intVal < 0) { + break label114; + } + + float floatVal3; + intVal = (floatVal3 = index - (this.rowProgress + 15.0F)) == 0.0F ? 0 : (floatVal3 < 0.0F ? -1 : 1); + } + + if (!flag) { + break label90; + } + + if (intVal <= 0) { + intVal = 1; + break label90; + } + } + + intVal = 0; + } + + int intVal6; + int intVal4 = intVal; + ClickGuiModuleRow modRow6 = this.clickGuiModuleRowField; + Tab guiTab9 = modRow6.getTab(); + doubleVal = guiTab9.getPosX() + 65.0; + floatVal4 = this.rowProgress + 2.0F; + ClickGuiModuleRow modRow7 = this.clickGuiModuleRowField; + Tab guiTab10 = modRow7.getTab(); + doubleVal7 = guiTab10.getPosX() + 122.0; + floatVal5 = this.rowProgress + 15.0F; + intVal6 = intVal4; + label69: + if (flag) { + if (intVal4 == 0) { + intVal6 = (this.stateFlag ? 1 : 0); + if (!flag) { + break label69; + } + + if (!this.stateFlag) { + Color awtColor3 = new Color(45, 45, 45); + intVal6 = awtColor3.getRGB(); + break label69; + } + } + + Color awtColor4 = new Color(50, 50, 50); + intVal6 = awtColor4.getRGB(); + } + + RenderUtils.drawRect(doubleVal, floatVal4, doubleVal7, floatVal5, intVal6); + ClickGuiModuleRow modRow8 = this.clickGuiModuleRowField; + Tab guiTab11 = modRow8.getTab(); + double doubleVal6 = guiTab11.getPosX() + 66.0; + double doubleVal8 = this.rowProgress + 3.0F; + ClickGuiModuleRow modRow9 = this.clickGuiModuleRowField; + Tab guiTab12 = modRow9.getTab(); + double doubleVal9 = guiTab12.getPosX() + 121.0; + double doubleVal10 = this.rowProgress + 14.0F; + Color awtColor5 = new Color(44, 44, 44); + intVal6 = awtColor5.getRGB(); + RenderUtils.drawRect(doubleVal6, doubleVal8, doubleVal9, doubleVal10, intVal6); + String textStr = this.settingField.getTextValue2(); + FontFamily fontFam4 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font4 = fontFam4.ofSize(18); + FontFamily fontFam5 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font5 = fontFam5.ofSize(18); + String textStr2 = font5.trimStringToWidth(textStr, 45, true); + ClickGuiModuleRow modRow10 = this.clickGuiModuleRowField; + Tab guiTab13 = modRow10.getTab(); + double doubleVal11 = guiTab13.getPosX() + 68.0; + double doubleVal12 = this.rowProgress + 6.0F; + font4.drawString(textStr2, doubleVal11, doubleVal12, -1, true); + int intVal5 = (this.stateFlag ? 1 : 0); + if (flag) { + if (!this.stateFlag) { + return; + } + + intVal5 = (Keyboard.isKeyDown(14) ? 1 : 0); + } + + if (flag) { + if (intVal5 == 0) { + return; + } + + TimerUtil timerUtil = this.timer2; + intVal5 = (timerUtil.delay(200L) ? 1 : 0); + } + + if (flag) { + if (intVal5 == 0) { + return; + } + + intVal5 = textStr.length(); + } + + if (intVal5 >= 1) { + StringProperty strProp2 = this.settingField.getStringPropertyField2(); + int len = textStr.length() - 1; + String textStr3 = textStr.substring(0, len); + strProp2.set(textStr3); + TimerUtil timerUtil2 = this.timer2; + timerUtil2.reset(); + } +} + + public void drawElement(char ch, int value) { + int intVal; + cc.novoline.gui.screen.setting.Setting setting2; + ClickGuiSettingRow settingRow; + + SettingType settingType = this.settingField.getSettingType(); + SettingType settingType2 = SettingType.TEXTBOX; + + if (settingType == SettingType.TEXTBOX) { + int intVal2 = (this.stateFlag ? 1 : 0); + + if (!this.stateFlag) { + return; + } + + intVal2 = value; + + + label321: { + label334: { + intVal = 1; + + if (intVal2 == 1) { + break label334; + } + + intVal2 = value; + intVal = 28; + + + if (intVal2 != intVal) { + break label321; + } + } + + this.stateFlag = false; + + return; + + } + + intVal2 = value; + intVal = 14; + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 157; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 29; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 54; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 42; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 15; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 58; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 211; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 199; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 210; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 200; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 208; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 205; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 203; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 56; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 184; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 197; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 70; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 207; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 201; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 209; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 221; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 59; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 60; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 61; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 62; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 63; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 64; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 65; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 66; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 67; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 68; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 87; + + + + if (intVal2 == intVal) { + return; + } + + intVal2 = value; + intVal = 88; + + + if (intVal2 == intVal) { + return; + } + + StringProperty strProp = this.settingField.getStringPropertyField2(); + Character character = ch; + strProp.append(character); + + return; + + } + + settingRow = this; + + settingType = this.settingField.getSettingType(); + settingType2 = SettingType.BINDABLE; + + + if (settingType != settingType2) { + return; + } + + settingRow = this; + + + if (!settingRow.stateFlag6) { + return; + } + + settingRow = this; + + + label156: { + + ClickGuiModuleRow modRow = settingRow.clickGuiModuleRowField; + AbstractModule mod = modRow.getModule(); + int intVal3 = value; + + if (value == 1) { + Setting setting3 = this.settingField; + + if (this.settingField.getName().equals("MODULE_BIND")) { + List itemList = SettingManager.getSettingsByMod(mod); + ((Setting)itemList.get(0)).getKeyBindProperty().set(KeyboardKeybind.of(0)); + List itemList5 = SettingManager.getSettingsByMod(mod); + AbstractModule mod2 = ((Setting)itemList5.get(0)).getAbstractModule(); + List itemList6 = SettingManager.getSettingsByMod(mod); + ModuleKeybind keybind = ((Setting)itemList6.get(0)).getKeyBindProperty().get(); + int keyCode = keybind.getKey(); + BindKeyEvent bindKeyEvent = new BindKeyEvent(mod2, 0, Keyboard.getKeyName(keyCode)); + EventManager.call(bindKeyEvent); + + break label156; + + } + + setting3 = this.settingField; + + + setting3.getKeyBindProperty().set(KeyboardKeybind.of(0)); + + break label156; + + } + + setting2 = this.settingField; + + intVal3 = (this.settingField.getName().equals("MODULE_BIND") ? 1 : 0); + + + if (intVal3 != 0) { + List itemList2 = SettingManager.getSettingsByMod(mod); + ((Setting)itemList2.get(0)).getKeyBindProperty().set(KeyboardKeybind.of(value)); + List itemList3 = SettingManager.getSettingsByMod(mod); + AbstractModule mod3 = ((Setting)itemList3.get(0)).getAbstractModule(); + List itemList4 = SettingManager.getSettingsByMod(mod); + ModuleKeybind keybind2 = ((Setting)itemList4.get(0)).getKeyBindProperty().get(); + int keyCode2 = keybind2.getKey(); + BindKeyEvent bindKeyEvent2 = new BindKeyEvent(mod3, value, Keyboard.getKeyName(keyCode2)); + EventManager.call(bindKeyEvent2); + + break label156; + + } + + setting2 = this.settingField; + + setting2.getKeyBindProperty().set(KeyboardKeybind.of(value)); + } + + this.stateFlag6 = false; + this.flagField = true; +} + + public void renderElement2(int value, int index, int count) { + Tab guiTab = this.clickGuiModuleRowField.getTab(); + double doubleVal = guiTab.getPosX() + 110.0; + Tab guiTab2 = this.clickGuiModuleRowField.getTab(); + double doubleVal2 = guiTab2.getPosX() + 5.0; + FontRenderer font = FontFamilySF_MEDIUM.FAMILY.ofSize(20); + String displayName = this.settingField.getDisplayName(); + int width = font.stringWidth(displayName); + double doubleVal3 = doubleVal - (doubleVal2 + Math.min(45, width) + 5.0); + ClickGuiModuleRow modRow = this.clickGuiModuleRowField; + Tab guiTab3 = modRow.getTab(); + double doubleVal4 = guiTab3.getPosX() + 120.0 - doubleVal3; + double doubleVal5; + int intVal = (doubleVal5 = value - doubleVal4) == 0.0 ? 0 : (doubleVal5 < 0.0 ? -1 : 1); + if (intVal < 0) { + return; + } + + if (value > (doubleVal4 + doubleVal3)) { + return; + } + + if (index < (this.rowProgress + 6.0F)) { + return; + } + + if (index > (this.rowProgress + 11.0F)) { + return; + } + + intVal = count; + + + if (intVal == 0) { + this.stateFlag4 = true; + } +} + + public void processHelper2(ClickGui clickGui, int value, int index) { + int intVal; + boolean flag; + cc.novoline.modules.configurations.util.ClickGuiSettingRow settingRow; + boolean flag2; + int intVal2; + HUD hudMod = ModuleRegistry.HUD.getModule(); + GL11.glEnable(3089); + int intVal3 = (a() ? 1 : 0); + Tab guiTab = this.clickGuiModuleRowField.getTab(); + float floatVal = (float)guiTab.getPosX() + 6.0F; + float floatVal7 = this.rowProgress; + ClickGuiModuleRow modRow = this.clickGuiModuleRowField; + Tab guiTab2 = modRow.getTab(); + GuiBlurFramebuffer.renderPanel(floatVal, floatVal7, (float)(guiTab2.getPosX() + 95.0), this.rowProgress + 20.0F); + flag2 = (boolean)((intVal3) != 0); + ClickGuiModuleRow modRow2 = this.clickGuiModuleRowField; + Tab guiTab3 = modRow2.getTab(); + ClickGUI clickGuiScreen = guiTab3.getClickGUI(); + FontFamily fontFam = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font = fontFam.ofSize(20); + String displayName2 = this.settingField.getDisplayName(); + modRow = this.clickGuiModuleRowField; + Tab guiTab4 = modRow.getTab(); + clickGuiScreen.drawScaledString(font, displayName2, guiTab4.getPosX() - this.cachedValue4, this.rowProgress + 6.0F, -1, true); + GL11.glDisable(3089); + StringProperty strProp = clickGui.getStringPropertyR(); + intVal2 = (strProp.equals("Basic") ? 1 : 0); + label209: + if (flag2) { + if (intVal2 != 0) { + FontFamily fontFam2 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font2 = fontFam2.ofSize(20); + String displayName = this.settingField.getDisplayName(); + intVal2 = font2.stringWidth(displayName); + if (!flag2) { + break label209; + } + + if (intVal2 > 90) { + GlStateManager.disableTexture2D(); + GL11.glShadeModel(7425); + GL11.glBegin(5); + int intVal4 = -2; + + label202: { + do { + FontFamily fontFam3 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font3 = fontFam3.ofSize(18); + if (intVal4 >= font3.getHeight() + 3) { + break; + } + + Color awtColor = new Color(55, 55, 55, 255); + intVal3 = awtColor.getRGB(); + RenderUtils.glColor(intVal3); + ClickGuiModuleRow modRow3 = this.clickGuiModuleRowField; + Tab guiTab5 = modRow3.getTab(); + GL11.glVertex2d(guiTab5.getPosX() + 100.0, this.rowProgress + 5.0F + intVal4); + Color awtColor2 = new Color(55, 55, 55, 0); + intVal3 = awtColor2.getRGB(); + RenderUtils.glColor(intVal3); + ClickGuiModuleRow modRow4 = this.clickGuiModuleRowField; + Tab guiTab6 = modRow4.getTab(); + GL11.glVertex2d(guiTab6.getPosX() + 50.0, this.rowProgress + 5.0F + intVal4); + intVal4++; + if (!flag2) { + break label202; + } + } while (flag2); + + GL11.glEnd(); + } + + GlStateManager.enableTexture2D(); + } + } + + ClickGuiModuleRow modRow5 = this.clickGuiModuleRowField; + Tab guiTab7 = modRow5.getTab(); + double doubleVal = guiTab7.getPosX() + 115.0; + double doubleVal30 = this.rowProgress + 10.0F; + double doubleVal31 = 14.0 * clickGui.getCachedValue(); + Color awtColor3 = this.settingField.getColor(); + Color awtColor4 = awtColor3.darker(); + Color awtColor5 = awtColor4.darker(); + int color2 = awtColor5.getRGB(); + RenderUtils.renderVisual5(doubleVal, doubleVal30, doubleVal31, color2); + ClickGuiModuleRow modRow6 = this.clickGuiModuleRowField; + Tab guiTab8 = modRow6.getTab(); + double doubleVal2 = guiTab8.getPosX() + 115.0; + double doubleVal32 = this.rowProgress + 10.0F; + double doubleVal33 = 12.0 * clickGui.getCachedValue(); + int intVal19 = this.settingField.getIntValue2(); + RenderUtils.renderVisual5(doubleVal2, doubleVal32, doubleVal33, intVal19); + intVal2 = (this.flagValueField ? 1 : 0); + } + + if (flag2) { + if (intVal2 == 0) { + return; + } + + StringProperty strProp2 = clickGui.getStringPropertyR(); + intVal2 = (strProp2.equals("Basic") ? 1 : 0); + } + + label184: { + if (intVal2 != 0) { + ClickGuiModuleRow modRow7 = this.clickGuiModuleRowField; + Tab guiTab9 = modRow7.getTab(); + double doubleVal3 = guiTab9.getPosX(); + double doubleVal34 = this.rowProgress + 20.0F; + ClickGuiModuleRow modRow8 = this.clickGuiModuleRowField; + Tab guiTab10 = modRow8.getTab(); + double doubleVal35 = guiTab10.getPosX() + 125.0; + double doubleVal36 = this.rowProgress + 20.0F + 83.0F; + int color3 = (new Color(45, 45, 45)).getRGB(); + RenderUtils.drawRect(doubleVal3, doubleVal34, doubleVal35, doubleVal36, color3); + if (flag2) { + break label184; + } + } + + ClickGuiModuleRow modRow9 = this.clickGuiModuleRowField; + Tab guiTab11 = modRow9.getTab(); + double doubleVal4 = guiTab11.getPosX(); + double doubleVal37 = this.rowProgress + 20.0F; + ClickGuiModuleRow modRow10 = this.clickGuiModuleRowField; + Tab guiTab12 = modRow10.getTab(); + double doubleVal38 = guiTab12.getPosX() + 125.0; + double doubleVal39 = this.rowProgress + 20.0F + 83.0F; + Color awtColor6 = new Color(0, 0, 0, (int)(60.0 * clickGui.getDoubleValue())); + int color4 = awtColor6.getRGB(); + RenderUtils.drawRect(doubleVal4, doubleVal37, doubleVal38, doubleVal39, color4); + } + + ClickGuiModuleRow modRow11 = this.clickGuiModuleRowField; + Tab guiTab13 = modRow11.getTab(); + double doubleVal5 = guiTab13.getPosX() + 2.0; + double doubleVal40 = this.rowProgress + 21.0F; + double doubleVal6 = 81.0; + ColorProperty colorProp = this.settingField.getColorProperty(); + Color awtColor7 = colorProp.getAwtColor(); + int intVal5 = awtColor7.getRed(); + int intVal20 = awtColor7.getGreen(); + Color awtColor8 = new Color(intVal5, intVal20, awtColor7.getBlue(), 255); + double doubleVal7 = doubleVal5 - 1.0; + double doubleVal41 = doubleVal40 - 1.0; + double doubleVal42 = doubleVal5 + doubleVal6 + 20.0; + double doubleVal43 = doubleVal40 + doubleVal6 + 1.0; + Color awtColor9 = new Color(45, 45, 45); + int color5 = awtColor9.getRGB(); + RenderUtils.drawRect(doubleVal7, doubleVal41, doubleVal42, doubleVal43, color5); + GL11.glPushMatrix(); + GlStateManager.disableTexture2D(); + GL11.glShadeModel(7425); + int intVal6 = 0; + + label178: { + while (intVal6 < doubleVal6) { + GL11.glBegin(7); + intVal3 = awtColor8.getRed(); + int intVal21 = awtColor8.getGreen(); + int intVal22 = awtColor8.getBlue(); + float[] floatArr4 = new float[3]; + float[] floatArr = Color.RGBtoHSB(intVal3, intVal21, intVal22, floatArr4); + float floatVal2 = floatArr[0]; + floatVal7 = 1.0F - intVal6 / 81.0F; + int intVal7 = Color.HSBtoRGB(floatVal2, 0.0F, floatVal7); + float floatVal3 = floatArr[0]; + floatVal7 = 1.0F - intVal6 / 81.0F; + int intVal8 = Color.HSBtoRGB(floatVal3, 1.0F, floatVal7); + RenderUtils.glColor(intVal7); + GL11.glVertex2d(doubleVal5, doubleVal40 + intVal6); + GL11.glVertex2d(doubleVal5, doubleVal40 + intVal6 + 1.0); + RenderUtils.glColor(intVal8); + GL11.glVertex2d(doubleVal5 + doubleVal6, doubleVal40 + intVal6 + 1.0); + GL11.glVertex2d(doubleVal5 + doubleVal6, doubleVal40 + intVal6); + GL11.glEnd(); + intVal6++; + if (!flag2) { + break label178; + } + + if (!flag2) { + break; + } + } + + GlStateManager.enableTexture2D(); + GL11.glPopMatrix(); + } + + int intVal9 = 0; + + label131: { + while (intVal9 < doubleVal6) { + float floatVal4 = intVal9 / 81.0F; + int intVal23 = Color.HSBtoRGB(floatVal4, 1.0F, 1.0F); + double doubleVal8 = doubleVal5 + doubleVal6 + 2.0; + double doubleVal44 = doubleVal40 + intVal9; + double doubleVal45 = doubleVal5 + doubleVal6 + 10.0; + double doubleVal46 = doubleVal40 + intVal9 + 1.0; + RenderUtils.drawRect(doubleVal8, doubleVal44, doubleVal45, doubleVal46, intVal23); + intVal9++; + if (!flag2) { + break label131; + } + + if (!flag2) { + break; + } + } + + intVal9 = 0; + } + + label167: { + label166: + while (true) { + int intVal10 = intVal9; + + label164: + while (true) { + if (intVal10 >= 3) { + break label166; + } + + intVal = 0; + if (!flag2) { + break label167; + } + + int intVal11 = 0; + + while (intVal11 < doubleVal6 / 3.0) { + intVal10 = intVal9 % 2; + if (!flag2) { + continue label164; + } + + Color awtColor10; + label219: { + if (flag2) { + if (intVal10 == 0) { + if (intVal11 % 2 == 0) { + awtColor10 = new Color(255, 255, 255); + if (flag2) { + break label219; + } + } + + awtColor10 = new Color(210, 210, 210); + if (flag2) { + break label219; + } + } + + intVal10 = intVal11 % 2; + } + + if (intVal10 == 0) { + awtColor10 = new Color(210, 210, 210); + if (flag2) { + break label219; + } + } + + awtColor10 = new Color(255, 255, 255); + } + + double doubleVal9 = doubleVal5 + doubleVal6 + 11.0 + 3 * intVal9; + double doubleVal47 = doubleVal40 + 3 * intVal11; + double doubleVal48 = doubleVal5 + doubleVal6 + 11.0 + 3 * intVal9 + 3.0; + double doubleVal49 = doubleVal40 + 3 * intVal11 + 3.0; + int color6 = awtColor10.getRGB(); + RenderUtils.drawRect(doubleVal9, doubleVal47, doubleVal48, doubleVal49, color6); + intVal11++; + if (!flag2) { + break; + } + } + + intVal9++; + if (!flag2) { + break label166; + } + break; + } + } + + intVal = 0; + } + + int intVal12 = intVal; + + label120: { + while (intVal12 < doubleVal6) { + double doubleVal10 = doubleVal5 + doubleVal6 + 11.0; + double doubleVal50 = doubleVal40 + intVal12; + double doubleVal51 = doubleVal5 + doubleVal6 + 20.0; + double doubleVal52 = doubleVal40 + intVal12 + 1.0; + int intVal24 = awtColor8.getRed(); + int intVal25 = awtColor8.getGreen(); + awtColor9 = new Color(intVal24, intVal25, awtColor8.getBlue(), 255 - (int)(intVal12 / 81.0F * 255.0F)); + int color7 = awtColor9.getRGB(); + RenderUtils.drawRect(doubleVal10, doubleVal50, doubleVal51, doubleVal52, color7); + intVal12++; + if (!flag2) { + break label120; + } + + if (!flag2) { + break; + } + } + + double doubleVal11 = doubleVal5 + doubleVal6 + 22.0; + double doubleVal53 = doubleVal5 + doubleVal6 + 30.0; + double doubleVal54 = doubleVal40 + 40.0; + int intVal13 = awtColor8.getRed(); + int intVal26 = awtColor8.getGreen(); + int intVal27 = awtColor8.getBlue(); + ColorProperty colorProp2 = this.settingField.getColorProperty(); + awtColor9 = new Color(intVal13, intVal26, intVal27, colorProp2.getAlpha()); + int color8 = awtColor9.getRGB(); + RenderUtils.drawRect(doubleVal11, doubleVal40, doubleVal53, doubleVal54, color8); + double doubleVal12 = doubleVal5 + doubleVal6 + 22.0; + double doubleVal55 = doubleVal40 + 41.0; + double doubleVal56 = doubleVal5 + doubleVal6 + 30.0; + double doubleVal57 = doubleVal40 + 81.0; + awtColor9 = this.accentColor; + int color9 = awtColor9.getRGB(); + RenderUtils.drawRect(doubleVal12, doubleVal55, doubleVal56, doubleVal57, color9); + } + + label110: { + label221: { + flag = this.flagValue; + if (flag2) { + if (this.flagValue) { + double doubleVal13 = 79.0; + double doubleVal14 = (index - (this.rowProgress + 22.0F)) / doubleVal13; + double doubleVal15 = MathHelper.clamp_double(doubleVal14, 0.0, 1.0) * 1.0; + this.cachedAngle = (float)doubleVal15; + intVal3 = awtColor7.getRed(); + int intVal28 = awtColor7.getGreen(); + int intVal29 = awtColor7.getBlue(); + float[] floatArr5 = new float[3]; + float[] floatArr2 = Color.RGBtoHSB(intVal3, intVal28, intVal29, floatArr5); + float floatVal5 = this.cachedAngle; + float floatVal8 = floatArr2[1]; + floatVal7 = floatArr2[2]; + int intVal14 = Color.HSBtoRGB(floatVal5, floatVal8, floatVal7); + Color awtColor11 = new Color(intVal14); + Setting setting = this.settingField; + int intVal15 = awtColor11.getRed(); + int intVal30 = awtColor11.getGreen(); + int intVal31 = awtColor11.getBlue(); + ColorProperty colorProp3 = this.settingField.getColorProperty(); + Color awtColor12 = colorProp3.getAwtColor(); + Color awtColor13 = new Color(intVal15, intVal30, intVal31, awtColor12.getAlpha()); + setting.applyUpdate(awtColor13.getRGB()); + break label221; + } + + flag = this.stateFlag2; + } + + if (flag2) { + if (flag) { + double doubleVal16 = 79.0; + double doubleVal17 = (index - (this.rowProgress + 22.0F)) / doubleVal16; + double doubleVal18 = MathHelper.clamp_double(doubleVal17, 0.0, 1.0) * 1.0; + this.cachedAngle2 = (float)doubleVal18; + Color awtColor14 = this.settingField.getColor(); + int intVal16 = (int)(this.cachedAngle2 * 255.0F); + int intVal32 = 255 - MathHelper.clamp_int(intVal16, 0, 255); + int intVal33 = Math.max(4, intVal32); + Setting setting2 = this.settingField; + int intVal17 = awtColor14.getRed(); + int intVal34 = awtColor14.getGreen(); + Color awtColor15 = new Color(intVal17, intVal34, awtColor14.getBlue(), intVal33); + setting2.applyUpdate(awtColor15.getRGB()); + break label221; + } + + flag = this.stateFlag3; + } + + if (!flag2) { + break label110; + } + + if (flag) { + double doubleVal19 = (value - doubleVal5) / doubleVal6; + double doubleVal20 = MathHelper.clamp_double(doubleVal19, 0.0, 1.0); + double doubleVal21 = (index - doubleVal40) / doubleVal6; + double doubleVal22 = MathHelper.clamp_double(doubleVal21, 0.0, 1.0); + this.cachedValue = MathHelper.clamp_double(doubleVal20, 0.04, 0.95); + this.cachedValue2 = MathHelper.clamp_double(doubleVal22, 0.04, 0.95); + Color awtColor16 = this.settingField.getColor(); + intVal3 = awtColor16.getRed(); + int intVal35 = awtColor16.getGreen(); + int intVal36 = awtColor16.getBlue(); + float[] floatArr6 = new float[3]; + float[] floatArr3 = Color.RGBtoHSB(intVal3, intVal35, intVal36, floatArr6); + float floatVal6 = floatArr3[0]; + float floatVal9 = (float)this.cachedValue; + floatVal7 = 1.0F - (float)this.cachedValue2; + Color awtColor17 = Color.getHSBColor(floatVal6, floatVal9, floatVal7); + int color = awtColor17.getRGB(); + Color awtColor18 = new Color(color); + Setting setting3 = this.settingField; + int intVal18 = awtColor18.getRed(); + int intVal37 = awtColor18.getGreen(); + int intVal38 = awtColor18.getBlue(); + Color awtColor19 = new Color(intVal18, intVal37, intVal38, awtColor16.getAlpha()); + setting3.applyUpdate(awtColor19.getRGB()); + } + } + + flag = this.flagValue; + } + + label95: { + label94: { + label222: { + if (flag2) { + if (flag) { + break label222; + } + + flag = this.stateFlag2; + } + + if (flag2) { + if (flag) { + break label222; + } + + settingRow = this; + if (!flag2) { + break label95; + } + + flag = this.stateFlag3; + } + + if (!flag) { + break label94; + } + } + + ClickGuiModuleRow modRow12 = this.clickGuiModuleRowField; + SettingEvent settingEvent = new SettingEvent(modRow12.getModule(), this.settingField.getName()); + EventManager.call(settingEvent); + } + + settingRow = this; + } + + ClickGuiModuleRow modRow13 = settingRow.clickGuiModuleRowField; + Tab guiTab14 = modRow13.getTab(); + double doubleVal23 = guiTab14.getPosX() + 2.0 + this.cachedValue * 81.0; + double doubleVal58 = this.rowProgress + 21.0F + this.cachedValue2 * 81.0; + awtColor9 = new Color(255, 255, 255, 255); + int color10 = awtColor9.getRGB(); + Color awtColor20 = new Color(255, 255, 255, 150); + int color11 = awtColor20.getRGB(); + RenderUtils.drawElement(doubleVal23, doubleVal58, 1.0, 1.0F, color10, color11); + double doubleVal24 = doubleVal5 + doubleVal6 + 3.0; + double doubleVal25 = doubleVal40 + this.cachedAngle * 81.0F; + double doubleVal59 = doubleVal40 + 80.0; + double doubleVal60 = MathHelper.clamp_double(doubleVal25, 0.0, doubleVal59); + double doubleVal61 = doubleVal5 + doubleVal6 + 9.0; + double doubleVal26 = doubleVal40 + this.cachedAngle * 81.0F + 1.0; + double doubleVal62 = doubleVal40 + 81.0; + double doubleVal63 = MathHelper.clamp_double(doubleVal26, 0.0, doubleVal62); + awtColor9 = new Color(20, 20, 20); + int color12 = awtColor9.getRGB(); + RenderUtils.drawRect(doubleVal24, doubleVal60, doubleVal61, doubleVal63, color12); + double doubleVal27 = doubleVal5 + doubleVal6 + 12.0; + double doubleVal28 = doubleVal40 + this.cachedAngle2 * 81.0F; + double doubleVal64 = doubleVal40 + 80.0; + double doubleVal65 = MathHelper.clamp_double(doubleVal28, 0.0, doubleVal64); + double doubleVal66 = doubleVal5 + doubleVal6 + 19.0; + double doubleVal29 = doubleVal40 + this.cachedAngle2 * 81.0F + 1.0; + double doubleVal67 = doubleVal40 + 81.0; + double doubleVal68 = MathHelper.clamp_double(doubleVal29, 0.0, doubleVal67); + awtColor9 = new Color(20, 20, 20); + int color13 = awtColor9.getRGB(); + RenderUtils.drawRect(doubleVal27, doubleVal65, doubleVal66, doubleVal68, color13); +} + + public void updateHelper(int value, int index, int count) { + double doubleVal2 = value; + ClickGuiModuleRow modRow = this.clickGuiModuleRowField; + Tab guiTab = modRow.getTab(); + double doubleVal; + int intVal = (doubleVal = doubleVal2 - (guiTab.getPosX() + 95.0)) == 0.0 ? 0 : (doubleVal < 0.0 ? -1 : 1); + if (intVal < 0) { + return; + } + + doubleVal2 = value; + modRow = this.clickGuiModuleRowField; + Tab guiTab2 = modRow.getTab(); + if (doubleVal2 > (guiTab2.getPosX() + 120.0)) { + return; + } + + if (index < (this.rowProgress + 3.0F)) { + return; + } + + if (index > (this.rowProgress + 17.0F)) { + return; + } + + intVal = count; + + if (intVal == 0) { + BooleanProperty boolProp = this.settingField.getBooleanProperty(); + Boolean flag = this.settingField.getBoolean(); + boolean flag2 = flag; + flag2 = !flag2; + + Boolean flag3 = flag2; + boolProp.set(flag3); + ClickGuiModuleRow modRow2 = this.clickGuiModuleRowField; + SettingEvent settingEvent = new SettingEvent(modRow2.getModule(), this.settingField.getName(), this.settingField.getDisplayName(), this.settingField.getBooleanProperty()); + EventManager.call(settingEvent); + } +} + + public int getStateTicks() { + return this.stateTicks; +} + + public void processHelper3(int value, int index, int count) { + int intVal; + double doubleVal = value; + ClickGuiModuleRow modRow = this.clickGuiModuleRowField; + Tab guiTab = modRow.getTab(); + if (doubleVal >= guiTab.getPosX()) { + double doubleVal2 = value; + modRow = this.clickGuiModuleRowField; + Tab guiTab2 = modRow.getTab(); + if (doubleVal2 <= (guiTab2.getPosX() + 125.0)) { + if (index >= this.rowProgress) { + if (index <= (this.rowProgress + 20.0F)) { + intVal = count; + + if (count == 0) { + boolean flag2 = this.flagValueField; + flag2 = !this.flagValueField; + + label152: { + this.flagValueField = flag2; + ClickGuiSettingRow settingRow = this; + + if (this.flagValueField) { + this.stateTicks = 103; + break label152; + } + + settingRow = this; + + + settingRow.stateTicks = 20; + } + + ColorProperty colorProp = this.settingField.getColorProperty(); + this.accentColor = colorProp.getAwtColor(); + } + } + } + } + } + + intVal = (this.flagValueField ? 1 : 0); + + if (intVal == 0) { + return; + } + + double doubleVal3 = value; + modRow = this.clickGuiModuleRowField; + Tab guiTab3 = modRow.getTab(); + if (doubleVal3 >= (guiTab3.getPosX() + 1.0)) { + double doubleVal5 = value; + modRow = this.clickGuiModuleRowField; + Tab guiTab4 = modRow.getTab(); + if (doubleVal5 <= (guiTab4.getPosX() + 82.0)) { + if (index >= (this.rowProgress + 21.0F)) { + if (index <= (this.rowProgress + 21.0F + 81.0F)) { + this.stateFlag3 = true; + return; + } + } + } + } + + double doubleVal6 = value; + modRow = this.clickGuiModuleRowField; + Tab guiTab5 = modRow.getTab(); + if (doubleVal6 >= (guiTab5.getPosX() + 85.0)) { + double doubleVal8 = value; + modRow = this.clickGuiModuleRowField; + Tab guiTab6 = modRow.getTab(); + if (doubleVal8 <= (guiTab6.getPosX() + 93.0)) { + if (index >= (this.rowProgress + 21.0F)) { + if (index <= (this.rowProgress + 21.0F + 81.0F)) { + this.flagValue = true; + return; + } + } + } + } + + double doubleVal9 = value; + modRow = this.clickGuiModuleRowField; + Tab guiTab7 = modRow.getTab(); + if (doubleVal9 >= (guiTab7.getPosX() + 94.0)) { + double doubleVal11 = value; + modRow = this.clickGuiModuleRowField; + Tab guiTab8 = modRow.getTab(); + if (doubleVal11 <= (guiTab8.getPosX() + 103.0)) { + if (index >= (this.rowProgress + 21.0F)) { + if (index <= (this.rowProgress + 21.0F + 81.0F)) { + this.stateFlag2 = true; + return; + } + } + } + } + + double doubleVal12 = value; + modRow = this.clickGuiModuleRowField; + Tab guiTab9 = modRow.getTab(); + if (doubleVal12 < (guiTab9.getPosX() + 104.0)) { + return; + } + + double doubleVal14 = value; + modRow = this.clickGuiModuleRowField; + Tab guiTab10 = modRow.getTab(); + if (doubleVal14 > (guiTab10.getPosX() + 113.0)) { + return; + } + + if (index < (this.rowProgress + 61.0F)) { + return; + } + + if (index <= (this.rowProgress + 101.0F)) { + Setting setting = this.settingField; + Color awtColor = this.accentColor; + setting.applyUpdate(awtColor.getRGB()); + ColorProperty colorProp2 = this.settingField.getColorProperty(); + Color awtColor2 = colorProp2.getAwtColor(); + this.cachedAngle2 = 1.0F - awtColor2.getAlpha() / 255.0F; + intVal = awtColor2.getRed(); + int intVal2 = awtColor2.getGreen(); + int intVal3 = awtColor2.getBlue(); + float[] floatArr2 = new float[3]; + float[] floatArr = Color.RGBtoHSB(intVal, intVal2, intVal3, floatArr2); + this.cachedAngle = floatArr[0]; + this.cachedValue = floatArr[1]; + this.cachedValue2 = 1.0F - floatArr[2]; + } +} + + public void renderClickGui(ClickGui clickGui, int value, int index, float amount, int count) { + boolean flag; + label37: { + flag = g(); + ClickGuiSettingRow settingRow = this; + + this.rowProgress = (float)this.getDoubleMetric(); + StringProperty strProp = clickGui.getStringPropertyR(); + if (strProp.equals("Basic")) { + ClickGuiModuleRow modRow = this.clickGuiModuleRowField; + Tab guiTab = modRow.getTab(); + double doubleVal = guiTab.getPosX(); + double doubleVal3 = this.rowProgress; + Tab guiTab2 = this.clickGuiModuleRowField.getTab(); + double doubleVal4 = guiTab2.getPosX() + 130.0; + double doubleVal5 = this.rowProgress + 20.0F; + int color = (new Color(55, 55, 55)).getRGB(); + RenderUtils.drawRect(doubleVal, doubleVal3, doubleVal4, doubleVal5, color); + + break label37; + + } + + settingRow = this; + + + ClickGuiModuleRow modRow2 = settingRow.clickGuiModuleRowField; + Tab guiTab3 = modRow2.getTab(); + double doubleVal2 = guiTab3.getPosX(); + double doubleVal6 = this.rowProgress; + ClickGuiModuleRow modRow3 = this.clickGuiModuleRowField; + Tab guiTab4 = modRow3.getTab(); + double doubleVal7 = guiTab4.getPosX() + 130.0; + double doubleVal8 = this.rowProgress + 20.0F; + Color awtColor = new Color(0, 0, 0, (int)(60.0 * clickGui.getDoubleValue())); + int color2 = awtColor.getRGB(); + RenderUtils.drawRect(doubleVal2, doubleVal6, doubleVal7, doubleVal8, color2); + } + + switch (ClickGuiSettingSwitchMap.SWITCH_MAP[this.settingField.getSettingType().ordinal()]) { + case 1: + FontFamily fontFam = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font = fontFam.ofSize(20); + String displayName = this.settingField.getDisplayName(); + this.updateHelper3(value, index, font.stringWidth(displayName) - 55); + this.drawElement(clickGui, count); + if (!flag) { + break; + } + case 2: + FontFamily fontFam2 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font2 = fontFam2.ofSize(20); + String displayName2 = this.settingField.getDisplayName(); + this.updateHelper3(value, index, font2.stringWidth(displayName2) - 50); + this.renderElement5(clickGui, value, index, count); + if (!flag) { + break; + } + case 3: + FontFamily fontFam3 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font3 = fontFam3.ofSize(20); + String displayName3 = this.settingField.getDisplayName(); + this.updateHelper3(value, index, font3.stringWidth(displayName3) - 95); + this.renderElement3(clickGui, value, index, count); + if (!flag) { + break; + } + case 4: + FontFamily fontFam4 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font4 = fontFam4.ofSize(20); + String displayName4 = this.settingField.getDisplayName(); + this.updateHelper3(value, index, font4.stringWidth(displayName4) - 95); + this.renderElement(clickGui, value, index, count); + if (!flag) { + break; + } + case 5: + FontFamily fontFam5 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font5 = fontFam5.ofSize(20); + String displayName5 = this.settingField.getDisplayName(); + this.updateHelper3(value, index, font5.stringWidth(displayName5) - 95); + this.processHelper2(clickGui, value, index); + if (!flag) { + break; + } + case 6: + FontFamily fontFam6 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font6 = fontFam6.ofSize(20); + String displayName6 = this.settingField.getDisplayName(); + this.updateHelper3(value, index, font6.stringWidth(displayName6) - 40); + this.processHelper(clickGui, value, index); + if (!flag) { + break; + } + case 7: + this.processHelper5(clickGui, value, index); + if (!flag) { + break; + } + case 8: + this.processHelper3(clickGui, value, index); + if (!flag) { + break; + } + case 9: + this.processHelper4(clickGui, value, index); + } +} + + public void renderElement3(ClickGui clickGui, int value, int index, int count) { + double doubleVal; + double doubleVal5; + int intVal3 = (g() ? 1 : 0); + HUD hudMod = ModuleRegistry.HUD.getModule(); + boolean flag = (intVal3 != 0); + GL11.glEnable(3089); + ClickGuiModuleRow modRow = this.clickGuiModuleRowField; + Tab guiTab = modRow.getTab(); + float floatVal = (float)guiTab.getPosX() + 6.0F; + float floatVal5 = this.rowProgress; + ClickGuiModuleRow modRow2 = this.clickGuiModuleRowField; + Tab guiTab2 = modRow2.getTab(); + GuiBlurFramebuffer.renderPanel(floatVal, floatVal5, (float)guiTab2.getPosX() + 105.0F, this.rowProgress + 20.0F); + ClickGuiModuleRow modRow3 = this.clickGuiModuleRowField; + Tab guiTab3 = modRow3.getTab(); + if (!flag) { + ClickGUI clickGuiScreen = guiTab3.getClickGUI(); + FontFamily fontFam = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font = fontFam.ofSize(20); + String displayName2 = this.settingField.getDisplayName(); + Tab guiTab4 = this.clickGuiModuleRowField.getTab(); + clickGuiScreen.drawScaledString(font, displayName2, guiTab4.getPosX() - this.cachedValue4, this.rowProgress + 6.0F, -1, true); + GL11.glDisable(3089); + StringProperty strProp = clickGui.getStringPropertyR(); + String textStr = "Basic"; + label102: + if (strProp.equals(textStr)) { + FontFamily fontFam2 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font2 = fontFam2.ofSize(20); + String displayName = this.settingField.getDisplayName(); + int width = font2.stringWidth(displayName); + if (!flag) { + if (width <= 100) { + break label102; + } + + GlStateManager.disableTexture2D(); + GL11.glShadeModel(7425); + GL11.glBegin(5); + width = -2; + } + + int intVal = width; + + while (true) { + FontFamily fontFam3 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font3 = fontFam3.ofSize(18); + if (intVal < font3.getHeight() + 3) { + Color awtColor = new Color(55, 55, 55, 255); + intVal3 = awtColor.getRGB(); + RenderUtils.glColor(intVal3); + ClickGuiModuleRow modRow4 = this.clickGuiModuleRowField; + Tab guiTab5 = modRow4.getTab(); + GL11.glVertex2d(guiTab5.getPosX() + 110.0, this.rowProgress + 5.0F + intVal); + Color awtColor2 = new Color(55, 55, 55, 0); + intVal3 = awtColor2.getRGB(); + RenderUtils.glColor(intVal3); + ClickGuiModuleRow modRow5 = this.clickGuiModuleRowField; + Tab guiTab6 = modRow5.getTab(); + GL11.glVertex2d(guiTab6.getPosX() + 60.0, this.rowProgress + 5.0F + intVal); + intVal++; + if (flag) { + break; + } + + if (!flag) { + continue; + } + } + + GL11.glEnd(); + break; + } + + GlStateManager.enableTexture2D(); + } + + ClickGuiModuleRow modRow6 = this.clickGuiModuleRowField; + guiTab3 = modRow6.getTab(); + } + + double doubleVal6; + label95: { + doubleVal = guiTab3.getPosX() + 117.0; + doubleVal5 = this.rowProgress + 8.5; + ClickGuiSettingRow settingRow = this; + if (!flag) { + if (this.flagValueField) { + doubleVal6 = 90.0 - this.settingField.getMsTimer().computeDoubleFromLong(100L, 90.0); + break label95; + } + + settingRow = this; + } + + doubleVal6 = settingRow.settingField.getMsTimer().computeDoubleFromLong(100L, 90.0); + } + + RenderUtils.drawElement(doubleVal, doubleVal5, 2.5F, -1, 6.0, doubleVal6); + ClickGuiSettingRow settingRow2 = this; + if (!flag) { + if (!this.flagValueField) { + return; + } + + settingRow2 = this; + } + + label83: { + float floatVal2; + float floatVal6; + label82: { + floatVal6 = settingRow2.rowProgress + 20.0F; + float floatVal3 = this.rowProgress + 20.0F; + StringProperty strProp2 = this.settingField.getStringProperty2(); + List itemList = strProp2.getAcceptableValues(); + floatVal2 = floatVal3 + itemList.size() * 15; + if (!flag) { + StringProperty strProp3 = clickGui.getStringPropertyR(); + if (!strProp3.equals("Basic")) { + break label82; + } + + ClickGuiModuleRow modRow7 = this.clickGuiModuleRowField; + Tab guiTab7 = modRow7.getTab(); + double doubleVal2 = guiTab7.getPosX(); + double doubleVal7 = floatVal6; + modRow2 = this.clickGuiModuleRowField; + Tab guiTab8 = modRow2.getTab(); + double doubleVal8 = guiTab8.getPosX() + 125.0; + double doubleVal9 = floatVal2; + int color = (new Color(40, 40, 40)).getRGB(); + RenderUtils.drawRect(doubleVal2, doubleVal7, doubleVal8, doubleVal9, color); + ClickGuiModuleRow modRow8 = this.clickGuiModuleRowField; + Tab guiTab9 = modRow8.getTab(); + float floatVal4 = (float)(guiTab9.getPosX() + 6.0); + float floatVal7 = floatVal2 - floatVal6; + Color awtColor3 = new Color(45, 45, 45); + int color2 = awtColor3.getRGB(); + RenderUtils.drawElement(floatVal4, floatVal6, 113.0F, floatVal7, 5.0F, color2); + } + + if (!flag) { + break label83; + } + } + + ClickGuiModuleRow modRow9 = this.clickGuiModuleRowField; + Tab guiTab10 = modRow9.getTab(); + double doubleVal3 = guiTab10.getPosX(); + double doubleVal10 = floatVal6; + modRow2 = this.clickGuiModuleRowField; + Tab guiTab11 = modRow2.getTab(); + double doubleVal11 = guiTab11.getPosX() + 125.0; + double doubleVal12 = floatVal2; + Color awtColor4 = new Color(0, 0, 0, (int)(120.0 * clickGui.getDoubleValue())); + int color3 = awtColor4.getRGB(); + RenderUtils.drawRect(doubleVal3, doubleVal10, doubleVal11, doubleVal12, color3); + } + + int intVal2 = 0; + + do { + StringProperty strProp4 = this.settingField.getStringProperty2(); + List itemList2 = strProp4.getAcceptableValues(); + if (intVal2 >= itemList2.size()) { + break; + } + + label120: { + double doubleVal4 = this.rowProgress + 20.0F + intVal2 * 15; + StringProperty strProp5 = this.settingField.getStringProperty2(); + List itemList3 = strProp5.getAcceptableValues(); + String textStr2 = (String)itemList3.get(intVal2); + StringProperty strProp6 = clickGui.getStringPropertyR(); + if (strProp6.equals("Basic")) { + ClickGuiModuleRow modRow10 = this.clickGuiModuleRowField; + Tab guiTab12 = modRow10.getTab(); + ClickGUI clickGuiScreen2 = guiTab12.getClickGUI(); + FontFamily fontFam4 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font4 = fontFam4.ofSize(25); + String textStr3 = "."; + ClickGuiModuleRow modRow11 = this.clickGuiModuleRowField; + Tab guiTab13 = modRow11.getTab(); + double doubleVal13 = guiTab13.getPosX() + 12.0; + double doubleVal14 = doubleVal4 - 0.5; + StringProperty strProp7 = this.settingField.getStringProperty2(); + int intVal4 = (strProp7.get().equals(textStr2) ? 1 : 0); + if (!flag) { + if (intVal4 != 0) { + intVal4 = ColorTheme.evaluateInt(count, 1.0); + } else { + Color awtColor5 = new Color(120, 120, 120); + intVal4 = awtColor5.getRGB(); + } + } + + clickGuiScreen2.drawScaledString(font4, textStr3, doubleVal13, doubleVal14, intVal4, true); + ClickGuiModuleRow modRow12 = this.clickGuiModuleRowField; + Tab guiTab14 = modRow12.getTab(); + ClickGUI clickGuiScreen3 = guiTab14.getClickGUI(); + FontFamily fontFam5 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font5 = fontFam5.ofSize(18); + modRow11 = this.clickGuiModuleRowField; + Tab guiTab15 = modRow11.getTab(); + double doubleVal15 = guiTab15.getPosX() + 18.0; + doubleVal14 = doubleVal4 + 5.0; + StringProperty strProp8 = this.settingField.getStringProperty2(); + int intVal5 = (strProp8.get().equals(textStr2) ? 1 : 0); + if (!flag) { + if (intVal5 != 0) { + intVal5 = ColorTheme.evaluateInt(count, 1.0); + } else { + Color awtColor6 = new Color(120, 120, 120); + intVal5 = awtColor6.getRGB(); + } + } + + clickGuiScreen3.drawScaledString(font5, textStr2, doubleVal15, doubleVal14, intVal5, true); + if (!flag) { + break label120; + } + } + + ClickGuiModuleRow modRow13 = this.clickGuiModuleRowField; + Tab guiTab16 = modRow13.getTab(); + ClickGUI clickGuiScreen4 = guiTab16.getClickGUI(); + FontFamily fontFam6 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font6 = fontFam6.ofSize(25); + String textStr4 = "."; + ClickGuiModuleRow modRow14 = this.clickGuiModuleRowField; + Tab guiTab17 = modRow14.getTab(); + double doubleVal16 = guiTab17.getPosX() + 12.0; + double doubleVal17 = doubleVal4 - 0.5; + StringProperty strProp9 = this.settingField.getStringProperty2(); + int intVal6 = (strProp9.get().equals(textStr2) ? 1 : 0); + if (!flag) { + if (intVal6 != 0) { + intVal6 = ColorTheme.evaluateInt(count, 1.0); + } else { + Color awtColor7 = new Color(160, 160, 160); + intVal6 = awtColor7.getRGB(); + } + } + + clickGuiScreen4.drawScaledString(font6, textStr4, doubleVal16, doubleVal17, intVal6, true); + ClickGuiModuleRow modRow15 = this.clickGuiModuleRowField; + Tab guiTab18 = modRow15.getTab(); + ClickGUI clickGuiScreen5 = guiTab18.getClickGUI(); + FontFamily fontFam7 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font7 = fontFam7.ofSize(18); + modRow14 = this.clickGuiModuleRowField; + Tab guiTab19 = modRow14.getTab(); + double doubleVal18 = guiTab19.getPosX() + 18.0; + doubleVal17 = doubleVal4 + 5.0; + StringProperty strProp10 = this.settingField.getStringProperty2(); + int intVal7 = (strProp10.get().equals(textStr2) ? 1 : 0); + if (!flag) { + if (intVal7 != 0) { + intVal7 = ColorTheme.evaluateInt(count, 1.0); + } else { + Color awtColor8 = new Color(160, 160, 160); + intVal7 = awtColor8.getRGB(); + } + } + + clickGuiScreen5.drawScaledString(font7, textStr2, doubleVal18, doubleVal17, intVal7, true); + } + + intVal2++; + } while (!flag); +} + + public void handleInt(int value, int index, int count) { + label52: { + label51: { + label50: { + label49: { + label48: { + label47: { + label46: { + label45: { + + switch (ClickGuiSettingSwitchMap.SWITCH_MAP[this.settingField.getSettingType().ordinal()]) { + case 1: + this.updateHelper(value, index, count); + break; + case 2: + break label45; + case 3: + break label46; + case 4: + break label47; + case 5: + break label48; + case 6: + break label49; + case 7: + break label50; + case 8: + break label51; + case 9: + break label52; + default: + return; + } + + + + return; + + } + + this.renderElement2(value, index, count); + + return; + + } + + this.updateHelper5(value, index, count); + + return; + + } + + this.processHelper5(value, index, count); + + return; + + } + + this.processHelper3(value, index, count); + + return; + + } + + this.processHelper4(value, index, count); + + return; + + } + + this.updateHelper4(value, index, count); + + return; + + } + + this.processHelper2(value, index, count); + + return; + + } + + this.updateHelper2(value, index, count); +} + + public void updateHelper2(int value, int index, int count) { + if (count == 0 && this.settingField.getBooleanProperty() != null) { + int intVal; + label49: { + label54: { + double doubleVal2 = value; + ClickGuiModuleRow modRow = this.clickGuiModuleRowField; + Tab guiTab = modRow.getTab(); + if (doubleVal2 < (guiTab.getPosX() + 5.0)) { + break label54; + } + + double doubleVal = value; + modRow = this.clickGuiModuleRowField; + Tab guiTab2 = modRow.getTab(); + if (doubleVal > (guiTab2.getPosX() + 123.0)) { + break label54; + } + + if (index < (this.rowProgress + 2.0F)) { + break label54; + } + + if (index <= (this.rowProgress + 18.0F)) { + intVal = 1; + break label49; + } + } + + intVal = 0; + } + + int intVal2 = intVal; + if (intVal2 != 0) { + BooleanProperty boolProp = this.settingField.getBooleanProperty(); + Boolean flag = this.settingField.getBoolean(); + boolean flag2 = flag; + flag2 = !flag2; + + flag = flag2; + boolProp.set(flag); + } + } +} + + public void updateHelper3(int value, int index, int count) { + int intVal; + ClickGuiSettingRow settingRow = this; + + if (this.drawElement(value, index)) { + label79: { + settingRow = this; + + if (!this.stateFlag5) { + settingRow = this; + + if (this.cachedValue4 < count - 4) { + TimerUtil timerUtil = this.timer; + intVal = (timerUtil.delay(600L) ? 1 : 0); + if ((intVal != 0)) { + this.cachedValue4 += 0.25; + } + + if (this.cachedValue4 != (count - 4)) { + break label79; + } + + TimerUtil timerUtil2 = this.timer; + timerUtil2.reset(); + break label79; + } + } + + settingRow = this; + + settingRow.stateFlag5 = true; + } + + settingRow = this; + + intVal = (this.stateFlag5 ? 1 : 0); + + if ((intVal != 0)) { + settingRow = this; + + if (this.cachedValue4 > -6.0) { + + TimerUtil timerUtil3 = this.timer; + if (timerUtil3.delay(600L)) { + this.cachedValue4 -= 0.25; + } + + settingRow = this; + + if (this.cachedValue4 != -6.0) { + return; + } + + settingRow = this; + + TimerUtil timerUtil4 = settingRow.timer; + timerUtil4.reset(); + return; + } + } + + settingRow = this; + + settingRow.stateFlag5 = false; + return; + } + + settingRow = this; + + + double doubleVal = this.cachedValue4 - 0.25; + settingRow.cachedValue4 = Math.max(-6.0, doubleVal); +} + + public void processHelper4(ClickGui clickGui, int value, int index) { + FontRenderer font; + Color awtColor; + Color awtColor2; + label33: { + font = FontFamilySF_BOLD.FAMILY.ofSize(19); + awtColor = new Color(225, 225, 225); + awtColor2 = new Color(110, 110, 110); + + StringProperty strProp = clickGui.getStringPropertyR(); + if (!strProp.equals("Old")) { + break label33; + } + + awtColor = new Color(255, 255, 255); + + + awtColor2 = new Color(200, 200, 200, 100); + } + + ClickGuiSettingRow settingRow; + settingRow = this; + + if (this.settingField.getBooleanProperty() != null) { + settingRow = this; + + BooleanProperty boolProp = this.settingField.getBooleanProperty(); + Boolean propFlag = boolProp.get(); + label23: + if (!propFlag) { + StringProperty strProp2 = clickGui.getStringPropertyR(); + if (strProp2.equals("Old")) { + awtColor = new Color(255, 255, 255, 120); + awtColor2 = new Color(200, 200, 200, 70); + break label23; + } + + awtColor = awtColor.darker(); + awtColor2 = awtColor2.darker(); + } + } + + ClickGuiModuleRow modRow = this.clickGuiModuleRowField; + Tab guiTab = modRow.getTab(); + ClickGUI clickGuiScreen = guiTab.getClickGUI(); + String displayName = this.settingField.getDisplayName(); + Tab guiTab2 = this.clickGuiModuleRowField.getTab(); + double doubleVal = guiTab2.getPosX() + 59.0; + String displayName2 = this.settingField.getDisplayName(); + double doubleVal3 = (float)(doubleVal - font.stringWidth(displayName2) / 2) + 5.0F; + double doubleVal4 = this.rowProgress + 5.0F; + clickGuiScreen.drawScaledString(font, displayName, doubleVal3, doubleVal4, awtColor.getRGB(), true); + settingRow = this; + + ClickGuiModuleRow modRow2 = settingRow.clickGuiModuleRowField; + Tab guiTab3 = modRow2.getTab(); + double doubleVal2 = guiTab3.getPosX() + 5.0; + double doubleVal5 = this.rowProgress + 17.0F; + ClickGuiModuleRow modRow3 = this.clickGuiModuleRowField; + Tab guiTab4 = modRow3.getTab(); + double doubleVal6 = guiTab4.getPosX() + 123.0; + double doubleVal7 = this.rowProgress + 18.0F; + int color = awtColor2.getRGB(); + RenderUtils.drawRect(doubleVal2, doubleVal5, doubleVal6, doubleVal7, color); +} + + public static void b(boolean flag) { + z = flag; +} + + public Setting getSetting() { + return this.settingField; +} + + public ClickGuiSettingRow(Setting setting, ClickGuiModuleRow clickGuiModuleRow) { + int intVal = (a() ? 1 : 0); + this.accentColor = Color.WHITE; + this.timer2 = new TimerUtil(); + this.settingField = setting; + this.clickGuiModuleRowField = clickGuiModuleRow; + boolean flag = (intVal != 0); + Setting setting2 = setting; + if (flag) { + if (setting.getSettingType() != SettingType.COLOR_PICKER) { + return; + } + + setting2 = setting; + } + + ColorProperty colorProp = setting2.getColorProperty(); + Color awtColor = colorProp.getAwtColor(); + this.accentColor = awtColor; + this.cachedAngle2 = 1.0F - awtColor.getAlpha() / 255.0F; + intVal = awtColor.getRed(); + int intVal2 = awtColor.getGreen(); + int intVal3 = awtColor.getBlue(); + float[] floatArr2 = new float[3]; + float[] floatArr = Color.RGBtoHSB(intVal, intVal2, intVal3, floatArr2); + this.cachedAngle = floatArr[0]; + this.cachedValue = floatArr[1]; + this.cachedValue2 = 1.0F - floatArr[2]; +} + + public void updateHelper4(int value, int index, int count) { + int intVal; + label49: { + label52: { + double doubleVal = value; + ClickGuiModuleRow modRow = this.clickGuiModuleRowField; + Tab guiTab = modRow.getTab(); + if (doubleVal < (guiTab.getPosX() + 5.0)) { + break label52; + } + + double doubleVal2 = value; + modRow = this.clickGuiModuleRowField; + Tab guiTab2 = modRow.getTab(); + if (doubleVal2 > (guiTab2.getPosX() + 110.0)) { + break label52; + } + + if (index < this.rowProgress) { + break label52; + } + + if (index <= (this.rowProgress + 15.0F)) { + intVal = 1; + break label49; + } + } + + intVal = 0; + } + + int intVal2 = intVal; + int intVal3 = intVal2; + + if (intVal2 == 0) { + return; + } + + intVal3 = count; + + + if (intVal3 == 0) { + Consumer consumer = this.settingField.getConsumer(); + consumer.accept(""); + } +} + + public void processHelper(int value, int index, int count) { + int intVal; + label49: { + label52: { + double doubleVal = value; + ClickGuiModuleRow modRow = this.clickGuiModuleRowField; + Tab guiTab = modRow.getTab(); + if (doubleVal < (guiTab.getPosX() + 5.0)) { + break label52; + } + + double doubleVal2 = value; + modRow = this.clickGuiModuleRowField; + Tab guiTab2 = modRow.getTab(); + if (doubleVal2 > (guiTab2.getPosX() + 110.0)) { + break label52; + } + + if (index < this.rowProgress) { + break label52; + } + + if (index <= (this.rowProgress + 15.0F)) { + intVal = 1; + break label49; + } + } + + intVal = 0; + } + + int intVal2 = intVal; + int intVal3 = intVal2; + + if (intVal2 == 0) { + return; + } + + intVal3 = count; + + + if (intVal3 == 0) { + Minecraft mcClient = Minecraft.getMinecraft(); + GuiScreen guiScreen = this.settingField.getGuiScreen(); + mcClient.displayGuiScreen(guiScreen); + } +} + + public double getDoubleMetric() { + double doubleVal = this.clickGuiModuleRowField.getDoubleValue3() + 20.0; + ClickGuiModuleRow modRow = this.clickGuiModuleRowField; + List itemList = modRow.getVisibleSettings(); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + ClickGuiSettingRow settingRow = (ClickGuiSettingRow)iter.next(); + if (settingRow == this) { + break; + } + + doubleVal += settingRow.stateTicks; + } + + return doubleVal; +} + + public void updateHelper5(int value, int index, int count) { + int intVal; + double doubleVal = value; + ClickGuiModuleRow modRow = this.clickGuiModuleRowField; + Tab guiTab = modRow.getTab(); + if (doubleVal >= guiTab.getPosX()) { + double doubleVal2 = value; + modRow = this.clickGuiModuleRowField; + Tab guiTab2 = modRow.getTab(); + if (doubleVal2 <= (guiTab2.getPosX() + 125.0)) { + if (index >= this.rowProgress) { + if (index <= (this.rowProgress + 20.0F)) { + intVal = count; + + label91: + if (count == 0) { + this.settingField.getMsTimer().performAction(); + boolean flag2 = this.flagValueField; + flag2 = !this.flagValueField; + + this.flagValueField = flag2; + ClickGuiSettingRow settingRow = this; + + if (this.flagValueField) { + StringProperty strProp = this.settingField.getStringProperty2(); + List itemList = strProp.getAcceptableValues(); + this.stateTicks = 20 + itemList.size() * 15; + break label91; + } + + settingRow = this; + + + settingRow.stateTicks = 20; + } + } + } + } + } + + intVal = (this.flagValueField ? 1 : 0); + + + if (intVal == 0) { + return; + } + + intVal = 0; + + + int intVal2 = intVal; + + while (true) { + StringProperty strProp2 = this.settingField.getStringProperty2(); + List itemList2 = strProp2.getAcceptableValues(); + if (intVal2 >= itemList2.size()) { + break; + } + + double doubleVal3 = this.rowProgress + 20.0F + intVal2 * 15; + + label65: + if (count == 0) { + double doubleVal4 = value; + modRow = this.clickGuiModuleRowField; + Tab guiTab3 = modRow.getTab(); + if (doubleVal4 < guiTab3.getPosX()) { + break label65; + } + + double doubleVal5 = value; + modRow = this.clickGuiModuleRowField; + Tab guiTab4 = modRow.getTab(); + if (doubleVal5 > (guiTab4.getPosX() + 125.0)) { + break label65; + } + + if (index < doubleVal3) { + break label65; + } + + if (index <= (doubleVal3 + 15.0)) { + StringProperty strProp3 = this.settingField.getStringProperty2(); + StringProperty strProp4 = this.settingField.getStringProperty2(); + List itemList3 = strProp4.getAcceptableValues(); + String textStr = (String)itemList3.get(intVal2); + strProp3.set(textStr); + ClickGuiModuleRow modRow2 = this.clickGuiModuleRowField; + SettingEvent settingEvent = new SettingEvent(modRow2.getModule(), this.settingField.getName(), this.settingField.getStringProperty2()); + EventManager.call(settingEvent); + } + } + + intVal2++; + + } +} + + public void renderElement4(int value, int index) { + int intVal; + label51: { + label54: { + double doubleVal = value; + ClickGuiModuleRow modRow = this.clickGuiModuleRowField; + Tab guiTab = modRow.getTab(); + if (doubleVal < (guiTab.getPosX() + 5.0)) { + break label54; + } + + double doubleVal2 = value; + modRow = this.clickGuiModuleRowField; + Tab guiTab2 = modRow.getTab(); + if (doubleVal2 > (guiTab2.getPosX() + 120.0)) { + break label54; + } + + if (index < this.rowProgress) { + break label54; + } + + if (index <= (this.rowProgress + 15.0F)) { + intVal = 1; + break label51; + } + } + + intVal = 0; + } + + int intVal2 = intVal; + ClickGuiModuleRow modRow2 = this.clickGuiModuleRowField; + Tab guiTab3 = modRow2.getTab(); + double doubleVal4 = guiTab3.getPosX() + 5.0; + double doubleVal3 = this.rowProgress; + ClickGuiModuleRow modRow3 = this.clickGuiModuleRowField; + Tab guiTab4 = modRow3.getTab(); + double doubleVal6 = guiTab4.getPosX() + 120.0; + double doubleVal7 = this.rowProgress + 15.0F; + int intVal3 = intVal2; + + if (intVal2 != 0) { + Color awtColor = new Color(25, 25, 25); + intVal3 = awtColor.getRGB(); + } else { + Color awtColor2 = new Color(19, 19, 19); + intVal3 = awtColor2.getRGB(); + } + + + RenderUtils.drawRect(doubleVal4, doubleVal3, doubleVal6, doubleVal7, intVal3); + ClickGuiModuleRow modRow4 = this.clickGuiModuleRowField; + Tab guiTab5 = modRow4.getTab(); + double doubleVal5 = guiTab5.getPosX() + 6.0; + doubleVal3 = this.rowProgress + 1.0F; + modRow3 = this.clickGuiModuleRowField; + Tab guiTab6 = modRow3.getTab(); + double doubleVal8 = guiTab6.getPosX() + 119.0; + doubleVal7 = this.rowProgress + 14.0F; + int intVal4 = intVal2; + + if (intVal2 != 0) { + Color awtColor3 = new Color(10, 10, 10); + intVal4 = awtColor3.getRGB(); + } else { + Color awtColor4 = new Color(12, 12, 12); + intVal4 = awtColor4.getRGB(); + } + + + RenderUtils.drawRect(doubleVal5, doubleVal3, doubleVal8, doubleVal7, intVal4); + String displayName = this.settingField.getDisplayName(); + ClickGuiModuleRow modRow5 = this.clickGuiModuleRowField; + Tab guiTab7 = modRow5.getTab(); + ClickGUI clickGuiScreen = guiTab7.getClickGUI(); + FontFamily fontFam = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font = fontFam.ofSize(20); + ClickGuiModuleRow modRow6 = this.clickGuiModuleRowField; + Tab guiTab8 = modRow6.getTab(); + clickGuiScreen.drawScaledCenteredString(font, displayName, (float)(guiTab8.getPosX() + 64.0), this.rowProgress + 4.0F, -1, true); +} + + public void processHelper2(int value, int index, int count) { + int width; + StringBuilder sb; + String textStr; + label52: { + sb = new StringBuilder(); + textStr = "["; + sb = sb.append(textStr); + int intVal = (this.stateFlag6 ? 1 : 0); + + if (this.stateFlag6) { + textStr = "..."; + break label52; + } + + ClickGuiModuleRow modRow = this.clickGuiModuleRowField; + AbstractModule mod = modRow.getModule(); + ModuleKeybind keybind = mod.getKeyBindProperty().get(); + intVal = keybind.getKey(); + + + textStr = Keyboard.getKeyName(intVal); + } + + label46: { + label55: { + sb = sb.append(textStr); + textStr = "]"; + String textStr2 = sb.append(textStr).toString(); + double doubleVal = value; + ClickGuiModuleRow modRow2 = this.clickGuiModuleRowField; + Tab guiTab = modRow2.getTab(); + double doubleVal2 = guiTab.getPosX() + 112.0; + FontRenderer font = FontFamilySF_MEDIUM.FAMILY.ofSize(18); + if (doubleVal < (doubleVal2 - font.stringWidth(textStr2))) { + break label55; + } + + double doubleVal4 = value; + ClickGuiModuleRow modRow3 = this.clickGuiModuleRowField; + Tab guiTab2 = modRow3.getTab(); + if (doubleVal4 > (guiTab2.getPosX() + 112.0)) { + break label55; + } + + if (index < (this.rowProgress + 1.0F)) { + break label55; + } + + if (index <= (this.rowProgress + 19.0F)) { + width = 1; + break label46; + } + } + + width = 0; + } + + int intVal2 = width; + if (count == 0) { + this.stateFlag6 = (boolean)((intVal2) != 0); + } +} + + public void processHelper5(int value, int index, int count) { + int intVal; + boolean flag; + ClickGuiSettingRow settingRow; + + flag = a(); + double doubleVal = value; + ClickGuiModuleRow modRow = this.clickGuiModuleRowField; + Tab guiTab = modRow.getTab(); + if (doubleVal >= guiTab.getPosX()) { + double doubleVal2 = value; + modRow = this.clickGuiModuleRowField; + Tab guiTab2 = modRow.getTab(); + if (doubleVal2 <= (guiTab2.getPosX() + 125.0)) { + if (index >= this.rowProgress) { + if (index <= (this.rowProgress + 20.0F)) { + intVal = count; + + label112: + if (count == 0) { + this.settingField.getMsTimer().performAction(); + boolean flag2 = this.flagValueField; + + flag2 = !this.flagValueField; + + + this.flagValueField = flag2; + ClickGuiSettingRow settingRow2 = this; + + if (this.flagValueField) { + ListProperty listProp = this.settingField.getListProperty(); + List itemList = listProp.getAcceptableValues(); + this.stateTicks = 20 + itemList.size() * 15; + + break label112; + + } + + settingRow2 = this; + + + settingRow2.stateTicks = 20; + } + } + } + } + } + + settingRow = this; + + intVal = (this.flagValueField ? 1 : 0); + + if (intVal == 0) { + return; + } + + settingRow = this; + + ListProperty listProp2 = settingRow.settingField.getListProperty(); + List itemList2 = listProp2.getAcceptableValues(); + Iterator iter = itemList2.iterator(); + + do { + if (!iter.hasNext()) { + break; + } + + String textStr = (String)iter.next(); + float floatVal = this.rowProgress + 20.0F; + ListProperty listProp3 = this.settingField.getListProperty(); + List itemList3 = listProp3.getAcceptableValues(); + double doubleVal3 = floatVal + itemList3.indexOf(textStr) * 15; + int intVal2 = count; + + if (count != 0) { + continue; + } + + double doubleVal4 = value; + ClickGuiModuleRow modRow2 = this.clickGuiModuleRowField; + Tab guiTab3 = modRow2.getTab(); + if (doubleVal4 < guiTab3.getPosX()) { + continue; + } + + double doubleVal6 = value; + ClickGuiModuleRow modRow3 = this.clickGuiModuleRowField; + Tab guiTab4 = modRow3.getTab(); + if (doubleVal6 > (guiTab4.getPosX() + 125.0)) { + continue; + } + + if (index < doubleVal3) { + continue; + } + + if (index > (doubleVal3 + 15.0)) { + continue; + } + + ListProperty listProp4 = this.settingField.getListProperty(); + List itemList4 = (List)listProp4.get(); + intVal2 = (itemList4.contains(textStr) ? 1 : 0); + + + label62: { + if (intVal2 != 0) { + ListProperty listProp5 = this.settingField.getListProperty(); + List itemList5 = (List)listProp5.get(); + itemList5.remove(textStr); + + break label62; + + } + + ListProperty listProp6 = this.settingField.getListProperty(); + List itemList6 = (List)listProp6.get(); + itemList6.add(textStr); + } + + ClickGuiModuleRow modRow4 = this.clickGuiModuleRowField; + SettingEvent settingEvent = new SettingEvent(modRow4.getModule(), this.settingField.getName(), this.settingField.getListProperty()); + EventManager.call(settingEvent); + } while (flag); +} + + public void processHelper3(ClickGui clickGui, int value, int index) { + java.lang.StringBuilder sb; + int keyCode; + label25: { + Tab guiTab = this.clickGuiModuleRowField.getTab(); + ClickGUI clickGuiScreen = guiTab.getClickGUI(); + FontRenderer font = FontFamilySF_MEDIUM.FAMILY.ofSize(20); + String displayName = this.settingField.getDisplayName(); + Tab guiTab2 = this.clickGuiModuleRowField.getTab(); + clickGuiScreen.drawScaledString(font, displayName, guiTab2.getPosX() + 5.5, this.rowProgress + 7.0F, -1, true); + Object obj = this.settingField.getName(); + + if (obj.equals("MODULE_BIND")) { + ClickGuiModuleRow modRow = this.clickGuiModuleRowField; + AbstractModule mod = modRow.getModule(); + ModuleKeybind keybind = mod.getKeyBindProperty().get(); + keyCode = keybind.getKey(); + break label25; + } + + obj = this.settingField.getKeyBindProperty().get(); + + + ModuleKeybind keybind2 = (ModuleKeybind)obj; + keyCode = keybind2.getKey(); + } + + String textStr; + label19: { + int intVal = keyCode; + StringBuilder sb2 = new StringBuilder(); + textStr = "["; + sb = sb2.append(textStr); + int intVal2 = (this.stateFlag6 ? 1 : 0); + + if (this.stateFlag6) { + textStr = "..."; + break label19; + } + + intVal2 = intVal; + + + textStr = Keyboard.getKeyName(intVal2); + } + + StringBuilder sb3 = sb.append(textStr); + textStr = "]"; + String textStr2 = sb3.append(textStr).toString(); + ClickGuiModuleRow modRow2 = this.clickGuiModuleRowField; + Tab guiTab3 = modRow2.getTab(); + ClickGUI clickGuiScreen2 = guiTab3.getClickGUI(); + FontFamily fontFam = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font2 = fontFam.ofSize(18); + ClickGuiModuleRow modRow3 = this.clickGuiModuleRowField; + Tab guiTab4 = modRow3.getTab(); + double doubleVal = guiTab4.getPosX() + 122.0; + FontFamily fontFam2 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font3 = fontFam2.ofSize(18); + clickGuiScreen2.drawScaledString(font2, textStr2, doubleVal - font3.stringWidth(textStr2), this.rowProgress + 6.0F, -1, false); +} + + public boolean drawElement(int value, int index) { + double doubleVal = value; + ClickGuiModuleRow modRow = this.clickGuiModuleRowField; + Tab guiTab = modRow.getTab(); + if (doubleVal < (guiTab.getPosX() + 5.0)) { + return false; + } + + if (index < this.rowProgress) { + return false; + } + + doubleVal = value; + modRow = this.clickGuiModuleRowField; + Tab guiTab2 = modRow.getTab(); + if (doubleVal > (guiTab2.getPosX() + 120.0)) { + return false; + } + + return index <= (this.rowProgress + 20.0F); +} + + public static boolean a() { + boolean flag = g(); + return !flag; +} + + public static boolean g() { + return z; +} + + static { + if (g()) { + b(true); + } + } + + public void processHelper4(int value, int index, int count) { + cc.novoline.modules.configurations.util.ClickGuiSettingRow settingRow; + int intVal; + label61: { + label64: { + double doubleVal = value; + ClickGuiModuleRow modRow = this.clickGuiModuleRowField; + Tab guiTab = modRow.getTab(); + if (doubleVal < (guiTab.getPosX() + 55.0)) { + break label64; + } + + double doubleVal2 = value; + modRow = this.clickGuiModuleRowField; + Tab guiTab2 = modRow.getTab(); + if (doubleVal2 > (guiTab2.getPosX() + 112.0)) { + break label64; + } + + if (index < (this.rowProgress + 2.0F)) { + break label64; + } + + if (index <= (this.rowProgress + 15.0F)) { + intVal = 1; + break label61; + } + } + + intVal = 0; + } + + int intVal2 = intVal; + int intVal3 = intVal2; + + if (intVal2 != 0) { + if (count != 0) { + return; + } + + this.stateFlag = true; + + return; + + } + + settingRow = this; + + intVal3 = (this.stateFlag ? 1 : 0); + + + if (intVal3 == 0) { + return; + } + + settingRow = this; + + settingRow.stateFlag = false; +} + + public void renderElement5(ClickGui clickGui, int value, int index, int count) { + int intVal3 = (g() ? 1 : 0); + GL11.glEnable(3089); + boolean flag = (intVal3 != 0); + ClickGuiModuleRow modRow = this.clickGuiModuleRowField; + Tab guiTab = modRow.getTab(); + float floatVal = (float)guiTab.getPosX() + 6.0F; + float floatVal5 = this.rowProgress; + ClickGuiModuleRow modRow2 = this.clickGuiModuleRowField; + Tab guiTab2 = modRow2.getTab(); + GuiBlurFramebuffer.renderPanel(floatVal, floatVal5, (float)guiTab2.getPosX() + 60.0F, this.rowProgress + 20.0F); + ClickGuiModuleRow modRow3 = this.clickGuiModuleRowField; + Tab guiTab3 = modRow3.getTab(); + if (!flag) { + ClickGUI clickGuiScreen = guiTab3.getClickGUI(); + FontFamily fontFam = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font = fontFam.ofSize(20); + String displayName2 = this.settingField.getDisplayName(); + Tab guiTab4 = this.clickGuiModuleRowField.getTab(); + clickGuiScreen.drawScaledString(font, displayName2, guiTab4.getPosX() - this.cachedValue4, this.rowProgress + 5.0F, -1, true); + GL11.glDisable(3089); + StringProperty strProp = clickGui.getStringPropertyR(); + String textStr = "Basic"; + label55: + if (strProp.equals(textStr)) { + FontFamily fontFam2 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font2 = fontFam2.ofSize(20); + String displayName = this.settingField.getDisplayName(); + int width = font2.stringWidth(displayName); + if (!flag) { + if (width <= 55) { + break label55; + } + + GlStateManager.disableTexture2D(); + GL11.glShadeModel(7425); + GL11.glBegin(5); + width = -2; + } + + int intVal = width; + + while (true) { + FontFamily fontFam3 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font3 = fontFam3.ofSize(18); + if (intVal < font3.getHeight() + 3) { + Color awtColor = new Color(55, 55, 55, 255); + intVal3 = awtColor.getRGB(); + RenderUtils.glColor(intVal3); + ClickGuiModuleRow modRow4 = this.clickGuiModuleRowField; + Tab guiTab5 = modRow4.getTab(); + GL11.glVertex2d(guiTab5.getPosX() + 60.0, this.rowProgress + 5.0F + intVal); + Color awtColor2 = new Color(55, 55, 55, 0); + intVal3 = awtColor2.getRGB(); + RenderUtils.glColor(intVal3); + ClickGuiModuleRow modRow5 = this.clickGuiModuleRowField; + Tab guiTab6 = modRow5.getTab(); + GL11.glVertex2d(guiTab6.getPosX() + 45.0, this.rowProgress + 5.0F + intVal); + intVal++; + if (flag) { + break; + } + + if (!flag) { + continue; + } + + } + + GL11.glEnd(); + break; + } + + GlStateManager.enableTexture2D(); + } + + ClickGuiModuleRow modRow6 = this.clickGuiModuleRowField; + guiTab3 = modRow6.getTab(); + } + + double doubleVal; + double doubleVal2; + double doubleVal3; + label48: { + label47: { + double doubleVal4 = guiTab3.getPosX() + 110.0; + ClickGuiModuleRow modRow7 = this.clickGuiModuleRowField; + Tab guiTab7 = modRow7.getTab(); + double doubleVal5 = guiTab7.getPosX() + 5.0; + FontFamily fontFam4 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font4 = fontFam4.ofSize(20); + String displayName3 = this.settingField.getDisplayName(); + int width2 = font4.stringWidth(displayName3); + doubleVal3 = doubleVal4 - (doubleVal5 + Math.min(45, width2) + 5.0); + ClickGuiModuleRow modRow8 = this.clickGuiModuleRowField; + Tab guiTab8 = modRow8.getTab(); + doubleVal = guiTab8.getPosX() + 120.0 - doubleVal3; + doubleVal2 = doubleVal3 / 100.0; + double doubleVal6 = (this.settingField.getDoubleValue() - this.settingField.getNumberProperty().e().doubleValue()) / (this.settingField.getNumberProperty().a().doubleValue() - this.settingField.getNumberProperty().e().doubleValue()) * 100.0; + Minecraft mcClient = Minecraft.getMinecraft(); + double doubleVal7 = mcClient.getDebugFPS() / 30; + double doubleVal8 = MathHelper.clamp_double(doubleVal7, 1.0, 9999.0); + this.cachedValue3 = this.cachedValue3 + (doubleVal6 - this.cachedValue3) * (0.2 / doubleVal8); + if (!flag) { + StringProperty strProp2 = clickGui.getStringPropertyR(); + if (!strProp2.equals("Basic")) { + break label47; + } + + float floatVal2 = (float)doubleVal; + floatVal5 = this.rowProgress + 7.0F; + float floatVal6 = (float)doubleVal3; + int color = (new Color(45, 45, 45)).getRGB(); + RenderUtils.drawElement(floatVal2, floatVal5, floatVal6, 3.0F, 1.0F, color); + } + + if (!flag) { + break label48; + } + } + + float floatVal3 = (float)doubleVal; + floatVal5 = this.rowProgress + 7.0F; + float floatVal7 = (float)doubleVal3; + Color awtColor3 = new Color(0, 0, 0, (int)(120.0 * clickGui.getDoubleValue())); + int color2 = awtColor3.getRGB(); + RenderUtils.drawElement(floatVal3, floatVal5, floatVal7, 3.0F, 1.0F, color2); + } + + double doubleVal9; + int intVal2 = (doubleVal9 = this.cachedValue3 - 1.0) == 0.0 ? 0 : (doubleVal9 < 0.0 ? -1 : 1); + if (!flag) { + if (intVal2 > 0) { + float floatVal4 = (float)doubleVal; + floatVal5 = this.rowProgress + 7.0F; + float floatVal8 = (float)(doubleVal2 * this.cachedValue3); + RenderUtils.drawElement(floatVal4, floatVal5, floatVal8, 3.0F, 1.0F, count); + } + + intVal2 = (int)(this.settingField.getDoubleValue() * 100.0); + } + + double doubleVal10 = intVal2 / 100.0; + ClickGuiModuleRow modRow9 = this.clickGuiModuleRowField; + Tab guiTab9 = modRow9.getTab(); + ClickGUI clickGuiScreen2 = guiTab9.getClickGUI(); + FontFamily fontFam5 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font5 = fontFam5.ofSize(13); + StringBuilder sb2 = new StringBuilder().append(doubleVal10); + String textStr2 = " "; + StringBuilder sb3 = sb2.append(textStr2); + textStr2 = this.settingField.getTextValue3(); + String textStr4 = sb3.append(textStr2).toString(); + double doubleVal11 = doubleVal + doubleVal2 * this.cachedValue3; + FontFamily fontFam6 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font6 = fontFam6.ofSize(13); + StringBuilder sb4 = new StringBuilder().append(doubleVal10); + sb4 = sb4.append(" "); + String textStr5 = this.settingField.getTextValue3(); + String textStr3 = sb4.append(textStr5).toString(); + double doubleVal12 = (float)(doubleVal11 - font6.stringWidth(textStr3) / 2); + ClickGuiModuleRow modRow10 = this.clickGuiModuleRowField; + Tab guiTab10 = modRow10.getTab(); + double doubleVal13 = guiTab10.getPosX(); + FontFamily fontFam7 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font7 = fontFam7.ofSize(13); + StringBuilder sb6 = new StringBuilder().append(doubleVal10); + StringBuilder sb7 = sb6.append(" "); + String textStr6 = this.settingField.getTextValue3(); + textStr5 = sb7.append(textStr6).toString(); + double doubleVal20 = doubleVal13 + font7.stringWidth(textStr5) * 2; + ClickGuiModuleRow modRow11 = this.clickGuiModuleRowField; + Tab guiTab11 = modRow11.getTab(); + double doubleVal14 = guiTab11.getPosX() + 110.0; + FontFamily fontFam8 = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font8 = fontFam8.ofSize(13); + StringBuilder sb9 = new StringBuilder().append(doubleVal10); + StringBuilder sb10 = sb9.append(" "); + String textStr7 = this.settingField.getTextValue3(); + textStr6 = sb10.append(textStr7).toString(); + double doubleVal21 = doubleVal14 - font8.stringWidth(textStr6) + 2.0; + clickGuiScreen2.drawScaledString(font5, textStr4, (float)MathHelper.clamp_double(doubleVal12, doubleVal20, doubleVal21), this.rowProgress + 14.5F, -1, false); + ClickGuiSettingRow settingRow = this; + if (!flag) { + if (!this.stateFlag4) { + return; + } + + settingRow = this; + } + + double doubleVal15 = settingRow.settingField.getNumberProperty().a().doubleValue() - this.settingField.getNumberProperty().e().doubleValue(); + double doubleVal16 = this.settingField.getNumberProperty().e().doubleValue(); + double doubleVal17 = (value - (doubleVal + 1.0)) / doubleVal3; + double doubleVal18 = doubleVal16 + MathHelper.clamp_double(doubleVal17, 0.0, 1.0) * doubleVal15; + double doubleVal22 = this.settingField.getCachedValue(); + double doubleVal19 = MathHelper.incValue(doubleVal18, doubleVal22); + this.settingField.applyUpdate(doubleVal19); + modRow2 = this.clickGuiModuleRowField; + SettingEvent settingEvent = new SettingEvent(modRow2.getModule(), this.settingField.getName(), this.settingField.getNumberProperty()); + EventManager.call(settingEvent); +} + + public void performAction() { + ClickGuiSettingRow settingRow; + settingRow = this; + + if (this.stateFlag4) { + settingRow = this; + + if (this.settingField.getName().equals("CG_DPI_SCALE")) { + ModuleRegistry modEntry = ModuleRegistry.CLICKGUI; + modEntry.obtainAbstractModule().applyInt5(this.settingField.getDoubleValue()); + } + } + + this.stateFlag4 = false; + this.flagValue = false; + this.stateFlag3 = false; + settingRow = this; + + settingRow.stateFlag2 = false; +} + + public void processHelper5(ClickGui clickGui, int value, int index) { + int intVal; + label73: { + label76: { + double doubleVal = value; + ClickGuiModuleRow modRow = this.clickGuiModuleRowField; + Tab guiTab = modRow.getTab(); + if (doubleVal < (guiTab.getPosX() + 5.0)) { + break label76; + } + + double doubleVal2 = value; + modRow = this.clickGuiModuleRowField; + Tab guiTab2 = modRow.getTab(); + if (doubleVal2 > (guiTab2.getPosX() + 120.0)) { + break label76; + } + + if (index < this.rowProgress) { + break label76; + } + + if (index <= (this.rowProgress + 15.0F)) { + intVal = 1; + break label73; + } + } + + intVal = 0; + } + + label77: { + int intVal2 = intVal; + StringProperty strProp = clickGui.getStringPropertyR(); + if (strProp.equals("Basic")) { + ClickGuiModuleRow modRow2 = this.clickGuiModuleRowField; + Tab guiTab3 = modRow2.getTab(); + double doubleVal4 = guiTab3.getPosX() + 5.0; + double doubleVal3 = this.rowProgress; + ClickGuiModuleRow modRow3 = this.clickGuiModuleRowField; + Tab guiTab4 = modRow3.getTab(); + double doubleVal8 = guiTab4.getPosX() + 120.0; + double doubleVal9 = this.rowProgress + 15.0F; + int intVal3 = intVal2; + + if (intVal2 != 0) { + Color awtColor = new Color(50, 50, 50); + intVal3 = awtColor.getRGB(); + } else { + Color awtColor2 = new Color(44, 44, 44); + intVal3 = awtColor2.getRGB(); + } + + + RenderUtils.drawRect(doubleVal4, doubleVal3, doubleVal8, doubleVal9, intVal3); + ClickGuiModuleRow modRow4 = this.clickGuiModuleRowField; + Tab guiTab5 = modRow4.getTab(); + double doubleVal5 = guiTab5.getPosX() + 6.0; + double doubleVal10 = this.rowProgress + 1.0F; + modRow3 = this.clickGuiModuleRowField; + Tab guiTab6 = modRow3.getTab(); + double doubleVal11 = guiTab6.getPosX() + 119.0; + doubleVal9 = this.rowProgress + 14.0F; + int intVal4 = intVal2; + + if (intVal2 != 0) { + Color awtColor3 = new Color(35, 35, 35); + intVal4 = awtColor3.getRGB(); + } else { + Color awtColor4 = new Color(37, 37, 37); + intVal4 = awtColor4.getRGB(); + } + + + RenderUtils.drawRect(doubleVal5, doubleVal10, doubleVal11, doubleVal9, intVal4); + + break label77; + + } + + ClickGuiModuleRow modRow5 = this.clickGuiModuleRowField; + Tab guiTab7 = modRow5.getTab(); + double doubleVal6 = guiTab7.getPosX() + 5.0; + double doubleVal12 = this.rowProgress; + ClickGuiModuleRow modRow6 = this.clickGuiModuleRowField; + Tab guiTab8 = modRow6.getTab(); + double doubleVal13 = guiTab8.getPosX() + 120.0; + double doubleVal14 = this.rowProgress + 15.0F; + int intVal5 = intVal2; + + if (intVal2 != 0) { + Color awtColor5 = new Color(0, 0, 0, 70); + intVal5 = awtColor5.getRGB(); + } else { + Color awtColor6 = new Color(0, 0, 0, 55); + intVal5 = awtColor6.getRGB(); + } + + + RenderUtils.drawRect(doubleVal6, doubleVal12, doubleVal13, doubleVal14, intVal5); + ClickGuiModuleRow modRow7 = this.clickGuiModuleRowField; + Tab guiTab9 = modRow7.getTab(); + double doubleVal7 = guiTab9.getPosX() + 6.0; + double doubleVal15 = this.rowProgress + 1.0F; + modRow6 = this.clickGuiModuleRowField; + Tab guiTab10 = modRow6.getTab(); + double doubleVal16 = guiTab10.getPosX() + 119.0; + doubleVal14 = this.rowProgress + 14.0F; + int intVal6 = intVal2; + + if (intVal2 != 0) { + Color awtColor7 = new Color(0, 0, 0, 70); + intVal6 = awtColor7.getRGB(); + } else { + Color awtColor8 = new Color(0, 0, 0, 55); + intVal6 = awtColor8.getRGB(); + } + + + RenderUtils.drawRect(doubleVal7, doubleVal15, doubleVal16, doubleVal14, intVal6); + } + + String displayName = this.settingField.getDisplayName(); + FontFamily fontFam = FontFamilySF_MEDIUM.FAMILY; + FontRenderer font = fontFam.ofSize(20); + ClickGuiModuleRow modRow8 = this.clickGuiModuleRowField; + Tab guiTab11 = modRow8.getTab(); + float floatVal = (float)(guiTab11.getPosX() + 64.0); + float floatVal2 = this.rowProgress + 4.0F; + font.drawCenteredString(displayName, floatVal, floatVal2, -1, true); +} +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/ClickGuiSettingSwitchMap.java b/src/main/java/cc/novoline/modules/configurations/util/ClickGuiSettingSwitchMap.java new file mode 100644 index 0000000..608e35a --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/ClickGuiSettingSwitchMap.java @@ -0,0 +1,54 @@ +package cc.novoline.modules.configurations.util; + +import cc.novoline.gui.screen.setting.SettingType; + +public class ClickGuiSettingSwitchMap { + static final int[] SWITCH_MAP = new int[SettingType.values().length]; + + static { + try { + SWITCH_MAP[SettingType.CHECKBOX.ordinal()] = 1; + } catch (NoSuchFieldError noSuchFieldError) { + } + + try { + SWITCH_MAP[SettingType.SLIDER.ordinal()] = 2; + } catch (NoSuchFieldError noSuchFieldError2) { + } + + try { + SWITCH_MAP[SettingType.COMBOBOX.ordinal()] = 3; + } catch (NoSuchFieldError noSuchFieldError3) { + } + + try { + SWITCH_MAP[SettingType.SELECTBOX.ordinal()] = 4; + } catch (NoSuchFieldError noSuchFieldError4) { + } + + try { + SWITCH_MAP[SettingType.COLOR_PICKER.ordinal()] = 5; + } catch (NoSuchFieldError noSuchFieldError5) { + } + + try { + SWITCH_MAP[SettingType.TEXTBOX.ordinal()] = 6; + } catch (NoSuchFieldError noSuchFieldError6) { + } + + try { + SWITCH_MAP[SettingType.BUTTON.ordinal()] = 7; + } catch (NoSuchFieldError noSuchFieldError7) { + } + + try { + SWITCH_MAP[SettingType.BINDABLE.ordinal()] = 8; + } catch (NoSuchFieldError noSuchFieldError8) { + } + + try { + SWITCH_MAP[SettingType.SEPARATOR.ordinal()] = 9; + } catch (NoSuchFieldError noSuchFieldError9) { + } + } +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/ConfigRootSnapshot.java b/src/main/java/cc/novoline/modules/configurations/util/ConfigRootSnapshot.java new file mode 100644 index 0000000..6f67d3e --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/ConfigRootSnapshot.java @@ -0,0 +1,55 @@ +package cc.novoline.modules.configurations.util; + +import cc.novoline.modules.configurations.ConfigManager; +import cc.novoline.modules.ModuleArrayMap; +import cc.novoline.modules.ModuleManager; +import net.minecraft.util.IContract; +import ninja.leaping.configurate.util.IObjectMapperAccess; +import cc.novoline.modules.configurations.holder.SavingModuleHolderSupport; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; + +@IContract +public final class ConfigRootSnapshot { + @IObjectMapperAccess("modules") + private ModuleArrayMap moduleArrayMap2; + @IObjectMapperAccess("config-version") + private int intState; + + public ConfigRootSnapshot() {} + + public static @NonNull ConfigRootSnapshot resolveConfigRootSnapshot2(@NonNull ConfigManager configManager, @NonNull String text) { + SavingModuleHolderSupport.notNull(configManager, "module manager"); + ModuleManager modManager = configManager.getModuleManager(); + return new ConfigRootSnapshot(modManager.getModules(), configManager.a()); +} + + @Override + public @NonNull String toString() { + StringBuilder sb = new StringBuilder(); + sb = sb.append("ClientConfig{options="); + ModuleArrayMap moduleArrayMap = this.moduleArrayMap2; + sb = sb.append(moduleArrayMap).append(", configVersion="); + int intVal = this.intState; + sb = sb.append(intVal); + return sb.append('}').toString(); +} + + public static @NonNull ConfigRootSnapshot resolveConfigRootSnapshot(@NonNull String text, @Nullable ModuleArrayMap moduleArrayMap, int value) { + SavingModuleHolderSupport.notNull(moduleArrayMap, "modules"); + return new ConfigRootSnapshot(moduleArrayMap, value); +} + + public int getIntValue() { + return this.intState; +} + + private ConfigRootSnapshot(@Nullable ModuleArrayMap moduleArrayMap, int value) { + this.moduleArrayMap2 = moduleArrayMap; + this.intState = value; +} + + public ModuleArrayMap getModuleArrayMap() { + return this.moduleArrayMap2; +} +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/DelsyConfigSerializer.java b/src/main/java/cc/novoline/modules/configurations/util/DelsyConfigSerializer.java new file mode 100644 index 0000000..83df7e6 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/DelsyConfigSerializer.java @@ -0,0 +1,71 @@ +package cc.novoline.modules.configurations.util; + +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.configurations.holder.StoringModuleHolder; +import com.google.common.reflect.TypeToken; +import ninja.leaping.configurate.objectmapping.serialize.TypeSerializer; +import cc.novoline.modules.ModuleArrayMap; +import cc.novoline.modules.ModuleManager; +import ninja.leaping.configurate.objectmapping.ObjectMapperSupport; +import ninja.leaping.configurate.objectmapping.ObjectMapperBoundInstance; +import ninja.leaping.configurate.objectmapping.ObjectMappingException; +import ninja.leaping.configurate.ConfigurationNode; + +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; + +public final class DelsyConfigSerializer implements TypeSerializer { + private final @NonNull ModuleManager moduleManager2; + + @Override + public void a(@NonNull TypeToken typeToken, @Nullable Object obj, @NonNull ConfigurationNode node) throws ObjectMappingException { + label17: { + if (obj == null) { + break label17; + } + + IDelsyConfigSerializerAccess val = node.o().c(); + Class clazz = obj.getClass(); + ObjectMapperSupport objectMapperSupport = (ObjectMapperSupport)val.a(clazz); + objectMapperSupport.a(obj).b(node); + + return; + } + + node.b((Object)null); +} + + + + @Override + public Object a(@NonNull TypeToken typeToken, @NonNull ConfigurationNode node) throws ObjectMappingException { + IDelsyConfigSerializerAccess val = node.o().c(); + Class clazz3 = typeToken.getRawType(); + ObjectMapperSupport objectMapperSupport = (ObjectMapperSupport)val.a(clazz3); + Class clazz = objectMapperSupport.c(); + if (!AbstractModule.class.isAssignableFrom(clazz)) { + ObjectMapperBoundInstance objectMapperBoundInstance = objectMapperSupport.e(); + return objectMapperBoundInstance.a(node); + } + + StoringModuleHolder storingModuleHolder; + try { + ModuleManager modManager = this.moduleManager2; + ModuleArrayMap moduleArrayMap = modManager.getModules(); + storingModuleHolder = (StoringModuleHolder)moduleArrayMap.getHolderByClass(objectMapperSupport.c()); + } catch (Throwable ex) { + StringBuilder sb2 = new StringBuilder().append("No registered module is available for class "); + Class clazz2 = objectMapperSupport.c(); + StringBuilder sb3 = sb2.append(clazz2); + throw new ObjectMappingException(sb3.append(" but is required to construct new instances!").toString(), ex); + } + + AbstractModule mod = storingModuleHolder.getAbstractModuleC(); + ObjectMapperBoundInstance objectMapperBoundInstance2 = objectMapperSupport.a(mod); + return objectMapperBoundInstance2.a(node); +} + + public DelsyConfigSerializer(@NonNull ModuleManager moduleManager) { + this.moduleManager2 = moduleManager; +} +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/FastEntrySetBridge.java b/src/main/java/cc/novoline/modules/configurations/util/FastEntrySetBridge.java new file mode 100644 index 0000000..faeb233 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/FastEntrySetBridge.java @@ -0,0 +1,10 @@ +package cc.novoline.modules.configurations.util; + +import it.unimi.dsi.fastutil.objects.ObjectIterator; +import it.unimi.dsi.fastutil.objects.Object2ObjectMap.FastEntrySet; + +public class FastEntrySetBridge { + public static ObjectIterator resolveObjectIterator(FastEntrySet fastEntrySet) { + return fastEntrySet.iterator(); +} +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/IDelsyConfigSerializerAccess.java b/src/main/java/cc/novoline/modules/configurations/util/IDelsyConfigSerializerAccess.java new file mode 100644 index 0000000..2c437d2 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/IDelsyConfigSerializerAccess.java @@ -0,0 +1,11 @@ +package cc.novoline.modules.configurations.util; + + +import ninja.leaping.configurate.objectmapping.ObjectMapper; +import ninja.leaping.configurate.objectmapping.ObjectMappingException; +import org.jetbrains.annotations.NotNull; + +public interface IDelsyConfigSerializerAccess { + @NotNull + ObjectMapper a(@NotNull Class param) throws ObjectMappingException; +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/ImmutableBooleanTag.java b/src/main/java/cc/novoline/modules/configurations/util/ImmutableBooleanTag.java new file mode 100644 index 0000000..84c2e04 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/ImmutableBooleanTag.java @@ -0,0 +1,4 @@ +package cc.novoline.modules.configurations.util; + +public class ImmutableBooleanTag { +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/ModuleMapSerializer.java b/src/main/java/cc/novoline/modules/configurations/util/ModuleMapSerializer.java new file mode 100644 index 0000000..816829d --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/ModuleMapSerializer.java @@ -0,0 +1,135 @@ +package cc.novoline.modules.configurations.util; + +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.configurations.holder.SavingModuleHolder; +import com.google.common.reflect.TypeToken; +import cc.novoline.modules.configurations.holder.ModuleHolder; +import it.unimi.dsi.fastutil.objects.ObjectIterator; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; +import ninja.leaping.configurate.ValueType; +import ninja.leaping.configurate.objectmapping.serialize.TypeSerializer; +import cc.novoline.modules.ModuleArrayMap; +import cc.novoline.modules.ModuleManager; +import ninja.leaping.configurate.objectmapping.serialize.TypeSerializerUnabletodeseJsonAdapter; +import ninja.leaping.configurate.objectmapping.ObjectMappingException; +import ninja.leaping.configurate.ConfigurationNode; +import cc.novoline.modules.configurations.holder.SavingModuleHolderSupport; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; + +public final class ModuleMapSerializer implements TypeSerializer { + private static final String CONST_STRING = "module manager"; + private final @NonNull Logger logger; + private final @NonNull ModuleManager moduleManager2; + + + public @NonNull ModuleArrayMap a(@NonNull TypeToken typeToken, @NonNull ConfigurationNode node) { + ModuleArrayMap moduleArrayMap = this.moduleManager2.getModules(); + ModuleArrayMap moduleArrayMap2 = new ModuleArrayMap(); + Map itemMap = node.k(); + Set itemSet = itemMap.entrySet(); + Iterator iter = itemSet.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + label56: { + Entry entry = (Entry)iter.next(); + String textStr = entry.getKey().toString(); + ConfigurationNode configurationNode = (ConfigurationNode)entry.getValue(); + Object obj = configurationNode.p(); + if (obj == ValueType.NULL) { + break label56; + } + + obj = moduleArrayMap.get(textStr); + + ModuleHolder modHolder; + if ((modHolder = (ModuleHolder)obj) != null) { + AbstractModule abstractModule = null; + ObjectMappingException ex2 = null; + + try { + TypeToken typeToken2 = modHolder.getTypeToken(); + abstractModule = ((AbstractModule)(configurationNode.a(typeToken2))); + } catch (ObjectMappingException ex) { + ex2 = ex; + } + + if (abstractModule == null) { + StringBuilder sb3 = new StringBuilder().append("Cannot initiate ").append(textStr); + String textStr2 = sb3.append(" module. Skipping it...").toString(); + if (ex2 != null) { + Logger log = this.logger; + log.warn(textStr2, ex2); + continue; + } + + Logger log2 = this.logger; + log2.warn(textStr2); + + continue; + } + + moduleArrayMap2.put(textStr, SavingModuleHolder.resolveSavingModuleHolder(textStr, abstractModule)); + } + } + + } + + return moduleArrayMap2; +} + + + + public void a(@NonNull TypeToken typeToken, @Nullable ModuleArrayMap moduleArrayMap, @NonNull ConfigurationNode node) throws ObjectMappingException { + ModuleArrayMap moduleArrayMap2 = moduleArrayMap; + if (moduleArrayMap == null) { + node.b((Object)null); + return; + } + + moduleArrayMap2 = moduleArrayMap; + + ObjectIterator objectIterator = FastEntrySetBridge.resolveObjectIterator(moduleArrayMap2.object2ObjectEntrySet()); + + while (true) { + if (!objectIterator.hasNext()) { + break; + } + + it.unimi.dsi.fastutil.objects.Object2ObjectMap.Entry entry = (it.unimi.dsi.fastutil.objects.Object2ObjectMap.Entry)objectIterator.next(); + String textStr = (String)entry.getKey(); + ModuleHolder modHolder = (ModuleHolder)entry.getValue(); + ModuleHolder modHolder2 = modHolder; + if (modHolder == null) { + continue; + } + + modHolder2 = (ModuleHolder)entry.getValue(); + + TypeToken typeToken2 = modHolder2.getTypeToken(); + ModuleHolder modHolder3 = (ModuleHolder)entry.getValue(); + AbstractModule abstractModule = modHolder3.getModule(); + Object[] objArr = new Object[]{textStr}; + ConfigurationNode configurationNode = node.a(objArr); + configurationNode.resolveConfigurationNode(typeToken2, abstractModule); + } +} + + public ModuleMapSerializer(ModuleManager moduleManager) { + ModuleManager modManager = moduleManager; + this.logger = LogManager.getLogger(); + SavingModuleHolderSupport.notNull(modManager, "module manager"); + this.moduleManager2 = modManager; +} + + +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/MutablePropertyFieldBinding.java b/src/main/java/cc/novoline/modules/configurations/util/MutablePropertyFieldBinding.java new file mode 100644 index 0000000..77a8030 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/MutablePropertyFieldBinding.java @@ -0,0 +1,33 @@ +package cc.novoline.modules.configurations.util; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.holder.ModuleHolder; +import java.lang.reflect.Field; + +import net.optifine.FieldReflectionAccess; +import cc.novoline.modules.configurations.holder.SavingModuleHolderSupport; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class MutablePropertyFieldBinding extends PropertyFieldBinding { + + private MutablePropertyFieldBinding(@NonNull String text, @NonNull Field field) { + super(text, field, null); +} + + @Override + public void handleAbstractModule(@NonNull AbstractModule module, @NonNull AbstractModule module2, boolean flag) throws IllegalAccessException { + Class clazz = module2.getClass(); + Class clazz2 = module.getClass(); + boolean flag2 = clazz.isAssignableFrom(clazz2); + SavingModuleHolderSupport.applyUpdate(flag2, "cannot copy value of property from different modules"); + BooleanProperty boolProp = (BooleanProperty)FieldReflectionAccess.updateState(this.field2, module); + BooleanProperty boolProp2 = (BooleanProperty)FieldReflectionAccess.updateState(this.field2, module2); + Boolean propFlag = boolProp.get(); + boolean flag3 = propFlag; + module2.setEnabled(flag3); +} + + public MutablePropertyFieldBinding(String text, Field field, PropertyBindingTag propertyBindingTag) { + this(text, field); +} +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/OutOfBoundsPropertyException.java b/src/main/java/cc/novoline/modules/configurations/util/OutOfBoundsPropertyException.java new file mode 100644 index 0000000..b6438e0 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/OutOfBoundsPropertyException.java @@ -0,0 +1,23 @@ +package cc.novoline.modules.configurations.util; + +import cc.novoline.modules.configurations.property.AbstractNumberProperty; +import cc.novoline.modules.exceptions.UnacceptableValueException; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class OutOfBoundsPropertyException extends UnacceptableValueException { + public OutOfBoundsPropertyException(Throwable throwable, @NonNull AbstractNumberProperty property) { + super(throwable, property); +} + + public OutOfBoundsPropertyException(String text, Throwable throwable, @NonNull AbstractNumberProperty property) { + super(text, throwable, property); +} + + public OutOfBoundsPropertyException(String text, @NonNull AbstractNumberProperty property) { + super(text, property); +} + + public OutOfBoundsPropertyException(@NonNull AbstractNumberProperty property) { + super(property); +} +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/PropertyBindingTag.java b/src/main/java/cc/novoline/modules/configurations/util/PropertyBindingTag.java new file mode 100644 index 0000000..9abafdb --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/PropertyBindingTag.java @@ -0,0 +1,4 @@ +package cc.novoline.modules.configurations.util; + +public class PropertyBindingTag { +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/PropertyFieldBinding.java b/src/main/java/cc/novoline/modules/configurations/util/PropertyFieldBinding.java new file mode 100644 index 0000000..f0eef56 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/PropertyFieldBinding.java @@ -0,0 +1,36 @@ +package cc.novoline.modules.configurations.util; + +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.configurations.property.Property; +import cc.novoline.modules.configurations.holder.ModuleHolder; +import java.lang.reflect.Field; +import net.optifine.FieldReflectionAccess; +import cc.novoline.modules.configurations.holder.SavingModuleHolderSupport; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class PropertyFieldBinding { + public final @NonNull Field field2; + public final @NonNull String textValue; + + private PropertyFieldBinding(@NonNull String text, @NonNull Field field) { + this.textValue = text; + this.field2 = field; +} + + public void handleAbstractModule(@NonNull AbstractModule module, @NonNull AbstractModule module2, boolean flag) throws IllegalAccessException { + Class clazz = module2.getClass(); + Class clazz2 = module.getClass(); + boolean flag2 = clazz.isAssignableFrom(clazz2); + SavingModuleHolderSupport.applyUpdate(flag2, "cannot copy value of property from different modules"); + Property property2 = (Property)FieldReflectionAccess.updateState(this.field2, module); + Property property3 = (Property)FieldReflectionAccess.updateState(this.field2, module2); + Object obj = property2.get(); + property3.set(obj); +} + + public PropertyFieldBinding(String text, Field field, PropertyBindingTag propertyBindingTag) { + this(text, field); +} + + +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/RotationVector.java b/src/main/java/cc/novoline/modules/configurations/util/RotationVector.java new file mode 100644 index 0000000..c8ddca6 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/RotationVector.java @@ -0,0 +1,147 @@ +package cc.novoline.modules.configurations.util; + +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.utils.render.RotationAngleUtil; +import net.minecraft.util.MathHelper; +import net.minecraft.client.Minecraft; + +public class RotationVector { + private float cachedAngle; + private float cachedAngle2; + private Minecraft mcClient; + + public float evaluateFloat(float value, IntProperty property) { + float floatVal9 = MathHelper.wrapAngleTo180_float(value); + float floatVal = this.cachedAngle; + int intVal = 0; + int intVal2 = 0; + float floatVal2 = RotationAngleUtil.getAngleDifference(this.cachedAngle, floatVal9); + Integer intVal7 = property.get(); + label39: + if (!(floatVal2 <= intVal7.intValue())) { + Integer intVal3 = property.get(); + int intVal4 = (intVal3.equals(property.getMaximum()) ? 1 : 0); + if ((intVal4 != 0)) { + break label39; + } + + float floatVal3; + intVal4 = (floatVal3 = floatVal - floatVal9) == 0.0F ? 0 : (floatVal3 < 0.0F ? -1 : 1); + + while ((intVal4 != 0)) { + intVal7 = property.get(); + float floatVal4 = intVal7.intValue(); + float floatVal10 = RotationAngleUtil.getAngleDifference(floatVal, floatVal9); + floatVal += Math.min(floatVal4, floatVal10); + floatVal = MathHelper.wrapAngleTo180_float(floatVal); + intVal2++; + + float floatVal5; + intVal4 = (floatVal5 = floatVal - floatVal9) == 0.0F ? 0 : (floatVal5 < 0.0F ? -1 : 1); + } + + floatVal = this.cachedAngle; + + while (true) { + if (floatVal != floatVal9) { + intVal7 = property.get(); + float floatVal6 = intVal7.intValue(); + float floatVal11 = RotationAngleUtil.getAngleDifference(floatVal, floatVal9); + floatVal -= Math.min(floatVal6, floatVal11); + floatVal = MathHelper.wrapAngleTo180_float(floatVal); + intVal++; + + continue; + } + + if (intVal <= intVal2) { + double doubleVal = this.cachedAngle; + Integer intVal5 = property.get(); + float floatVal7 = intVal5.intValue(); + float floatVal12 = RotationAngleUtil.getAngleDifference(this.cachedAngle, floatVal9); + double doubleVal2 = Math.min(floatVal7, floatVal12); + this.cachedAngle = (float)(doubleVal - (doubleVal2 - Math.random())); + return this.cachedAngle; + } + break; + } + + double doubleVal3 = this.cachedAngle; + Integer intVal6 = property.get(); + float floatVal8 = intVal6.intValue(); + float floatVal13 = RotationAngleUtil.getAngleDifference(this.cachedAngle, floatVal9); + double doubleVal4 = Math.min(floatVal8, floatVal13); + this.cachedAngle = (float)(doubleVal3 + (doubleVal4 - Math.random())); + return this.cachedAngle; + } + + floatVal2 = this.cachedAngle = floatVal9; + + return floatVal2; +} + + public RotationVector(float value) { + this.mcClient = Minecraft.getMinecraft(); + this.cachedAngle = value; +} + + public RotationVector() { + this.mcClient = Minecraft.getMinecraft(); +} + + public float evaluateFloat(float value, float amount) { + float floatVal5 = MathHelper.wrapAngleTo180_float(value); + float floatVal = this.cachedAngle; + int intVal = 0; + int intVal2 = 0; + float floatVal2; + int intVal3 = (floatVal2 = RotationAngleUtil.getAngleDifference(this.cachedAngle, floatVal5) - amount) == 0.0F ? 0 : (floatVal2 < 0.0F ? -1 : 1); + if (intVal3 <= 0) { + return this.cachedAngle = floatVal5; + } + + float floatVal3; + intVal3 = (floatVal3 = floatVal - floatVal5) == 0.0F ? 0 : (floatVal3 < 0.0F ? -1 : 1); + + while (true) { + if (intVal3 == 0) { + floatVal = this.cachedAngle; + break; + } + + float floatVal6 = RotationAngleUtil.getAngleDifference(floatVal, floatVal5); + floatVal += Math.min(amount, floatVal6); + floatVal = MathHelper.wrapAngleTo180_float(floatVal); + intVal2++; + + float floatVal4; + intVal3 = (floatVal4 = floatVal - floatVal5) == 0.0F ? 0 : (floatVal4 < 0.0F ? -1 : 1); + } + + while (true) { + if (floatVal != floatVal5) { + float floatVal7 = RotationAngleUtil.getAngleDifference(floatVal, floatVal5); + floatVal -= Math.min(amount, floatVal7); + floatVal = MathHelper.wrapAngleTo180_float(floatVal); + intVal++; + + continue; + } + + if (intVal <= intVal2) { + double doubleVal4 = this.cachedAngle; + float floatVal8 = RotationAngleUtil.getAngleDifference(this.cachedAngle, floatVal5); + double doubleVal = Math.min(amount, floatVal8); + this.cachedAngle = (float)(doubleVal4 - (doubleVal - Math.random())); + return this.cachedAngle; + } + break; + } + + double doubleVal2 = this.cachedAngle; + float floatVal9 = RotationAngleUtil.getAngleDifference(this.cachedAngle, floatVal5); + double doubleVal3 = Math.min(amount, floatVal9); + this.cachedAngle = (float)(doubleVal2 + (doubleVal3 - Math.random())); + return this.cachedAngle; +} +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/ScaffoldBlockData.java b/src/main/java/cc/novoline/modules/configurations/util/ScaffoldBlockData.java new file mode 100644 index 0000000..72f9749 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/ScaffoldBlockData.java @@ -0,0 +1,132 @@ +package cc.novoline.modules.configurations.util; + + +import cc.novoline.events.EventManager; +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.player.Scaffold; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.shader.RoundedTextureShader; +import java.awt.Color; +import cc.novoline.utils.fonts.holders.FontSF_BOLD_Holder; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class ScaffoldBlockData { + final Scaffold scaffoldField; + + public ScaffoldBlockData(Scaffold scaffold) { + this.scaffoldField = scaffold; +} + + private void invokeCallback(boolean flag, double value, double amount) { + net.minecraft.item.ItemStack stack; + int intVal = this.scaffoldField.getIntValue10(); + String textStr = String.valueOf(intVal); + BooleanProperty boolProp = this.scaffoldField.getBackground(); + Boolean propFlag = boolProp.get(); + byte byteVal = (byte)(propFlag ? 1 : 0); + if (byteVal != 0) { + int intVal2 = (flag ? 1 : 0); + if (flag != false) { + intVal2 = 4; + } else { + intVal2 = textStr.length(); + } + + double doubleVal2 = 10 * intVal2; + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal = value / 2.0 - doubleVal2 / 2.0; + int intVal6 = (flag ? 1 : 0); + intVal6 = (flag != false ? 158 : 131); + + double doubleVal3 = amount - intVal6; + double doubleVal4 = flag != false ? 46.0 : 18.0; + double doubleVal5 = flag != false ? 24.0 : 18.0; + DoubleProperty doubleProp = this.scaffoldField.getRoundness(); + Double propDouble = doubleProp.get(); + double doubleVal6 = propDouble; + doubleVal5 = Math.min(doubleVal5, doubleVal6); + IntProperty intProp = this.scaffoldField.getSmoothness(); + Integer intVal3 = intProp.get(); + double doubleVal7 = intVal3.intValue(); + IntProperty intProp2 = this.scaffoldField.getAlpha(); + Integer intVal7 = intProp2.get(); + Color awtColor = new Color(0, 0, 0, intVal7); + roundedTextureShader.drawRoundedRect(doubleVal, doubleVal3, doubleVal2, doubleVal4, doubleVal5, doubleVal7, awtColor, true); + } + + byteVal = (byte)(flag ? 1 : 0); + + if (byteVal != 0) { + InventoryPlayer inventory2 = Scaffold.resolveMinecraft31(this.scaffoldField).thePlayer.inventory; + IntProperty intProp3 = this.scaffoldField.getSlot(); + Integer intVal4 = intProp3.get(); + int intVal5 = intVal4 - 1; + ItemStack stack2 = inventory2.getStackInSlot(intVal5); + + label60: + if (stack2 != null) { + Item item2 = stack2.getItem(); + if (item2 == null) { + break label60; + } + + stack = stack2; + + item2 = stack2.getItem(); + + if (!(item2 instanceof ItemBlock)) { + break label60; + } + + stack = stack2; + + double doubleVal8 = value / 2.0 - 8.0; + double doubleVal9 = amount - 150.0; + RenderUtils.drawElement9(stack, doubleVal8, doubleVal9, 0.75); + } + } + + FontRenderer font = FontSF_BOLD_Holder.FONT; + double doubleVal10 = value / 2.0; + double doubleVal11 = amount - 125.0; + font.drawCenteredString(textStr, doubleVal10, doubleVal11, 16777215, true); +} + + @EventTarget + public void onRender2D(Render2DEvent event) { + ScaffoldBlockData scaffoldBlockData = this; + if (!(this.scaffoldField.getSmoothAnim().getValue() <= 0.0)) { + ScaledResolution scaledRes = new ScaledResolution(Scaffold.resolveMinecraft32(this.scaffoldField)); + double scaledWidthD = scaledRes.getScaledWidthDoubleGui(); + double scaledHeightD = scaledRes.getScaledHeightDoubleGui(); + BooleanProperty boolProp = this.scaffoldField.getIcon(); + Boolean propFlag = boolProp.get(); + byte byteVal = (byte)(propFlag ? 1 : 0); + double doubleVal = scaledWidthD / 2.0; + int intVal2 = (byteVal != 0 ? 158 : 131); + + double doubleVal2 = scaledHeightD - intVal2; + int intVal = byteVal; + intVal = (byteVal != 0 ? 46 : 18); + + double doubleVal3 = doubleVal2 + intVal / 2; + this.scaffoldField.getSmoothAnim().renderVisual(doubleVal, doubleVal3, 0.14, $lambdaCapture$0(this, byteVal != 0, scaledWidthD, scaledHeightD), 200L); + return; + } + + scaffoldBlockData = this; + + EventManager.unregister(scaffoldBlockData); +} + + private static Runnable $lambdaCapture$0(ScaffoldBlockData $c0, boolean $c1, double $c2, double $c3) { return () -> $c0.invokeCallback($c1, $c2, $c3); } +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/TabGuiCategoryItem.java b/src/main/java/cc/novoline/modules/configurations/util/TabGuiCategoryItem.java new file mode 100644 index 0000000..3683d01 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/TabGuiCategoryItem.java @@ -0,0 +1,297 @@ +package cc.novoline.modules.configurations.util; + +import cc.novoline.Novoline; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.visual.TabGui; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.render.TabGuiModuleItem; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.function.Consumer; +import cc.novoline.modules.ModuleManager; +import net.minecraft.util.MathHelper; +import net.minecraft.client.Minecraft; + +public final class TabGuiCategoryItem { + private final EnumModuleType enumModuleTypeField; + private final TabGui tabGuiField; + private final List tabGuiModuleItemList; + private boolean stateFlag; + private float cachedAngle; + + public List getTabGuiModuleItemList() { + return this.tabGuiModuleItemList; +} + + public TabGui getTabGuiField() { + return this.tabGuiField; +} + + public EnumModuleType getEnumModuleTypeField() { + return this.enumModuleTypeField; +} + + public TabGuiModuleItem getTabGuiModuleItem() { + cc.novoline.utils.render.TabGuiModuleItem tabGuiModuleItem; + Iterator iter = this.tabGuiModuleItemList.iterator(); + + while (true) { + if (iter.hasNext()) { + TabGuiModuleItem tabGuiModuleItem2 = (TabGuiModuleItem)iter.next(); + tabGuiModuleItem = tabGuiModuleItem2; + + if (tabGuiModuleItem2.isSelected()) { + tabGuiModuleItem = tabGuiModuleItem2; + break; + } + + continue; + } + + return null; + } + + return tabGuiModuleItem; +} + + public void setStateFlag(boolean flag) { + this.stateFlag = flag; +} + + public boolean isStateFlag() { + return this.stateFlag; +} + + public void renderVisual() { + double doubleVal; + double doubleVal2; + label63: { + double doubleVal3; + TabGuiCategoryItem tabGuiCategoryItem; + + int height = this.tabGuiField.getRowHeight(); + List itemList5 = this.tabGuiField.getListI(); + doubleVal = height + itemList5.indexOf(this) * this.tabGuiField.getIntValue24(); + doubleVal2 = doubleVal + this.tabGuiField.getIntValue24(); + Minecraft mcClient = Minecraft.getMinecraft(); + doubleVal3 = mcClient.getDebugFPS() / 13; + if (this.isReadyState()) { + TabGuiCategoryItem tabGuiCategoryItem2 = this; + + if (!(this.cachedAngle < 3.0F)) { + break label63; + } + + tabGuiCategoryItem2 = this; + + + double doubleVal4 = this.cachedAngle + 3.0 / doubleVal3; + tabGuiCategoryItem2.cachedAngle = (float)MathHelper.clamp_double(doubleVal4, 0.0, 3.0); + break label63; + } + + tabGuiCategoryItem = this; + + if (this.cachedAngle <= 0.0F) { + break label63; + } + + tabGuiCategoryItem = this; + + double doubleVal5 = this.cachedAngle - 3.0 / doubleVal3; + tabGuiCategoryItem.cachedAngle = (float)MathHelper.clamp_double(doubleVal5, 0.0, 3.0); + } + + StringBuilder sb = new StringBuilder(); + String textStr = this.enumModuleTypeField.name(); + char ch = textStr.charAt(0); + sb = sb.append(ch); + textStr = this.enumModuleTypeField.name(); + textStr = textStr.substring(1); + textStr = textStr.toLowerCase(); + String textStr2 = sb.append(textStr).toString(); + int intVal = (this.isReadyState() ? 1 : 0); + + if (intVal != 0) { + long longVal = 0L; + int intVal2 = (int)doubleVal + 1; + + while (intVal2 < doubleVal2 - 1.0) { + double doubleVal6 = intVal2; + double doubleVal7 = intVal2 + 1; + int color = ColorTheme.getHudColor(longVal); + RenderUtils.drawRect(2.0, doubleVal6, 3.5, doubleVal7, color); + longVal -= 120L; + intVal2++; + + } + } + + this.tabGuiField.applyUpdate5(textStr2, 3.0F + this.cachedAngle, doubleVal + this.tabGuiField.computeIntInt(20) * 0.3 - (10 - this.tabGuiField.getIntValue23()) * 0.2, -1); + + intVal = (this.isStateFlag() ? 1 : 0); + + + if (intVal == 0) { + return; + } + + intVal = this.tabGuiField.getIntValue7() + 5; + + + float floatVal = intVal; + float floatVal2 = this.tabGuiField.getRowHeight(); + List itemList = this.tabGuiModuleItemList; + List itemList2 = this.tabGuiModuleItemList; + int size2 = itemList2.size() - 1; + float floatVal3 = ((TabGuiModuleItem)itemList.get(size2)).getIntValue() + 6; + List itemList3 = this.tabGuiModuleItemList; + float floatVal4 = itemList3.size() * this.tabGuiField.getIntValue24(); + this.tabGuiField.applyUpdate5(floatVal, floatVal2, floatVal3, floatVal4); + List itemList4 = this.tabGuiModuleItemList; + Consumer consumer = ((java.util.function.Consumer) TabGuiModuleItem::renderVisual); + itemList4.forEach(consumer); +} + + public TabGuiCategoryItem(TabGui tabGui, EnumModuleType enumModuleType) { + this.tabGuiModuleItemList = new ObjectArrayList<>(); + this.cachedAngle = 0.0F; + this.enumModuleTypeField = enumModuleType; + this.tabGuiField = tabGui; + this.setStateFlag(false); + Novoline novolineInst = tabGui.getNovoline(); + ModuleManager modManager = novolineInst.getModuleManager(); + List itemList = modManager.getByCategory(enumModuleType); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + AbstractModule mod = (AbstractModule)iter.next(); + List itemList2 = this.tabGuiModuleItemList; + itemList2.add(new TabGuiModuleItem(mod, this)); + } +} + + private double[] computeArray() { + boolean flag; + double doubleVal; + int intVal; + List itemList = this.tabGuiField.getListI(); + doubleVal = 15 + itemList.indexOf(this) * 12; + boolean flag2 = TabGuiSelectOption.a(); + String textStr = this.enumModuleTypeField.name(); + String textStr2 = textStr.toUpperCase(); + byte byteVal = -1; + flag = flag2; + intVal = textStr2.hashCode(); + + switch (intVal) { + case 1993470708: + intVal = (textStr2.equals("COMBAT") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 0; + if (flag) { + break; + } + case 678949039: + intVal = (textStr2.equals("MOVEMENT") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 1; + if (flag) { + break; + } + case -1932423455: + intVal = (textStr2.equals("PLAYER") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 2; + if (flag) { + break; + } + case -1146279864: + intVal = (textStr2.equals("EXPLOITS") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 3; + if (flag) { + break; + } + case 1185082643: + intVal = (textStr2.equals("VISUALS") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 4; + if (flag) { + break; + } + case 2366700: + intVal = (textStr2.equals("MISC") ? 1 : 0); + + if (intVal != 0) { + byteVal = 5; + } + } + + intVal = byteVal; + + + switch (intVal) { + case 0: + return new double[]{61.0, (float)(doubleVal + 5.0)}; + case 1: + case 2: + case 3: + return new double[]{60.5, (float)(doubleVal + 5.0)}; + case 4: + case 5: + default: + intVal = 2; + } + + + double[] doubleArr = new double[intVal]; + doubleArr[0] = 60.0; + doubleArr[1] = (float)(doubleVal + 5.0); + return doubleArr; +} + + public boolean isReadyState() { + List itemList = this.tabGuiField.getListI(); + int foundIdx = itemList.indexOf(this); + foundIdx = foundIdx == this.tabGuiField.getStateTicks5() ? 1 : 0; + + return ((((foundIdx & 1)) != 0)); +} + + public TabGui getTabGui() { return this.getTabGuiField(); } + public EnumModuleType getCategory() { return this.getEnumModuleTypeField(); } + public List getModuleItems() { return this.getTabGuiModuleItemList(); } + public TabGuiModuleItem getSelectedModuleItem() { return this.getTabGuiModuleItem(); } + public boolean isExpanded() { return this.isStateFlag(); } + public void setExpanded(boolean expanded) { this.setStateFlag(expanded); } + public boolean isSelected() { return this.isReadyState(); } + public void render() { this.renderVisual(); } +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/TabGuiSelectOption.java b/src/main/java/cc/novoline/modules/configurations/util/TabGuiSelectOption.java new file mode 100644 index 0000000..b291372 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/TabGuiSelectOption.java @@ -0,0 +1,303 @@ +package cc.novoline.modules.configurations.util; + +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.visual.TabGui; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.RenderUtils; +import java.awt.Color; +import java.text.DecimalFormat; +import java.util.Iterator; +import java.util.List; +import net.minecraft.util.MathHelper; +import net.minecraft.client.Minecraft; + +public final class TabGuiSelectOption { + private static boolean d; + private final TabGuiSettingItem tabGuiSettingItemField; + private String textValue; + private float cachedAngle = 0.0F; + + public TabGuiSelectOption(TabGuiSettingItem tabGuiSettingItem, String text) { + this.textValue = text; + this.tabGuiSettingItemField = tabGuiSettingItem; +} + + public TabGuiSelectOption(TabGuiSettingItem tabGuiSettingItem) { + this.tabGuiSettingItemField = tabGuiSettingItem; +} + + public String getTextValue() { + return this.textValue; +} + + public static void b(boolean flag) { + d = flag; +} + + public void renderVisual() { + boolean flag; + float floatVal; + float floatVal2; + int intVal; + int intVal2; + label111: { + boolean flag2 = g(); + TabGuiCategoryItem tabGuiCategoryItem = this.tabGuiSettingItemField.getModuleItem().getCategoryItem(); + int height = tabGuiCategoryItem.getTabGui().getRowHeight(); + List itemList = this.tabGuiSettingItemField.getTabGuiSelectOptionList(); + int foundIdx = itemList.indexOf(this); + TabGuiCategoryItem tabGuiCategoryItem2 = this.tabGuiSettingItemField.getModuleItem().getCategoryItem(); + floatVal = height + foundIdx * tabGuiCategoryItem2.getTabGui().getIntValue24(); + TabGuiCategoryItem tabGuiCategoryItem3 = this.tabGuiSettingItemField.getModuleItem().getCategoryItem(); + floatVal2 = floatVal + tabGuiCategoryItem3.getTabGui().getIntValue24(); + Minecraft mcClient = Minecraft.getMinecraft(); + double doubleVal = mcClient.getDebugFPS() / 13; + tabGuiCategoryItem = this.obtainTabGuiSettingItem().obtainTabGuiSettingItem().getCategoryItem(); + intVal = tabGuiCategoryItem.getTabGui().getIntValue7() + this.obtainTabGuiSettingItem().obtainTabGuiSettingItem().getIntValue(); + flag = flag2; + intVal2 = (this.isReadyState() ? 1 : 0); + if (intVal2 != 0) { + if (this.cachedAngle >= 3.0F) { + break label111; + } + + double doubleVal2 = this.cachedAngle + 3.0 / doubleVal; + this.cachedAngle = (float)MathHelper.clamp_double(doubleVal2, 0.0, 3.0); + break label111; + } + + if (this.cachedAngle > 0.0F) { + double doubleVal3 = this.cachedAngle - 3.0 / doubleVal; + this.cachedAngle = (float)MathHelper.clamp_double(doubleVal3, 0.0, 3.0); + } + } + + intVal2 = TabGuiSettingSwitchMap.SWITCH_MAP[this.tabGuiSettingItemField.getSetting().getSettingType().ordinal()]; + + switch (intVal2) { + case 1: + String textStr; + label88: { + double doubleVal4 = this.tabGuiSettingItemField.getSetting().getDoubleValue(); + double doubleVal5 = (int)(doubleVal4 * 100.0) / 100.0; + if (doubleVal5 % 1.0 == 0.0) { + textStr = new DecimalFormat("0.##").format(doubleVal5); + break label88; + } + + StringBuilder sb2 = new StringBuilder().append(doubleVal5); + textStr = sb2.append("").toString(); + } + + TabGuiCategoryItem tabGuiCategoryItem4 = this.obtainTabGuiSettingItem().obtainTabGuiSettingItem().getCategoryItem(); + TabGui tabGui = tabGuiCategoryItem4.getTabGui(); + double doubleVal11 = intVal + this.tabGuiSettingItemField.getIntValue() + 29.5; + double doubleVal6 = floatVal; + TabGuiCategoryItem tabGuiCategoryItem5 = this.tabGuiSettingItemField.getModuleItem().getCategoryItem(); + tabGui.applyUpdate5(textStr, doubleVal11, doubleVal6 + tabGuiCategoryItem5.getTabGui().computeIntInt(20) * 0.3, -1); + if (!flag) { + return; + } + case 2: + label114: { + TabGuiSelectOption tabGuiSelectOption = this; + + if (this.isReadyState()) { + long longVal = 0L; + int intVal3 = (int)floatVal + 1; + + while (intVal3 < floatVal2 - 2.0F) { + double doubleVal7 = intVal + this.tabGuiSettingItemField.getIntValue() + 28; + double doubleVal12 = intVal3; + double doubleVal13 = intVal + this.tabGuiSettingItemField.getIntValue() + 29.5; + double doubleVal14 = intVal3 + 1; + int color = ColorTheme.getHudColor(longVal); + RenderUtils.drawRect(doubleVal7, doubleVal12, doubleVal13, doubleVal14, color); + longVal -= 120L; + intVal3++; + + } + } + + tabGuiSelectOption = this; + + + TabGuiCategoryItem tabGuiCategoryItem6 = tabGuiSelectOption.obtainTabGuiSettingItem().obtainTabGuiSettingItem().getCategoryItem(); + TabGui tabGui2 = tabGuiCategoryItem6.getTabGui(); + String textStr2 = this.textValue; + double doubleVal15 = intVal + this.tabGuiSettingItemField.getIntValue() + 31; + double doubleVal8 = floatVal; + TabGuiCategoryItem tabGuiCategoryItem7 = this.tabGuiSettingItemField.getModuleItem().getCategoryItem(); + double doubleVal16 = doubleVal8 + tabGuiCategoryItem7.getTabGui().computeIntInt(20) * 0.3; + String textStr3 = this.tabGuiSettingItemField.getSetting().getTextValue(); + String textStr6 = this.textValue; + int intVal5 = (textStr3.equalsIgnoreCase(textStr6) ? 1 : 0); + if (intVal5 != 0) { + intVal5 = -1; + } else { + Color awtColor = new Color(163, 163, 163, 255); + intVal5 = awtColor.getRGB(); + } + + tabGui2.applyUpdate5(textStr2, doubleVal15, doubleVal16, intVal5); + } + + if (!flag) { + return; + } + case 3: + break; + default: + return; + } + + TabGuiSelectOption tabGuiSelectOption2 = this; + + if (this.isReadyState()) { + long longVal2 = 0L; + int intVal4 = (int)floatVal + 1; + + while (intVal4 < floatVal2 - 2.0F) { + double doubleVal9 = intVal + this.tabGuiSettingItemField.getIntValue() + 28; + double doubleVal17 = intVal4; + double doubleVal18 = intVal + this.tabGuiSettingItemField.getIntValue() + 29.5; + double doubleVal19 = intVal4 + 1; + int color2 = ColorTheme.getHudColor(longVal2); + RenderUtils.drawRect(doubleVal9, doubleVal17, doubleVal18, doubleVal19, color2); + longVal2 -= 120L; + intVal4++; + + } + } + + tabGuiSelectOption2 = this; + + + TabGuiCategoryItem tabGuiCategoryItem8 = tabGuiSelectOption2.obtainTabGuiSettingItem().obtainTabGuiSettingItem().getCategoryItem(); + TabGui tabGui3 = tabGuiCategoryItem8.getTabGui(); + String textStr4 = this.textValue; + double doubleVal20 = intVal + this.tabGuiSettingItemField.getIntValue() + 31; + double doubleVal10 = floatVal; + TabGuiCategoryItem tabGuiCategoryItem9 = this.tabGuiSettingItemField.getModuleItem().getCategoryItem(); + double doubleVal21 = doubleVal10 + tabGuiCategoryItem9.getTabGui().computeIntInt(20) * 0.3; + ListProperty listProp = this.tabGuiSettingItemField.getSetting().getListProperty(); + String textStr5 = this.textValue; + int intVal6 = (listProp.contains(textStr5) ? 1 : 0); + if (intVal6 != 0) { + intVal6 = -1; + } else { + Color awtColor2 = new Color(163, 163, 163, 255); + intVal6 = awtColor2.getRGB(); + } + + tabGui3.applyUpdate5(textStr4, doubleVal20, doubleVal21, intVal6); +} + + public int getIntValue() { + boolean flag2 = g(); + int intVal = 0; + boolean flag = flag2; + int intVal2 = TabGuiSettingSwitchMap.SWITCH_MAP[this.tabGuiSettingItemField.getSetting().getSettingType().ordinal()]; + switch (intVal2) { + case 1: + String textStr; + label32: { + double doubleVal = this.tabGuiSettingItemField.getSetting().getDoubleValue(); + double doubleVal2 = (int)(doubleVal * 100.0) / 100.0; + if (doubleVal2 % 1.0 == 0.0) { + textStr = new DecimalFormat("0.##").format(doubleVal2); + break label32; + } + + StringBuilder sb2 = new StringBuilder().append(doubleVal2); + textStr = sb2.append("").toString(); + } + + TabGuiCategoryItem tabGuiCategoryItem = this.tabGuiSettingItemField.getModuleItem().getCategoryItem(); + return tabGuiCategoryItem.getTabGui().computeIntValue3(textStr); + case 2: + StringProperty strProp = this.tabGuiSettingItemField.getSetting().getStringProperty3(); + List itemList = strProp.getAcceptableValues(); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + String textStr2 = (String)iter.next(); + TabGuiCategoryItem tabGuiCategoryItem2 = this.tabGuiSettingItemField.getModuleItem().getCategoryItem(); + int intVal3 = tabGuiCategoryItem2.getTabGui().computeIntValue3(textStr2); + + if (intVal3 <= intVal) { + continue; + } + + TabGuiCategoryItem tabGuiCategoryItem3 = this.tabGuiSettingItemField.getModuleItem().getCategoryItem(); + intVal3 = tabGuiCategoryItem3.getTabGui().computeIntValue3(textStr2); + + intVal = intVal3; + } + + if (!flag) { + break; + } + case 3: + ListProperty listProp = this.tabGuiSettingItemField.getSetting().getListProperty(); + List itemList2 = listProp.getAcceptableValues(); + Iterator iter2 = itemList2.iterator(); + + while (true) { + if (!iter2.hasNext()) { + break; + } + + String textStr3 = (String)iter2.next(); + TabGuiCategoryItem tabGuiCategoryItem4 = this.tabGuiSettingItemField.getModuleItem().getCategoryItem(); + int intVal4 = tabGuiCategoryItem4.getTabGui().computeIntValue3(textStr3); + + if (intVal4 <= intVal) { + continue; + } + + TabGuiCategoryItem tabGuiCategoryItem5 = this.tabGuiSettingItemField.getModuleItem().getCategoryItem(); + intVal4 = tabGuiCategoryItem5.getTabGui().computeIntValue3(textStr3); + + intVal = intVal4; + } + } + + intVal2 = intVal; + + return intVal2; +} + + public static boolean g() { + return d; +} + + public static boolean a() { + boolean flag = g(); + return !flag; +} + + static { + if (g()) { + b(true); + } + } + + public TabGuiSettingItem obtainTabGuiSettingItem() { + return this.tabGuiSettingItemField; +} + + public boolean isReadyState() { + List itemList = this.tabGuiSettingItemField.getTabGuiSelectOptionList(); + int foundIdx = itemList.indexOf(this); + TabGuiCategoryItem tabGuiCategoryItem = this.tabGuiSettingItemField.getModuleItem().getCategoryItem(); + foundIdx = foundIdx == tabGuiCategoryItem.getTabGui().getIntValue22() ? 1 : 0; + + return ((((foundIdx & 1)) != 0)); +} +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/TabGuiSettingItem.java b/src/main/java/cc/novoline/modules/configurations/util/TabGuiSettingItem.java new file mode 100644 index 0000000..a512eca --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/TabGuiSettingItem.java @@ -0,0 +1,306 @@ +package cc.novoline.modules.configurations.util; +import cc.novoline.gui.click.SettingTypeSwitchMap; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.RenderUtils; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.utils.render.TabGuiModuleItem; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import java.awt.Color; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.function.Consumer; +import java.util.function.Predicate; +import java.util.function.ToIntFunction; +import java.util.stream.Stream; + +import net.minecraft.util.MathHelper; +import net.minecraft.client.Minecraft; +import org.checkerframework.checker.nullness.qual.Nullable; + +public final class TabGuiSettingItem { + private final TabGuiModuleItem moduleItem; + private boolean stateFlag; + private float cachedAngle; + private final Setting settingField; + private final List tabGuiSelectOptionList; + + public void renderVisual() { + cc.novoline.modules.visual.TabGui tabGui; + float floatVal; + float floatVal2; + int intVal; + label106: { + TabGuiCategoryItem tabGuiCategoryItem = this.moduleItem.getCategoryItem(); + int intVal2 = tabGuiCategoryItem.getTabGui().getIntValue6(); + List itemList4 = this.moduleItem.getSettingItems(); + int foundIdx = itemList4.indexOf(this); + TabGuiCategoryItem tabGuiCategoryItem2 = this.moduleItem.getCategoryItem(); + floatVal = intVal2 + foundIdx * tabGuiCategoryItem2.getTabGui().getIntValue24(); + tabGuiCategoryItem = this.moduleItem.getCategoryItem(); + floatVal2 = floatVal + tabGuiCategoryItem.getTabGui().getIntValue24(); + Minecraft mcClient = Minecraft.getMinecraft(); + double doubleVal = mcClient.getDebugFPS() / 13; + intVal = (this.isReadyState() ? 1 : 0); + if (intVal != 0) { + if (this.cachedAngle >= 3.0F) { + break label106; + } + + double doubleVal2 = this.cachedAngle + 3.0 / doubleVal; + this.cachedAngle = (float)MathHelper.clamp_double(doubleVal2, 0.0, 3.0); + break label106; + + } + + if (this.cachedAngle > 0.0F) { + double doubleVal3 = this.cachedAngle - 3.0 / doubleVal; + this.cachedAngle = (float)MathHelper.clamp_double(doubleVal3, 0.0, 3.0); + } + } + + TabGuiCategoryItem tabGuiCategoryItem3 = this.moduleItem.getCategoryItem(); + intVal = tabGuiCategoryItem3.getTabGui().getIntValue7() + this.moduleItem.getMaxModuleWidth(); + + int intVal3; + intVal3 = intVal; + TabGuiSettingItem tabGuiSettingItem = this; + + if (this.isReadyState()) { + long longVal = 0L; + int intVal4 = (int)floatVal + 1; + + while (intVal4 < floatVal2 - 2.0F) { + double doubleVal4 = intVal3 + 17.5; + double doubleVal5 = intVal4; + double doubleVal6 = intVal3 + 19; + double doubleVal7 = intVal4 + 1; + int color = ColorTheme.getHudColor(longVal); + RenderUtils.drawRect(doubleVal4, doubleVal5, doubleVal6, doubleVal7, color); + longVal -= 120L; + intVal4++; + + } + } + + tabGuiSettingItem = this; + + + String displayName; + double doubleVal8; + double doubleVal9; + int intVal5; + label72: { + TabGuiCategoryItem tabGuiCategoryItem4 = tabGuiSettingItem.moduleItem.getTabGuiCategoryItem(); + tabGui = tabGuiCategoryItem4.getTabGui(); + displayName = this.settingField.getDisplayName(); + doubleVal8 = intVal3 + this.cachedAngle + 18.0F; + doubleVal9 = floatVal; + TabGuiCategoryItem tabGuiCategoryItem5 = this.moduleItem.getCategoryItem(); + doubleVal9 += tabGuiCategoryItem5.getTabGui().computeIntInt(20) * 0.3; + TabGuiCategoryItem tabGuiCategoryItem6 = this.moduleItem.getCategoryItem(); + doubleVal9 -= (10 - tabGuiCategoryItem6.getTabGui().getIntValue23()) * 0.2; + Object obj = this.settingField.getSettingType(); + if (obj != SettingType.CHECKBOX) { + intVal5 = -1; + break label72; + } + + BooleanProperty boolProp = this.getSetting().getBooleanProperty(); + obj = boolProp.get(); + + Boolean flag2 = (Boolean)obj; + intVal5 = (flag2 ? 1 : 0); + if (intVal5 != 0) { + intVal5 = -1; + } else { + Color awtColor = new Color(163, 163, 163, 255); + intVal5 = awtColor.getRGB(); + } + } + + tabGui.applyUpdate5(displayName, doubleVal8, doubleVal9, intVal5); + + Object obj2 = this; + if (!this.isStateFlag()) { + return; + } + + List itemList = this.tabGuiSelectOptionList; + obj2 = itemList.get(0); + + label112: { + TabGuiSelectOption tabGuiSelectOption = (TabGuiSelectOption)obj2; + SettingType settingType = tabGuiSelectOption.obtainTabGuiSettingItem().getSetting().getSettingType(); + TabGuiCategoryItem tabGuiCategoryItem7 = this.moduleItem.getCategoryItem(); + float floatVal6 = tabGuiCategoryItem7.getTabGui().getIntValue6(); + List itemList2 = this.tabGuiSelectOptionList; + intVal = itemList2.size(); + TabGuiCategoryItem tabGuiCategoryItem8 = this.moduleItem.getCategoryItem(); + float floatVal7 = intVal * tabGuiCategoryItem8.getTabGui().getIntValue24(); + SettingType settingType2 = settingType; + SettingType settingType3 = SettingType.COMBOBOX; + if (settingType == SettingType.COMBOBOX) { + float floatVal3 = intVal3 + tabGuiSelectOption.obtainTabGuiSettingItem().getIntValue() + 27; + float floatVal8 = tabGuiSelectOption.getIntValue() + 10; + TabGuiCategoryItem tabGuiCategoryItem9 = this.moduleItem.getCategoryItem(); + tabGuiCategoryItem9.getTabGui().applyUpdate5(floatVal3, floatVal6, floatVal8, floatVal7); + break label112; + } + + settingType2 = settingType; + settingType3 = SettingType.SELECTBOX; + + if (settingType2 == settingType3) { + float floatVal4 = intVal3 + tabGuiSelectOption.obtainTabGuiSettingItem().getIntValue() + 27; + float floatVal9 = tabGuiSelectOption.getIntValue() + 10; + TabGuiCategoryItem tabGuiCategoryItem10 = this.moduleItem.getCategoryItem(); + tabGuiCategoryItem10.getTabGui().applyUpdate5(floatVal4, floatVal6, floatVal9, floatVal7); + break label112; + } + + settingType2 = settingType; + settingType3 = SettingType.SLIDER; + + if (settingType2 == settingType3) { + float floatVal5 = intVal3 + tabGuiSelectOption.obtainTabGuiSettingItem().getIntValue() + 27; + float floatVal10 = tabGuiSelectOption.getIntValue() + 5.0F; + TabGuiCategoryItem tabGuiCategoryItem11 = this.moduleItem.getCategoryItem(); + tabGuiCategoryItem11.getTabGui().applyUpdate5(floatVal5, floatVal6, floatVal10, floatVal7); + } + } + + List itemList3 = this.tabGuiSelectOptionList; + Consumer consumer = ((java.util.function.Consumer) TabGuiSelectOption::renderVisual); + itemList3.forEach(consumer); +} + + public Setting getSetting() { + return this.settingField; +} + + private int mapSetting(Setting setting) { + TabGuiCategoryItem tabGuiCategoryItem = this.moduleItem.getCategoryItem(); + return tabGuiCategoryItem.getTabGui().computeIntValue3(setting.getDisplayName()); +} + + public void setStateFlag(boolean flag) { + this.stateFlag = flag; +} + + public TabGuiModuleItem obtainTabGuiSettingItem() { + return this.moduleItem; +} + + public boolean isReadyState() { + List itemList = this.moduleItem.getSettingItems(); + int foundIdx = itemList.indexOf(this); + TabGuiCategoryItem tabGuiCategoryItem = this.moduleItem.getCategoryItem(); + foundIdx = foundIdx == tabGuiCategoryItem.getTabGui().getIntValue21() ? 1 : 0; + + return ((((foundIdx & 1)) != 0)); +} + + public List getTabGuiSelectOptionList() { + return this.tabGuiSelectOptionList; +} + + public boolean isStateFlag() { + return this.stateFlag; +} + + public int getIntValue() { + AbstractModule mod = this.moduleItem.getModule(); + List itemList = SettingManager.getSettingsByMod(mod); + Stream stream2 = itemList.stream(); + ToIntFunction toIntFunction = ((java.util.function.ToIntFunction) this::mapSetting); + return stream2.mapToInt(toIntFunction).filter((int intVal) -> intVal >= 0).max().orElse(0); +} + + public TabGuiSettingItem(Setting setting, TabGuiModuleItem tabGuiModuleItem) { + boolean flag; + label47: { + label42: { + int intVal = (TabGuiSelectOption.a() ? 1 : 0); + this.tabGuiSelectOptionList = new ObjectArrayList<>(); + this.cachedAngle = 0.0F; + this.settingField = setting; + this.moduleItem = tabGuiModuleItem; + flag = (boolean)((intVal) != 0); + this.setStateFlag(false); + intVal = SettingTypeSwitchMap.SWITCH_MAP[setting.getSettingType().ordinal()]; + if (flag) { + switch (intVal) { + case 1: + List itemList = this.tabGuiSelectOptionList; + itemList.add(new TabGuiSelectOption(this)); + break; + case 2: + break label42; + case 3: + break label47; + default: + return; + } + } + + if (flag) { + return; + } + } + + ListProperty listProp = setting.getListProperty(); + List itemList2 = listProp.getAcceptableValues(); + Iterator iter = itemList2.iterator(); + + do { + if (!iter.hasNext()) { + break; + } + + String textStr = (String)iter.next(); + List itemList3 = this.tabGuiSelectOptionList; + TabGuiSelectOption tabGuiSelectOption = new TabGuiSelectOption(this, textStr); + itemList3.add(tabGuiSelectOption); + if (!flag) { + return; + } + } while (flag); + + if (flag) { + return; + } + } + + StringProperty strProp = setting.getStringProperty3(); + List itemList4 = strProp.getAcceptableValues(); + Iterator iter2 = itemList4.iterator(); + + do { + if (!iter2.hasNext()) { + break; + } + + String textStr2 = (String)iter2.next(); + List itemList5 = this.tabGuiSelectOptionList; + TabGuiSelectOption tabGuiSelectOption2 = new TabGuiSelectOption(this, textStr2); + itemList5.add(tabGuiSelectOption2); + } while (flag); +} + + public @Nullable TabGuiSelectOption getTabGuiSelectOption() { + Stream stream2 = this.tabGuiSelectOptionList.stream(); + Predicate predicate = ((java.util.function.Predicate) TabGuiSelectOption::isReadyState); + Stream stream3 = stream2.filter(predicate); + Optional optional = stream3.findFirst(); + return (TabGuiSelectOption)optional.orElse(null); +} + + public cc.novoline.utils.render.TabGuiModuleItem getModuleItem() { return this.obtainTabGuiSettingItem(); } +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/TabGuiSettingSwitchMap.java b/src/main/java/cc/novoline/modules/configurations/util/TabGuiSettingSwitchMap.java new file mode 100644 index 0000000..f7e735c --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/TabGuiSettingSwitchMap.java @@ -0,0 +1,24 @@ +package cc.novoline.modules.configurations.util; + +import cc.novoline.gui.screen.setting.SettingType; + +public class TabGuiSettingSwitchMap { + static final int[] SWITCH_MAP = new int[SettingType.values().length]; + + static { + try { + SWITCH_MAP[SettingType.SLIDER.ordinal()] = 1; + } catch (NoSuchFieldError noSuchFieldError) { + } + + try { + SWITCH_MAP[SettingType.COMBOBOX.ordinal()] = 2; + } catch (NoSuchFieldError noSuchFieldError2) { + } + + try { + SWITCH_MAP[SettingType.SELECTBOX.ordinal()] = 3; + } catch (NoSuchFieldError noSuchFieldError3) { + } + } +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/TargetHudCard.java b/src/main/java/cc/novoline/modules/configurations/util/TargetHudCard.java new file mode 100644 index 0000000..f5fb572 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/TargetHudCard.java @@ -0,0 +1,421 @@ +package cc.novoline.modules.configurations.util; + + +import net.minecraft.client.gui.Gui; +import cc.novoline.events.EventManager; +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.events.events.RenderGuiEvent; +import cc.novoline.events.type.GuiState; +import cc.novoline.modules.combat.TargetHUD; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.visual.HUD; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.MovementUtils; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.Timer; +import cc.novoline.utils.anim.SmoothAnimation; +import cc.novoline.utils.shader.HudNotificationBox; +import cc.novoline.modules.ModuleRegistry; +import java.awt.Color; +import java.util.UUID; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.MathHelper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.DefaultPlayerSkin; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class TargetHudCard { + private HudNotificationBox hudNotificationBoxField; + private EntityPlayer targetPlayer; + private double cachedValue; + private boolean stateFlag; + private double cachedValue2; + private double cachedValue3; + private SmoothAnimation smoothAnim; + private double cachedValue4; + private double cachedValue5; + private double cachedValue6; + private int stateTicks; + private Timer msTimer; + final TargetHUD targetHUD; + private float floatValue; + + private void renderElement(EntityPlayer player, double value, double amount, double offset, double dist) { + UUID uUID = player.getUUID2(); + NetworkPlayerInfo networkPlayerInfo = NetHandlerPlayClient.applyS3BPacketScoreboardObjective(uUID); + ResourceLocation resLoc; + if (networkPlayerInfo == null) { + resLoc = DefaultPlayerSkin.getDefaultSkin(player.getUUID2()); + } else { + resLoc = networkPlayerInfo.getLocationSkin(); + } + + value -= offset * 0.5; + amount -= offset * 0.5; + Minecraft mcClient = TargetHUD.resolveMinecraft10(this.targetHUD); + TextureManager texManager = mcClient.getTextureManager(); + texManager.bindTexture(resLoc); + GlStateManager.enableBlend(); + GlStateManager.alphaFunc(516, 0.0F); + GL11.glColor4d(1.0, 1.0, 1.0, dist); + Gui.renderStep(value, amount, 8.0F, 8.0F, 8, 8, offset, offset, 64.0F, 64.0F); + double doubleVal = value + offset; + double doubleVal2 = amount + offset; + int hurtTime2 = 10 * player.hurtTime; + int color = ColorTheme.getColor(255, 0, 0, hurtTime2); + RenderUtils.drawRect(value, amount, doubleVal, doubleVal2, color); +} + + private double evaluateDouble(double value) { + boolean flag = this.smoothAnim.isStateFlag(); + double doubleVal = this.msTimer.getScaledElapsed(800L, 1.0); + double doubleVal2 = value * (flag ? 1.0 - doubleVal : doubleVal); + return MathHelper.clamp_double(doubleVal2, 0.05, 1.0); +} + + public static SmoothAnimation evaluateDouble(TargetHudCard targetHudCard) { + return targetHudCard.smoothAnim; +} + + private float evaluateDouble(float value) { + boolean flag = this.smoothAnim.isStateFlag(); + double doubleVal = this.msTimer.getScaledElapsed(800L, 1.0); + float floatVal = (float)(value * (flag ? 1.0 - doubleVal : doubleVal)); + return MathHelper.clamp(floatVal, 0.05F, 1.0F); +} + + public void performAction() { + StringProperty strProp = this.targetHUD.getColorType(); + if (strProp.equals("Breath")) { + HudNotificationBox hudNotificationBox = this.hudNotificationBoxField; + ColorProperty colorProp = this.targetHUD.getColor(); + Integer color = colorProp.getColorInt(); + hudNotificationBox.applyUpdate(false, color, true); + } else { + this.hudNotificationBoxField.applyUpdate3(false, true); + } +} + + public void evaluateDouble(Runnable runnable) { + this.smoothAnim.renderVisual2(this.cachedValue3, this.cachedValue5, 0.1, runnable, 200L, 300L); +} + + public void performAction2() { + if (this.targetPlayer != null) { + double doubleVal = MovementUtils.evaluateDouble(true); + this.renderElement3(this.targetPlayer); + MovementUtils.unscale(doubleVal); + } +} + + public void performAction3() { + this.smoothAnim.applyDouble(0.2); + this.msTimer.reset(); + this.stateTicks = -1; + EventManager.unregister(this); +} + + private void invokeCallback(double value, double amount) { + double doubleVal = value + this.cachedValue4; + double doubleVal2 = amount + this.cachedValue; + int intVal = this.evaluateDouble(255); + int color = ColorTheme.getColor(50, 50, 50, intVal); + RenderUtils.drawRect(value, amount, doubleVal, doubleVal2, color); + double doubleVal3 = value + 1.0; + double doubleVal4 = amount + 1.0; + doubleVal = value + this.cachedValue4 - 1.0; + doubleVal2 = amount + this.cachedValue - 1.0; + intVal = this.evaluateDouble(255); + color = ColorTheme.getColor(60, 60, 60, intVal); + RenderUtils.drawRect(doubleVal3, doubleVal4, doubleVal, doubleVal2, color); +} + + private void renderElement2(EntityPlayer player, HUD hUD, double value, double amount, double offset, double dist, int index, int count, int num, boolean flag) { + float health = player.getHealth(); + float floatVal = player.computeFloat(); + Minecraft mcClient = TargetHUD.resolveMinecraft13(this.targetHUD); + float floatVal2 = 2000 / mcClient.getDebugFPS(); + if (this.stateTicks != player.getEntityId()) { + this.floatValue = health; + this.stateTicks = player.getEntityId(); + } else if (this.floatValue > health) { + float floatVal3 = this.floatValue - 0.00625F * floatVal2; + this.floatValue = MathHelper.clamp(floatVal3, health, 999.0F); + } else if (this.floatValue < health) { + float floatVal4 = this.floatValue + 0.00625F * floatVal2; + this.floatValue = MathHelper.clamp(floatVal4, 0.0F, health); + } + + double doubleVal = value - 1.0; + double doubleVal4 = amount - 1.0; + double doubleVal5 = value + offset + 1.0; + double doubleVal6 = amount + dist + 1.0; + int intVal = this.evaluateDouble(255); + int color = ColorTheme.getColor(50, 50, 50, intVal); + RenderUtils.drawRect(doubleVal, doubleVal4, doubleVal5, doubleVal6, color); + double doubleVal7 = offset / floatVal * this.floatValue; + Color awtColor = new Color(index); + Color awtColor2 = new Color(count); + Color awtColor3 = new Color(num); + if (this.msTimer.getLongValue() > 800L) { + StringProperty strProp = this.targetHUD.getColorType(); + if (strProp.equals("Fade")) { + Color awtColor4 = awtColor2.darker(); + color = awtColor4.getRGB(); + Color awtColor5 = awtColor3.darker(); + int color2 = awtColor5.getRGB(); + RenderUtils.drawElement4(value, amount, doubleVal7, dist, color, color2); + } else { + StringProperty strProp2 = this.targetHUD.getColorType(); + if (strProp2.equals("Static")) { + doubleVal5 = value + doubleVal7; + doubleVal6 = amount + dist; + Color awtColor6 = awtColor.darker(); + color = awtColor6.getRGB(); + RenderUtils.drawRect(value, amount, doubleVal5, doubleVal6, color); + } else { + doubleVal5 = value + doubleVal7; + doubleVal6 = amount + dist; + Color awtColor7 = new Color(ColorTheme.evaluateInt4(index)); + Color awtColor8 = awtColor7.darker(); + color = awtColor8.getRGB(); + RenderUtils.drawRect(value, amount, doubleVal5, doubleVal6, color); + } + } + } + + doubleVal7 = offset / floatVal * health; + StringProperty strProp3 = this.targetHUD.getColorType(); + if (strProp3.equals("Fade")) { + RenderUtils.drawElement4(value, amount, doubleVal7, dist, count, num); + } else { + StringProperty strProp4 = this.targetHUD.getColorType(); + if (strProp4.equals("Static")) { + doubleVal5 = value + doubleVal7; + doubleVal6 = amount + dist; + RenderUtils.drawRect(value, amount, doubleVal5, doubleVal6, index); + } else { + doubleVal5 = value + doubleVal7; + doubleVal6 = amount + dist; + color = ColorTheme.evaluateInt4(index); + RenderUtils.drawRect(value, amount, doubleVal5, doubleVal6, color); + } + } + + StringBuilder sb = new StringBuilder(); + double doubleVal2 = 100.0 / floatVal * this.floatValue; + double doubleVal3 = MathHelper.roundToDecimal(doubleVal2, 1); + StringBuilder sb2 = sb.append(doubleVal3); + String textStr = sb2.append("%").toString(); + FontRenderer font = TargetHUD.resolveMinecraft7(this.targetHUD).crackFontRenderer; + doubleVal5 = value + offset * 0.5; + FontRenderer font2 = TargetHUD.resolveMinecraft9(this.targetHUD).crackFontRenderer; + doubleVal5 -= font2.getStringWidth(textStr) / 2; + doubleVal6 = amount + 1.0; + int intVal2 = this.evaluateDouble(255); + color = ColorTheme.reAlpha(16777215, intVal2); + font.renderStep2(textStr, doubleVal5, doubleVal6, color, true); +} + + public void applyEntityPlayer(EntityPlayer player) { + this.targetPlayer = player; + BooleanProperty boolProp = this.targetHUD.getDrawDropEffect(); + Boolean propFlag = boolProp.get(); + if (propFlag && this.targetPlayer != null && this.targetPlayer.hurtTime == 9) { + StringProperty strProp = this.targetHUD.getColorType(); + if (strProp.equals("Fade")) { + HudNotificationBox hudNotificationBox = this.hudNotificationBoxField; + ColorProperty colorProp = this.targetHUD.getColorBegin(); + Integer color = colorProp.getColorInt(); + int intVal = color; + ColorProperty colorProp2 = this.targetHUD.getColorEnd(); + Integer color2 = colorProp2.getColorInt(); + int intVal3 = color2; + IntProperty intProp = this.targetHUD.getDropEffectQuantity(); + Integer intVal4 = intProp.get(); + hudNotificationBox.applyUpdate2(intVal, intVal3, 20.0, intVal4); + } else { + StringProperty strProp2 = this.targetHUD.getColorType(); + if (strProp2.equals("Static")) { + HudNotificationBox hudNotificationBox2 = this.hudNotificationBoxField; + ColorProperty colorProp3 = this.targetHUD.getColor(); + Integer color3 = colorProp3.getColorInt(); + int intVal2 = color3; + IntProperty intProp2 = this.targetHUD.getDropEffectQuantity(); + Integer intVal5 = intProp2.get(); + hudNotificationBox2.applyUpdate(intVal2, 20.0, intVal5); + } else { + HudNotificationBox hudNotificationBox3 = this.hudNotificationBoxField; + IntProperty intProp3 = this.targetHUD.getDropEffectQuantity(); + Integer intVal6 = intProp3.get(); + hudNotificationBox3.applyUpdate3(20.0, intVal6); + } + } + } +} + + private void renderElement3(EntityPlayer player) { + HUD hUD = ModuleRegistry.HUD.getModule(); + FontRenderer font = TargetHUD.resolveMinecraft3(this.targetHUD).crackFontRenderer; + double doubleVal = this.targetHUD.getCachedValue(); + double doubleVal2 = this.targetHUD.getCachedValue3(); + String nameStr = player.getName(); + int width = 44 + font.getStringWidth(nameStr); + this.cachedValue4 = Math.max(92, width); + this.cachedValue = 42.0; + this.cachedValue3 = doubleVal + this.cachedValue4 * 0.5; + this.cachedValue5 = doubleVal2 + this.cachedValue * 0.5; + ColorProperty colorProp = this.targetHUD.getColor(); + Integer color = colorProp.getColorInt(); + int intVal = color; + int intVal4 = this.evaluateDouble(255); + int color4 = ColorTheme.reAlpha(intVal, intVal4); + ColorProperty colorProp2 = this.targetHUD.getColorBegin(); + Integer color2 = colorProp2.getColorInt(); + int intVal2 = color2; + intVal4 = this.evaluateDouble(255); + int color5 = ColorTheme.reAlpha(intVal2, intVal4); + ColorProperty colorProp3 = this.targetHUD.getColorEnd(); + Integer color3 = colorProp3.getColorInt(); + int intVal3 = color3; + intVal4 = this.evaluateDouble(255); + int color6 = ColorTheme.reAlpha(intVal3, intVal4); + this.evaluateDouble(((Runnable) (() -> this.invokeCallback(doubleVal, doubleVal2)))); + this.hudNotificationBoxField.doubleField2 = doubleVal + 21.0; + this.hudNotificationBoxField.doubleField = doubleVal2 + 21.0; + this.performAction(); + this.evaluateDouble(((Runnable) (() -> this.invokeCallback2(player, doubleVal, doubleVal2, font, hUD, color4, color5, color6)))); +} + + public void evaluateDouble(EntityPlayer player) { + double doubleVal = MovementUtils.evaluateDouble(true); + this.renderElement3(player); + MovementUtils.unscale(doubleVal); +} + + public void evaluateDouble(RenderGuiEvent event) { + if (event.getGuiScreen() instanceof GuiChat) { + int intVal = event.getMouseX(); + double doubleVal = MovementUtils.evaluateDouble(intVal); + intVal = event.getMouseY(); + double doubleVal2 = MovementUtils.scaleYInt(intVal); + DoubleProperty doubleProp = this.targetHUD.getPosX(); + Double propDouble = doubleProp.get(); + double doubleVal3 = propDouble; + DoubleProperty doubleProp2 = this.targetHUD.getPosY(); + Double propDouble2 = doubleProp2.get(); + double doubleVal12 = propDouble2; + boolean flag = doubleVal > doubleVal3 && doubleVal <= doubleVal3 + this.cachedValue4 && doubleVal2 > doubleVal12 && doubleVal2 <= doubleVal12 + this.cachedValue; + if (event.getState() == GuiState.CLICK) { + if (event.getMouseButton() == 0 && flag) { + this.cachedValue6 = doubleVal3 - doubleVal; + this.cachedValue2 = doubleVal12 - doubleVal2; + this.stateFlag = true; + } + } else if (event.getState() == GuiState.RENDER) { + if (this.stateFlag) { + DoubleProperty doubleProp3 = this.targetHUD.getPosX(); + double doubleVal13 = this.cachedValue6 + doubleVal; + DoubleProperty doubleProp4 = this.targetHUD.getPosX(); + Double doubleVal4 = doubleProp4.getMinimum(); + double doubleVal14 = doubleVal4; + DoubleProperty doubleProp5 = this.targetHUD.getPosX(); + Double doubleVal5 = doubleProp5.getMaximum(); + double doubleVal15 = doubleVal5; + doubleVal13 = MathHelper.clamp_double(doubleVal13, doubleVal14, doubleVal15); + Double doubleVal6 = doubleVal13; + doubleProp3.set(doubleVal6); + DoubleProperty doubleProp6 = this.targetHUD.getPosY(); + double doubleVal7 = this.cachedValue2 + doubleVal2; + doubleProp4 = this.targetHUD.getPosY(); + Double doubleVal8 = doubleProp4.getMinimum(); + double doubleVal16 = doubleVal8; + doubleProp5 = this.targetHUD.getPosY(); + Double doubleVal9 = doubleProp5.getMaximum(); + double doubleVal17 = doubleVal9; + doubleVal7 = MathHelper.clamp_double(doubleVal7, doubleVal16, doubleVal17); + Double doubleVal10 = doubleVal7; + doubleProp6.set(doubleVal10); + } + + if (!TargetHUD.checkTargetHUD2(this.targetHUD)) { + this.evaluateDouble(this.targetPlayer = TargetHUD.resolveMinecraft12(this.targetHUD).thePlayer); + } + + if (flag) { + double doubleVal11 = MovementUtils.evaluateDouble(true); + double doubleVal18 = this.cachedValue4; + double doubleVal19 = this.cachedValue; + int color = ColorTheme.getColor(0, 0, 0, 100); + int color2 = ColorTheme.WHITE.getRGB(); + RenderUtils.drawBorderedRoundedRect(doubleVal3, doubleVal12, doubleVal18, doubleVal19, 0.0, 2.5F, color, color2); + MovementUtils.unscale(doubleVal11); + } + } else if (event.getState() == GuiState.RELEASE && event.getMouseButton() == 0) { + this.stateFlag = false; + } else if (event.getState() == GuiState.INITIAL && !TargetHUD.checkTargetHUD2(this.targetHUD)) { + this.performAction3(); + } else if (event.getState() == GuiState.CLOSE && !this.targetHUD.getStateFlag()) { + this.performAction4(); + } + } +} + + public TargetHudCard(TargetHUD targetHUD, TargetHudTag targetHudTag) { + this(targetHUD); +} + + private void invokeCallback2(EntityPlayer player, double value, double amount, FontRenderer font, HUD hUD, int index, int count, int num) { + this.renderElement(player, value + 21.0, amount + 21.0, 38.0 - 0.2 * player.hurtTime, this.evaluateDouble(1.0)); + String nameStr = player.getName(); + double doubleVal = value + 42.0; + double doubleVal2 = amount + this.cachedValue * 0.5 - 12.0; + int intVal = this.evaluateDouble(255); + int color = ColorTheme.reAlpha(16777215, intVal); + font.renderStep2(nameStr, doubleVal, doubleVal2, color, true); + this.renderElement2(player, hUD, value + 42.0, amount + this.cachedValue * 0.5, this.cachedValue4 - 45.0, 10.0, index, count, num, true); +} + + @EventTarget + public void onRender2D(Render2DEvent event) { + if (this.smoothAnim.getValue() <= 0.05) { + EventManager.unregister(this); + } else { + this.performAction2(); + } +} + + private int evaluateDouble(int value) { + boolean flag = this.smoothAnim.isStateFlag(); + double doubleVal = this.msTimer.getScaledElapsed(800L, 1.0); + int intVal = (int)(value * (flag ? 1.0 - doubleVal : doubleVal)); + return MathHelper.clamp(intVal, 35, 255); +} + + public void performAction4() { + this.smoothAnim.reset(); + this.msTimer.reset(); + EventManager.register(this); +} + + private TargetHudCard(TargetHUD targetHUD) { + this.targetHUD = targetHUD; + this.smoothAnim = new SmoothAnimation(); + this.msTimer = new Timer(); + this.hudNotificationBoxField = new HudNotificationBox(); +} + + public cc.novoline.utils.anim.SmoothAnimation getSmoothAnim() { return this.smoothAnim; } +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/TargetHudParticle.java b/src/main/java/cc/novoline/modules/configurations/util/TargetHudParticle.java new file mode 100644 index 0000000..bd6a203 --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/TargetHudParticle.java @@ -0,0 +1,512 @@ +package cc.novoline.modules.configurations.util; + + +import net.minecraft.client.gui.Gui; +import cc.novoline.events.EventManager; +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.events.events.RenderGuiEvent; +import cc.novoline.events.type.GuiState; +import cc.novoline.modules.combat.TargetHUD; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.visual.HUD; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.MovementUtils; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.Timer; +import cc.novoline.utils.anim.SmoothAnimation; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontFamilyPOPPING_MEDIUM; +import cc.novoline.utils.fonts.holders.FontFamilyPOPPING_REGULAR; +import cc.novoline.utils.shader.GaussianBlurShader; +import cc.novoline.utils.shader.RoundedRectShader; +import cc.novoline.utils.shader.RoundedTextureShader; +import cc.novoline.utils.shader.HudNotificationBox; +import cc.novoline.modules.ModuleRegistry; +import java.awt.Color; +import java.util.UUID; + +import net.minecraft.client.gui.GuiChat; +import cc.novoline.utils.fonts.holders.FontFamilySF_BOLD; + +import net.minecraft.util.MathHelper; +import cc.novoline.utils.fonts.api.FontFamily; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.DefaultPlayerSkin; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class TargetHudParticle { + private Timer msTimer; + private boolean stateFlag; + private double cachedValue; + private double cachedValue2; + private double doubleValue; + final TargetHUD targetHUD; + private SmoothAnimation smoothAnimation; + private int stateTicks; + private double cachedValue3; + private EntityPlayer targetPlayer; + private HudNotificationBox hudNotificationBoxField; + private float cachedAngle; + private double cachedValue4; + private double cachedValue5; + + public void applyUpdate(EntityPlayer player) { + double doubleVal = MovementUtils.evaluateDouble(true); + this.renderElement(player); + MovementUtils.unscale(doubleVal); +} + + public void performAction() { + StringProperty strProp = this.targetHUD.getColorType(); + if (strProp.equals("Breath")) { + HudNotificationBox hudNotificationBox = this.hudNotificationBoxField; + ListProperty listProp = this.targetHUD.getShaders(); + boolean flag = listProp.contains("Glow"); + ColorProperty colorProp = this.targetHUD.getColor(); + Integer color = colorProp.getColorInt(); + int intVal = color; + StringProperty strProp2 = this.targetHUD.getDropEffectMode(); + hudNotificationBox.applyUpdate(flag, intVal, strProp2.equals("Square")); + } else { + HudNotificationBox hudNotificationBox2 = this.hudNotificationBoxField; + ListProperty listProp2 = this.targetHUD.getShaders(); + boolean flag2 = listProp2.contains("Glow"); + StringProperty strProp3 = this.targetHUD.getDropEffectMode(); + hudNotificationBox2.applyUpdate3(flag2, strProp3.equals("Square")); + } +} + + private void invokeCallback( + FontRenderer font, String text, double value, double amount, boolean flag, HUD hUD, FontRenderer fontRenderer, String str, int index, int count, int num + ) { + double doubleVal2 = value + 44.0; + double doubleVal3 = amount + 11.0; + int intVal = this.applyUpdate(255); + font.drawElement3(text, doubleVal2, doubleVal3, ColorTheme.reAlpha(16777215, intVal), true, flag); + StringProperty strProp = this.targetHUD.getColorType(); + if (strProp.equals("Fade")) { + doubleVal2 = value + 44.0; + hUD.renderFontRenderer(fontRenderer, str, doubleVal2 + font.stringWidth(text), amount + 11.0, true, flag, index, count); + } else { + strProp = this.targetHUD.getColorType(); + if (strProp.equals("Breath")) { + double doubleVal4 = value + 44.0; + doubleVal4 += font.stringWidth(text); + doubleVal2 = amount + 11.0; + fontRenderer.drawElement3(str, doubleVal4, doubleVal2, ColorTheme.evaluateInt4(num), true, flag); + } else { + double doubleVal = value + 44.0; + fontRenderer.drawElement3(str, doubleVal + font.stringWidth(text), amount + 11.0, num, true, flag); + } + } +} + + private void invokeCallback2(HUD hUD, double value, double amount, double offset, boolean flag, int index, int count, int num) { + FontRenderer font = FontFamilySF_BOLD.FAMILY.ofSize(16); + StringProperty strProp = this.targetHUD.getColorType(); + if (strProp.equals("Fade")) { + double doubleVal5 = this.cachedAngle; + doubleVal5 = MathHelper.roundToDecimal(doubleVal5, 1); + hUD.renderFontRenderer(font, String.valueOf(doubleVal5), value + amount + 2.0, offset + 1.5, true, flag, index, count); + } else { + strProp = this.targetHUD.getColorType(); + if (strProp.equals("Static")) { + double doubleVal = this.cachedAngle; + double doubleVal2 = MathHelper.roundToDecimal(doubleVal, 1); + font.drawElement3(String.valueOf(doubleVal2), value + amount + 2.0, offset + 1.5, num, true, flag); + } else { + double doubleVal3 = this.cachedAngle; + double doubleVal4 = MathHelper.roundToDecimal(doubleVal3, 1); + String textStr = String.valueOf(doubleVal4); + double doubleVal6 = value + amount + 2.0; + double doubleVal7 = offset + 1.5; + font.drawElement3(textStr, doubleVal6, doubleVal7, ColorTheme.evaluateInt4(num), true, flag); + } + } +} + + public void applyUpdate(Runnable runnable) { + this.smoothAnimation.renderVisual2(this.cachedValue, this.doubleValue, 0.1, runnable, 200L, 300L); +} + + public TargetHudParticle(TargetHUD targetHUD, TargetHudTag targetHudTag) { + this(targetHUD); +} + + private void invokeCallback3(double value, double amount, double offset, double dist, double value2, int index, int count, int num) { + StringProperty strProp = this.targetHUD.getColorType(); + if (strProp.equals("Fade")) { + double doubleVal = value + amount; + double doubleVal4 = dist - amount * 2.0; + double doubleVal5 = value2 * 0.5; + RenderUtils.drawElement5(doubleVal, offset, doubleVal4, value2, doubleVal5, index, count); + } else { + strProp = this.targetHUD.getColorType(); + if (strProp.equals("Static")) { + double doubleVal2 = value + amount; + double doubleVal6 = dist - amount * 2.0; + double doubleVal7 = value2 * 0.5; + RenderUtils.drawRoundedRect(doubleVal2, offset, doubleVal6, value2, doubleVal7, num); + } else { + double doubleVal3 = value + amount; + double doubleVal8 = dist - amount * 2.0; + double doubleVal9 = value2 * 0.5; + int color = ColorTheme.evaluateInt4(num); + RenderUtils.drawRoundedRect(doubleVal3, offset, doubleVal8, value2, doubleVal9, color); + } + } +} + + public void performAction2() { + this.smoothAnimation.applyDouble(0.2); + this.msTimer.reset(); + this.stateTicks = -1; + EventManager.unregister(this); +} + + private void invokeCallback4(ResourceLocation location, double value, double amount, double offset) { + Minecraft mcClient = TargetHUD.resolveMinecraft5(this.targetHUD); + TextureManager texManager = mcClient.getTextureManager(); + texManager.bindTexture(location); + GL11.glColor4d(1.0, 1.0, 1.0, 1.0); + Gui.renderStep(value, amount, 8.0F, 8.0F, 8, 8, offset, offset, 64.0F, 64.0F); +} + + private void renderElement(EntityPlayer player) { + HUD hUD = ModuleRegistry.HUD.getModule(); + FontFamily fontFam = FontFamilyPOPPING_REGULAR.FAMILY; + FontRenderer font = fontFam.ofSize(19); + fontFam = FontFamilyPOPPING_MEDIUM.FAMILY; + FontRenderer font2 = fontFam.ofSize(19); + boolean flag = this.smoothAnimation.getValue() != 1.0; + String textStr = "Name: "; + String nameStr = player.getName(); + double doubleVal3 = this.targetHUD.getCachedValue(); + double doubleVal4 = this.targetHUD.getCachedValue3(); + int width = 91 + font2.stringWidth(nameStr); + this.cachedValue2 = Math.max(98, width); + this.cachedValue4 = 44.0; + this.cachedValue = doubleVal3 + this.cachedValue2 * 0.5; + this.doubleValue = doubleVal4 + this.cachedValue4 * 0.5; + ColorProperty colorProp = this.targetHUD.getColor(); + Integer color = colorProp.getColorInt(); + int intVal = color; + int intVal6 = this.applyUpdate(255); + int color4 = ColorTheme.reAlpha(intVal, intVal6); + ColorProperty colorProp2 = this.targetHUD.getColorBegin(); + Integer color2 = colorProp2.getColorInt(); + int intVal2 = color2; + int intVal7 = this.applyUpdate(255); + int color5 = ColorTheme.reAlpha(intVal2, intVal7); + ColorProperty colorProp3 = this.targetHUD.getColorEnd(); + Integer color3 = colorProp3.getColorInt(); + int intVal3 = color3; + int intVal8 = this.applyUpdate(255); + int color6 = ColorTheme.reAlpha(intVal3, intVal8); + IntProperty intProp = this.targetHUD.getRoundness(); + Integer intVal4 = intProp.get(); + int intVal5 = intVal4; + double doubleVal5 = Math.max(intVal5, 4); + this.applyUpdate(((Runnable) (() -> this.invokeCallback5(doubleVal3, doubleVal4, doubleVal5)))); + this.hudNotificationBoxField.doubleField2 = doubleVal3 + 22.0; + this.hudNotificationBoxField.doubleField = doubleVal4 + 22.0; + this.performAction(); + this.applyUpdate(((Runnable) (() -> this.invokeCallback(font, textStr, doubleVal3, doubleVal4, flag, hUD, font2, nameStr, color5, color6, color4)))); + double doubleVal6 = doubleVal3 + 44.0; + double doubleVal7 = doubleVal4 + 28.0; + double doubleVal8 = this.cachedValue2; + BooleanProperty boolProp = this.targetHUD.getShowHealthValue(); + Boolean propFlag = boolProp.get(); + this.renderElement3(player, hUD, doubleVal6, doubleVal7, doubleVal8 - (propFlag ? 68 : 54), 8.0, 8.0, color4, color5, color6, flag); + double propDouble = this.smoothAnimation.getValue(); + double doubleVal = doubleVal3 + 22.0 - this.cachedValue; + double doubleVal2 = Math.abs(doubleVal); + this.renderElement2(player, doubleVal3 + 22.0 + (doubleVal2 - doubleVal2 * propDouble), doubleVal4 + 22.0, 34.0 * propDouble - 0.2 * player.hurtTime, doubleVal5 * 2.0 * propDouble); +} + + public void performAction3() { + this.smoothAnimation.reset(); + this.msTimer.reset(); + EventManager.register(this); +} + + private void renderElement2(EntityPlayer player, double value, double amount, double offset, double dist) { + UUID uUID = player.getUUID2(); + NetworkPlayerInfo networkPlayerInfo = NetHandlerPlayClient.applyS3BPacketScoreboardObjective(uUID); + ResourceLocation resourceLocation; + if (networkPlayerInfo == null) { + resourceLocation = DefaultPlayerSkin.getDefaultSkin(player.getUUID2()); + } else { + resourceLocation = networkPlayerInfo.getLocationSkin(); + } + + value -= offset * 0.5; + amount -= offset * 0.5; + double doubleVal = value; + double doubleVal2 = amount; + RoundedRectShader.getRoundedRectShader().drawElement(value, amount, offset, offset, dist, 2.0, 0.96F, $lambdaCapture$2(this, resourceLocation, doubleVal, doubleVal2, offset), this.applyUpdate(1.0F)); + RoundedTextureShader.getInstance().applyUpdate2(value, amount, offset, offset, dist, 2.0, new Color(255, 0, 0, 18 * player.hurtTime), 0.96F, true); +} + + @EventTarget + public void onRender2D(Render2DEvent event) { + if (this.smoothAnimation.getValue() <= 0.05) { + EventManager.unregister(this); + } else { + this.performAction5(); + } +} + + private void updateTargetHUDState() { + double doubleVal = this.targetHUD.getCachedValue(); + double doubleVal2 = this.targetHUD.getCachedValue3(); + double doubleVal3 = this.cachedValue2; + double doubleVal4 = this.cachedValue4; + int color = ColorTheme.BLACK.getRGB(); + RenderUtils.drawRoundedRect(doubleVal, doubleVal2, doubleVal3, doubleVal4, 12.0, color); +} + + private void invokeCallback5(double x, double y, double z) { + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal = this.cachedValue2; + double doubleVal2 = this.cachedValue4; + double doubleVal3 = z * 2.0; + IntProperty intProp = this.targetHUD.getAlpha(); + Integer intVal = intProp.get(); + Color awtColor = new Color(0, 0, 0, this.applyUpdate(intVal)); + roundedTextureShader.applyUpdate4(x, y, doubleVal, doubleVal2, doubleVal3, 2.0, awtColor, true); +} + + public void performAction4() { + if (this.targetPlayer != null) { + double doubleVal = MovementUtils.evaluateDouble(true); + this.applyUpdate(this::updateTargetHUDState); + MovementUtils.unscale(doubleVal); + } +} + + private float applyUpdate(float value) { + boolean flag = this.smoothAnimation.isStateFlag(); + double doubleVal = this.msTimer.getScaledElapsed(flag ? 800L : 500L, 1.0); + float floatVal = (float)(value * (flag ? 1.0 - doubleVal : doubleVal)); + return MathHelper.clamp(floatVal, 0.05F, 1.0F); +} + + private void renderElement3(EntityPlayer player, HUD hUD, double value, double amount, double offset, double dist, double value2, int index, int count, int num, boolean flag) { + float health = player.getHealth(); + float floatVal = player.computeFloat(); + Minecraft mcClient = TargetHUD.resolveMinecraft4(this.targetHUD); + float floatVal2 = 2000 / mcClient.getDebugFPS(); + if (this.stateTicks != player.getEntityId()) { + this.cachedAngle = health; + this.stateTicks = player.getEntityId(); + } else if (this.cachedAngle > health) { + float floatVal3 = this.cachedAngle - 0.00625F * floatVal2; + this.cachedAngle = MathHelper.clamp(floatVal3, health, 999.0F); + } else if (this.cachedAngle < health) { + float floatVal4 = this.cachedAngle + 0.00625F * floatVal2; + this.cachedAngle = MathHelper.clamp(floatVal4, 0.0F, health); + } + + double doubleVal5 = offset / floatVal * this.cachedAngle; + double doubleVal6 = Math.max(10.0, doubleVal5); + double doubleVal7 = 1.5 / offset * doubleVal6; + ListProperty listProp = this.targetHUD.getShaders(); + if (listProp.contains("Glow")) { + GaussianBlurShader gaussianBlurShader = GaussianBlurShader.getGaussianBlurShader(); + int intVal = this.applyUpdate(255); + Runnable runnable = ((Runnable) (() -> { this.applyUpdate(((java.lang.Runnable) () -> this.invokeCallback3(value, doubleVal7, amount, doubleVal6, dist, count, num, index))); })); + gaussianBlurShader.renderVisual(12, intVal, true, runnable, null); + } + + double propDouble = this.smoothAnimation.getValue(); + double doubleVal = this.cachedValue - value; + double doubleVal2 = this.doubleValue - amount; + double doubleVal3 = value + (doubleVal - doubleVal * propDouble); + double doubleVal8 = amount + (doubleVal2 - doubleVal2 * propDouble); + double doubleVal9 = offset * propDouble; + double doubleVal10 = dist * propDouble; + double doubleVal11 = value2 * propDouble; + this.renderElement5(doubleVal3, doubleVal8, doubleVal9, doubleVal10, doubleVal11, Color.BLACK.getRGB(), this.applyUpdate(0.4F)); + StringProperty strProp = this.targetHUD.getColorType(); + if (strProp.equals("Fade")) { + this.renderElement4(value + (doubleVal - doubleVal * propDouble), amount + (doubleVal2 - doubleVal2 * propDouble), doubleVal6 * propDouble, dist * propDouble, value2 * propDouble, count, num, this.applyUpdate(1.0F)); + } else { + StringProperty strProp2 = this.targetHUD.getColorType(); + if (strProp2.equals("Static")) { + this.renderElement5(value + (doubleVal - doubleVal * propDouble), amount + (doubleVal2 - doubleVal2 * propDouble), doubleVal6 * propDouble, dist * propDouble, value2 * propDouble, index, this.applyUpdate(1.0F)); + } else { + double doubleVal4 = value + (doubleVal - doubleVal * propDouble); + doubleVal8 = amount + (doubleVal2 - doubleVal2 * propDouble); + doubleVal9 = doubleVal6 * propDouble; + doubleVal10 = dist * propDouble; + doubleVal11 = value2 * propDouble; + this.renderElement5(doubleVal4, doubleVal8, doubleVal9, doubleVal10, doubleVal11, ColorTheme.evaluateInt4(index), this.applyUpdate(1.0F)); + } + } + + BooleanProperty boolProp = this.targetHUD.getShowHealthValue(); + Boolean propFlag = boolProp.get(); + if (propFlag) { + this.applyUpdate(((java.lang.Runnable) () -> this.invokeCallback2(hUD, value, offset, amount, flag, count, num, index))); + } +} + + private void renderElement4(double value, double amount, double offset, double dist, double value2, int index, int count, float factor) { + RoundedRectShader.getRoundedRectShader().drawElement(value, amount, offset, dist, value2, 2.0, 0.96F, ((java.lang.Runnable) () -> { RenderUtils.drawElement(value, amount, offset, dist, index, count); }), factor); +} + + public static SmoothAnimation applyUpdate(TargetHudParticle targetHudParticle) { + return targetHudParticle.smoothAnimation; +} + + private TargetHudParticle(TargetHUD targetHUD) { + this.targetHUD = targetHUD; + this.smoothAnimation = new SmoothAnimation(); + this.msTimer = new Timer(); + this.hudNotificationBoxField = new HudNotificationBox(); +} + + public void applyEntityPlayer(EntityPlayer player) { + this.targetPlayer = player; + BooleanProperty boolProp = this.targetHUD.getDrawDropEffect(); + Boolean propFlag = boolProp.get(); + if (propFlag && this.targetPlayer != null && this.targetPlayer.hurtTime == 9) { + StringProperty strProp = this.targetHUD.getColorType(); + if (strProp.equals("Fade")) { + HudNotificationBox hudNotificationBox = this.hudNotificationBoxField; + ColorProperty colorProp = this.targetHUD.getColorBegin(); + Integer color = colorProp.getColorInt(); + int intVal = color; + ColorProperty colorProp2 = this.targetHUD.getColorEnd(); + Integer color2 = colorProp2.getColorInt(); + int intVal3 = color2; + IntProperty intProp = TargetHUD.resolveIntProperty2(this.targetHUD); + Integer intVal4 = intProp.get(); + hudNotificationBox.applyUpdate2(intVal, intVal3, 20.0, intVal4); + } else { + StringProperty strProp2 = TargetHUD.resolveStringProperty(this.targetHUD); + if (strProp2.equals("Static")) { + HudNotificationBox hudNotificationBox2 = this.hudNotificationBoxField; + ColorProperty colorProp3 = TargetHUD.resolveColorProperty(this.targetHUD); + Integer color3 = colorProp3.getColorInt(); + int intVal2 = color3; + IntProperty intProp2 = TargetHUD.resolveIntProperty2(this.targetHUD); + Integer intVal5 = intProp2.get(); + hudNotificationBox2.applyUpdate(intVal2, 20.0, intVal5); + } else { + HudNotificationBox hudNotificationBox3 = this.hudNotificationBoxField; + IntProperty intProp3 = TargetHUD.resolveIntProperty2(this.targetHUD); + Integer intVal6 = intProp3.get(); + hudNotificationBox3.applyUpdate3(20.0, intVal6); + } + } + } +} + + private int applyUpdate(int value) { + boolean flag = this.smoothAnimation.isStateFlag(); + double doubleVal = this.msTimer.getScaledElapsed(flag ? 800L : 500L, 1.0); + int intVal = (int)(value * (flag ? 1.0 - doubleVal : doubleVal)); + return MathHelper.clamp(intVal, 35, 255); +} + + public void applyUpdate(RenderGuiEvent event) { + if (event.getGuiScreen() instanceof GuiChat) { + int intVal2 = event.getMouseX(); + double doubleVal = MovementUtils.evaluateDouble(intVal2); + intVal2 = event.getMouseY(); + double doubleVal2 = MovementUtils.scaleYInt(intVal2); + DoubleProperty doubleProp = TargetHUD.resolveDoubleProperty2(this.targetHUD); + Double propDouble = doubleProp.get(); + double doubleVal3 = propDouble; + DoubleProperty doubleProp2 = TargetHUD.resolveDoubleProperty(this.targetHUD); + Double propDouble2 = doubleProp2.get(); + double doubleVal12 = propDouble2; + boolean flag = doubleVal > doubleVal3 && doubleVal <= doubleVal3 + this.cachedValue2 && doubleVal2 > doubleVal12 && doubleVal2 <= doubleVal12 + this.cachedValue4; + if (event.getState() == GuiState.CLICK) { + if (event.getMouseButton() == 0 && flag) { + this.cachedValue3 = doubleVal3 - doubleVal; + this.cachedValue5 = doubleVal12 - doubleVal2; + this.stateFlag = true; + } + } else if (event.getState() == GuiState.RENDER) { + if (this.stateFlag) { + DoubleProperty doubleProp3 = TargetHUD.resolveDoubleProperty2(this.targetHUD); + double doubleVal13 = this.cachedValue3 + doubleVal; + DoubleProperty doubleProp4 = TargetHUD.resolveDoubleProperty2(this.targetHUD); + Double doubleVal4 = doubleProp4.getMinimum(); + double doubleVal14 = doubleVal4; + DoubleProperty doubleProp5 = TargetHUD.resolveDoubleProperty2(this.targetHUD); + Double doubleVal5 = doubleProp5.getMaximum(); + double doubleVal15 = doubleVal5; + doubleVal13 = MathHelper.clamp_double(doubleVal13, doubleVal14, doubleVal15); + Double doubleVal6 = doubleVal13; + doubleProp3.set(doubleVal6); + DoubleProperty doubleProp6 = TargetHUD.resolveDoubleProperty(this.targetHUD); + double doubleVal7 = this.cachedValue5 + doubleVal2; + doubleProp4 = TargetHUD.resolveDoubleProperty(this.targetHUD); + Double doubleVal8 = doubleProp4.getMinimum(); + double doubleVal16 = doubleVal8; + doubleProp5 = TargetHUD.resolveDoubleProperty(this.targetHUD); + Double doubleVal9 = doubleProp5.getMaximum(); + double doubleVal17 = doubleVal9; + doubleVal7 = MathHelper.clamp_double(doubleVal7, doubleVal16, doubleVal17); + Double doubleVal10 = doubleVal7; + doubleProp6.set(doubleVal10); + } + + if (!TargetHUD.checkTargetHUD2(this.targetHUD)) { + this.applyUpdate(this.targetPlayer = TargetHUD.resolveMinecraft6(this.targetHUD).thePlayer); + } + + if (flag) { + double doubleVal11 = MovementUtils.evaluateDouble(true); + double doubleVal18 = this.cachedValue2; + double doubleVal19 = this.cachedValue4; + IntProperty intProp = TargetHUD.resolveIntProperty(this.targetHUD); + Integer intVal = intProp.get(); + int intVal3 = intVal; + double doubleVal20 = Math.max(4, intVal3); + int color = ColorTheme.getColor(0, 0, 0, 100); + int color2 = ColorTheme.WHITE.getRGB(); + RenderUtils.drawBorderedRoundedRect(doubleVal3, doubleVal12, doubleVal18, doubleVal19, doubleVal20, 2.5F, color, color2); + MovementUtils.unscale(doubleVal11); + } + } else if (event.getState() == GuiState.RELEASE && event.getMouseButton() == 0) { + this.stateFlag = false; + } else if (event.getState() == GuiState.INITIAL && !TargetHUD.checkTargetHUD2(this.targetHUD)) { + this.performAction2(); + } else if (event.getState() == GuiState.CLOSE && !TargetHUD.checkTargetHUD(this.targetHUD)) { + this.performAction3(); + } + } +} + + private void renderElement5(double value, double amount, double offset, double dist, double value2, int index, float factor) { + RoundedRectShader.getRoundedRectShader().drawElement(value, amount, offset, dist, value2, 2.0, 0.96F, ((java.lang.Runnable) () -> { RenderUtils.drawElement11(value, amount, offset, dist, index); }), factor); +} + + public void performAction5() { + if (this.targetPlayer != null) { + double doubleVal = MovementUtils.evaluateDouble(true); + this.renderElement(this.targetPlayer); + MovementUtils.unscale(doubleVal); + } +} + private static Runnable $lambdaCapture$2(TargetHudParticle $c0, net.minecraft.util.ResourceLocation $c1, double $c2, double $c3, double $c4) { return () -> $c0.invokeCallback4($c1, $c2, $c3, $c4); } + + public cc.novoline.utils.anim.SmoothAnimation getSmoothAnimation() { return this.smoothAnimation; } +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/TargetHudTag.java b/src/main/java/cc/novoline/modules/configurations/util/TargetHudTag.java new file mode 100644 index 0000000..dff58af --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/TargetHudTag.java @@ -0,0 +1,4 @@ +package cc.novoline.modules.configurations.util; + +public class TargetHudTag { +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/TriedToApi.java b/src/main/java/cc/novoline/modules/configurations/util/TriedToApi.java new file mode 100644 index 0000000..358881e --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/TriedToApi.java @@ -0,0 +1,11 @@ +package cc.novoline.modules.configurations.util; + +import cc.novoline.modules.configurations.property.Property; +import org.checkerframework.checker.nullness.qual.Nullable; + +public interface TriedToApi extends Property { + @Override + default void set(@Nullable Type type) { + throw new UnsupportedOperationException("Tried to change immutable property"); +} +} diff --git a/src/main/java/cc/novoline/modules/configurations/util/WaypointEntry.java b/src/main/java/cc/novoline/modules/configurations/util/WaypointEntry.java new file mode 100644 index 0000000..35b365e --- /dev/null +++ b/src/main/java/cc/novoline/modules/configurations/util/WaypointEntry.java @@ -0,0 +1,281 @@ +package cc.novoline.modules.configurations.util; + + +import org.lwjgl.util.glu.GLU; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.visual.HUD; +import cc.novoline.utils.MovementUtils; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontCustom_16; +import cc.novoline.utils.render.RotationAngleUtil; +import cc.novoline.modules.ModuleRegistry; +import java.awt.Color; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; + +import net.minecraft.client.renderer.GlStateManager; +import cc.novoline.modules.configurations.holder.SavingModuleHolderSupport; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.BufferUtils; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.GL11; + +public final class WaypointEntry { + private final int stateTicks; + private final int intValue; + private transient double[] doubleArray2 = new double[]{0.0, 0.0, 0.0}; + private final String cachedText; + private final int stateTicks2; + + public int computeIntValue() { + double posX2 = Minecraft.getMinecraft().thePlayer.posX - this.getStateTicks2(); + int intVal = (int)Math.abs(posX2); + posX2 = Minecraft.getMinecraft().thePlayer.posY - this.getStateTicks(); + int intVal2 = (int)Math.abs(posX2); + posX2 = Minecraft.getMinecraft().thePlayer.posZ - this.getIntValue(); + int intVal3 = (int)Math.abs(posX2); + posX2 = intVal * intVal + intVal2 * intVal2 + intVal3 * intVal3; + return (int)Math.sqrt(posX2); +} + + public boolean isStateReady() { + float pitch; + Minecraft mcClient; + float floatVal; + float floatVal2; + float yaw; + label50: { + mcClient = Minecraft.getMinecraft(); + floatVal = RotationAngleUtil.buildFloatArray2(this.getStateTicks2(), this.getIntValue(), this.getStateTicks())[0]; + floatVal2 = RotationAngleUtil.buildFloatArray2(this.getStateTicks2(), this.getIntValue(), this.getStateTicks())[1]; + Minecraft mcClient2 = mcClient; + + GameSettings gameSettings2 = mcClient.gameSettings; + if (gameSettings2.getThirdPersonView() == 0) { + yaw = mcClient.getRenderViewEntity().rotationYaw; + break label50; + } + + mcClient2 = mcClient; + + + yaw = mcClient2.getRenderViewEntity().floatState7; + } + + GameSettings gameSettings3 = mcClient.gameSettings; + int intVal = gameSettings3.getThirdPersonView(); + intVal = intVal == 2 ? 180 : 0; + + float floatVal3 = yaw + intVal; + float floatVal4 = RotationAngleUtil.getAngleDifference(floatVal, RotationAngleUtil.wrapAngleTo180(floatVal3)); + + if (!(floatVal4 < 90.0F)) { + return false; + } + + floatVal4 = floatVal2; + + + label36: { + Minecraft mcClient3 = mcClient; + + gameSettings3 = mcClient.gameSettings; + if (gameSettings3.getThirdPersonView() == 0) { + pitch = mcClient.thePlayer.rotationPitch; + break label36; + } + + mcClient3 = mcClient; + + + pitch = mcClient3.thePlayer.floatState9; + } + + return RotationAngleUtil.getAngleDifference(floatVal4, pitch) < 90.0F; +} + + public int getStateTicks2() { + return this.stateTicks2; +} + + public int getIntValue() { + return this.intValue; +} + + public WaypointEntry(String text, int value, int index, int count) { + this.cachedText = text; + this.stateTicks2 = value; + this.stateTicks = index; + this.intValue = count; +} + + public void setDoubleArray2(double[] doubleArray) { + this.doubleArray2 = doubleArray; +} + + public void renderVisual() { + boolean flag3 = HUD.H(); + ScaledResolution scaledRes = new ScaledResolution(Minecraft.getMinecraft()); + FontRenderer font = FontCustom_16.FONT; + boolean flag = flag3; + boolean flag2 = this.isStateReady(); + if (!flag2) { + return; + } + + GL11.glPushMatrix(); + double doubleVal = this.doubleArray2[0]; + double doubleVal2 = doubleVal / scaledRes.getScaleFactor(); + double doubleVal3 = this.doubleArray2[1]; + doubleVal3 /= scaledRes.getScaleFactor(); + double doubleVal4 = this.doubleArray2[2]; + GL11.glTranslated(doubleVal2, doubleVal3, doubleVal4 / scaledRes.getScaleFactor()); + flag2 = true; + + MovementUtils.applyGuiScale(flag2); + float floatVal = 1.0F; + int intVal = Minecraft.getMinecraft().gameSettings.guiScale; + switch (intVal) { + case 0: + floatVal = 0.5F; + if (flag) { + break; + } + case 1: + floatVal = 2.0F; + if (flag) { + break; + } + case 3: + floatVal = 0.6666667F; + case 2: + } + + intVal = scaledRes.getScaledWidth(); + + float floatVal2 = intVal / 2.0F; + float floatVal3 = scaledRes.getScaledHeight() / 2.0F; + StringBuilder sb = new StringBuilder(); + String textStr = this.cachedText; + sb = sb.append(textStr); + textStr = " "; + sb = sb.append(textStr); + int intVal2 = this.computeIntValue(); + sb = sb.append(intVal2); + textStr = "m"; + String textStr2 = sb.append(textStr).toString(); + float floatVal4 = font.stringWidth(textStr2) / 2.0F; + float floatVal5 = 11.25F; + float floatVal6 = floatVal2 / floatVal + floatVal4; + float floatVal7 = floatVal2 / floatVal - floatVal4; + float floatVal8 = floatVal3 / floatVal - floatVal5; + float floatVal9 = floatVal3 / floatVal + floatVal5; + GL11.glTranslated(0.0, -2.5, 0.0); + GlStateManager.disableDepth(); + sb = new StringBuilder(); + textStr = this.cachedText; + sb = sb.append(textStr); + textStr = " "; + sb = sb.append(textStr); + int intVal3 = this.computeIntValue(); + sb = sb.append(intVal3); + textStr = "m"; + String textStr3 = sb.append(textStr).toString(); + float floatVal10 = -(font.stringWidth(textStr3) / 2) - 2; + StringBuilder sb2 = new StringBuilder(); + String textStr9 = this.cachedText; + sb2 = sb2.append(textStr9).append(" "); + int intVal4 = this.computeIntValue(); + sb2 = sb2.append(intVal4); + String textStr4 = sb2.append("m").toString(); + float floatVal12 = font.stringWidth(textStr4) / 2 + 2; + Color awtColor = new Color(0, 0, 0, 100); + int color2 = awtColor.getRGB(); + RenderUtils.drawRect(floatVal10, -5.0F, floatVal12, 10.0F, color2); + ModuleRegistry modEntry = ModuleRegistry.HUD; + HUD hudMod = modEntry.getModule(); + sb = new StringBuilder(); + textStr = this.cachedText; + sb = sb.append(textStr); + textStr = " "; + sb = sb.append(textStr); + int intVal5 = this.computeIntValue(); + sb = sb.append(intVal5); + textStr = "m"; + String textStr5 = sb.append(textStr).toString(); + float floatVal11 = -(font.stringWidth(textStr5) / 2) - 2; + sb2 = new StringBuilder(); + textStr9 = this.cachedText; + sb2 = sb2.append(textStr9).append(" "); + int intVal6 = this.computeIntValue(); + sb2 = sb2.append(intVal6); + String textStr6 = sb2.append("m").toString(); + float floatVal13 = font.stringWidth(textStr6) / 2 + 2; + ColorProperty colorProp = hudMod.getColorProperty4(); + Integer color = colorProp.getColorInt(); + int intVal9 = color; + RenderUtils.drawRect(floatVal11, -6.0F, floatVal13, -5.0F, intVal9); + sb = new StringBuilder(); + textStr = this.cachedText; + sb = sb.append(textStr); + textStr = " "; + sb = sb.append(textStr); + EnumChatFormatting enumChatFormatting = EnumChatFormatting.GRAY; + sb = sb.append(enumChatFormatting); + int intVal7 = this.computeIntValue(); + sb = sb.append(intVal7); + textStr = "m"; + String textStr7 = sb.append(textStr).toString(); + sb2 = new StringBuilder(); + textStr9 = this.cachedText; + sb2 = sb2.append(textStr9).append(" "); + int intVal8 = this.computeIntValue(); + sb2 = sb2.append(intVal8); + String textStr8 = sb2.append("m").toString(); + float floatVal14 = -(font.stringWidth(textStr8) / 2.0F); + font.drawString(textStr7, floatVal14, 0.0F, -1); + GlStateManager.enableDepth(); + GL11.glPopMatrix(); +} + + public String getCachedText() { + return this.cachedText; +} + + public int getStateTicks() { + return this.stateTicks; +} + + public static WaypointEntry resolveWaypointEntry(String text, int value, int index, int count) { + SavingModuleHolderSupport.applyUpdate(text, "name"); + return new WaypointEntry(text, value, index, count); +} + + public double[] buildDoubleArray(double x, double y, double z) { + FloatBuffer floatBuffer = BufferUtils.createFloatBuffer(3); + FloatBuffer floatBuffer2 = BufferUtils.createFloatBuffer(16); + FloatBuffer floatBuffer3 = BufferUtils.createFloatBuffer(16); + IntBuffer intBuffer = BufferUtils.createIntBuffer(16); + GL11.glGetFloat(2982, floatBuffer2); + GL11.glGetFloat(2983, floatBuffer3); + GL11.glGetInteger(2978, intBuffer); + byte byteVal = (byte)(GLU.gluProject((float)x, (float)y, (float)z, floatBuffer2, floatBuffer3, intBuffer, floatBuffer) ? 1 : 0); + byte byteVal2 = byteVal; + if (byteVal == 0) { + return null; + } + + byteVal2 = 3; + + double[] doubleArr = new double[byteVal2]; + doubleArr[0] = floatBuffer.get(0); + float floatVal = Display.getHeight(); + doubleArr[1] = floatVal - floatBuffer.get(1); + doubleArr[2] = floatBuffer.get(2); + return doubleArr; +} +} diff --git a/src/main/java/cc/novoline/modules/exceptions/NumberPropertyException.java b/src/main/java/cc/novoline/modules/exceptions/NumberPropertyException.java new file mode 100644 index 0000000..3b2b990 --- /dev/null +++ b/src/main/java/cc/novoline/modules/exceptions/NumberPropertyException.java @@ -0,0 +1,22 @@ +package cc.novoline.modules.exceptions; + +import cc.novoline.modules.configurations.property.Property; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class NumberPropertyException extends PropertyException { + public NumberPropertyException(@NonNull Property property) { + super(property); +} + + public NumberPropertyException(String text, Throwable throwable, @NonNull Property property) { + super(text, throwable, property); +} + + public NumberPropertyException(Throwable throwable, @NonNull Property property) { + super(throwable, property); +} + + public NumberPropertyException(String text, @NonNull Property property) { + super(text, property); +} +} diff --git a/src/main/java/cc/novoline/modules/exceptions/PropertyException.java b/src/main/java/cc/novoline/modules/exceptions/PropertyException.java new file mode 100644 index 0000000..17b2541 --- /dev/null +++ b/src/main/java/cc/novoline/modules/exceptions/PropertyException.java @@ -0,0 +1,33 @@ +package cc.novoline.modules.exceptions; + +import cc.novoline.modules.configurations.property.Property; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class PropertyException extends RuntimeException { +private final @NonNull Property property2; + + public PropertyException(String text, @NonNull Property property) { + super(text); + this.property2 = property; +} + + + + public PropertyException(String text, Throwable throwable, @NonNull Property property) { + super(text, throwable); + this.property2 = property; +} + + public @NonNull Property getProperty() { + return this.property2; +} + + public PropertyException(Throwable throwable, @NonNull Property property) { + super(throwable); + this.property2 = property; +} + + public PropertyException(@NonNull Property property) { + this.property2 = property; +} +} diff --git a/src/main/java/cc/novoline/modules/exceptions/UnacceptableValueException.java b/src/main/java/cc/novoline/modules/exceptions/UnacceptableValueException.java new file mode 100644 index 0000000..2f6233e --- /dev/null +++ b/src/main/java/cc/novoline/modules/exceptions/UnacceptableValueException.java @@ -0,0 +1,22 @@ +package cc.novoline.modules.exceptions; + +import cc.novoline.modules.configurations.property.AbstractNumberProperty; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class UnacceptableValueException extends PropertyException { + public UnacceptableValueException(String text, @NonNull AbstractNumberProperty property) { + super(text, property); +} + + public UnacceptableValueException(Throwable throwable, @NonNull AbstractNumberProperty property) { + super(throwable, property); +} + + public UnacceptableValueException(@NonNull AbstractNumberProperty property) { + super(property); +} + + public UnacceptableValueException(String text, Throwable throwable, @NonNull AbstractNumberProperty property) { + super(text, throwable, property); +} +} diff --git a/src/main/java/cc/novoline/modules/exceptions/UnregisteredModuleException.java b/src/main/java/cc/novoline/modules/exceptions/UnregisteredModuleException.java new file mode 100644 index 0000000..aac59c5 --- /dev/null +++ b/src/main/java/cc/novoline/modules/exceptions/UnregisteredModuleException.java @@ -0,0 +1,17 @@ +package cc.novoline.modules.exceptions; + +public final class UnregisteredModuleException extends RuntimeException { + public UnregisteredModuleException(Throwable throwable) { + super(throwable); +} + + public UnregisteredModuleException(String text) { + super(text); +} + + public UnregisteredModuleException(String text, Throwable throwable) { + super(text, throwable); +} + + public UnregisteredModuleException() {} +} diff --git a/src/main/java/cc/novoline/modules/exploits/Blink.java b/src/main/java/cc/novoline/modules/exploits/Blink.java new file mode 100644 index 0000000..7e47784 --- /dev/null +++ b/src/main/java/cc/novoline/modules/exploits/Blink.java @@ -0,0 +1,317 @@ +package cc.novoline.modules.exploits; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.LoadWorldEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.SettingEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.player.Freecam; +import cc.novoline.modules.player.Scaffold; +import cc.novoline.modules.ModuleRegistry; +import java.util.ArrayList; +import java.util.concurrent.ThreadLocalRandom; +import java.util.function.Consumer; +import net.minecraft.client.entity.AbstractClientPlayerOnLivingUpdateHelper; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.network.Packet; + +public final class Blink extends AbstractModule { + private final ArrayList arrayListField; + @Property("lagback-check") + private final BooleanProperty lagbackCheck; + private AbstractClientPlayerOnLivingUpdateHelper abstractClientPlayerOnLivingUpdateHelperField; + @Property("packet-limit") + private IntProperty packetLimit; + @Property("mode") + private StringProperty mode; + + + public StringProperty getMode() { + return this.mode; +} + + public StringProperty getStringPropertyValue() { + return this.getMode(); +} + + @EventTarget + private void onPacket(PacketEvent event) { + java.util.ArrayList packetList; + java.util.ArrayList packetList2; + cc.novoline.events.events.PacketEvent packetEvent; + cc.novoline.modules.exploits.Blink blink; + boolean flag3 = event.getState().equals(State.OUTGOING); + + if (flag3) { + + boolean flag = event.getPacket() instanceof C03PacketPlayer; + if (flag) { + label99: { + C03PacketPlayer playerPacket = (C03PacketPlayer)event.getPacket(); + boolean flag2 = playerPacket.isMoving(); + if (flag2) { + ArrayList itemList = this.arrayListField; + Packet packet = event.getPacket(); + itemList.add(packet); + event.setCancelled(true); + StringProperty strProp = this.mode; + int intVal2 = (strProp.equals("Pulse") ? 1 : 0); + if (intVal2 == 0) { + break label99; + } + + packetList = this.arrayListField; + + intVal2 = packetList.size(); + + IntProperty intProp = this.packetLimit; + Integer intVal3 = intProp.get(); + if (intVal2 <= intVal3) { + break label99; + } + + ArrayList itemList2 = this.arrayListField; + Consumer> consumer = this::applyInt5; + itemList2.forEach(consumer); + packetList = this.arrayListField; + + packetList.clear(); + break label99; + } + + packetList2 = this.arrayListField; + + flag2 = packetList2.isEmpty(); + + if (flag2) { + break label99; + } + + ArrayList itemList3 = this.arrayListField; + Consumer> consumer2 = this::applyInt5; + itemList3.forEach(consumer2); + packetList2 = this.arrayListField; + + packetList2.clear(); + } + + return; + } + + packetEvent = event; + + flag = event.getPacket() instanceof C02PacketUseEntity; + + if (!flag) { + packetEvent = event; + + if (!(event.getPacket() instanceof C0BPacketEntityAction)) { + packetEvent = event; + + if (!(event.getPacket() instanceof C07PacketPlayerDigging)) { + packetEvent = event; + + if (!(event.getPacket() instanceof C08PacketPlayerBlockPlacement)) { + return; + } + } + } + } + + packetEvent = event; + + packetEvent.setCancelled(true); + return; + } + + flag3 = event.getPacket() instanceof S08PacketPlayerPosLook; + + + if (!flag3) { + return; + } + + blink = this; + + BooleanProperty boolProp = this.lagbackCheck; + Boolean propFlag = boolProp.get(); + flag3 = propFlag; + + if (!flag3) { + return; + } + + blink = this; + + blink.applyInt5(this.getClass()); +} + + public AbstractClientPlayerOnLivingUpdateHelper obtainAbstractModule() { + return this.abstractClientPlayerOnLivingUpdateHelperField; +} + + public Blink(ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + this.arrayListField = new ArrayList<>(); + StringProperty strProp = StringProperty.of("Basic"); + String[] stringArr = new String[]{"Basic", "Pulse"}; + this.mode = strProp.acceptableValues(stringArr); + this.lagbackCheck = BooleanProperty.of(false); + this.packetLimit = IntProperty.of(4).minimum(2).maximum(15); + Setting setting = new Setting("BLINK_MODE", "Mode", SettingType.COMBOBOX, this, this.mode); + SettingManager.register(setting); + setting = new Setting("BLINK_PACKET_LIMIT", "Packet Limit", SettingType.SLIDER, this, this.packetLimit, 1.0, () -> this.mode.equals("Pulse")); + SettingManager.register(setting); + setting = new Setting("BLINK_LAG_DISABLE", "Disable on lagback", SettingType.CHECKBOX, this, this.lagbackCheck); + SettingManager.register(setting); +} + + + @Override + public void onDisable() { + Blink blink; + blink = this; + + if (this.mc.theWorld != null) { + blink = this; + + if (this.abstractClientPlayerOnLivingUpdateHelperField != null) { + WorldClient world = this.mc.theWorld; + world.removeEntityFromWorld(this.abstractClientPlayerOnLivingUpdateHelperField); + } + } + + blink = this; + + ArrayList itemList = blink.arrayListField; + if (itemList.isEmpty()) { + return; + } + + ArrayList itemList2 = this.arrayListField; + Consumer> consumer = this::applyInt5; + itemList2.forEach(consumer); + itemList = this.arrayListField; + + itemList.clear(); +} + + public void handleSettingEvent(SettingEvent event) { + label56: { + SettingEvent settingEvent = event; + + if (event == null) { + break label56; + } + + settingEvent = event; + + + boolean flag = settingEvent.getSettingName().equals("BLINK_MODE"); + + if (flag) { + break label56; + } + + flag = event.getSettingName().equals("DISABLER_PING_SPOOF_TOGGLE"); + + + if (!flag) { + return; + } + } + + boolean enabled2; + label39: { + label57: { + ModuleRegistry modEntry = ModuleRegistry.DISABLER; + Disabler disabler = modEntry.getModule(); + enabled2 = disabler.isEnabled(); + + if (!enabled2) { + break label57; + } + + enabled2 = disabler.checkState4(); + + + if (enabled2) { + enabled2 = true; + break label39; + } + } + + enabled2 = false; + } + + boolean flag2 = enabled2; + StringProperty strProp = this.mode; + boolean flag3 = strProp.equals("Basic"); + + if (!flag3) { + return; + } + + flag3 = flag2; + + + if (!flag3) { + this.popNotification(this.getDisplayName(), "You need to enabled Disabler and turn on Ping Spoof option in it to use BASIC mode", 4500, NotificationType.WARNING); + StringProperty strProp2 = this.mode; + strProp2.set("Pulse"); + } +} + + + @EventTarget + public void onLoadWorld(LoadWorldEvent event) { + this.arrayListField.clear(); + this.applyInt5(this.getClass()); +} + + @Override + public void onEnable() { + this.handleClassArray(Freecam.class, Scaffold.class); + Blink blink = this; + StringProperty strProp = this.mode; + if (!strProp.equals("Basic")) { + return; + } + + WorldClient world = this.mc.theWorld; + EntityPlayerSP player = this.mc.thePlayer; + this.abstractClientPlayerOnLivingUpdateHelperField = new AbstractClientPlayerOnLivingUpdateHelper(world, player.getGameProfile()); + this.abstractClientPlayerOnLivingUpdateHelperField.handleEntity(this.mc.thePlayer); + this.abstractClientPlayerOnLivingUpdateHelperField.resolveDouble6(this.mc.thePlayer.rotationYawHead); + AbstractClientPlayerOnLivingUpdateHelper val = this.abstractClientPlayerOnLivingUpdateHelperField; + EntityPlayerSP player2 = this.mc.thePlayer; + val.handleFloat5(player2.getHealth()); + blink = this; + + WorldClient world2 = blink.mc.theWorld; + ThreadLocalRandom threadLocalRandom = ThreadLocalRandom.current(); + int intVal = threadLocalRandom.nextInt(); + world2.addEntityToWorld(intVal, this.abstractClientPlayerOnLivingUpdateHelperField); +} + + +} diff --git a/src/main/java/cc/novoline/modules/exploits/ClickTeleport.java b/src/main/java/cc/novoline/modules/exploits/ClickTeleport.java new file mode 100644 index 0000000..f590593 --- /dev/null +++ b/src/main/java/cc/novoline/modules/exploits/ClickTeleport.java @@ -0,0 +1,706 @@ +package cc.novoline.modules.exploits; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.render.RotationAngleUtil; +import cc.novoline.utils.tasks.TaskManager; +import cc.novoline.utils.tasks.TaskStage; +import cc.novoline.utils.tasks.impl.ClickTeleportTask; + +import cc.novoline.Novoline; +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.MoveEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.combat.KillAura; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.LongProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.ModuleRegistry; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C04PacketPlayerPosition; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.util.MathHelper; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.init.Blocks; +import net.minecraft.network.play.client.C07PacketPlayerDigging$Action; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.util.MovingObjectPosition$MovingObjectType; + +public class ClickTeleport extends AbstractModule { + private List blockPosList; + private boolean stateFlag; + @Property("damage") + private BooleanProperty damage; + @Property("mode") + private StringProperty mode; + @Property("speed") + private StringProperty speed; + @Property("delay") + private LongProperty delay; + private TimerUtil timer; + + public static void processClickTeleport(ClickTeleport clickTeleport) { + clickTeleport.performStep9(); +} + + public MovingObjectPosition getMovingObjectPositionC() { + float floatVal = 999.0F; + Vec3 vec = this.getVec3(); + Vec3 vec2 = RotationAngleUtil.getVectorForRotation(this.mc.thePlayer.rotationPitch, this.mc.thePlayer.rotationYaw); + double posX = vec2.xCoord * floatVal; + double posY = vec2.yCoord * floatVal; + double posZ = vec2.zCoord * floatVal; + Vec3 vec3 = vec.addVector(posX, posY, posZ); + return this.mc.theWorld.rayTraceBlocks(vec, vec3, false, false, false); +} + + public Vec3 applyUpdate4(double x, double y, double z) { + return new Vec3(x, y, z); +} + + + @EventTarget + public void onMove(MoveEvent event) { + StringProperty strProp = this.mode; + boolean propFlag = strProp.get().equals("BlocksMC"); + if (!propFlag) { + return; + } + + strProp = this.speed; + propFlag = strProp.get().equals("Delayed"); + + if (!propFlag) { + return; + } + + List itemList = this.blockPosList; + propFlag = itemList.isEmpty(); + + if (!propFlag) { + event.setCachedValue32(this.mc.thePlayer.motionY = 0.0); + event.setMoveSpeed(0.0); + } +} + + private void performStep9() { + double doubleVal; + int intVal; + int intVal2; + ClickTeleport clickTeleport; + + intVal2 = Disabler.getIntValue(); + boolean propFlag = this.mode.get().equals("NCPNoTimer"); + + if (propFlag) { + label320: { + + EntityPlayerSP player = this.mc.thePlayer; + double doubleVal2 = player.applyArmorCalculations(true, 0.2); + MovingObjectPosition rayTrace = this.getMovingObjectPositionC(); + + if (rayTrace == null) { + break label320; + } + + clickTeleport = this; + + rayTrace = this.getMovingObjectPositionC(); + + + if (rayTrace.typeOfHit == MovingObjectPosition$MovingObjectType.BLOCK) { + BlockPos pos = this.getMovingObjectPositionC().getBlockPos(); + double doubleVal3 = pos.getX() + 0.5; + double doubleVal39 = pos.getZ() + 0.5; + float floatVal = RotationAngleUtil.evaluateFloat(doubleVal3, doubleVal39); + EntityPlayerSP player2 = this.mc.thePlayer; + double doubleVal40 = pos.getY(); + double doubleVal4 = player2.resolveDouble(doubleVal3, doubleVal40, doubleVal39); + double doubleVal5 = Math.abs(doubleVal4); + double posY3 = this.mc.thePlayer.posY; + double doubleVal6 = doubleVal2; + + label310: + while (true) { + double doubleVal7; + int intVal3 = (doubleVal7 = doubleVal6 - doubleVal5) == 0.0 ? 0 : (doubleVal7 < 0.0 ? -1 : 1); + + while (true) { + if (intVal3 >= 0) { + break label310; + } + + double doubleVal8 = floatVal; + double angleRad = Math.toRadians(doubleVal8); + double angleRad2 = -Math.sin(angleRad) * doubleVal6; + double doubleVal9 = floatVal; + double angleRad3 = Math.toRadians(doubleVal9); + double angleRad4 = Math.cos(angleRad3) * doubleVal6; + double doubleVal10 = 0.0; + Vec3 vec = this.applyUpdate4(this.mc.thePlayer.posX + angleRad2, posY3, this.mc.thePlayer.posZ + angleRad4); + Vec3 vec2 = RotationAngleUtil.getVectorForRotation(90.0F, 0.0F); + double posX3 = vec2.xCoord * 99.0; + doubleVal40 = vec2.yCoord * 99.0; + double posZ3 = vec2.zCoord * 99.0; + Vec3 vec8 = vec.addVector(posX3, doubleVal40, posZ3); + WorldClient world = this.mc.theWorld; + MovingObjectPosition rayTrace2 = world.rayTraceBlocks(vec, vec8, false, false, false); + + MovingObjectPosition rayTrace3 = rayTrace2; + + while (true) { + if (rayTrace3 == null) { + this.applyUpdate4("Can't teleport there!", 2000, NotificationType.ERROR); + return; + } + + double doubleVal11 = 0.0; + + while (doubleVal11 < doubleVal2) { + Vec3 vec3 = RotationAngleUtil.getVectorForRotation(0.0F, floatVal); + posX3 = vec3.xCoord * doubleVal11; + doubleVal40 = vec3.yCoord * doubleVal11; + posZ3 = vec3.zCoord * doubleVal11; + Vec3 vec9 = vec.addVector(posX3, doubleVal40, posZ3); + WorldClient world2 = this.mc.theWorld; + MovingObjectPosition rayTrace4 = world2.rayTraceBlocks(vec, vec9, false, false, false); + + rayTrace3 = rayTrace4; + + if (rayTrace4 != null && rayTrace4.typeOfHit == MovingObjectPosition$MovingObjectType.BLOCK) { + doubleVal10 = doubleVal11; + + break; + + } + + doubleVal11 += doubleVal2 / 100.0; + + + } + + WorldClient world3 = this.mc.theWorld; + posZ3 = this.mc.thePlayer.posX; + double doubleVal41 = floatVal; + doubleVal41 = Math.toRadians(doubleVal41); + posZ3 -= Math.sin(doubleVal41) * (doubleVal6 + doubleVal2); + double posZ4 = this.mc.thePlayer.posZ; + double doubleVal42 = floatVal; + doubleVal42 = Math.toRadians(doubleVal42); + BlockPos pos2 = new BlockPos(posZ3, posY3, posZ4 + Math.cos(doubleVal42) * (doubleVal6 + doubleVal2)); + IBlockState blockState = world3.getBlockState(pos2); + Block block = blockState.getBlock(); + double doubleVal12 = doubleVal10; + + if (doubleVal10 > 0.0 && block != Blocks.tallgrass) { + double angleRad5; + double angleRad6; + label298: { + double doubleVal13 = floatVal; + double angleRad7 = Math.toRadians(doubleVal13); + angleRad5 = -Math.sin(angleRad7) * (doubleVal10 - 0.3); + double doubleVal14 = floatVal; + double angleRad8 = Math.toRadians(doubleVal14); + angleRad6 = Math.cos(angleRad8) * (doubleVal10 - 0.3); + this.updateHelper2(this.mc.thePlayer.posX + angleRad2 + angleRad5, posY3, this.mc.thePlayer.posZ + angleRad4 + angleRad6); + Block block2 = block; + + if (block == Blocks.air) { + doubleVal = 0.5; + break label298; + } + + block2 = block; + + + double doubleVal15 = block2.getBlockBoundsMaxY(); + doubleVal = doubleVal15 - block.getBlockBoundsMinY(); + } + + double doubleVal16; + label292: { + double doubleVal17 = doubleVal; + doubleVal16 = doubleVal17 - posY3 % 1.0; + + if (doubleVal16 < 0.625) { + this.updateHelper2(this.mc.thePlayer.posX + angleRad2 + angleRad5, posY3 + doubleVal16, this.mc.thePlayer.posZ + angleRad4 + angleRad6); + + break label292; + + } + + this.updateHelper2(this.mc.thePlayer.posX + angleRad2 + angleRad5, posY3 + 0.42F, this.mc.thePlayer.posZ + angleRad4 + angleRad6); + + + this.updateHelper2(this.mc.thePlayer.posX + angleRad2 + angleRad5, posY3 + 0.7531999805212, this.mc.thePlayer.posZ + angleRad4 + angleRad6); + } + + posY3 += doubleVal16; + + break; + + } + + doubleVal12 = 0.0; + + + double doubleVal18 = doubleVal12; + Vec3 vec4 = this.applyUpdate4(this.mc.thePlayer.posX + angleRad2, posY3, this.mc.thePlayer.posZ + angleRad4); + double doubleVal19 = 0.0; + + while (doubleVal19 < 99.0) { + Vec3 vec5 = RotationAngleUtil.getVectorForRotation(90.0F, 0.0F); + posX3 = vec5.xCoord * doubleVal19; + doubleVal40 = vec5.yCoord * doubleVal19; + posZ3 = vec5.zCoord * doubleVal19; + Vec3 vec10 = vec4.addVector(posX3, doubleVal40, posZ3); + WorldClient world4 = this.mc.theWorld; + MovingObjectPosition rayTrace5 = world4.rayTraceBlocks(vec4, vec10, false, false, false); + + rayTrace3 = rayTrace5; + + if (rayTrace5 != null && rayTrace5.typeOfHit == MovingObjectPosition$MovingObjectType.BLOCK) { + WorldClient world5 = this.mc.theWorld; + BlockPos pos3 = rayTrace5.getBlockPos(); + IBlockState blockState2 = world5.getBlockState(pos3); + Block block3 = blockState2.getBlock(); + + if (block3 != Blocks.tallgrass) { + double doubleVal20 = MathHelper.roundToDecimal(doubleVal19, 3); + doubleVal18 = MathHelper.incValue(doubleVal20, 0.125); + + break; + + } + } + + doubleVal19 += 1.0E-4; + + } + + label344: { + double doubleVal21 = doubleVal18; + + if (!(doubleVal18 > 0.0)) { + break label344; + } + + doubleVal21 = 0.0; + + + double doubleVal22 = doubleVal21; + Vec3 vec6 = this.applyUpdate4(this.mc.thePlayer.posX + angleRad2, posY3 - 0.01, this.mc.thePlayer.posZ + angleRad4); + double doubleVal23 = 0.0; + + while (doubleVal23 < doubleVal2) { + Vec3 vec7 = RotationAngleUtil.getVectorForRotation(0.0F, floatVal); + posX3 = vec7.xCoord * doubleVal23; + doubleVal40 = vec7.yCoord * doubleVal23; + posZ3 = vec7.zCoord * doubleVal23; + Vec3 vec11 = vec6.addVector(posX3, doubleVal40, posZ3); + WorldClient world6 = this.mc.theWorld; + MovingObjectPosition rayTrace6 = world6.rayTraceBlocks(vec6, vec11, false, false, false); + + rayTrace3 = rayTrace6; + + if (rayTrace6 != null && rayTrace6.typeOfHit != MovingObjectPosition$MovingObjectType.BLOCK) { + doubleVal22 = doubleVal23; + } + + doubleVal23 += 0.001; + + + } + + double doubleVal24 = floatVal; + double angleRad9 = Math.toRadians(doubleVal24); + doubleVal23 = -Math.sin(angleRad9) * (doubleVal22 + 0.5); + double doubleVal25 = floatVal; + double angleRad10 = Math.toRadians(doubleVal25); + double angleRad11 = Math.cos(angleRad10) * (doubleVal22 + 0.5); + this.updateHelper2(this.mc.thePlayer.posX + angleRad2 + doubleVal23, posY3, this.mc.thePlayer.posZ + angleRad4 + angleRad11); + double doubleVal26 = 0.0; + double doubleVal27 = 0.0; + int intVal4 = 0; + + while (intVal4 < 99) { + + label244: { + double doubleVal28 = doubleVal26; + double doubleVal29 = doubleVal18; + + if (doubleVal26 < doubleVal18) { + double doubleVal30 = doubleVal27 + 0.08; + doubleVal27 = doubleVal30 * 0.980000019073486; + doubleVal26 += doubleVal27; + double doubleVal43 = posY3 - doubleVal26; + + if (!(doubleVal26 < doubleVal18)) { + break label244; + } + + this.updateHelper2(this.mc.thePlayer.posX + angleRad2 + doubleVal23, doubleVal43, this.mc.thePlayer.posZ + angleRad4 + angleRad11); + + break label244; + + } + + doubleVal28 = posY3; + doubleVal29 = doubleVal18; + + + posY3 = doubleVal28 - doubleVal29; + + break; + + } + + intVal4++; + + } + + + break; + + } + + this.updateHelper2(this.mc.thePlayer.posX + angleRad2, posY3, this.mc.thePlayer.posZ + angleRad4); + break; + } + + doubleVal6 += doubleVal2; + + break; + } + } + + EntityPlayerSP player3 = this.mc.thePlayer; + player3.setPosition(doubleVal3, posY3, doubleVal39); + } + + clickTeleport = this; + + clickTeleport.toggle(); + } + + + return; + + } + + clickTeleport = this; + + StringProperty strProp = this.mode; + propFlag = strProp.get().equals("BlocksMC"); + + + if (!propFlag) { + return; + } + + clickTeleport = this; + + label350: { + MovingObjectPosition rayTrace7 = clickTeleport.getMovingObjectPositionC(); + MovingObjectPosition rayTrace8 = rayTrace7; + + if (rayTrace7 == null) { + break label350; + } + + rayTrace8 = rayTrace7; + + + label171: { + + Object obj = rayTrace8.typeOfHit; + + if (rayTrace8.typeOfHit != MovingObjectPosition$MovingObjectType.BLOCK) { + return; + } + + clickTeleport = this; + + BooleanProperty boolProp = this.damage; + obj = boolProp.get(); + + + Boolean flag = (Boolean)obj; + if (!flag) { + break label171; + } + + this.sendPacketNoEvent(new C04PacketPlayerPosition(this.mc.thePlayer.posX, this.mc.thePlayer.posY + 3.0005123413124, this.mc.thePlayer.posZ, false)); + this.sendPacketNoEvent(new C04PacketPlayerPosition(this.mc.thePlayer.posX, this.mc.thePlayer.posY, this.mc.thePlayer.posZ, false)); + clickTeleport = this; + + clickTeleport.applyInt5(new C03PacketPlayer(true)); + } + + BlockPos pos4 = rayTrace7.getBlockPos(); + double posX2 = this.mc.thePlayer.posX; + double doubleVal31 = posX2 - pos4.getX(); + double doubleVal32 = Math.abs(doubleVal31); + double posZ2 = this.mc.thePlayer.posZ; + double doubleVal33 = posZ2 - pos4.getZ(); + double doubleVal44 = Math.abs(doubleVal33); + double dist = Math.hypot(doubleVal32, doubleVal44); + double posY2 = this.mc.thePlayer.posY; + double doubleVal34 = posY2 - pos4.getY(); + int intVal5 = 0; + + label353: { + + while (true) { + if (intVal5 < dist) { + intVal = intVal5 % 7; + + if (intVal == 0) { + double doubleVal35 = this.mc.thePlayer.rotationYaw; + double angleRad12 = Math.toRadians(doubleVal35); + double angleRad13 = -Math.sin(angleRad12) * intVal5; + double doubleVal36 = this.mc.thePlayer.rotationYaw; + double angleRad14 = Math.toRadians(doubleVal36); + double angleRad15 = Math.cos(angleRad14) * intVal5; + List itemList = this.blockPosList; + BlockPos pos5 = new BlockPos(this.mc.thePlayer.posX + angleRad13, this.mc.thePlayer.posY, this.mc.thePlayer.posZ + angleRad15); + itemList.add(pos5); + } + + intVal5++; + + continue; + + } + + List itemList2 = this.blockPosList; + itemList2.add(pos4); + clickTeleport = this; + + StringProperty strProp2 = this.speed; + intVal = (strProp2.get().equals("Instant") ? 1 : 0); + break; + } + + if (intVal == 0) { + break label353; + } + + clickTeleport = this; + + List itemList3 = clickTeleport.blockPosList; + Iterator iter = itemList3.iterator(); + + do { + if (!iter.hasNext()) { + break; + } + + BlockPos pos6 = (BlockPos)iter.next(); + + ClickTeleport clickTeleport2 = this; + + List itemList4 = this.blockPosList; + int foundIdx = itemList4.indexOf(pos6); + List itemList5 = this.blockPosList; + if (foundIdx == itemList5.size() - 1) { + EntityPlayerSP player4 = this.mc.thePlayer; + double doubleVal37 = pos6.getX(); + double doubleVal45 = pos6.getY() + 1; + double doubleVal46 = pos6.getZ(); + player4.setPosition(doubleVal37, doubleVal45, doubleVal46); + this.toggle(); + + continue; + + } + + clickTeleport2 = this; + + + double doubleVal38 = pos6.getX(); + double doubleVal47 = pos6.getY(); + clickTeleport2.applyInt5(new C04PacketPlayerPosition(doubleVal38, doubleVal47, pos6.getZ(), false)); + } while (intVal2 != 0); + } + + + return; + + } + + this.toggle(); +} + + private void updateHelper2(double x, double y, double z) { + KillAura killAura = ModuleRegistry.KILLAURA.getModule(); + if (killAura.isReadyState3()) { + this.sendPacketNoEvent(new C07PacketPlayerDigging(C07PacketPlayerDigging$Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, EnumFacing.DOWN)); + } + + EntityPlayerSP player = this.mc.thePlayer; + this.sendPacketNoEvent(new C04PacketPlayerPosition(x, y, z, player.matchesDouble2(y))); +} + + public static TimerUtil resolveTimerUtil(ClickTeleport clickTeleport) { + return clickTeleport.timer; +} + + private Boolean supplyBoolean() { + boolean propFlag; + label21: { + label23: { + propFlag = this.mode.get().equals("BlocksMC"); + if (!propFlag) { + break label23; + } + + StringProperty strProp = this.speed; + propFlag = strProp.get().equals("Delayed"); + + if (propFlag) { + propFlag = true; + break label21; + } + } + + propFlag = false; + } + + return propFlag; +} + + @Override + public void onEnable() { + TaskManager taskManager = this.novoline.getTaskManager(); + taskManager.applyFutureTask(new ClickTeleportTask(this, 50, TaskStage.TICK)); +} + + public ClickTeleport(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.blockPosList = new CopyOnWriteArrayList<>(); + this.timer = new TimerUtil(); + StringProperty strProp = StringProperty.of("BlocksMC"); + String[] stringArr = new String[]{"BlocksMC", "NCPNoTimer"}; + this.mode = strProp.acceptableValues(stringArr); + StringProperty strProp2 = StringProperty.of("Instant"); + stringArr = new String[]{"Instant", "Delayed"}; + this.speed = strProp2.acceptableValues(stringArr); + this.delay = LongProperty.of(100L).minimum(50L).maximum(400L); + this.damage = BooleanProperty.of(true); + Setting setting = new Setting("CT_MODE", "Mode", SettingType.COMBOBOX, this, this.mode); + SettingManager.register(setting); + Setting setting2 = new Setting("CT_SPEED", "Speed", SettingType.COMBOBOX, this, this.speed, () -> this.mode.get().equals("BlocksMC")); + SettingManager.register(setting2); + Setting setting3 = new Setting("CT_DELAY", "Delay", SettingType.SLIDER, this, this.delay, 10.0, this::supplyBoolean); + SettingManager.register(setting3); + Setting setting4 = new Setting("CT_DAMAGE", "Damage", SettingType.CHECKBOX, this, this.damage, () -> this.mode.get().equals("BlocksMC")); + SettingManager.register(setting4); +} + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + cc.novoline.modules.exploits.ClickTeleport clickTeleport; + Object obj = event.getState(); + if (obj != State.PRE) { + return; + } + + StringProperty strProp = this.mode; + obj = strProp.get(); + + boolean flag = ((String)obj).equals("BlocksMC"); + if (!flag) { + return; + } + + StringProperty strProp2 = this.speed; + flag = strProp2.get().equals("Delayed"); + + if (!flag) { + return; + } + + TimerUtil timerUtil = this.timer; + Long delayMs = this.delay.get(); + long longVal = delayMs; + flag = timerUtil.delay(longVal); + + if (!flag) { + return; + } + + clickTeleport = this; + + List itemList = this.blockPosList; + flag = itemList.isEmpty(); + + if (!flag) { + List itemList2 = this.blockPosList; + label32: { + if (itemList2.size() == 1) { + EntityPlayerSP player = this.mc.thePlayer; + List itemList3 = this.blockPosList; + BlockPos pos = (BlockPos)itemList3.get(0); + double doubleVal = pos.getX(); + List itemList5 = this.blockPosList; + BlockPos pos2 = (BlockPos)itemList5.get(0); + double doubleVal3 = pos2.getY() + 1; + List itemList6 = this.blockPosList; + BlockPos pos3 = (BlockPos)itemList6.get(0); + double doubleVal4 = pos3.getZ(); + player.setPosition(doubleVal, doubleVal3, doubleVal4); + this.toggle(); + break label32; + } + + List itemList4 = this.blockPosList; + BlockPos pos4 = (BlockPos)itemList4.get(0); + double doubleVal2 = pos4.getX(); + List itemList7 = this.blockPosList; + BlockPos pos5 = (BlockPos)itemList7.get(0); + double doubleVal5 = pos5.getY(); + List itemList8 = this.blockPosList; + BlockPos pos6 = (BlockPos)itemList8.get(0); + this.sendPacketNoEvent(new C04PacketPlayerPosition(doubleVal2, doubleVal5, pos6.getZ(), false)); + itemList2 = this.blockPosList; + itemList2.remove(0); + } + } + + clickTeleport = this; + + TimerUtil timerUtil2 = clickTeleport.timer; + timerUtil2.reset(); +} + + + private Vec3 getVec3() { + double posX2 = this.mc.thePlayer.posX; + double posY2 = this.mc.thePlayer.posY; + EntityPlayerSP player = this.mc.thePlayer; + return new Vec3(posX2, posY2 + player.getEyeHeight(), this.mc.thePlayer.posZ); +} + + + + public java.util.List getBlockPosList() { return this.blockPosList; } + public cc.novoline.utils.TimerUtil getTimer() { return this.timer; } +} diff --git a/src/main/java/cc/novoline/modules/exploits/Disabler.java b/src/main/java/cc/novoline/modules/exploits/Disabler.java new file mode 100644 index 0000000..3502acf --- /dev/null +++ b/src/main/java/cc/novoline/modules/exploits/Disabler.java @@ -0,0 +1,670 @@ +package cc.novoline.modules.exploits; + +import cc.novoline.events.events.WindowClickEvent; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ServerUtils; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.Event; +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.LoadWorldEvent; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.SettingEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.move.Speed; +import cc.novoline.modules.player.AutoArmor; +import cc.novoline.modules.player.GameSpeed; +import cc.novoline.modules.player.InvManager; +import cc.novoline.modules.player.Scaffold; +import cc.novoline.modules.ModuleRegistry; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Consumer; +import java.util.function.Predicate; +import java.util.stream.Stream; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.network.play.client.C00PacketKeepAlive; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraft.client.multiplayer.PlayerControllerMPMode; +import net.minecraft.network.play.client.C0FPacketConfirmTransaction; +import net.minecraft.network.play.client.C0EPacketClickWindow; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.init.Blocks; +import net.minecraft.network.Packet; +import net.minecraft.network.play.client.C16PacketClientStatus$EnumState; +import net.minecraft.util.BlockPos; + +public class Disabler extends AbstractModule { + @Property("click-bypass") + private BooleanProperty clickBypass; + @Property("ping-delay") + private IntProperty pingDelay; + private int stateTicks; + @Property("ping-spoof") + private BooleanProperty pingSpoof; + private TimerUtil timer; + private List packetList; + private TimerUtil timer2; + private static int intState2; + + + public BooleanProperty getClickBypass() { + return this.clickBypass; +} + + public BooleanProperty getBooleanProperty() { + return this.getClickBypass(); +} + + public boolean isFlagK() { + Boolean propFlag = this.clickBypass.get(); + return propFlag; +} + + @Override + public void onDisable() { + if (ServerUtils.isHypixel()) { + ModuleRegistry modEntry = ModuleRegistry.INVMANAGER; + InvManager invManager = modEntry.getModule(); + invManager.handleSettingEvent((cc.novoline.events.events.SettingEvent)null); + modEntry = ModuleRegistry.AUTOARMOR; + AutoArmor autoArmor = modEntry.getModule(); + autoArmor.handleSettingEvent((cc.novoline.events.events.SettingEvent)null); + modEntry = ModuleRegistry.SCAFFOLD; + Scaffold scaffold = modEntry.getModule(); + scaffold.handleSettingEvent((SettingEvent)null); + modEntry = ModuleRegistry.SPEED; + Speed speedMod = modEntry.getModule(); + speedMod.handleSettingEvent((SettingEvent)null); + modEntry = ModuleRegistry.GAMESPEED; + GameSpeed gameSpeed = modEntry.getModule(); + gameSpeed.handleSettingEvent((cc.novoline.events.events.SettingEvent)null); + modEntry = ModuleRegistry.BLINK; + Blink blink = modEntry.getModule(); + blink.handleSettingEvent((cc.novoline.events.events.SettingEvent)null); + modEntry = ModuleRegistry.NOFALL; + NoFall noFall = modEntry.getModule(); + noFall.handleSettingEvent((cc.novoline.events.events.SettingEvent)null); + } +} + + public boolean matchesFlag(boolean flag) { + int intVal; + boolean flag2; + intVal = h(); + flag2 = ServerUtils.isHypixel(); + + if (!flag2) { + BooleanProperty boolProp = this.clickBypass; + Boolean propFlag = boolProp.get(); + flag2 = propFlag; + + if (!flag2) { + return false; + } + } + + EntityPlayerSP player = this.mc.thePlayer; + flag2 = player.isMoving(); + + if (!flag2) { + return false; + } + + TimerUtil timerUtil = this.timer; + flag2 = timerUtil.delay(160L); + + if (flag2) { + return true; + } else { + return intVal != 0 ? flag : !flag; + } +} + + private void handleEvent(Event event) { + cc.novoline.modules.exploits.Disabler disabler; + cc.novoline.modules.exploits.Disabler disabler2; + int intVal = getIntValue(); + short shortVal = (short)(event instanceof WindowClickEvent ? 1 : 0); + + if ((shortVal != 0)) { + label224: { + WindowClickEvent windowClickEvent = (WindowClickEvent)event; + String textStr = "In Motion Click was cancelled to keep your safety"; + BooleanProperty boolProp = this.clickBypass; + Boolean propFlag = boolProp.get(); + if (propFlag) { + label233: { + C0EPacketClickWindow clickWindowPacket = windowClickEvent.getPacket(); + boolean flag = clickWindowPacket.isBypassableInventoryClick(); + if (windowClickEvent.getMode() == PlayerControllerMPMode.PRE) { + EntityPlayerSP player = this.mc.thePlayer; + boolean flag2 = player.isMoving(); + + if (!flag2) { + break label233; + } + + flag2 = flag; + + + if (flag2) { + break label233; + } + + this.popNotification(this.getDisplayName(), textStr, 2500, NotificationType.WARNING); + windowClickEvent.setCancelled(true); + break label233; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + boolean flag3 = player2.isMoving(); + + if (!flag3) { + break label233; + } + + flag3 = flag; + + + if (flag3) { + this.performStep12(); + } + } + + break label224; + } + + label205: + if (windowClickEvent.getMode() == PlayerControllerMPMode.PRE) { + + boolean flag4 = ServerUtils.isHypixel(); + if (!flag4) { + break label205; + } + + disabler = this; + + EntityPlayerSP player3 = this.mc.thePlayer; + flag4 = player3.isMoving(); + + if (!flag4) { + break label205; + } + + disabler = this; + + disabler.popNotification(this.getDisplayName(), textStr, 2500, NotificationType.WARNING); + windowClickEvent.setCancelled(true); + } + } + + return; + } + + shortVal = (short)(event instanceof PacketEvent ? 1 : 0); + + + + if ((shortVal != 0)) { + label238: { + PacketEvent packetEvent = (PacketEvent)event; + PacketEvent packetEvent2 = packetEvent; + + if (packetEvent.getState() != State.OUTGOING) { + break label238; + } + + packetEvent2 = packetEvent; + + + Packet packet = packetEvent2.getPacket(); + boolean flag5 = packet instanceof C16PacketClientStatus; + if (intVal != 0) { + if (flag5) { + label174: { + C16PacketClientStatus clientStatusPacket = (C16PacketClientStatus)packet; + Object obj = clientStatusPacket.obtainEnumState(); + if (obj != C16PacketClientStatus$EnumState.OPEN_INVENTORY_ACHIEVEMENT) { + break label174; + } + + BooleanProperty boolProp2 = this.clickBypass; + obj = boolProp2.get(); + + Boolean flag6 = (Boolean)obj; + if (flag6) { + packetEvent.setCancelled(true); + } + } + + break label238; + } + + flag5 = packet instanceof C0FPacketConfirmTransaction; + } + + + if (flag5) { + label241: { + C0FPacketConfirmTransaction confirmTransactionPacket = (C0FPacketConfirmTransaction)packet; + int intVal2 = confirmTransactionPacket.getWindowId(); + + if (intVal2 != 0) { + break label241; + } + + intVal2 = confirmTransactionPacket.getUid2(); + + + if (intVal2 >= 0) { + break label241; + } + + BooleanProperty boolProp3 = this.pingSpoof; + Boolean propFlag2 = boolProp3.get(); + intVal2 = (propFlag2 ? 1 : 0); + + if (intVal2 == 0) { + break label241; + } + + List itemList = this.packetList; + itemList.add(packet); + + packetEvent.setCancelled(true); + } + + break label238; + } + + flag5 = packet instanceof C00PacketKeepAlive; + + + if (!flag5) { + break label238; + } + + BooleanProperty boolProp4 = this.pingSpoof; + Boolean propFlag3 = boolProp4.get(); + flag5 = propFlag3; + + if (!flag5) { + break label238; + } + + List itemList2 = this.packetList; + Packet packet2 = packetEvent.getPacket(); + itemList2.add(packet2); + + packetEvent.setCancelled(true); + } + + return; + } + + shortVal = (short)(event instanceof MotionUpdateEvent ? 1 : 0); + + + if ((shortVal == 0)) { + return; + } + + BooleanProperty boolProp5 = this.pingSpoof; + Boolean propFlag4 = boolProp5.get(); + shortVal = (short)(propFlag4 ? 1 : 0); + + if ((shortVal != 0)) { + MotionUpdateEvent motionUpdateEvent = (MotionUpdateEvent)event; + if (motionUpdateEvent.getState() == cc.novoline.events.type.State.PRE) { + label256: { + boolean flag7 = this.checkState5(); + + if (flag7) { + shortVal = 3980; + break label256; + } + + flag7 = this.isEnabled(ModuleRegistry.FIREBALL); + + + + if (flag7) { + break label256; + } + + flag7 = this.isEnabled(ModuleRegistry.LONGJUMP); + + + if (flag7) { + shortVal = 240; + } + } + + TimerUtil timerUtil = this.timer2; + long longVal = this.stateTicks; + boolean flag8 = timerUtil.delay(longVal); + if (!flag8) { + return; + } + + disabler2 = this; + + List itemList3 = this.packetList; + flag8 = itemList3.isEmpty(); + + if (flag8) { + return; + } + + disabler2 = this; + + disabler2.performStep10(); + } + } +} + + public void performStep10() { + List itemList = this.packetList; + Stream stream2 = itemList.stream(); + Predicate predicate = (Packet packet3) -> packet3 instanceof C00PacketKeepAlive; + Stream stream3 = stream2.filter(predicate); + Consumer> consumer = this::applyInt5; + stream3.forEach(consumer); + itemList = this.packetList; + Stream stream4 = itemList.stream(); + predicate = (Packet packet4) -> packet4 instanceof C0FPacketConfirmTransaction; + Stream stream5 = stream4.filter(predicate); + Consumer> consumer2 = this::applyInt5; + stream5.forEach(consumer2); + itemList = this.packetList; + itemList.clear(); + IntProperty intProp = this.pingDelay; + Integer intVal = intProp.get(); + this.stateTicks = intVal - 10; + TimerUtil timerUtil = this.timer2; + timerUtil.reset(); +} + + public void performStep11() { + this.timer2.reset(); +} + + static { + handleInt(0); + } + + public void performStep12() { + TimerUtil timerUtil = this.timer; + if (!timerUtil.delay(160L)) { + return; + } + + this.sendPacketNoEvent(new C0DPacketCloseWindow(0)); + timerUtil = this.timer; + + timerUtil.reset(); +} + + public static int h() { + return intState2; +} + + public void applyUpdate2(int value) { + int intVal = 0; + int intVal3 = 0; + + while (true) { + List itemList3 = this.packetList; + if (intVal3 >= itemList3.size()) { + break; + } + + List itemList = this.packetList; + Packet packet = (Packet)itemList.get(intVal3); + + if (packet instanceof C0FPacketConfirmTransaction) { + if (intVal == value) { + this.applyInt5(packet); + List itemList2 = this.packetList; + itemList2.remove(intVal3); + } + + intVal++; + } + + intVal3++; + + } +} + + @EventTarget + public void onLoadWorld(LoadWorldEvent event) { + this.performStep10(); +} + + private boolean matchesBlockPos(BlockPos pos) { + IBlockState blockState = this.mc.theWorld.getBlockState(pos); + Block block = blockState.getBlock(); + Block block2 = block; + Block block3 = Blocks.chest; + if (block == Blocks.chest) { + return true; + } + + block2 = block; + block3 = Blocks.crafting_table; + + if (block2 == block3) { + return true; + } + + block2 = block; + block3 = Blocks.dropper; + + if (block2 == block3) { + return true; + } + + block2 = block; + block3 = Blocks.dispenser; + + if (block2 == block3) { + return true; + } + + block2 = block; + block3 = Blocks.trapped_chest; + + + if (block2 == block3) { + return true; + } + + block2 = block; + + block3 = Blocks.furnace; + + + if (block2 == block3) { + return true; + } + + block2 = block; + + Block block4 = Blocks.hopper; + if (block2 == Blocks.hopper) { + return true; + } + + block2 = block; + block4 = Blocks.command_block; + + if (block2 == block4) { + return true; + } + + block2 = block; + block4 = Blocks.ender_chest; + + return block2 == block4; +} + + public boolean checkState4() { + Boolean propFlag = this.pingSpoof.get(); + return propFlag; +} + + public static void handleInt(int value) { + intState2 = value; +} + + public void applyUpdate3(int value) { + this.stateTicks = value - 10; +} + + private boolean checkState5() { + GameSpeed gameSpeed = ModuleRegistry.GAMESPEED.getModule(); + Blink blink = ModuleRegistry.BLINK.getModule(); + boolean enabled = gameSpeed.isEnabled(); + if (enabled) { + StringProperty strProp = gameSpeed.getStringProperty3(); + boolean flag = strProp.equals("Balance"); + + if (flag) { + return true; + } + } + + enabled = blink.isEnabled(); + + if (!enabled) { + return false; + } + + StringProperty strProp2 = blink.getStringPropertyValue(); + enabled = strProp2.equals("Basic"); + + return enabled; +} + + public void updateHelper2() { + this.sendPacketNoEvent(new C0DPacketCloseWindow(0)); + this.timer.reset(); +} + + public List getPacketList() { + return this.packetList; +} + + @EventTarget + public void handleWindowClickEvent(WindowClickEvent event) { + this.handleEvent((Event)event); +} + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + this.handleEvent(event); +} + + @EventTarget + public void onPacket(PacketEvent event) { + this.handleEvent(event); +} + + + public static int getIntValue() { + int intVal = h(); + return intVal == 0 ? 48 : 0; +} + + public Disabler(ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + this(moduleManager, enumModuleType, text, prepareDisablerInit(moduleManager, enumModuleType, text)); +} + + private static int prepareDisablerInit(ModuleManager manager, EnumModuleType type, String text) { + String textStr = text; + EnumModuleType modCategory = type; + ModuleManager modManager = manager; + int intVal = getIntValue(); + String textStr2 = textStr; + EnumModuleType modCategory2 = modCategory; + ModuleManager modManager2 = modManager; + return intVal; +} + + private Disabler(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, int value) { + super(moduleManager, enumModuleType, text); + this.pingSpoof = BooleanProperty.of(true); + IntProperty intProp = IntProperty.of(400); + Integer intVal2 = 300; + IntProperty intProp2 = intProp.minimum(intVal2); + this.pingDelay = intProp2.maximum(800); + this.clickBypass = BooleanProperty.of(true); + this.packetList = new ArrayList<>(); + IntProperty intProp3 = this.pingDelay; + Integer intVal = intProp3.get(); + this.stateTicks = intVal - 10; + this.timer2 = new TimerUtil(); + this.timer = new TimerUtil(); + Setting setting = new Setting("DISABLER_PING_SPOOF", "Ping Spoof", SettingType.SEPARATOR, this); + SettingManager.register(setting); + Setting setting2 = new Setting("DISABLER_PING_SPOOF_TOGGLE", "Enabled", SettingType.CHECKBOX, this, this.pingSpoof); + SettingManager.register(setting2); + Setting setting3 = new Setting("DISABLER_PING_DELAY", "Ping Delay", SettingType.SLIDER, this, this.pingDelay, 50.0, "ms", () -> this.pingSpoof.get()); + SettingManager.register(setting3); + Setting setting4 = new Setting("DISABLER_CLICK_BYPASS_SEPARATOR", "Inventory Click Bypass", SettingType.SEPARATOR, this); + SettingManager.register(setting4); + Setting setting5 = new Setting("DISABLER_CLICK_BYPASS_ENABLED", "Enabled", SettingType.CHECKBOX, this, this.clickBypass); + SettingManager.register(setting5); +} + + + public void handleSettingEvent(SettingEvent event) { + label27: { + SettingEvent settingEvent = event; + + if (event == null) { + break label27; + } + + settingEvent = event; + + + boolean flag = settingEvent.getSettingName().equals("DISABLER_PING_SPOOF_TOGGLE"); + + if (flag) { + break label27; + } + + flag = event.getSettingName().equals("DISABLER_CLICK_BYPASS_ENABLED"); + + + if (!flag) { + return; + } + } + + ModuleRegistry modEntry = ModuleRegistry.SCAFFOLD; + Scaffold scaffold = modEntry.getModule(); + scaffold.handleSettingEvent((SettingEvent)null); + modEntry = ModuleRegistry.SPEED; + Speed speedMod = modEntry.getModule(); + speedMod.handleSettingEvent((SettingEvent)null); +} + +} diff --git a/src/main/java/cc/novoline/modules/exploits/Fireball.java b/src/main/java/cc/novoline/modules/exploits/Fireball.java new file mode 100644 index 0000000..03d8ceb --- /dev/null +++ b/src/main/java/cc/novoline/modules/exploits/Fireball.java @@ -0,0 +1,313 @@ +package cc.novoline.modules.exploits; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.combat.KillAura; +import cc.novoline.modules.player.Scaffold; +import cc.novoline.modules.ModuleRegistry; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.minecraft.network.play.server.S30PacketWindowItems; +import net.minecraft.network.play.server.S27PacketExplosion; +import net.minecraft.util.MathHelper; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.network.play.client.C0EPacketClickWindow; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.server.S2FPacketSetSlot; +import org.jetbrains.annotations.NotNull; + +public class Fireball extends AbstractModule { + private int stateTicks; + private int stateTicks2; + private boolean stateFlag; + private boolean stateFlag2; + private int stateTicks3; + private boolean stateFlag3; + + @Override + public void onEnable() { + AbstractModule mod = this; + if (this.computeIntValue() == -1) { + this.applyString2("No fireballs in inventory", 2500); + return; + } + + this.stateTicks3 = this.computeIntValue(); + ModuleRegistry modEntry = ModuleRegistry.DISABLER; + mod = modEntry.getModule(); + + Disabler disabler = (Disabler)mod; + label24: + if (disabler.isEnabled()) { + Disabler disabler2 = disabler; + if (!disabler.checkState4()) { + break label24; + } + + disabler2 = disabler; + + disabler2.performStep10(); + } + + this.stateTicks2 = 0; + this.stateTicks = 0; + this.stateFlag2 = false; + this.stateFlag3 = true; +} + + private int computeIntValue() { + return this.mc.thePlayer.inventory.getInventorySlotContainItem(Items.fire_charge); +} + + @EventTarget + public void onPacket(PacketEvent event) { + cc.novoline.modules.exploits.Fireball fireball; + PacketEvent packetEvent = event; + if (event.getState() != State.INCOMING) { + return; + } + + packetEvent = event; + + boolean flag = packetEvent.getPacket() instanceof S27PacketExplosion; + if (flag) { + S27PacketExplosion explosionPacket = (S27PacketExplosion)event.getPacket(); + this.mc.thePlayer.motionX = explosionPacket.computeFloat2(); + this.mc.thePlayer.motionY = explosionPacket.getMotionY(); + this.mc.thePlayer.motionZ = explosionPacket.getMotionZ(); + event.setCancelled(true); + return; + } + + flag = event.getPacket() instanceof S12PacketEntityVelocity; + + if (flag) { + label95: { + S12PacketEntityVelocity entityVelocityPacket = (S12PacketEntityVelocity)event.getPacket(); + int intVal = entityVelocityPacket.getEntityID(); + EntityPlayerSP player = this.mc.thePlayer; + if (intVal != player.getEntityId()) { + break label95; + } + + this.mc.thePlayer.motionX = entityVelocityPacket.computeDouble3(); + this.mc.thePlayer.motionY = entityVelocityPacket.computeDouble(); + this.mc.thePlayer.motionZ = entityVelocityPacket.computeDouble2(); + this.stateTicks2 = 10; + + event.setCancelled(true); + } + + return; + } + + flag = event.getPacket() instanceof S30PacketWindowItems; + + if (flag) { + if (!this.stateFlag) { + return; + } + + event.setCancelled(true); + return; + } + + flag = event.getPacket() instanceof S2FPacketSetSlot; + + + if (flag) { + label125: { + + S2FPacketSetSlot setSlotPacket = (S2FPacketSetSlot)event.getPacket(); + int slot = setSlotPacket.getSlot(); + + if (slot != 36 + this.mc.thePlayer.inventory.currentItem) { + break label125; + } + + fireball = this; + + slot = (this.stateFlag ? 1 : 0); + + + if (slot == 0) { + break label125; + } + + fireball = this; + + InventoryPlayer inventory2 = fireball.mc.thePlayer.inventory; + int ticks = this.stateTicks3; + ItemStack stack2 = inventory2.getStackInSlot(ticks); + + label59: + if (stack2 != null) { + ItemStack stack = stack2; + + if (stack2.stackSize < 2) { + InventoryPlayer inventory3 = this.mc.thePlayer.inventory; + ticks = this.stateTicks3; + inventory3.setInventorySlotContents(ticks, null); + break label59; + } + + stack = stack2; + + + stack.stackSize--; + InventoryPlayer inventory4 = this.mc.thePlayer.inventory; + ticks = this.stateTicks3; + inventory4.setInventorySlotContents(ticks, stack2); + } + + event.setCancelled(true); + + + this.stateFlag = false; + } + + return; + } + + flag = event.getPacket() instanceof S08PacketPlayerPosLook; + + + if (flag) { + this.applyInt5(this.getClass()); + } +} + + private void applyInt2(int value) { + short shortVal = this.mc.thePlayer.inventoryContainer.executeStep(); + int slot = this.mc.thePlayer.inventory.currentItem; + this.sendPacketNoEvent(new C0EPacketClickWindow(0, value, slot, 2, null, shortVal)); +} + + private void handleInt(int value, Disabler disabler, KillAura killAura) { + int intVal = value; + byte byteVal = 9; + if (value < 9) { + intVal = (killAura.evaluateFlag("Hypixel") ? 1 : 0); + + if (intVal != 0) { + this.callbackTask3.run(); + } + } + + intVal = value; + + byteVal = 9; + + label35: { + if (intVal < byteVal) { + this.sendPacketNoEvent(new C09PacketHeldItemChange(this.computeIntValue())); + break label35; + } + + this.applyInt2(value); + } + + label30: { + Fireball fireball = this; + this.sendPacketNoEvent(new C08PacketPlayerBlockPlacement(new ItemStack(Items.obtainItem2()))); + if (value < 9) { + this.sendPacketNoEvent(new C09PacketHeldItemChange(this.mc.thePlayer.inventory.currentItem)); + break label30; + } + + fireball = this; + + fireball.applyInt2(value); + } + + if (value > 8) { + disabler.performStep12(); + this.stateFlag = true; + } +} + + public Fireball(@NotNull ModuleManager moduleManager, @NotNull EnumModuleType enumModuleType, @NotNull String text) { + super(moduleManager, enumModuleType, text); +} + + @EventTarget(0) + public void onMotionUpdate(MotionUpdateEvent event) { + cc.novoline.modules.exploits.Fireball fireball; + label56: + if (this.stateFlag3) { + label54: { + MotionUpdateEvent motionUpdateEvent = event; + if (event.getState() != cc.novoline.events.type.State.PRE) { + break label54; + } + + float floatVal = this.mc.thePlayer.getMoveDirection(-180.0F); + event.setYaw(floatVal); + motionUpdateEvent = event; + + float floatVal2 = 78.0F + MathHelper.resolveInt3(0.1F, 0.3F); + motionUpdateEvent.setPitch(floatVal2); + + break label56; + + } + + int ticks = this.stateTicks3; + Disabler disabler = ModuleRegistry.DISABLER.getModule(); + this.handleInt(ticks, disabler, ModuleRegistry.KILLAURA.getModule()); + this.stateFlag3 = false; + } + + if (event.getState() == cc.novoline.events.type.State.PRE) { + int ticks2 = this.stateTicks2; + + if (this.stateTicks2 > 0) { + this.stateTicks2--; + } + + ticks2 = this.stateTicks2; + + + + if (ticks2 == 9) { + EntityPlayerSP player = this.mc.thePlayer; + EntityPlayerSP player2 = this.mc.thePlayer; + double speed = player2.getSpeed() * 3.8; + player.setMoveSpeed(speed); + this.stateFlag2 = true; + } + + ticks2 = (this.mc.thePlayer.onGround ? 1 : 0); + + + + if (ticks2 == 0) { + return; + } + + fireball = this; + + ticks2 = (this.stateFlag2 ? 1 : 0); + + + if (ticks2 == 0) { + return; + } + + fireball = this; + + fireball.applyInt5(this.getClass()); + } +} +} diff --git a/src/main/java/cc/novoline/modules/exploits/NoFall.java b/src/main/java/cc/novoline/modules/exploits/NoFall.java new file mode 100644 index 0000000..165c98f --- /dev/null +++ b/src/main/java/cc/novoline/modules/exploits/NoFall.java @@ -0,0 +1,656 @@ +package cc.novoline.modules.exploits; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.HypixelLobbyType; +import cc.novoline.utils.ServerUtils; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.render.RotationAngleUtil; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.LoadWorldEvent; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.SettingEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.ModuleRegistry; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Consumer; +import net.minecraft.block.BlockFlowingWater; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.minecraft.network.play.client.C05PacketPlayerLook; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.entity.player.PlayerCapabilities; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.network.Packet; + +public final class NoFall extends AbstractModule { + @Property("hypixel-mode") + private StringProperty hypixelMode; + private double cachedValue; + private List c03PacketPlayerList; + private int stateTicks; + @Property("void-check") + private BooleanProperty voidCheck; + @Property("mode") + private StringProperty mode; + private int stateTicks2; + private boolean stateFlag; + private double cachedValue2; + + @EventTarget + public void onMotionUpdate1(MotionUpdateEvent event) { + cc.novoline.modules.exploits.NoFall noFall; + HypixelLobbyType lobbyType = HypixelLobbyType.LOBBY; + boolean flag = ServerUtils.serverIs(lobbyType); + if (flag) { + return; + } + + lobbyType = HypixelLobbyType.PRE; + flag = ServerUtils.serverIs(lobbyType); + + if (flag) { + return; + } + + flag = event.getState().equals(State.PRE); + + if (!flag) { + return; + } + + StringProperty strProp = this.mode; + flag = strProp.equals("NoGround"); + + if (flag) { + this.updateHelper3(event); + return; + } + + StringProperty strProp2 = this.mode; + flag = strProp2.b("Spoof"); + + if (flag) { + this.applyMotionUpdateEvent3(event); + return; + } + + StringProperty strProp3 = this.mode; + flag = strProp3.b("Packet"); + + if (flag) { + this.applyMotionUpdateEvent(event); + return; + } + + noFall = this; + + StringProperty strProp4 = this.mode; + flag = strProp4.b("Hypixel"); + + if (!flag) { + return; + } + + noFall = this; + + noFall.handleMotionUpdateEvent(event, ModuleRegistry.DISABLER.getModule()); +} + + + public StringProperty getMode() { + return this.mode; +} + + public StringProperty getStringPropertyC() { + return this.getMode(); +} + + + public boolean evaluateFlag(double value) { + double dist; + int intVal = (dist = this.mc.thePlayer.fallDistance - value) == 0.0 ? 0 : (dist < 0.0 ? -1 : 1); + if (intVal <= 0) { + return false; + } + + if (this.mc.thePlayer.prevPosY - this.mc.thePlayer.posY <= 0.0) { + return false; + } + + BooleanProperty boolProp = this.voidCheck; + Boolean propFlag = boolProp.get(); + intVal = (propFlag ? 1 : 0); + + if (intVal != 0) { + EntityPlayerSP player = this.mc.thePlayer; + intVal = (player.isConditionMet13() ? 1 : 0); + + if (intVal == 0) { + return false; + } + } + + EntityPlayerSP player2 = this.mc.thePlayer; + intVal = (player2.isSpectator() ? 1 : 0); + + if (intVal != 0) { + return false; + } + + PlayerCapabilities playerCapabilities = this.mc.thePlayer.capabilities; + intVal = (playerCapabilities.evaluateCondition4() ? 1 : 0); + + return intVal == 0; +} + + public NoFall(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.c03PacketPlayerList = new ArrayList<>(); + StringProperty strProp = StringProperty.of("Hypixel"); + String[] stringArr = new String[]{"Spoof", "Packet", "NoGround", "Legit", "Hypixel"}; + this.mode = strProp.acceptableValues(stringArr); + StringProperty strProp2 = StringProperty.of("Packet"); + stringArr = new String[]{"Spoof", "Packet"}; + this.hypixelMode = strProp2.acceptableValues(stringArr); + this.voidCheck = BooleanProperty.of(true); + Setting setting = new Setting("NF_MODE", "Mode", SettingType.COMBOBOX, this, this.mode); + SettingManager.register(setting); + setting = new Setting("NF_HYPIXEL_MODE", "Hypixel Mode", SettingType.COMBOBOX, this, this.hypixelMode, () -> this.mode.equals("Hypixel")); + SettingManager.register(setting); + setting = new Setting("NF_VOID_CHECK", "Void Check", SettingType.CHECKBOX, this, this.voidCheck); + SettingManager.register(setting); +} + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + this.handleString3(this.mode.get()); +} + + private void handleAction(MotionUpdateEvent event) { + int intVal; + intVal = (this.checkState6() ? 1 : 0); + + if (intVal != 0) { + intVal = this.getIntValue(); + + if (intVal != -1) { + this.stateFlag = true; + EntityPlayerSP player = this.mc.thePlayer; + double motionY2 = this.mc.thePlayer.motionY; + motionY2 = Math.abs(motionY2); + if (!player.matchesDouble(motionY2)) { + return; + } + + label35: { + MotionUpdateEvent motionUpdateEvent = event; + + if (event.getState() != State.PRE) { + break label35; + } + + motionUpdateEvent = event; + + + motionUpdateEvent.setPitch(90.0F); + + return; + + } + + this.sendPacketNoEvent(new C09PacketHeldItemChange(this.getIntValue())); + InventoryPlayer inventory2 = this.mc.thePlayer.inventory; + int intVal2 = this.getIntValue(); + this.sendPacketNoEvent(new C08PacketPlayerBlockPlacement(inventory2.getStackInSlot(intVal2))); + return; + } + } + + intVal = (this.stateFlag ? 1 : 0); + + if (intVal != 0) { + if (event.getState() == State.PRE) { + EntityPlayerSP player2 = this.mc.thePlayer; + BlockFlowingWater blockFlowingWater = Blocks.flowing_water; + float[] floatArr = RotationAngleUtil.evaluateFloat2(player2.findNearestBlock(blockFlowingWater)); + float floatVal = floatArr[0]; + event.setYaw(floatVal); + float floatVal2 = floatArr[1]; + event.setPitch(floatVal2); + return; + } + + this.sendPacketNoEvent(new C08PacketPlayerBlockPlacement(new ItemStack(Items.bucket))); + this.sendPacketNoEvent(new C09PacketHeldItemChange(this.mc.thePlayer.inventory.currentItem)); + this.stateFlag = false; + } +} + + @Override + public void onEnable() { + this.handleString3(this.mode.get()); +} + + @EventTarget + public void onLoadWorld(LoadWorldEvent event) { + this.mc.thePlayer.fallDistance = 0.0F; + this.mc.timer.timerSpeed = 1.0F; + this.stateFlag = false; +} + + private void applyMotionUpdateEvent(MotionUpdateEvent event) { + NoFall noFall; + boolean flag = this.checkState6(); + if (flag) { + label43: { + this.stateFlag = true; + NoFall noFall2 = this; + if (!(this.cachedValue + this.mc.thePlayer.fallDistance - this.cachedValue2 > 3.0)) { + noFall = this; + + if (!(this.mc.thePlayer.fallDistance > 3.0F)) { + break label43; + } + + noFall = this; + + if (this.cachedValue != 0.0) { + break label43; + } + } + + Boolean flag2 = Boolean.TRUE; + this.sendPacket(new C03PacketPlayer(this.stateFlag = flag2)); + noFall2 = this; + + noFall2.cachedValue = 0.0; + } + + this.cachedValue = this.cachedValue + (this.mc.thePlayer.fallDistance - this.cachedValue2); + noFall = this; + + noFall.cachedValue2 = this.mc.thePlayer.fallDistance; + return; + } + + noFall = this; + + if (!this.stateFlag) { + return; + } + + this.cachedValue = 0.0; + this.cachedValue2 = 0.0; + noFall = this; + + noFall.stateFlag = false; +} + + private int getIntValue() { + return this.mc.thePlayer.computeItemInt(Items.water_bucket); +} + + + private void updateHelper3(MotionUpdateEvent event) { + cc.novoline.modules.exploits.NoFall noFall; + boolean flag; + label41: { + + boolean flag2 = this.checkState6(); + if (flag2) { + this.stateFlag = true; + break label41; + } + + noFall = this; + + EntityPlayerSP player = this.mc.thePlayer; + flag2 = player.isInWater(); + + if (!flag2) { + noFall = this; + + EntityPlayerSP player2 = this.mc.thePlayer; + if (!player2.isConditionMet4()) { + EntityPlayerSP player3 = this.mc.thePlayer; + flag = player3.isOnLadder(); + + if (!flag) { + break label41; + } + } + } + + noFall = this; + + noFall.stateFlag = false; + } + + flag = this.stateFlag; + + if (flag) { + event.setOnGround(false); + } +} + + @EventTarget(0) + public void onMotionUpdate2(MotionUpdateEvent event) { + NoFall noFall = this; + + StringProperty strProp = this.mode; + if (!strProp.equals("Legit")) { + return; + } + + noFall = this; + + + noFall.handleAction(event); +} + + + public boolean checkState6() { + float distanceF; + int intVal = (distanceF = this.mc.thePlayer.fallDistance - 3.0F) == 0.0F ? 0 : (distanceF < 0.0F ? -1 : 1); + if (intVal <= 0) { + return false; + } + + if (this.mc.thePlayer.prevPosY - this.mc.thePlayer.posY <= 0.0) { + return false; + } + + BooleanProperty boolProp = this.voidCheck; + Boolean propFlag = boolProp.get(); + intVal = (propFlag ? 1 : 0); + + if (intVal == 0) { + return true; + } + + EntityPlayerSP player = this.mc.thePlayer; + return player.isConditionMet13(); +} + + private void handleMotionUpdateEvent(MotionUpdateEvent event, Disabler disabler) { + int size2; + java.util.List c03PacketPlayerList2; + NoFall noFall; + boolean flag = this.checkState6(); + if (flag) { + label51: { + disabler.applyUpdate3(1200); + this.mc.timer.timerSpeed = 1.0F; + this.stateFlag = true; + if (this.cachedValue + this.mc.thePlayer.fallDistance - this.cachedValue2 <= 3.0) { + if (this.mc.thePlayer.fallDistance <= 3.0F) { + break label51; + } + + if (this.cachedValue != 0.0) { + break label51; + } + } + + this.cachedValue = 0.0; + List itemList = this.c03PacketPlayerList; + float yaw = event.getYaw(); + itemList.add(new C05PacketPlayerLook(yaw, event.getPitch(), true)); + + this.mc.timer.timerSpeed = 0.5F; + } + + this.cachedValue = this.cachedValue + (this.mc.thePlayer.fallDistance - this.cachedValue2); + this.cachedValue2 = this.mc.thePlayer.fallDistance; + List itemList2 = this.c03PacketPlayerList; + C03PacketPlayer playerPacket = event.toPlayerPacket(); + itemList2.add(playerPacket); + event.setCancelled(true); + c03PacketPlayerList2 = this.c03PacketPlayerList; + + size2 = c03PacketPlayerList2.size(); + + if (size2 <= 19) { + return; + } + + List itemList3 = this.c03PacketPlayerList; + Consumer consumer = this::handlePacket; + itemList3.forEach(consumer); + c03PacketPlayerList2 = this.c03PacketPlayerList; + + c03PacketPlayerList2.clear(); + return; + } + + noFall = this; + + if (!this.stateFlag) { + return; + } + + List itemList4 = this.c03PacketPlayerList; + Consumer consumer2 = this::handlePacket; + itemList4.forEach(consumer2); + List itemList5 = this.c03PacketPlayerList; + itemList5.clear(); + this.cachedValue = 0.0; + this.cachedValue2 = 0.0; + this.mc.timer.timerSpeed = 1.0F; + noFall = this; + + noFall.stateFlag = false; +} + + + @EventTarget + public void onPacket(PacketEvent event) { + PacketEvent packetEvent = event; + if (event.getState() != cc.novoline.events.State.INCOMING) { + return; + } + + packetEvent = event; + + Packet packet = packetEvent.getPacket(); + if (!(packet instanceof S12PacketEntityVelocity)) { + return; + } + + packet = event.getPacket(); + + S12PacketEntityVelocity entityVelocityPacket = (S12PacketEntityVelocity)packet; + int intVal = entityVelocityPacket.getEntityID(); + EntityPlayerSP player = this.mc.thePlayer; + if (intVal != player.getEntityId()) { + return; + } + + intVal = (this.checkState6() ? 1 : 0); + + if (intVal != 0) { + event.setCancelled(true); + } +} + + public void handleSettingEvent(SettingEvent event) { + cc.novoline.modules.configurations.property.object.StringProperty strProp; + boolean flag; + + label64: { + SettingEvent settingEvent = event; + + if (event == null) { + break label64; + } + + settingEvent = event; + + + flag = settingEvent.getSettingName().equals("NF_MODE"); + + if (!flag) { + flag = event.getSettingName().equals("DISABLER_PING_SPOOF_TOGGLE"); + + if (!flag) { + return; + } + } + } + + StringProperty strProp2 = this.mode; + flag = strProp2.equals("Hypixel"); + + + if (flag) { + label40: { + ModuleRegistry modEntry = ModuleRegistry.DISABLER; + Disabler disabler = modEntry.getModule(); + + if (disabler.isEnabled()) { + if (disabler.checkState4()) { + break label40; + } + } + + this.popNotification(this.getDisplayName(), "You need to enabled Disabler module and Ping Spoof option in it to use HYPIXEL mode", 3500, NotificationType.WARNING); + + + StringProperty strProp3 = this.mode; + strProp3.set("Legit"); + } + + + return; + + } + + strProp = this.mode; + + String[] stringArr = new String[]{"Legit", "NoGround"}; + flag = strProp.b(stringArr); + + + if (flag) { + return; + } + + String displayName = this.getDisplayName(); + StringBuilder sb = new StringBuilder(); + sb = sb.append("Mode was set to LEGIT Mode due to unstable "); + StringProperty strProp4 = this.mode; + String propStr = strProp4.get(); + sb = sb.append(propStr); + this.popNotification(displayName, sb.append(" bypass").toString(), 3500, NotificationType.WARNING); + strProp = this.mode; + + strProp.set("Legit"); +} + + @Override + public void onDisable() { + this.mc.timer.timerSpeed = 1.0F; +} + + private void applyMotionUpdateEvent2(MotionUpdateEvent event) { + NoFall noFall; + boolean flag = this.checkState6(); + if (flag) { + label43: { + this.stateFlag = true; + NoFall noFall2 = this; + if (!(this.cachedValue + this.mc.thePlayer.fallDistance - this.cachedValue2 > 3.0)) { + if (this.mc.thePlayer.fallDistance <= 3.0F) { + break label43; + } + + if (this.cachedValue != 0.0) { + break label43; + } + } + + noFall2 = this; + + noFall2.cachedValue = 0.0; + event.setOnGround(true); + } + + this.cachedValue = this.cachedValue + (this.mc.thePlayer.fallDistance - this.cachedValue2); + this.cachedValue2 = this.mc.thePlayer.fallDistance; + List itemList = this.c03PacketPlayerList; + C03PacketPlayer playerPacket = event.toPlayerPacket(); + itemList.add(playerPacket); + + event.setCancelled(true); + return; + } + + noFall = this; + + if (!this.stateFlag) { + return; + } + + List itemList2 = this.c03PacketPlayerList; + Consumer consumer = this::handlePacket; + itemList2.forEach(consumer); + List itemList3 = this.c03PacketPlayerList; + itemList3.clear(); + this.cachedValue = 0.0; + this.cachedValue2 = 0.0; + noFall = this; + + noFall.stateFlag = false; +} + + private void applyMotionUpdateEvent3(MotionUpdateEvent event) { + NoFall noFall; + + int intVal = (this.checkState6() ? 1 : 0); + + if (intVal != 0) { + this.stateTicks++; + + if (this.stateTicks % 2 == 0) { + return; + } + + event.setOnGround(true); + + + return; + } + + noFall = this; + + intVal = this.stateTicks; + + + if (intVal <= 0) { + return; + } + + noFall = this; + + noFall.stateTicks = 0; +} + +} diff --git a/src/main/java/cc/novoline/modules/exploits/Phase.java b/src/main/java/cc/novoline/modules/exploits/Phase.java new file mode 100644 index 0000000..5c728f4 --- /dev/null +++ b/src/main/java/cc/novoline/modules/exploits/Phase.java @@ -0,0 +1,182 @@ +package cc.novoline.modules.exploits; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.CollideWithBlockEvent; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.MoveEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C04PacketPlayerPosition; +import net.minecraft.util.MathHelper; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.client.entity.EntityPlayerSP; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class Phase extends AbstractModule { + @Property("mode") + private StringProperty mode; + @Property("hieght") + private IntProperty hieght; + + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + net.minecraft.client.entity.EntityPlayerSP player; + boolean flag = this.mode.equals("Normal"); + + if (!flag) { + return; + } + + flag = event.getState().equals(State.PRE); + + + if (flag) { + this.mc.thePlayer.stepHeight = 0.015625F; + EntityPlayerSP player2 = this.mc.thePlayer; + float floatVal = player2.getMovementInput().getMoveStrafe(); + EntityPlayerSP player3 = this.mc.thePlayer; + float floatVal2 = player3.getMovementInput().getMoveForward(); + float yaw = this.mc.thePlayer.rotationYaw; + double doubleVal = 0.3; + double doubleVal2 = yaw; + double angleRad = Math.toRadians(doubleVal2); + double doubleVal3 = -MathHelper.sin(angleRad); + double doubleVal4 = yaw; + double angleRad2 = Math.toRadians(doubleVal4); + double doubleVal5 = MathHelper.cos(angleRad2); + double doubleVal6 = floatVal2 * doubleVal * doubleVal3 + floatVal * doubleVal * doubleVal5; + double doubleVal7 = floatVal2 * doubleVal * doubleVal5 - floatVal * doubleVal * doubleVal3; + boolean flag2 = this.mc.thePlayer.isCollidedHorizontally; + if (!this.mc.thePlayer.isCollidedHorizontally) { + return; + } + + EntityPlayerSP player4 = this.mc.thePlayer; + flag2 = player4.isOnLadder(); + + + if (flag2) { + return; + } + + player = this.mc.thePlayer; + + flag2 = this.mc.thePlayer.onGround; + + + if (!flag2) { + return; + } + + player = this.mc.thePlayer; + + double posX2 = player.posX; + double posY2 = this.mc.thePlayer.posY; + double posZ2 = this.mc.thePlayer.posZ; + this.sendPacket(new C04PacketPlayerPosition(posX2 + doubleVal6, posY2, posZ2 + doubleVal7, true)); + this.sendPacket(new C04PacketPlayerPosition(posX2, posY2 + 3.0, posZ2, true)); + EntityPlayerSP player5 = this.mc.thePlayer; + double doubleVal8 = posX2 + doubleVal6; + double doubleVal9 = posZ2 + doubleVal7; + player5.setPosition(doubleVal8, posY2, doubleVal9); + } +} + + + public Phase(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + StringProperty strProp = StringProperty.of("Normal"); + String[] stringArr = new String[]{"VClip", "Normal"}; + this.mode = strProp.acceptableValues(stringArr); + this.hieght = IntProperty.of(-3).minimum(-10).maximum(10); + Setting setting = new Setting("PHASE_MODE", "Mode", SettingType.COMBOBOX, this, this.mode); + SettingManager.register(setting); + setting = new Setting("PHASE_CLIP_HEIGHT", "VClip Height", SettingType.SLIDER, this, this.hieght, 1.0, () -> this.mode.equals("VClip")); + SettingManager.register(setting); +} + + @Override + public void onEnable() { + StringProperty strProp = this.mode; + if (strProp.equals("VClip")) { + EntityPlayerSP player = this.mc.thePlayer; + double posX2 = this.mc.thePlayer.posX; + double posY2 = this.mc.thePlayer.posY; + Integer intVal = this.hieght.get(); + posY2 += intVal.intValue(); + double posZ2 = this.mc.thePlayer.posZ; + player.setPosition(posX2, posY2, posZ2); + this.toggle(); + } +} + + @Override + public void onDisable() { + this.mc.thePlayer.stepHeight = 0.625F; +} + + + @EventTarget + public void onCollideWithBlock(CollideWithBlockEvent event) { + boolean flag = this.mode.equals("Normal"); + if (!flag) { + return; + } + + EntityPlayerSP player = this.mc.thePlayer; + flag = player.isInsideBlock(); + + if (flag) { + event.setBoundingBox(null); + } +} + + @EventTarget + public void onMove(MoveEvent event) { + boolean flag = this.mode.equals("Normal"); + if (!flag) { + return; + } + + EntityPlayerSP player = this.mc.thePlayer; + flag = player.isInsideBlock(); + + if (!flag) { + return; + } + + KeyBinding keyBinding = this.mc.gameSettings.am; + flag = keyBinding.isKeyDown(); + + label41: { + if (flag) { + event.setCachedValue32(this.mc.thePlayer.motionY += 0.09F); + break label41; + } + + KeyBinding keyBinding2 = this.mc.gameSettings.E; + flag = keyBinding2.isKeyDown(); + + if (flag) { + event.setCachedValue32(this.mc.thePlayer.motionY -= 0.09F); + break label41; + } + + event.setCachedValue32(this.mc.thePlayer.motionY = 0.0); + } + + EntityPlayerSP player2 = this.mc.thePlayer; + event.setMoveSpeed(player2.getBaseMoveSpeed()); +} + +} diff --git a/src/main/java/cc/novoline/modules/misc/AntiAlts.java b/src/main/java/cc/novoline/modules/misc/AntiAlts.java new file mode 100644 index 0000000..e3065bf --- /dev/null +++ b/src/main/java/cc/novoline/modules/misc/AntiAlts.java @@ -0,0 +1,137 @@ +package cc.novoline.modules.misc; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.TimerUtil; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.LoadWorldEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.PlayerUpdateEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import com.mojang.authlib.GameProfile; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.CopyOnWriteArrayList; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.network.Packet; +import net.minecraft.util.IChatComponent; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class AntiAlts extends AbstractModule { + private List uUIDList; + @Property("report-bot") + private BooleanProperty reportBot; + private TimerUtil timer; + + + public AntiAlts(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.uUIDList = new CopyOnWriteArrayList<>(); + this.timer = new TimerUtil(); + this.reportBot = BooleanProperty.of(false); + SettingManager.register(new Setting("AA_REPORT_BOT", "Report Bot", SettingType.CHECKBOX, this, this.reportBot)); +} + + @EventTarget + public void onLoadWorld(LoadWorldEvent event) { + List itemList = this.uUIDList; + itemList.clear(); + TimerUtil timerUtil = this.timer; + timerUtil.reset(); +} + + @EventTarget + public void onPacket(PacketEvent event) { + Packet packet; + { + int intVal = UhcCrafts.getIntValue4(); + boolean flag = event.getState().equals(State.INCOMING); + if (intVal == 0) { + if (!flag) { + return; + } + + packet = event.getPacket(); + + flag = packet instanceof S02PacketChat; + } + + if (!flag) { + return; + } + + packet = event.getPacket(); + } + + S02PacketChat chatPacket = (S02PacketChat)packet; + IChatComponent chatComp = chatPacket.getChatComponent(); + String msgText = chatComp.getFormattedText(); + if (msgText.startsWith("\u00a7cThere is no player named")) { + event.setCancelled(true); + } +} + + + @EventTarget + public void onPlayerUpdate(PlayerUpdateEvent event) { + NetHandlerPlayClient netHandler = this.mc.getNetHandler(); + Collection collection = netHandler.getPlayerInfoMap(); + Iterator iter = collection.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + NetworkPlayerInfo networkPlayerInfo = (NetworkPlayerInfo)iter.next(); + GameProfile gameProfile = networkPlayerInfo.getGameProfile(); + UUID uUID = gameProfile.getId(); + String nameStr = networkPlayerInfo.getGameProfile().getName(); + TimerUtil timerUtil = this.timer; + boolean flag = timerUtil.delay(1000L); + if (!flag) { + continue; + } + + List itemList = this.uUIDList; + flag = itemList.contains(uUID); + + if (flag) { + continue; + } + + EntityPlayerSP player = this.mc.thePlayer; + flag = uUID.equals(player.getUUID()); + + if (!flag) { + StringBuilder sb3 = new StringBuilder().append("/report ").append(nameStr); + String textStr = sb3.append(" killaura fly speed").toString(); + this.sendPacket(new C01PacketChatMessage(textStr)); + BooleanProperty boolProp = this.reportBot; + Boolean propFlag = boolProp.get(); + if (propFlag) { + } + + List itemList2 = this.uUIDList; + itemList2.add(uUID); + TimerUtil timerUtil2 = this.timer; + timerUtil2.reset(); + } + } +} + +} diff --git a/src/main/java/cc/novoline/modules/misc/AntiFireBall.java b/src/main/java/cc/novoline/modules/misc/AntiFireBall.java new file mode 100644 index 0000000..1ba56a9 --- /dev/null +++ b/src/main/java/cc/novoline/modules/misc/AntiFireBall.java @@ -0,0 +1,92 @@ +package cc.novoline.modules.misc; + +import cc.novoline.events.events.ClickMouseEvent; +import cc.novoline.utils.TimerUtil; + +import cc.novoline.events.EventTarget; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import java.util.Iterator; +import java.util.List; +import cc.novoline.viaversion.ViaSupportUtil; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.entity.Entity; +import net.minecraft.entity.projectile.EntityFireball; +import net.minecraft.network.play.client.C02PacketUseEntity$Action; +import org.jetbrains.annotations.NotNull; + +public class AntiFireBall extends AbstractModule { + private TimerUtil timer; + + @EventTarget + public void onClickMouse(ClickMouseEvent event) { + Minecraft mcClient = this.mc; + if (this.mc.thePlayer == null) { + return; + } + + mcClient = this.mc; + + WorldClient world = mcClient.theWorld; + List itemList = world.getLoadedEntityList(); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + Entity entity = (Entity)iter.next(); + int intVal = (entity instanceof EntityFireball ? 1 : 0); + if (intVal == 0) { + continue; + } + + intVal = entity.ticksExisted; + + if (intVal <= 7) { + continue; + } + + EntityPlayerSP player = this.mc.thePlayer; + if (player.getDistanceToEntity(entity) >= 6.0F) { + continue; + } + + TimerUtil timerUtil = this.timer; + intVal = (timerUtil.delay(70L) ? 1 : 0); + + if (intVal == 0) { + continue; + } + + ViaSupportUtil viaSupport = ViaSupportUtil.getInstance(); + intVal = viaSupport.getClientProtocolVersion(); + + label34: { + if (intVal > 47) { + this.sendPacketNoEvent(new C02PacketUseEntity(entity, C02PacketUseEntity$Action.ATTACK)); + EntityPlayerSP player2 = this.mc.thePlayer; + player2.swingItem(); + break label34; + } + + EntityPlayerSP player3 = this.mc.thePlayer; + player3.swingItem(); + this.sendPacketNoEvent(new C02PacketUseEntity(entity, C02PacketUseEntity$Action.ATTACK)); + } + + TimerUtil timerUtil2 = this.timer; + timerUtil2.reset(); + } +} + + public AntiFireBall(@NotNull ModuleManager moduleManager, @NotNull EnumModuleType enumModuleType, @NotNull String text, @NotNull String str) { + super(moduleManager, enumModuleType, text, str); + this.timer = new TimerUtil(); +} +} diff --git a/src/main/java/cc/novoline/modules/misc/AutoHypixel.java b/src/main/java/cc/novoline/modules/misc/AutoHypixel.java new file mode 100644 index 0000000..d3aa336 --- /dev/null +++ b/src/main/java/cc/novoline/modules/misc/AutoHypixel.java @@ -0,0 +1,467 @@ +package cc.novoline.modules.misc; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.modules.PlayerRelationType; +import cc.novoline.utils.notifications.NotificationManager; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.tasks.TaskManager; +import cc.novoline.utils.tasks.TaskStage; +import cc.novoline.utils.tasks.impl.AutoHypixelTask; + +import cc.novoline.Novoline; +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.network.Packet; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class AutoHypixel extends AbstractModule { + @Property("auto-pit-list") + private final ListProperty autoPitList; + @Property("reconnect") + private final BooleanProperty reconnect; + private List entityList; + @Property("delay") + private final IntProperty delay; + @Property("min-bounty") + private final IntProperty minBounty; + @Property("auto-play") + private final BooleanProperty autoPlay; + + @EventTarget + public void onPacket(PacketEvent event) { + cc.novoline.modules.misc.AutoHypixel autoHypixel; + boolean flag = event.getState().equals(State.INCOMING); + if (!flag) { + return; + } + + BooleanProperty boolProp = this.reconnect; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + this.applyPacketEvent(event); + } + + BooleanProperty boolProp2 = this.autoPlay; + Boolean propFlag2 = boolProp2.get(); + flag = propFlag2; + + if (flag) { + this.applyPacketEvent3(event); + } + + autoHypixel = this; + + ListProperty listProp = this.autoPitList; + flag = listProp.contains("Quick Math"); + + if (!flag) { + return; + } + + autoHypixel = this; + + autoHypixel.applyPacketEvent2(event); +} + + private void applyPacketEvent(PacketEvent event) { + int intVal = UhcCrafts.getIntValue4(); + Packet packet = event.getPacket(); + if (intVal == 0) { + if (!(packet instanceof S02PacketChat)) { + return; + } + + packet = event.getPacket(); + } + + S02PacketChat chatPacket = (S02PacketChat)packet; + IChatComponent chatComp = chatPacket.getChatComponent(); + String textStr = chatComp.getUnformattedText(); + if (textStr.contains("Flying or related")) { + this.sendPacketNoEvent(new C01PacketChatMessage("/back")); + } +} + + + + + private Boolean lambdaImpl$new$0() { + ListProperty listProp = this.autoPitList; + return listProp.contains("Target Bounty"); +} + + public static void executeAutoHypixel(AutoHypixel autoHypixel, Packet packet) { + autoHypixel.handlePacket(packet); +} + + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + boolean flag; + cc.novoline.modules.misc.AutoHypixel autoHypixel; + int intVal = UhcCrafts.g(); + if (event.getState().equals(cc.novoline.events.type.State.PRE)) { + List itemList = this.entityList; + Iterator iter = itemList.iterator(); + + while (true) { + if (iter.hasNext()) { + Entity entity = (Entity)iter.next(); + WorldClient world = this.mc.theWorld; + itemList = world.getPlayerEntities(); + flag = itemList.contains(entity); + + if (!flag) { + itemList = this.entityList; + itemList.remove(entity); + Novoline novolineInst = this.novoline; + novolineInst.getPlayerManager().removeType(entity.getName(), PlayerRelationType.TARGET); + } + + continue; + } + + autoHypixel = this; + + ListProperty listProp = this.autoPitList; + flag = listProp.contains("Target Bounty"); + break; + } + + if (!flag) { + return; + } + + autoHypixel = this; + + WorldClient world2 = autoHypixel.mc.theWorld; + itemList = world2.getPlayerEntities(); + Iterator iter2 = itemList.iterator(); + + while (true) { + if (iter2.hasNext()) { + label190: { + EntityPlayer player2 = (EntityPlayer)iter2.next(); + EntityPlayer player3 = player2; + boolean flag2 = player2.equals(this.mc.thePlayer); + + if (flag2) { + break label190; + } + + player3 = player2; + + IChatComponent chatComp = player3.getDisplayName(); + String textStr = chatComp.getUnformattedText(); + String nameStr = player2.getName(); + String textStr2 = textStr; + String textStr3 = "\u00a76\u00a7l"; + if (!textStr.contains(textStr3)) { + break label190; + } + + textStr2 = textStr; + textStr3 = " "; + + String[] stringArr = textStr2.split(textStr3); + int len = stringArr.length; + if (len <= 2) { + break label190; + } + + String textStr4 = stringArr[stringArr.length - 1]; + textStr3 = "\u00a76\u00a7l"; + String textStr5 = textStr4.replace(textStr3, ""); + textStr3 = "g"; + String textStr6 = textStr5.replace(textStr3, ""); + len = Integer.parseInt(textStr6); + + int intVal2 = len; + int intVal3 = intVal2; + IntProperty intProp = this.minBounty; + Integer intVal4 = intProp.get(); + if (intVal2 < intVal4) { + break label190; + } + + itemList = this.entityList; + intVal3 = (itemList.contains(player2) ? 1 : 0); + + if (intVal3 != 0) { + break label190; + } + + Novoline novolineInst2 = this.novoline; + intVal3 = (novolineInst2.getPlayerManager().hasType(player2.getName(), PlayerRelationType.FRIEND) ? 1 : 0); + + if (intVal3 != 0) { + break label190; + } + + itemList = this.entityList; + itemList.add(player2); + + textStr3 = "Found a bountied player"; + StringBuilder sb = new StringBuilder(); + String nameStr3 = player2.getName(); + sb = sb.append(nameStr3).append(" has "); + EnumChatFormatting enumChatFormatting = EnumChatFormatting.GOLD; + sb = sb.append(enumChatFormatting).append(intVal2); + sb = sb.append("g"); + EnumChatFormatting enumChatFormatting2 = EnumChatFormatting.RESET; + sb = sb.append(enumChatFormatting2); + nameStr3 = " on him!"; + this.popNotification(textStr3, sb.append(nameStr3).toString(), 7000, NotificationType.INFO); + } + + if (intVal != 0) { + continue; + } + + itemList = this.entityList; + iter2 = itemList.iterator(); + } else { + itemList = this.entityList; + iter2 = itemList.iterator(); + } + + if (!iter2.hasNext()) { + return; + } + break; + } + + while (true) { + Entity entity2 = (Entity)iter2.next(); + Novoline novolineInst3 = this.novoline; + boolean flag3 = novolineInst3.getPlayerManager().hasType(entity2.getName(), PlayerRelationType.FRIEND); + + if (flag3) { + itemList = this.entityList; + itemList.remove(entity2); + Novoline novolineInst4 = this.novoline; + novolineInst4.getPlayerManager().removeType(entity2.getName(), PlayerRelationType.TARGET); + break; + } + + + IChatComponent chatComp2 = entity2.getDisplayName(); + String textStr7 = chatComp2.getUnformattedText(); + String nameStr2 = entity2.getName(); + Novoline novolineInst5 = this.novoline; + novolineInst5.getPlayerManager().setType(entity2.getName(), PlayerRelationType.TARGET); + String textStr8 = "\u00a76\u00a7l"; + boolean flag4 = textStr7.contains(textStr8); + + if (flag4) { + label118: { + textStr8 = " "; + String[] stringArr2 = textStr7.split(textStr8); + int len2 = stringArr2.length; + if (len2 < 3) { + itemList = this.entityList; + itemList.remove(entity2); + Novoline novolineInst6 = this.novoline; + novolineInst6.getPlayerManager().removeType(entity2.getName(), PlayerRelationType.TARGET); + if (intVal != 0) { + break label118; + } + + String textStr9 = stringArr2[stringArr2.length - 1]; + textStr8 = "\u00a76\u00a7l"; + String textStr15 = ""; + String textStr10 = textStr9.replace(textStr8, textStr15); + textStr8 = "g"; + textStr15 = ""; + String textStr11 = textStr10.replace(textStr8, textStr15); + len2 = Integer.parseInt(textStr11); + } else { + String textStr12 = stringArr2[stringArr2.length - 1]; + textStr8 = "\u00a76\u00a7l"; + String textStr16 = ""; + String textStr13 = textStr12.replace(textStr8, textStr16); + textStr8 = "g"; + textStr16 = ""; + String textStr14 = textStr13.replace(textStr8, textStr16); + len2 = Integer.parseInt(textStr14); + } + + int intVal5 = len2; + IntProperty intProp2 = this.minBounty; + Integer intVal6 = intProp2.get(); + if (intVal5 < intVal6) { + itemList = this.entityList; + itemList.remove(entity2); + Novoline novolineInst7 = this.novoline; + novolineInst7.getPlayerManager().removeType(entity2.getName(), PlayerRelationType.TARGET); + } + } + + + + if (!iter2.hasNext()) { + break; + } + continue; + + } + + itemList = this.entityList; + itemList.remove(entity2); + Novoline novolineInst8 = this.novoline; + novolineInst8.getPlayerManager().removeType(entity2.getName(), PlayerRelationType.TARGET); + + if (!iter2.hasNext()) { + break; + } + + } + } +} + + + private void applyPacketEvent2(PacketEvent event) { + java.lang.String textStr; + int intVal = UhcCrafts.getIntValue4(); + Packet packet = event.getPacket(); + if (intVal == 0) { + if (!(packet instanceof S02PacketChat)) { + return; + } + + packet = event.getPacket(); + } + + String textStr2; + S02PacketChat chatPacket = (S02PacketChat)packet; + IChatComponent chatComp = chatPacket.getChatComponent(); + String textStr3 = chatComp.getUnformattedText(); + textStr2 = ":"; + int len = textStr3.split(textStr2).length; + if (len > 1) { + return; + } + + textStr = textStr3; + textStr2 = "QUICK MATHS! Solve:"; + + len = (textStr3.contains(textStr2) ? 1 : 0); + + if (len == 0) { + return; + } + + textStr = textStr3; + textStr2 = "Solve: "; + + String[] stringArr = textStr.split(textStr2); + ScriptEngineManager scriptEngineManager = new ScriptEngineManager(); + ScriptEngine scriptEngine = scriptEngineManager.getEngineByName("JavaScript"); + + try { + String textStr4 = stringArr[1]; + this.sendPacketNoEvent(new C01PacketChatMessage(scriptEngine.eval(textStr4.replace("x", "*")).toString())); + } catch (ScriptException ex) { + ex.printStackTrace(); + } +} + + public AutoHypixel(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.reconnect = BooleanProperty.of(false); + this.autoPlay = BooleanProperty.of(false); + IntProperty intProp = IntProperty.of(3); + Integer intVal = 1; + IntProperty intProp2 = intProp.minimum(intVal); + this.delay = intProp2.maximum(10); + ListProperty listProp = ListProperty.of("Quick Math"); + String[] stringArr = new String[]{"Quick Math", "Target Bounty"}; + this.autoPitList = listProp.acceptableValues((Object[])stringArr); + this.minBounty = IntProperty.of(500).minimum(50).maximum(5000); + this.entityList = new CopyOnWriteArrayList<>(); + Setting setting = new Setting("AH_AUTO_PIT", "Auto Pit", SettingType.SELECTBOX, this, this.autoPitList); + SettingManager.register(setting); + Setting setting2 = new Setting("AH_BOUNTY", "Minimal Bounty", SettingType.SLIDER, this, this.minBounty, 50.0, this::lambdaImpl$new$0); + SettingManager.register(setting2); + Setting setting3 = new Setting("AH_AUTO_REC", "Reconnect", SettingType.CHECKBOX, this, this.reconnect); + SettingManager.register(setting3); + Setting setting4 = new Setting("AH_AUTO_AP", "Auto Play", SettingType.CHECKBOX, this, this.autoPlay); + SettingManager.register(setting4); + Setting setting5 = new Setting("AH_AP_DELAY", "Delay (Seconds)", SettingType.SLIDER, this, this.delay, 1.0, this.autoPlay::get); + SettingManager.register(setting5); +} + + @Override + public void onDisable() { + List itemList = this.entityList; + + if (itemList.isEmpty()) { + return; + } + + itemList = this.entityList; + + + itemList.clear(); +} + + private void applyPacketEvent3(PacketEvent event) { + Packet packet = event.getPacket(); + if (!(packet instanceof S02PacketChat)) { + return; + } + + packet = event.getPacket(); + + S02PacketChat chatPacket = (S02PacketChat)packet; + String textStr = chatPacket.getChatComponent().toString(); + String textStr2 = textStr.split("action=RUN_COMMAND, value='")[1]; + String textStr3 = textStr2; + String textStr4 = "/play "; + if (!textStr2.startsWith(textStr4)) { + return; + } + + textStr3 = textStr2; + textStr4 = "'}"; + + String textStr5 = textStr3.split(textStr4)[0]; + Novoline novolineInst = Novoline.getInstance(); + NotificationManager notifManager = novolineInst.getNotificationManager(); + Integer intVal = this.delay.get(); + int intVal3 = intVal * 1000; + notifManager.pop("Sending you to the next game in ", intVal3, NotificationType.INFO); + Novoline novolineInst2 = Novoline.getInstance(); + TaskManager taskManager = novolineInst2.getTaskManager(); + Integer intVal2 = this.delay.get(); + AutoHypixelTask autoHypixelTask = new AutoHypixelTask(this, intVal2 * 1000, TaskStage.TICK, textStr5); + taskManager.applyFutureTask(autoHypixelTask); +} + +} diff --git a/src/main/java/cc/novoline/modules/misc/AutoTool.java b/src/main/java/cc/novoline/modules/misc/AutoTool.java new file mode 100644 index 0000000..30815ad --- /dev/null +++ b/src/main/java/cc/novoline/modules/misc/AutoTool.java @@ -0,0 +1,260 @@ +package cc.novoline.modules.misc; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.combat.KillAura; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.ModuleRegistry; +import net.minecraft.item.ItemImpl; +import net.minecraft.item.ItemShears; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.minecraft.client.multiplayer.PlayerControllerMP; +import cc.novoline.modules.player.ChestStealerSupport; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.network.Packet; +import net.minecraft.network.play.client.C07PacketPlayerDigging$Action; +import net.minecraft.util.BlockPos; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class AutoTool extends AbstractModule { + private boolean stateFlag; + @Property("switch-back") + private BooleanProperty switchBack; + private int stateTicks; + @Property("mode") + private StringProperty mode; + + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + cc.novoline.modules.misc.AutoTool autoTool; + boolean flag = event.getState().equals(State.PRE); + if (!flag) { + return; + } + + StringProperty strProp = this.mode; + flag = strProp.equals("Basic"); + + if (!flag) { + return; + } + + PlayerControllerMP controller = this.mc.playerController; + flag = controller.evaluateCondition3(); + + + if (flag) { + label38: { + WorldClient world = this.mc.theWorld; + BlockPos pos = this.mc.objectMouseOver.getBlockPos(); + IBlockState blockState = world.getBlockState(pos); + int intVal2 = this.computeBlockInt(blockState.getBlock()); + + if (intVal2 == this.mc.thePlayer.inventory.currentItem) { + break label38; + } + + this.mc.thePlayer.inventory.currentItem = intVal2; + + + BooleanProperty boolProp = this.switchBack; + Boolean propFlag = boolProp.get(); + this.stateFlag = propFlag; + } + + return; + } + + autoTool = this; + + flag = this.stateFlag; + + + if (flag) { + this.mc.thePlayer.inventory.currentItem = this.stateTicks; + this.stateFlag = false; + return; + } + + autoTool = this; + + autoTool.stateTicks = this.mc.thePlayer.inventory.currentItem; +} + + public AutoTool(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + StringProperty strProp = StringProperty.of("Basic"); + String[] stringArr = new String[]{"Basic", "Silent"}; + this.mode = strProp.acceptableValues(stringArr); + this.switchBack = BooleanProperty.of(true); + Setting setting = new Setting("AT_MODE", "Mode", SettingType.COMBOBOX, this, this.mode); + SettingManager.register(setting); + setting = new Setting("AT_SWITCH_BACK", "Switch Back", SettingType.CHECKBOX, this, this.switchBack, () -> this.mode.equals("Basic")); + SettingManager.register(setting); +} + + @EventTarget + public void onPacket(PacketEvent event) { + int intVal = UhcCrafts.getIntValue4(); + PacketEvent packetEvent = event; + + if (event.getState() != cc.novoline.events.State.OUTGOING) { + return; + } + + packetEvent = event; + + + Packet packet = packetEvent.getPacket(); + if (intVal == 0) { + if (!(packet instanceof C07PacketPlayerDigging)) { + return; + } + + packet = event.getPacket(); + } + + C07PacketPlayerDigging playerDiggingPacket = (C07PacketPlayerDigging)packet; + if (playerDiggingPacket.getStatus() == C07PacketPlayerDigging$Action.STOP_DESTROY_BLOCK) { + StringProperty strProp = this.mode; + int intVal2 = (strProp.equals("Silent") ? 1 : 0); + if (intVal2 == 0) { + return; + } + + WorldClient world = this.mc.theWorld; + BlockPos pos = playerDiggingPacket.getPosition(); + IBlockState blockState = world.getBlockState(pos); + intVal2 = this.computeBlockInt(blockState.getBlock()); + + int intVal3 = intVal2; + if (intVal3 != this.mc.thePlayer.inventory.currentItem) { + ModuleRegistry modEntry = ModuleRegistry.KILLAURA; + KillAura killAura = modEntry.getModule(); + if (killAura.evaluateFlag("Hypixel")) { + this.callbackTask3.run(); + } + + this.sendPacketNoEvent(new C09PacketHeldItemChange(intVal3)); + event.performStep(); + + this.sendPacketNoEvent(new C09PacketHeldItemChange(this.mc.thePlayer.inventory.currentItem)); + } + } +} + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + this.handleString3(this.mode.get()); +} + + + public StringProperty getMode() { + return this.mode; +} + + public StringProperty getStringProperty() { + return this.getMode(); +} + + + public int computeBlockInt(Block block) { + int intVal3 = UhcCrafts.getIntValue4(); + int slot = this.mc.thePlayer.inventory.currentItem; + float floatVal = 1.0F; + int intVal = 0; + int intVal2 = intVal3; + + while (true) { + if (intVal < 9) { + InventoryPlayer inventory2 = this.mc.thePlayer.inventory; + float floatVal2 = this.computeFloat(block, inventory2.getStackInSlot(intVal)); + if (intVal2 == 0) { + float floatVal3; + intVal3 = (floatVal3 = floatVal2 - floatVal) == 0.0F ? 0 : (floatVal3 < 0.0F ? -1 : 1); + if (intVal2 != 0) { + break; + } + + if (intVal3 > 0) { + slot = intVal; + floatVal = floatVal2; + } + + intVal++; + } + + continue; + } + + intVal3 = slot; + break; + } + + return intVal3; +} + + + @Override + public void onDisable() { + this.stateTicks = this.mc.thePlayer.inventory.currentItem; + this.stateFlag = false; +} + + @Override + public void onEnable() { + this.handleString3(this.mode.get()); +} + + public float computeFloat(Block block, ItemStack stack) { + float floatVal = 1.0F; + if (block != Blocks.air) { + ItemStack stack2 = stack; + if (stack == null) { + return floatVal; + } + + stack2 = stack; + + + if (!(stack2.getItem() instanceof ItemImpl)) { + stack2 = stack; + + if (!(stack.getItem() instanceof ItemShears)) { + return floatVal; + } + } + + stack2 = stack; + + + floatVal = stack2.getStrVsBlock(block); + int intVal = Enchantment.efficiency.effectId; + floatVal += ChestStealerSupport.getEnchantmentLevel(intVal, stack); + } + + return floatVal; +} + + +} diff --git a/src/main/java/cc/novoline/modules/misc/ChatBypass.java b/src/main/java/cc/novoline/modules/misc/ChatBypass.java new file mode 100644 index 0000000..eb30bb9 --- /dev/null +++ b/src/main/java/cc/novoline/modules/misc/ChatBypass.java @@ -0,0 +1,110 @@ +package cc.novoline.modules.misc; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraft.network.Packet; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class ChatBypass extends AbstractModule { + @Property("mode") + private final StringProperty mode; + + + @EventTarget + public void onPacket(PacketEvent event) { + int intVal = UhcCrafts.getIntValue4(); + PacketEvent packetEvent = event; + + if (event.getState() != State.OUTGOING) { + return; + } + + packetEvent = event; + + + Packet packet = packetEvent.getPacket(); + if (intVal == 0) { + if (!(packet instanceof C01PacketChatMessage)) { + return; + } + + packet = event.getPacket(); + } + + C01PacketChatMessage chatMessagePacket = (C01PacketChatMessage)packet; + String msgText = chatMessagePacket.getMessage(); + String textStr13 = "/"; + boolean flag = msgText.startsWith(textStr13); + if (flag) { + return; + } + + textStr13 = "."; + flag = msgText.startsWith(textStr13); + + if (!flag) { + StringBuilder sb; + label40: { + sb = new StringBuilder(); + StringProperty strProp = this.mode; + if (!strProp.equals("Cyrillic")) { + break label40; + } + + String textStr = msgText.replace("e", "\u0435"); + String textStr2 = textStr.replace("a", "\u0430"); + String textStr3 = textStr2.replace("y", "\u0443"); + String textStr4 = textStr3.replace("o", "\u043e"); + String textStr5 = textStr4.replace("c", "\u0441"); + String textStr6 = textStr5.replace("B", "\u0412"); + String textStr7 = textStr6.replace("E", "\u0415"); + String textStr8 = textStr7.replace("A", "\u0410"); + String textStr9 = textStr8.replace("Y", "\u0423"); + String textStr10 = textStr9.replace("O", "\u041e"); + String textStr11 = textStr10.replace("C", "\u0421"); + String textStr12 = textStr11.replace("k", "\u041a"); + textStr13 = "K"; + msgText = textStr12.replace(textStr13, "\u041a"); + chatMessagePacket.applyNetHandlerPlayServer(msgText); + + + return; + + } + + char[] charArr = msgText.toCharArray(); + int len = charArr.length; + int intVal2 = 0; + + while (intVal2 < len) { + char ch = charArr[intVal2]; + StringBuilder sb2 = sb.append(ch); + sb2.append("\u00b7"); + intVal2++; + + } + + chatMessagePacket.applyNetHandlerPlayServer(sb.toString()); + } +} + + public ChatBypass(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String message, String text) { + super(moduleManager, enumModuleType, message, text); + StringProperty strProp = StringProperty.of("Cyrillic"); + String[] stringArr = new String[]{"Cyrillic", "Dots"}; + this.mode = strProp.acceptableValues(stringArr); + SettingManager.register(new Setting("CB_MODE", "Mode", SettingType.COMBOBOX, this, this.mode)); +} + + +} diff --git a/src/main/java/cc/novoline/modules/misc/ChatFutures.java b/src/main/java/cc/novoline/modules/misc/ChatFutures.java new file mode 100644 index 0000000..972baf8 --- /dev/null +++ b/src/main/java/cc/novoline/modules/misc/ChatFutures.java @@ -0,0 +1,401 @@ +package cc.novoline.modules.misc; + + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.HypixelChatChannel; +import cc.novoline.utils.ServerUtils; +import cc.novoline.utils.TimerUtil; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraft.network.play.server.S45PacketTitle; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.network.Packet; +import net.minecraft.util.IChatComponent; + +public final class ChatFutures extends AbstractModule { + @Property("mode") + private final StringProperty mode; + private TimerUtil timer; + @Property("filter-bypass") + private final BooleanProperty filterBypass; + private TimerUtil timer2; + @Property("auto-gg-message") + private StringProperty autoGgMessage; + @Property("delay") + private final IntProperty delay; + @Property("text") + private final StringProperty text; + @Property("auto-gg") + private BooleanProperty autoGg; + @Property("spammer") + private final BooleanProperty spammer; + + private void applyPacketEvent4(PacketEvent event) { + java.lang.String propStr; + boolean flag; + int intVal = UhcCrafts.getIntValue4(); + Packet packet = event.getPacket(); + if (intVal == 0) { + if (!(packet instanceof S45PacketTitle)) { + return; + } + + packet = event.getPacket(); + } + + S45PacketTitle titlePacket = (S45PacketTitle)packet; + IChatComponent chatComp = titlePacket.getMessage(); + boolean flag2 = chatComp.getUnformattedText().equals("\u00a76\u00a7lVICTORY!"); + if (!flag2) { + return; + } + + TimerUtil timerUtil = this.timer2; + long longVal = this.getIntValue2(); + flag2 = timerUtil.delay(longVal); + + if (!flag2) { + return; + } + + StringProperty strProp = this.autoGgMessage; + propStr = strProp.get(); + + flag2 = propStr.startsWith("/"); + + if (flag2) { + this.sendPacketNoEvent(new C01PacketChatMessage(this.autoGgMessage.get())); + return; + } + + propStr = ""; + + String textStr; + label45: { + + textStr = propStr; + flag = ServerUtils.isHypixel(); + + if (flag) { + HypixelChatChannel hypixelChatChannel = HypixelChatChannel.ALL; + flag = ServerUtils.channelIs(hypixelChatChannel); + + if (!flag) { + textStr = "/achat "; + } + } + + StringBuilder sb2 = new StringBuilder().append(textStr); + StringProperty strProp2 = this.autoGgMessage; + String propStr2 = strProp2.get(); + textStr = sb2.append(propStr2).toString(); + + String lowerStr = textStr.toLowerCase(); + flag = lowerStr.startsWith("gg"); + + if (!flag) { + break label45; + } + + this.sendPacketNoEvent(new C01PacketChatMessage(textStr)); + + + return; + + } + + this.sendPacket(new C01PacketChatMessage(textStr)); +} + + private boolean checkString2(String str, String[] args) { + int intVal = (str.contains("KILL!") ? 1 : 0); + + if (intVal == 0) { + return false; + } + + intVal = args.length; + + + return intVal < 3; +} + + public ChatFutures(ModuleManager moduleManager, EnumModuleType enumModuleType, String message, String str) { + super(moduleManager, enumModuleType, message, str); + this.timer = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.filterBypass = BooleanProperty.of(false); + this.spammer = BooleanProperty.of(false); + StringProperty strProp = StringProperty.of("Cyrillic"); + String[] stringArr = new String[]{"Cyrillic", "Dots"}; + this.mode = strProp.acceptableValues(stringArr); + this.text = StringProperty.of("Buy novoline"); + this.delay = IntProperty.of(3000).minimum(100).maximum(15000); + this.autoGg = BooleanProperty.of(true); + this.autoGgMessage = StringProperty.of("GG"); + Setting setting = new Setting("CF_FILTER_BYPASS", "Filter Bypass", SettingType.CHECKBOX, this, this.filterBypass); + SettingManager.register(setting); + Setting setting2 = new Setting("CF_FILTER_BYPASS_MODE", "Bypass Mode", SettingType.COMBOBOX, this, this.mode, this.filterBypass::get); + SettingManager.register(setting2); + Setting setting3 = new Setting("CF_SPAMMER", "Spammer", SettingType.CHECKBOX, this, this.spammer); + SettingManager.register(setting3); + Setting setting4 = new Setting("CF_SPAMMER_TEXT", "Text", SettingType.TEXTBOX, this, "Spam text", this.text, this.spammer::get); + SettingManager.register(setting4); + Setting setting5 = new Setting("CF_SPAMMER_DELAY", "Delay", SettingType.SLIDER, this, this.delay, 100.0, "ms", this.spammer::get); + SettingManager.register(setting5); + Setting setting6 = new Setting("CF_AUTO_GG", "AutoGG", SettingType.CHECKBOX, this, this.autoGg); + SettingManager.register(setting6); + Setting setting7 = new Setting("CF_AUTO_GG_MESSAGE", "Message", SettingType.TEXTBOX, this, "Message Text", this.autoGgMessage, this.autoGg::get); + SettingManager.register(setting7); +} + + + private int getIntValue2() { + IChatComponent chatComp = this.mc.thePlayer.getDisplayName(); + String msgText = chatComp.getFormattedText(); + short shortVal = (short)(msgText.contains("VIP") ? 1 : 0); + + if (shortVal == 0) { + if (!(msgText.contains("MVP"))) { + return 3050; + } + } + + shortVal = 1050; + + + return shortVal; +} + + private boolean checkCondition(String str, String[] args) { + String nameStr = this.mc.thePlayer.getName(); + boolean flag = str.contains(nameStr); + + if (!flag) { + return false; + } + + flag = args[0].equals(this.mc.thePlayer.getName()); + + + if (flag) { + return false; + } + + flag = str.contains("was killed by"); + + if (flag) { + return true; + } + + flag = str.contains("was thrown into the void by"); + return flag; +} + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + cc.novoline.modules.misc.ChatFutures chatFutures; + cc.novoline.modules.misc.ChatFutures chatFutures2; + boolean flag = event.getState().equals(State.PRE); + if (!flag) { + return; + } + + BooleanProperty boolProp = this.spammer; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + return; + } + + TimerUtil timerUtil = this.timer; + Integer intVal = this.delay.get(); + long longVal = intVal.intValue(); + flag = timerUtil.delay(longVal); + + label65: { + label49: { + if (!flag) { + return; + } + + chatFutures = this; + + StringProperty strProp = this.text; + String propStr = strProp.get(); + flag = propStr.startsWith("/"); + + if (!flag) { + chatFutures2 = this; + + StringProperty strProp2 = this.text; + String propStr2 = strProp2.get(); + if (!propStr2.startsWith(".")) { + break label49; + } + } + + chatFutures = this; + + chatFutures.applyInt5(new C01PacketChatMessage(this.text.get())); + break label65; + } + + chatFutures2 = this; + + C01PacketChatMessage chatMessagePacket; + StringBuilder sb; + String textStr; + label32: { + sb = new StringBuilder(); + if (ServerUtils.isHypixel()) { + if (!this.mc.isSingleplayer()) { + textStr = "/achat "; + break label32; + } + } + + textStr = ""; + } + + sb = sb.append(textStr); + StringProperty strProp3 = this.text; + textStr = strProp3.get(); + chatMessagePacket = new C01PacketChatMessage(sb.append(textStr).toString()); + chatFutures2.handlePacket(chatMessagePacket); + } + + TimerUtil timerUtil2 = this.timer; + timerUtil2.reset(); +} + + @EventTarget + public void onPacket(PacketEvent event) { + ChatFutures chatFutures; + + boolean flag2 = event.getState().equals(cc.novoline.events.State.OUTGOING); + if (flag2) { + + boolean flag = event.getPacket() instanceof C01PacketChatMessage; + if (!flag) { + return; + } + + chatFutures = this; + + BooleanProperty boolProp = this.filterBypass; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + C01PacketChatMessage chatMessagePacket = (C01PacketChatMessage)event.getPacket(); + String msgText = chatMessagePacket.getMessage(); + + String textStr13 = "/"; + if (!msgText.startsWith(textStr13)) { + textStr13 = "."; + label47: + if (!msgText.startsWith(textStr13)) { + StringBuilder sb; + label65: { + sb = new StringBuilder(); + StringProperty strProp = this.mode; + if (!strProp.equals("Cyrillic")) { + break label65; + } + + String textStr = msgText.replace("e", "\u0435"); + String textStr2 = textStr.replace("a", "\u0430"); + String textStr3 = textStr2.replace("y", "\u0443"); + String textStr4 = textStr3.replace("o", "\u043e"); + String textStr5 = textStr4.replace("c", "\u0441"); + String textStr6 = textStr5.replace("B", "\u0412"); + String textStr7 = textStr6.replace("E", "\u0415"); + String textStr8 = textStr7.replace("A", "\u0410"); + String textStr9 = textStr8.replace("Y", "\u0423"); + String textStr10 = textStr9.replace("O", "\u041e"); + String textStr11 = textStr10.replace("C", "\u0421"); + String textStr12 = textStr11.replace("k", "\u041a"); + textStr13 = "K"; + msgText = textStr12.replace(textStr13, "\u041a"); + chatMessagePacket.applyNetHandlerPlayServer(msgText); + + + break label47; + + } + + char[] charArr = msgText.toCharArray(); + int len = charArr.length; + int intVal2 = 0; + + while (intVal2 < len) { + char ch = charArr[intVal2]; + StringBuilder sb2 = sb.append(ch); + sb2.append("\u00b7"); + intVal2++; + + } + + chatMessagePacket.applyNetHandlerPlayServer(sb.toString()); + } + } + } + + chatFutures = this; + + TimerUtil timerUtil = chatFutures.timer2; + timerUtil.reset(); + + return; + } + + chatFutures = this; + + BooleanProperty boolProp2 = this.autoGg; + Boolean propFlag2 = boolProp2.get(); + flag2 = propFlag2; + + if (!flag2) { + return; + } + + chatFutures = this; + + chatFutures.applyPacketEvent4(event); +} + + + private int computeIntValue() { + IChatComponent chatComp = this.mc.thePlayer.getDisplayName(); + String msgText = chatComp.getFormattedText(); + short shortVal = (short)(msgText.contains("VIP") ? 1 : 0); + if (shortVal == 0) { + if (!(msgText.contains("MVP"))) { + return 3050; + } + } + + shortVal = 1050; + + return shortVal; +} + + +} diff --git a/src/main/java/cc/novoline/modules/misc/Debug.java b/src/main/java/cc/novoline/modules/misc/Debug.java new file mode 100644 index 0000000..a1765ea --- /dev/null +++ b/src/main/java/cc/novoline/modules/misc/Debug.java @@ -0,0 +1,62 @@ +package cc.novoline.modules.misc; + +import cc.novoline.utils.fonts.api.FontRenderer; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.events.events.Render3DEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.player.BedBreaker; +import com.google.common.collect.Lists; +import cc.novoline.modules.ModuleRegistry; +import java.util.ArrayList; +import java.util.Iterator; +import cc.novoline.modules.ModuleManager; +import cc.novoline.utils.fonts.holders.FontFamilySF_REGULAR; +import cc.novoline.utils.fonts.api.FontFamily; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class Debug extends AbstractModule { + + @EventTarget + public void onRender3D(Render3DEvent event) {} + + + + @Override + public void onEnable() {} + + @EventTarget + public void onRender2D(Render2DEvent event) { + try { + FontRenderer font = FontFamilySF_REGULAR.FAMILY.ofSize(20); + float floatVal = 150.0F; + ModuleRegistry modEntry = ModuleRegistry.BEDBREAKER; + BedBreaker bedBreaker = modEntry.getModule(); + Boolean[] booleanArr = new Boolean[1]; + int intVal = (bedBreaker.getCachedAngle() > 0.0F) ? 1 : 0; + + booleanArr[0] = Boolean.valueOf((intVal != 0)); + ArrayList itemList = Lists.newArrayList(booleanArr); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + Object obj = iter.next(); + String textStr = String.valueOf(obj); + double doubleVal = floatVal; + font.drawString(textStr, 40.0, doubleVal, 16777215, true); + floatVal += font.getHeight() + 1; + } + } catch (NullPointerException ex) { + } +} + + public Debug(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); +} +} diff --git a/src/main/java/cc/novoline/modules/misc/FastPlace.java b/src/main/java/cc/novoline/modules/misc/FastPlace.java new file mode 100644 index 0000000..2483d54 --- /dev/null +++ b/src/main/java/cc/novoline/modules/misc/FastPlace.java @@ -0,0 +1,35 @@ +package cc.novoline.modules.misc; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.ModuleManager; + +public final class FastPlace extends AbstractModule { + @Property("blocks-only") + public final BooleanProperty blocksOnly; + @Property("place-delay") + public final IntProperty placeDelay; + + + public FastPlace(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + IntProperty intProp = IntProperty.of(3); + Integer intVal = 1; + IntProperty intProp2 = intProp.minimum(intVal); + this.placeDelay = intProp2.maximum(4); + this.blocksOnly = BooleanProperty.of(true); + Setting setting = new Setting("PLACE_DELAY", "Place Delay", SettingType.SLIDER, this, this.placeDelay, 1.0); + SettingManager.register(setting); + setting = new Setting("BLOCKS_ONLY", "Blocks Only", SettingType.CHECKBOX, this, this.blocksOnly); + SettingManager.register(setting); +} + + +} diff --git a/src/main/java/cc/novoline/modules/misc/LightningTracker.java b/src/main/java/cc/novoline/modules/misc/LightningTracker.java new file mode 100644 index 0000000..6e499d1 --- /dev/null +++ b/src/main/java/cc/novoline/modules/misc/LightningTracker.java @@ -0,0 +1,117 @@ +package cc.novoline.modules.misc; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.modules.configurations.util.WaypointEntry; +import cc.novoline.utils.helper.SoundAlertHelper; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.visual.Waypoints; +import cc.novoline.modules.ModuleRegistry; +import net.minecraft.network.play.server.S29PacketSoundEffect; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiIngame; +import net.minecraft.event.ClickEvent; +import net.minecraft.event.HoverEvent; +import net.minecraft.event.HoverEvent$Action; +import net.minecraft.network.Packet; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatStyle; + +public class LightningTracker extends AbstractModule { + @Property("auto-waypoint") + BooleanProperty autoWaypoint; + + public LightningTracker(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.autoWaypoint = BooleanProperty.of(false); + SettingManager.register(new Setting("LT_AUTO_WP", "Auto waypoint", SettingType.CHECKBOX, this, this.autoWaypoint)); +} + + + @EventTarget + public void onPacket(PacketEvent evt) { + int intVal; + Packet packet; + { + intVal = UhcCrafts.getIntValue4(); + boolean flag = evt.getState().equals(State.INCOMING); + if (intVal == 0) { + if (!flag) { + return; + } + + packet = evt.getPacket(); + + flag = packet instanceof S29PacketSoundEffect; + } + + if (!flag) { + return; + } + + packet = evt.getPacket(); + } + + S29PacketSoundEffect soundEffectPacket = (S29PacketSoundEffect)packet; + int intVal2 = (soundEffectPacket.getSoundName().equals("ambient.weather.thunder") ? 1 : 0); + + if (intVal2 == 0) { + return; + } + + intVal2 = (int)soundEffectPacket.getX(); + + + int intVal3 = intVal2; + double doubleVal = soundEffectPacket.getY(); + int intVal4 = (int)Math.max(100.0, doubleVal); + int intVal5 = (int)soundEffectPacket.getZ(); + Minecraft mcClient = this.mc; + String textStr = mcClient.isSingleplayer() ? "/tp " : ".tp "; + StringBuilder sb5 = new StringBuilder().append(intVal3).append(" ").append(intVal4).append(" "); + String textStr2 = sb5.append(intVal5).toString(); + ChatComponentText chatText = new ChatComponentText(textStr2); + ChatStyle chatStyle = chatText.getChatStyle(); + HoverEvent$Action hoverEvent$Action = HoverEvent$Action.SHOW_TEXT; + StringBuilder sb6 = new StringBuilder().append(textStr); + HoverEvent hoverEvent = new HoverEvent(hoverEvent$Action, new ChatComponentText(sb6.append(textStr2).toString())); + chatText.setChatStyle(chatStyle.setChatHoverEvent(hoverEvent)); + ChatStyle chatStyle2 = chatText.getChatStyle(); + net.minecraft.event.ClickEvent$Action clickEvent$Action = net.minecraft.event.ClickEvent$Action.RUN_COMMAND; + StringBuilder sb7 = new StringBuilder().append(textStr); + ClickEvent clickEvent = new ClickEvent(clickEvent$Action, sb7.append(textStr2).toString()); + chatText.setChatStyle(chatStyle2.setChatClickEvent(clickEvent)); + StringBuilder sb8 = new StringBuilder(); + String displayName = SoundAlertHelper.createTextMessage(this.getDisplayName()).getFormattedText(); + StringBuilder sb9 = sb8.append(displayName); + ChatComponentText chatText2 = new ChatComponentText(sb9.append("detected at ").toString()); + chatText2.appendSibling(chatText); + GuiIngame guiIngame = this.mc.ingameGUI; + guiIngame.getChatGUI().printChatMessage(chatText2); + AbstractModule mod = this; + + BooleanProperty boolProp = this.autoWaypoint; + Boolean propFlag = boolProp.get(); + if (!propFlag) { + return; + } + + ModuleRegistry modEntry = ModuleRegistry.WAYPOINTS; + mod = modEntry.getModule(); + + + Waypoints waypoints = (Waypoints)mod; + waypoints.handleWaypointEntry(new WaypointEntry("Lightning", intVal3, intVal4, intVal5)); +} + + +} diff --git a/src/main/java/cc/novoline/modules/misc/MiddleClick.java b/src/main/java/cc/novoline/modules/misc/MiddleClick.java new file mode 100644 index 0000000..dc2913c --- /dev/null +++ b/src/main/java/cc/novoline/modules/misc/MiddleClick.java @@ -0,0 +1,219 @@ +package cc.novoline.modules.misc; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.util.MovingObjectPosition$MovingObjectType; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.lwjgl.input.Mouse; + +public class MiddleClick extends AbstractModule { + @Property("tag-mode") + private StringProperty tagMode; + @Property("friend") + private final BooleanProperty friend; + private boolean stateFlag; + @Property("pearl") + private final BooleanProperty pearl; + @Property("down-place") + private final BooleanProperty downPlace; + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + cc.novoline.modules.misc.MiddleClick middleClick; + int intVal = (event.getState().equals(State.PRE) ? 1 : 0); + if ((intVal == 0)) { + return; + } + + intVal = (Mouse.isButtonDown(2) ? 1 : 0); + + label114: { + if ((intVal == 0)) { + break label114; + } + + middleClick = this; + + intVal = (this.stateFlag ? 1 : 0); + + if ((intVal == 0)) { + return; + } + + middleClick = this; + + label94: { + label118: { + if (middleClick.mc.objectMouseOver.entityHit != null) { + intVal = (this.mc.objectMouseOver.entityHit instanceof EntityPlayer ? 1 : 0); + + if (intVal != 0) { + BooleanProperty boolProp = this.friend; + Boolean propFlag = boolProp.get(); + intVal = (propFlag ? 1 : 0); + + if ((intVal != 0)) { + break label118; + } + } + } + + middleClick = this; + + intVal = middleClick.getIntValue3(); + + if (intVal == -1) { + break label94; + } + + middleClick = this; + + BooleanProperty boolProp2 = this.pearl; + Boolean propFlag2 = boolProp2.get(); + if (!propFlag2) { + break label94; + } + + MiddleClick middleClick2 = this; + BooleanProperty boolProp3 = this.downPlace; + Boolean propFlag3 = boolProp3.get(); + if (propFlag3) { + middleClick = this; + + if (this.mc.objectMouseOver.typeOfHit == MovingObjectPosition$MovingObjectType.BLOCK) { + break label94; + } + } + + this.applyInt3(this.getIntValue3()); + InventoryPlayer inventory2 = this.mc.thePlayer.inventory; + int intVal2 = this.getIntValue3(); + this.sendPacket(new C08PacketPlayerBlockPlacement(inventory2.getStackInSlot(intVal2))); + middleClick2 = this; + + middleClick2.applyInt3(this.mc.thePlayer.inventory.currentItem); + + break label94; + + } + + middleClick = this; + + BooleanProperty boolProp4 = this.friend; + Boolean propFlag4 = boolProp4.get(); + intVal = (propFlag4 ? 1 : 0); + + label65: + if ((intVal != 0)) { + EntityPlayer player = (EntityPlayer)this.mc.objectMouseOver.entityHit; + StringProperty strProp = this.tagMode; + String textStr2 = "Friend"; + boolean flag = strProp.equals(textStr2); + if (flag) { + EntityPlayerSP player2 = this.mc.thePlayer; + StringBuilder sb = new StringBuilder(); + StringBuilder sb2 = sb.append(".f "); + String nameStr = player.getName(); + textStr2 = sb2.append(nameStr).toString(); + player2.handleString(textStr2); + break label65; + } + + middleClick = this; + + StringProperty strProp2 = this.tagMode; + textStr2 = "Target"; + flag = strProp2.equals(textStr2); + + if (flag) { + EntityPlayerSP player3 = this.mc.thePlayer; + StringBuilder sb3 = new StringBuilder(); + String textStr = ".tar "; + StringBuilder sb4 = sb3.append(textStr); + textStr = player.getName(); + textStr2 = sb4.append(textStr).toString(); + player3.handleString(textStr2); + } + } + } + + middleClick = this; + + middleClick.stateFlag = false; + + return; + + } + + this.stateFlag = true; +} + + + private void applyInt3(int value) { + MiddleClick middleClick = this; + if (this.mc.thePlayer.inventory.currentItem == this.getIntValue3()) { + return; + } + + middleClick = this; + + middleClick.applyInt5(new C09PacketHeldItemChange(value)); +} + + public boolean isReadyState5() { + boolean enabled = this.isEnabled(); + if (!enabled) { + return false; + } + + BooleanProperty boolProp = this.downPlace; + Boolean propFlag = boolProp.get(); + enabled = propFlag; + + return enabled; +} + + public MiddleClick(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.pearl = BooleanProperty.of(true); + this.friend = BooleanProperty.of(true); + this.downPlace = BooleanProperty.of(false); + StringProperty strProp = StringProperty.of("Friend"); + String[] stringArr = new String[]{"Friend", "Target"}; + this.tagMode = strProp.acceptableValues(stringArr); + this.stateFlag = true; + Setting setting = new Setting("MC_FRIEND", "Click Tag", SettingType.CHECKBOX, this, this.friend); + SettingManager.register(setting); + setting = new Setting("MC_TAG_MODE", "Tag Mode", SettingType.COMBOBOX, this, this.tagMode, this.friend::get); + SettingManager.register(setting); + setting = new Setting("MC_PEARL", "Pearl", SettingType.CHECKBOX, this, this.pearl); + SettingManager.register(setting); + setting = new Setting("MC_DOWN_PLACE", "Down Place", SettingType.CHECKBOX, this, this.downPlace); + SettingManager.register(setting); +} + + + private int getIntValue3() { + return this.mc.thePlayer.computeItemInt(Items.ender_pearl); +} + + +} diff --git a/src/main/java/cc/novoline/modules/misc/Notifier.java b/src/main/java/cc/novoline/modules/misc/Notifier.java new file mode 100644 index 0000000..4202606 --- /dev/null +++ b/src/main/java/cc/novoline/modules/misc/Notifier.java @@ -0,0 +1,113 @@ +package cc.novoline.modules.misc; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.SpawnCheckEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.GuiIngame; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.event.ClickEvent; +import net.minecraft.event.HoverEvent; +import net.minecraft.event.HoverEvent$Action; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatStyle; +import net.minecraft.util.IChatComponent; + +public final class Notifier extends AbstractModule { + @Property("additional_y") + private IntProperty additional_y; + + public Notifier(ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + IntProperty intProp = IntProperty.of(10); + Integer intVal = 10; + IntProperty intProp2 = intProp.minimum(intVal); + this.additional_y = intProp2.maximum(90); + SettingManager.register(new Setting("NF_ADD_Y", "Addition Y", SettingType.SLIDER, this, this.additional_y, 5.0)); +} + + + public boolean matchesEntity(Entity entity) { + String displayName = entity.getDisplayName().getFormattedText(); + return displayName.contains("\u00a78[NPC]"); +} + + + @EventTarget + public void onSpawnCheck(SpawnCheckEvent evt) { + int intVal4 = (evt.getTrackedEntity() instanceof EntityPlayer ? 1 : 0); + if (intVal4 == 0) { + return; + } + + Entity entity = evt.getTrackedEntity(); + intVal4 = entity.getEntityId(); + + EntityPlayerSP player = this.mc.thePlayer; + if (intVal4 == player.getEntityId()) { + return; + } + + intVal4 = (this.matchesEntity(evt.getTrackedEntity()) ? 1 : 0); + + if (intVal4 != 0) { + return; + } + + intVal4 = (int)evt.getTrackedEntity().posX; + + int intVal = intVal4; + int intVal2 = (int)evt.getTrackedEntity().posY; + int intVal3 = (int)evt.getTrackedEntity().posZ; + Minecraft mcClient = this.mc; + String textStr = mcClient.isSingleplayer() ? "/tp " : ".tp "; + String nameStr = evt.getTrackedEntity().getName(); + String lowerStr = nameStr.toLowerCase(); + ChatComponentText chatText = new ChatComponentText("\u00a7dNotifier\u00a7r\u00a77 \u00bb "); + ChatComponentText chatText2 = new ChatComponentText("\u00a73Name: \u00a7r"); + ChatComponentText chatText3 = new ChatComponentText(lowerStr); + ChatStyle chatStyle = chatText3.getChatStyle(); + HoverEvent$Action hoverEvent$Action = HoverEvent$Action.SHOW_TEXT; + StringBuilder sb = new StringBuilder().append(textStr); + HoverEvent hoverEvent = new HoverEvent(hoverEvent$Action, new ChatComponentText(sb.append(lowerStr).toString())); + chatText3 = (ChatComponentText)chatText3.setChatStyle(chatStyle.setChatHoverEvent(hoverEvent)); + chatStyle = chatText3.getChatStyle(); + net.minecraft.event.ClickEvent$Action clickEvent$Action = net.minecraft.event.ClickEvent$Action.RUN_COMMAND; + StringBuilder sb2 = new StringBuilder().append(textStr); + ClickEvent clickEvent = new ClickEvent(clickEvent$Action, sb2.append(lowerStr).toString()); + chatText3 = (ChatComponentText)chatText3.setChatStyle(chatStyle.setChatClickEvent(clickEvent)); + ChatComponentText chatText4 = new ChatComponentText(" \u00a73Coords: \u00a7r"); + StringBuilder sb3 = new StringBuilder(); + StringBuilder sb4 = sb3.append("\u00a7bX:\u00a7r "); + StringBuilder sb5 = sb4.append(intVal); + StringBuilder sb6 = sb5.append(" \u00a7bY:\u00a7r "); + StringBuilder sb7 = sb6.append(intVal2); + StringBuilder sb8 = sb7.append(" \u00a7bZ:\u00a7r "); + ChatComponentText chatText5 = new ChatComponentText(sb8.append(intVal3).toString()); + StringBuilder sb14 = new StringBuilder().append(textStr).append(intVal).append(" ").append(intVal2).append(" "); + String textStr2 = sb14.append(intVal3).toString(); + chatStyle = chatText5.getChatStyle(); + hoverEvent = new HoverEvent(HoverEvent$Action.SHOW_TEXT, new ChatComponentText(textStr2)); + chatText5 = (ChatComponentText)chatText5.setChatStyle(chatStyle.setChatHoverEvent(hoverEvent)); + chatStyle = chatText5.getChatStyle(); + ClickEvent clickEvent2 = new ClickEvent(net.minecraft.event.ClickEvent$Action.RUN_COMMAND, textStr2); + chatText5 = (ChatComponentText)chatText5.setChatStyle(chatStyle.setChatClickEvent(clickEvent2)); + IChatComponent chatComp = chatText.appendSibling(chatText2); + IChatComponent chatComp2 = chatComp.appendSibling(chatText3); + IChatComponent chatComp3 = chatComp2.appendSibling(chatText4); + chatComp3.appendSibling(chatText5); + GuiIngame guiIngame = this.mc.ingameGUI; + guiIngame.getChatGUI().printChatMessage(chatText); +} + +} diff --git a/src/main/java/cc/novoline/modules/misc/Optimization.java b/src/main/java/cc/novoline/modules/misc/Optimization.java new file mode 100644 index 0000000..f14c03a --- /dev/null +++ b/src/main/java/cc/novoline/modules/misc/Optimization.java @@ -0,0 +1,188 @@ +package cc.novoline.modules.misc; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.SpawnCheckEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.player.EntityPlayer; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class Optimization extends AbstractModule { + @Property("static-particle-color") + private static BooleanProperty staticParticleColor; + @Property("remove-armor-stands") + private BooleanProperty removeArmorStands; + @Property("fast-entity-lightning") + private static BooleanProperty fastEntityLightning; + @Property("fast-block-lightning") + private static BooleanProperty fastBlockLightning; + @Property("remove-entity-frames") + private BooleanProperty removeEntityFrames; + @Property("no-render-item") + private static BooleanProperty noRenderItem; + @Property("remove-bots") + private BooleanProperty removeBots; + private static boolean stateFlag; + + static { + noRenderItem = BooleanProperty.of(false); + staticParticleColor = BooleanProperty.of(false); + fastEntityLightning = BooleanProperty.of(false); + fastBlockLightning = BooleanProperty.of(false); + } + + + public static boolean isReadyState6() { + boolean flag = stateFlag; + if (!stateFlag) { + return false; + } + + BooleanProperty boolProp = staticParticleColor; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + return flag; +} + + public static boolean isReadyState7() { + boolean flag = stateFlag; + if (!stateFlag) { + return false; + } + + BooleanProperty boolProp = noRenderItem; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + return flag; +} + + @EventTarget + public void onSpawnCheck(SpawnCheckEvent event) { + boolean flag; + Boolean propFlag = this.removeBots.get(); + flag = propFlag; + + if (flag) { + flag = event.getTrackedEntity() instanceof EntityPlayer; + + if (flag) { + String nameStr = event.getTrackedEntity().getName(); + flag = nameStr.startsWith("\u00a7c"); + + if (flag) { + WorldClient world = this.mc.theWorld; + Entity entity = event.getTrackedEntity(); + world.removeEntityFromWorld(entity); + } + } + } + + BooleanProperty boolProp = this.removeEntityFrames; + propFlag = boolProp.get(); + flag = propFlag; + + label52: { + + if (flag) { + flag = event.getTrackedEntity() instanceof EntityItemFrame; + + if (flag) { + break label52; + } + } + + BooleanProperty boolProp2 = this.removeArmorStands; + propFlag = boolProp2.get(); + flag = propFlag; + + + if (!flag) { + return; + } + + flag = event.getTrackedEntity() instanceof EntityArmorStand; + + + if (!flag) { + return; + } + } + + WorldClient world2 = this.mc.theWorld; + Entity entity2 = event.getTrackedEntity(); + world2.removeEntityFromWorld(entity2); +} + + + public static boolean checkState7() { + boolean flag = stateFlag; + if (!stateFlag) { + return false; + } + + BooleanProperty boolProp = fastBlockLightning; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + return flag; +} + + public static boolean checkState8() { + boolean flag = stateFlag; + if (!stateFlag) { + return false; + } + + BooleanProperty boolProp = fastEntityLightning; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + return flag; +} + + @Override + public void onDisable() { + stateFlag = false; +} + + public Optimization(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + this.removeArmorStands = BooleanProperty.of(false); + this.removeEntityFrames = BooleanProperty.of(false); + this.removeBots = BooleanProperty.of(false); + Setting setting = new Setting("OM_REMOVE_ARMOR_STANDS", "Remove Armor Stands", SettingType.CHECKBOX, this, this.removeArmorStands); + SettingManager.register(setting); + setting = new Setting("OM_REMOVE_ENTITY_FRAMES", "Remove Entity Frames", SettingType.CHECKBOX, this, this.removeEntityFrames); + SettingManager.register(setting); + setting = new Setting("OM_REMOVE_BOST", "Remove Bots", SettingType.CHECKBOX, this, this.removeBots); + SettingManager.register(setting); + setting = new Setting("OM_NO_ITEM_RENDER", "No Item Render", SettingType.CHECKBOX, this, noRenderItem); + SettingManager.register(setting); + setting = new Setting("OM_STATIC_PARTICLE_COLOR", "Static Particle Color", SettingType.CHECKBOX, this, staticParticleColor); + SettingManager.register(setting); + setting = new Setting("OM_FAST_ENTITY_LIGHTING", "Fast Entity Lighting", SettingType.CHECKBOX, this, fastEntityLightning); + SettingManager.register(setting); + setting = new Setting("OM_FAST_BLOCK_LIGHTING", "Fast Block Lighting", SettingType.CHECKBOX, this, fastBlockLightning); + SettingManager.register(setting); +} + + + @Override + public void onEnable() { + stateFlag = true; +} + +} diff --git a/src/main/java/cc/novoline/modules/misc/ResetVL.java b/src/main/java/cc/novoline/modules/misc/ResetVL.java new file mode 100644 index 0000000..e508bcb --- /dev/null +++ b/src/main/java/cc/novoline/modules/misc/ResetVL.java @@ -0,0 +1,131 @@ +package cc.novoline.modules.misc; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.MoveEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.ModuleManager; +import net.minecraft.util.MathHelper; +import net.minecraft.client.MinecraftHelper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.entity.Entity; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class ResetVL extends AbstractModule { + @Property("jumps") + private IntProperty jumps; + private int stateTicks; + @Property("timer-speed") + public DoubleProperty timerSpeed; + + + @Override + public void onEnable() { + this.stateTicks = 0; +} + + + @Override + public void onDisable() { + this.mc.timer.timerSpeed = 1.0F; +} + + @EventTarget + public void onMove(MoveEvent event) { + int ticks = this.stateTicks; + Integer intVal = this.jumps.get(); + if (ticks < intVal * 2) { + event.setMoveSpeed(0.0); + } +} + + + public ResetVL(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + DoubleProperty doubleProp = DoubleProperty.of(1.0); + Double doubleVal = 1.0; + DoubleProperty doubleProp2 = doubleProp.minimum(doubleVal); + this.timerSpeed = doubleProp2.maximum(2.0); + this.jumps = IntProperty.of(10).minimum(5).maximum(25); + Setting setting = new Setting("RESET_VL_JUMPS", "Jumps", SettingType.SLIDER, this, this.jumps, 1.0); + SettingManager.register(setting); + setting = new Setting("RESET_VL_TIMER_SPEED", "Timer Speed", SettingType.SLIDER, this, this.timerSpeed, 0.1); + SettingManager.register(setting); +} + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + if (event.getState() == State.PRE) { + int ticks = this.stateTicks; + Integer intVal = this.jumps.get(); + if (ticks < intVal * 2) { + MinecraftHelper minecraftHelper = this.mc.timer; + DoubleProperty doubleProp = this.timerSpeed; + Double propDouble = doubleProp.get(); + minecraftHelper.timerSpeed = propDouble.floatValue(); + Entity entity = this.mc.thePlayer; + if (this.mc.thePlayer.onGround) { + label33: { + label32: { + ResetVL resetVL = this; + if (this.stateTicks % 2 != 0) { + break label32; + } + + resetVL = this; + + EntityPlayerSP player = resetVL.mc.thePlayer; + double doubleVal = player.getFloat2(); + double angleRad = Math.toRadians(doubleVal); + double doubleVal2 = -MathHelper.sin(angleRad); + EntityPlayerSP player2 = this.mc.thePlayer; + double doubleVal3 = player2.getFloat2(); + double angleRad2 = Math.toRadians(doubleVal3); + double doubleVal4 = MathHelper.cos(angleRad2); + double doubleVal5 = event.getX(); + EntityPlayerSP player3 = this.mc.thePlayer; + double doubleVal6 = doubleVal5 + doubleVal2 * player3.resolveDouble(false) * 0.15; + event.setX(doubleVal6); + double doubleVal7 = event.getZ(); + player3 = this.mc.thePlayer; + double doubleVal8 = doubleVal7 + doubleVal4 * player3.resolveDouble(false) * 0.15; + event.setZ(doubleVal8); + double doubleVal9 = event.getY(); + double doubleVal10 = doubleVal9 + MathHelper.randomDouble(4.0E-4, 5.0E-4); + event.setY(doubleVal10); + event.setOnGround(false); + break label33; + } + + double doubleVal11 = event.getY() + 0.1249999999; + event.setY(doubleVal11); + event.setOnGround(false); + } + + this.stateTicks++; + } + + Minecraft mcClient = this.mc; + entity = mcClient.getRenderViewEntity(); + + entity.posY = event.getY(); + return; + } + + this.mc.timer.timerSpeed = 1.0F; + this.toggle(); + } +} + + +} diff --git a/src/main/java/cc/novoline/modules/misc/Spammer.java b/src/main/java/cc/novoline/modules/misc/Spammer.java new file mode 100644 index 0000000..6278e5e --- /dev/null +++ b/src/main/java/cc/novoline/modules/misc/Spammer.java @@ -0,0 +1,148 @@ +package cc.novoline.modules.misc; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.type.State; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.utils.ServerUtils; +import cc.novoline.utils.TimerUtil; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.gui.screen.setting.Setting; +import java.util.concurrent.ThreadLocalRandom; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraft.client.Minecraft; + +public final class Spammer extends AbstractModule { + @Property("delay") + private final IntProperty delay; + @Property("text") + private final StringProperty text; + private final TimerUtil timer; + @Property("name") + private final StringProperty name; + private boolean stateFlag; + private static final char[] fieldVal; + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + cc.novoline.modules.misc.Spammer spammer; + byte byteVal = (byte)(event.getState().equals(State.PRE) ? 1 : 0); + if ((byteVal == 0)) { + return; + } + + TimerUtil timerUtil = this.timer; + Integer intVal = this.delay.get(); + long longVal = intVal.intValue(); + byteVal = (byte)(timerUtil.delay(longVal) ? 1 : 0); + + if ((byteVal != 0)) { + StringBuilder sb = new StringBuilder(); + StringProperty strProp = this.text; + String propStr = strProp.get(); + char[] charArr = propStr.toCharArray(); + char[] charArr2 = charArr; + int len = charArr2.length; + int intVal2 = 0; + + label71: { + while (true) { + if (intVal2 < len) { + char ch = charArr2[intVal2]; + sb.append(ch); + byteVal = 0; + + int intVal3 = 0; + + while (true) { + ThreadLocalRandom threadLocalRandom = ThreadLocalRandom.current(); + if (intVal3 >= threadLocalRandom.nextInt(0, 4)) { + break; + } + + sb.append('\u05fc'); + intVal3++; + + } + + intVal2++; + + continue; + } + + spammer = this; + + StringProperty strProp2 = this.text; + String propStr2 = strProp2.get(); + byteVal = (byte)(propStr2.startsWith("/") ? 1 : 0); + break; + } + + if (byteVal != 0) { + this.sendPacket(new C01PacketChatMessage(this.text.get())); + break label71; + } + + spammer = this; + + C01PacketChatMessage chatMessagePacket; + StringBuilder sb2; + String textStr; + label36: { + chatMessagePacket = null; + sb2 = new StringBuilder(); + if (ServerUtils.isHypixel()) { + if (!this.mc.isSingleplayer()) { + textStr = "/achat "; + break label36; + } + } + + textStr = ""; + } + + sb2 = sb2.append(textStr); + chatMessagePacket = new C01PacketChatMessage(sb2.append(sb).toString()); + spammer.handlePacket(chatMessagePacket); + } + + TimerUtil timerUtil2 = this.timer; + timerUtil2.reset(); + } +} + + static { + String textStr = "abcdefghijklmnopqrstuvwxyz"; + fieldVal = textStr.toCharArray(); + } + + public Spammer(ModuleManager moduleManager, EnumModuleType enumModuleType, String str) { + super((moduleManager), (enumModuleType), (str)); + String textStr = str; + EnumModuleType modCategory = enumModuleType; + ModuleManager modManager = moduleManager; + String textStr2 = (str); + EnumModuleType modCategory2 = (enumModuleType); + ModuleManager modManager2 = (moduleManager); + this.timer = new TimerUtil(); + this.stateFlag = true; + this.name = StringProperty.of("Name here"); + this.text = StringProperty.of("Buy novoline"); + IntProperty intProp = IntProperty.of(3000); + Integer intVal = 100; + IntProperty intProp2 = intProp.minimum(intVal); + this.delay = intProp2.maximum(15000); + Setting setting = new Setting("SPAMMER_TEXT", "Text", SettingType.TEXTBOX, this, "Spam text", this.text); + SettingManager.register(setting); + setting = new Setting("SPAMMER_DELAY", "Delay (in ms)", SettingType.SLIDER, this, this.delay, 100.0); + SettingManager.register(setting); +} + + +} diff --git a/src/main/java/cc/novoline/modules/misc/StaffAnalyzer.java b/src/main/java/cc/novoline/modules/misc/StaffAnalyzer.java new file mode 100644 index 0000000..f07aba3 --- /dev/null +++ b/src/main/java/cc/novoline/modules/misc/StaffAnalyzer.java @@ -0,0 +1,85 @@ +package cc.novoline.modules.misc; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.visual.ClickGui; +import cc.novoline.modules.ModuleRegistry; +import cc.novoline.modules.ModuleManager; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class StaffAnalyzer extends AbstractModule { + private TimerUtil timer; + private int stateTicks; + @Property("delay") + private IntProperty delay; + private int stateTicks2; + + + public StaffAnalyzer(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + IntProperty intProp = IntProperty.of(60); + Integer intVal = 10; + IntProperty intProp2 = intProp.minimum(intVal); + this.delay = intProp2.maximum(180); + this.timer = new TimerUtil(); + SettingManager.register(new Setting("SA_DELAY", "Delay", SettingType.SLIDER, this, this.delay, 5.0, "s")); +} + + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + if (event.getState().equals(State.PRE)) { + StaffAnalyzer staffAnalyzer; + ClickGui clickGuiMod = ModuleRegistry.CLICKGUI.getModule(); + Integer intVal2 = clickGuiMod.getIntegerValue2(); + this.stateTicks = intVal2 - this.stateTicks2; + TimerUtil timerUtil = this.timer; + IntProperty intProp = this.delay; + intVal2 = intProp.get(); + long longVal = intVal2 * 1000; + int intVal = (timerUtil.delay(longVal) ? 1 : 0); + if (intVal == 0) { + return; + } + + staffAnalyzer = this; + + intVal = this.stateTicks; + + if (intVal > 0) { + String textStr = "Staff Activity"; + StringBuilder sb = new StringBuilder(); + sb = sb.append("Staff has banned "); + int ticks = this.stateTicks; + sb = sb.append(ticks); + String textStr2 = this.stateTicks <= 1 && this.stateTicks != 0 ? " player" : " players"; + + sb = sb.append(textStr2).append(" in the last "); + IntProperty intProp2 = this.delay; + Object obj = intProp2.get(); + sb = sb.append((Object)obj); + obj = " seconds"; + this.popNotification(textStr, sb.append((String)obj).toString(), 3000, NotificationType.INFO); + } + + intVal2 = clickGuiMod.getIntegerValue2(); + this.stateTicks2 = intVal2; + staffAnalyzer = this; + + TimerUtil timerUtil2 = staffAnalyzer.timer; + timerUtil2.reset(); + } +} + +} diff --git a/src/main/java/cc/novoline/modules/misc/UhcCrafts.java b/src/main/java/cc/novoline/modules/misc/UhcCrafts.java new file mode 100644 index 0000000..b61f3ab --- /dev/null +++ b/src/main/java/cc/novoline/modules/misc/UhcCrafts.java @@ -0,0 +1,1203 @@ +package cc.novoline.modules.misc; + +import cc.novoline.events.type.GuiState; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.modules.misc.uhc.UhcScrollBar; +import cc.novoline.modules.misc.uhc.UhcRecipeEntry; +import cc.novoline.modules.misc.uhc.UhcCraftRecipe; +import cc.novoline.modules.misc.uhc.UhcProfessionRegistry; +import cc.novoline.utils.HypixelLobbyType; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.ServerUtils; +import cc.novoline.utils.StencilUtil; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.notifications.NotificationManager; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.render.ColorPaletteUtil; + +import cc.novoline.Novoline; +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.LoadWorldEvent; +import cc.novoline.events.events.PlayerUpdateEvent; +import cc.novoline.events.events.RenderGuiEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.visual.ClickGui; +import com.mojang.authlib.GameProfile; +import cc.novoline.modules.ModuleRegistry; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ForkJoinPool; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.GuiIngame; +import net.minecraft.client.gui.inventory.GuiCrafting; +import net.minecraft.client.network.NetworkPlayerInfo; +import org.apache.commons.io.IOUtils; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.json.JSONArray; +import org.json.JSONObject; + +public class UhcCrafts extends AbstractModule { + private String cachedText; + private String cachedText2; + private TimerUtil timer; + private UhcProfessionRegistry uhcProfessionRegistryField; + private boolean stateFlag; + private final UhcRecipeEntry uhcRecipeEntryField; + private String cachedText3; + private static int Y; + private TimerUtil timer2; + private String textValue; + private final List uhcScrollBarList; + private String cachedText4; + @Property("stop-moving") + private BooleanProperty stopMoving; + private boolean stateFlag2; + + + public static void executeUhcCrafts(UhcCrafts uhcCrafts, String text, String str, int value, NotificationType notificationType) { + uhcCrafts.applyUpdate5(text, str, value, notificationType); +} + + public static Minecraft resolveMinecraft13(UhcCrafts uhcCrafts) { + return uhcCrafts.mc; +} + + public static Minecraft resolveMinecraft14(UhcCrafts uhcCrafts) { + return uhcCrafts.mc; +} + + public static int g() { + return Y; +} + + public List getListValue() { + return this.uhcScrollBarList; +} + + private void invokeCallback(JSONObject jSONObject, Throwable throwable) { + boolean flag; + UhcCraftRecipe uhcCraftRecipe; + int intVal; + JSONObject jSONObject2; + String textStr; + + intVal = getIntValue4(); + textStr = this.cachedText3; + boolean flag2 = jSONObject.getBoolean(textStr); + + if (!flag2) { + return; + } + + jSONObject2 = jSONObject; + textStr = this.cachedText2; + + flag2 = jSONObject.isNull(textStr); + + + if (flag2) { + return; + } + + jSONObject2 = jSONObject; + textStr = this.cachedText2; + + JSONObject jSONObject3 = jSONObject2.getJSONObject(textStr); + JSONObject jSONObject4 = jSONObject3; + String textStr2 = this.cachedText; + + if (jSONObject3.isNull(textStr2)) { + return; + } + + jSONObject4 = jSONObject3; + textStr2 = this.cachedText; + + + JSONObject jSONObject5 = jSONObject4.getJSONObject(textStr2); + JSONObject jSONObject6 = jSONObject5; + String textStr3 = this.textValue; + + if (jSONObject5.isNull(textStr3)) { + return; + } + + jSONObject6 = jSONObject5; + textStr3 = this.textValue; + + + JSONObject jSONObject7 = jSONObject6.getJSONObject(textStr3); + JSONObject jSONObject8 = jSONObject7; + String textStr4 = this.cachedText4; + + if (jSONObject7.isNull(textStr4)) { + return; + } + + jSONObject8 = jSONObject7; + textStr4 = this.cachedText4; + + + JSONArray jSONArray = jSONObject8.getJSONArray(textStr4); + Iterator iter = jSONArray.iterator(); + + do { + boolean hasNext2 = iter.hasNext(); + + label484: + while (true) { + if (!hasNext2) { + return; + } + + String textStr5; + + label521: { + Object obj = iter.next(); + String textStr6 = (String)obj; + textStr = "_"; + textStr5 = textStr6.replace(textStr, " "); + flag = textStr5.equals("iron ingots"); + + if (flag) { + textStr5 = "iron pack"; + + break label521; + + } + + flag = textStr5.equals("arrows economy"); + + + + if (flag) { + textStr5 = "arrow economy"; + + break label521; + + } + + flag = textStr5.equals("enchant bottles"); + + + + if (flag) { + textStr5 = "enlightening pack"; + + break label521; + + } + + flag = textStr5.equals("eight leather"); + + + + if (flag) { + textStr5 = "leather economy"; + + break label521; + + } + + flag = textStr5.equals("eight steaks"); + + + + if (flag) { + textStr5 = "delicious meal"; + + break label521; + + } + + flag = textStr5.equals("resist pot"); + + + + if (flag) { + textStr5 = "potion of toughness"; + + break label521; + + } + + flag = textStr5.equals("pandoras box"); + + + + if (flag) { + textStr5 = "pandora's box"; + + break label521; + + } + + flag = textStr5.equals("power one book"); + + + + if (flag) { + textStr5 = "book of power"; + + break label521; + + } + + flag = textStr5.equals("apples"); + + + + if (flag) { + textStr5 = "eve's temptation"; + + break label521; + + } + + flag = textStr5.equals("eight glowstone"); + + + + if (flag) { + textStr5 = "dust of light"; + + break label521; + + } + + flag = textStr5.equals("egen potion"); + + + + if (flag) { + textStr5 = "nectar"; + if (intVal == 0) { + break label521; + } + } + + flag = textStr5.equals("philosopher pick"); + + + + if (flag) { + textStr5 = "philosopher's pickaxe"; + if (intVal == 0) { + break label521; + } + } + + flag = textStr5.equals("prot book"); + + + + if (flag) { + textStr5 = "book of protection"; + if (intVal == 0) { + break label521; + } + } + + flag = textStr5.equals("sharp one book"); + + + + if (flag) { + textStr5 = "book of sharpening"; + if (intVal == 0) { + break label521; + } + } + + flag = textStr5.equals("light enchanting"); + + + + if (flag) { + textStr5 = "light Enchantment table"; + if (intVal == 0) { + break label521; + } + } + + flag = textStr5.equals("melon"); + + + + if (flag) { + textStr5 = "healing fruit"; + if (intVal == 0) { + break label521; + } + } + + flag = textStr5.equals("proj prot book"); + + + + if (flag) { + textStr5 = "artemis' book"; + if (intVal == 0) { + break label521; + } + } + + flag = textStr5.equals("absorption pot"); + + + + if (flag) { + textStr5 = "holy water"; + if (intVal == 0) { + break label521; + } + } + + flag = textStr5.equals("cupids bow"); + + + + if (flag) { + textStr5 = "cupid's bow"; + if (intVal == 0) { + break label521; + } + } + + flag = textStr5.equals("green armor"); + + + + if (flag) { + textStr5 = "spiked armor"; + if (intVal == 0) { + break label521; + } + } + + flag = textStr5.equals("seven league boots"); + + + + if (flag) { + textStr5 = "seven-league boots"; + if (intVal == 0) { + break label521; + } + } + + flag = textStr5.equals("kings rod"); + + + + if (flag) { + textStr5 = "king's rod"; + if (intVal == 0) { + break label521; + } + } + + flag = textStr5.equals("nether wart"); + + + + if (flag) { + textStr5 = "brewing artifact"; + if (intVal == 0) { + break label521; + } + } + + flag = textStr5.equals("blaze rod"); + + + + if (flag) { + textStr5 = "flaming artifact"; + if (intVal == 0) { + break label521; + } + } + + flag = textStr5.equals("anduril"); + + + + if (flag) { + textStr5 = "and\u016bril"; + if (intVal == 0) { + break label521; + } + } + + flag = textStr5.equals("artemis bow"); + + + + if (flag) { + textStr5 = "artemis' bow"; + if (intVal == 0) { + break label521; + } + } + + flag = textStr5.equals("efficiency pickaxe"); + + + + if (flag) { + textStr5 = "quick pick"; + if (intVal == 0) { + break label521; + } + } + + flag = textStr5.equals("lumberjack axe"); + + + + if (flag) { + textStr5 = "lumberjack's axe"; + if (intVal == 0) { + break label521; + } + } + + flag = textStr5.equals("masters compass"); + + + + if (flag) { + textStr5 = "master's compass"; + if (intVal == 0) { + break label521; + } + } + + flag = textStr5.equals("miners blessing"); + + + + if (flag) { + textStr5 = "miner's blessing"; + if (intVal == 0) { + break label521; + } + } + + flag = textStr5.equals("deaths scythe"); + + + + if (flag) { + textStr5 = "death's scythe"; + if (intVal == 0) { + break label521; + } + } + + flag = textStr5.equals("sugar cane"); + + + + if (flag) { + textStr5 = "sugar rush"; + if (intVal == 0) { + break label521; + } + } + + flag = textStr5.equals("el dorado"); + + + if (flag) { + textStr5 = "treasure of el dorado"; + } + } + + textStr = "prestige"; + flag = textStr5.contains(textStr); + + label522: { + + if (!flag) { + break label522; + } + + textStr = "working tools"; + flag = textStr5.contains(textStr); + + + + if (flag) { + this.uhcProfessionRegistryField.getProfessionByName("Toolsmithing").createUhcCraftRecipe(true); + if (intVal == 0) { + break label522; + } + } + + textStr = "looter"; + flag = textStr5.contains(textStr); + + + + if (flag) { + this.uhcProfessionRegistryField.getProfessionByName("Invention").createUhcCraftRecipe(true); + if (intVal == 0) { + break label522; + } + } + + textStr = "archery tools"; + flag = textStr5.contains(textStr); + + + + if (flag) { + this.uhcProfessionRegistryField.getProfessionByName("Hunter").createUhcCraftRecipe(true); + if (intVal == 0) { + break label522; + } + } + + textStr = "lunch box"; + flag = textStr5.contains(textStr); + + + + if (flag) { + this.uhcProfessionRegistryField.getProfessionByName("Survivalism").createUhcCraftRecipe(true); + if (intVal == 0) { + break label522; + } + } + + textStr = "leather armor"; + flag = textStr5.contains(textStr); + + + + if (flag) { + this.uhcProfessionRegistryField.getProfessionByName("Armorsmithing").createUhcCraftRecipe(true); + if (intVal == 0) { + break label522; + } + } + + textStr = "magic tools"; + flag = textStr5.contains(textStr); + + + + if (flag) { + this.uhcProfessionRegistryField.getProfessionByName("Enchanting").createUhcCraftRecipe(true); + if (intVal == 0) { + break label522; + } + } + + textStr = "horseman"; + flag = textStr5.contains(textStr); + + + + if (flag) { + this.uhcProfessionRegistryField.getProfessionByName("Bloodcraft").createUhcCraftRecipe(true); + if (intVal == 0) { + break label522; + } + } + + textStr = "ecologist"; + flag = textStr5.contains(textStr); + + + + if (flag) { + this.uhcProfessionRegistryField.getProfessionByName("Strategist").createUhcCraftRecipe(true); + if (intVal == 0) { + break label522; + } + } + + textStr = "trapper"; + flag = textStr5.contains(textStr); + + + + if (flag) { + this.uhcProfessionRegistryField.getProfessionByName("Engineering").createUhcCraftRecipe(true); + if (intVal == 0) { + break label522; + } + } + + textStr = "farmer"; + flag = textStr5.contains(textStr); + + + if (flag) { + this.uhcProfessionRegistryField.getProfessionByName("Cooking").createUhcCraftRecipe(true); + } + } + + List itemList = this.uhcProfessionRegistryField.getAllRecipes(); + Iterator iter2 = itemList.iterator(); + + while (true) { + if (!iter2.hasNext()) { + break label484; + } + + UhcCraftRecipe uhcCraftRecipe2 = (UhcCraftRecipe)iter2.next(); + String nameStr = uhcCraftRecipe2.getName(); + hasNext2 = nameStr.toLowerCase().equals(textStr5); + + label479: { + + + if (!hasNext2) { + break label479; + } + + uhcCraftRecipe = uhcCraftRecipe2; + + hasNext2 = uhcCraftRecipe2.isQueued(); + + + if (hasNext2) { + break label479; + } + + uhcCraftRecipe = uhcCraftRecipe2; + + uhcCraftRecipe.setQueued(true); + } + + } + } + + this.stateFlag2 = false; + TimerUtil timerUtil = this.timer2; + timerUtil.reset(); + this.stateFlag = true; + } while (intVal == 0); +} + + public static Minecraft resolveMinecraft15(UhcCrafts uhcCrafts) { + return uhcCrafts.mc; +} + + public static Minecraft resolveMinecraft16(UhcCrafts uhcCrafts) { + return uhcCrafts.mc; +} + + public static Minecraft resolveMinecraft17(UhcCrafts uhcCrafts) { + return uhcCrafts.mc; +} + + public static Minecraft resolveMinecraft18(UhcCrafts uhcCrafts) { + return uhcCrafts.mc; +} + + @EventTarget + public void onPlayerUpdate(PlayerUpdateEvent event) { + AbstractModule mod; + boolean flag = this.stateFlag2; + if (!this.stateFlag2) { + return; + } + + mod = this; + + TimerUtil timerUtil = this.timer; + flag = timerUtil.delay(1200L); + + if (!flag) { + return; + } + + ModuleRegistry modEntry = ModuleRegistry.CLICKGUI; + mod = modEntry.getModule(); + + ClickGui clickGuiMod = (ClickGui)mod; + String textStr = clickGuiMod.getCachedText2(); + CompletableFuture completableFuture = this.getCompletableFutureA(textStr); + completableFuture.whenCompleteAsync(((java.util.function.BiConsumer) this::invokeCallback)); + TimerUtil timerUtil2 = this.timer; + timerUtil2.reset(); +} + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + UhcCrafts uhcCrafts; + uhcCrafts = this; + + if (this.stateFlag) { + uhcCrafts = this; + + TimerUtil timerUtil = this.timer2; + if (timerUtil.delay(50L)) { + List itemList = this.uhcProfessionRegistryField.getAllRecipes(); + Stream stream2 = itemList.stream(); + Predicate predicate = ((java.util.function.Predicate) UhcCraftRecipe::isStateFlag2); + Stream stream3 = stream2.filter(predicate); + long longVal = stream3.count(); + String displayName = this.getDisplayName(); + StringBuilder sb = new StringBuilder().append(longVal); + this.applyUpdate5(displayName, sb.append(" recipes unlocked").toString(), 3000, NotificationType.INFO); + this.stateFlag = false; + } + } + + uhcCrafts = this; + + + if (uhcCrafts.mc.currentScreen != null) { + return; + } + + uhcCrafts = this; + + + List itemList2 = uhcCrafts.uhcScrollBarList; + + if (itemList2.isEmpty()) { + return; + } + + itemList2 = this.uhcScrollBarList; + + + itemList2.clear(); +} + + public boolean checkState9() { + boolean enabled = this.isEnabled(); + if (!enabled) { + return false; + } + + BooleanProperty boolProp = this.stopMoving; + Boolean propFlag = boolProp.get(); + enabled = propFlag; + + + if (!enabled) { + return false; + } + + enabled = this.mc.currentScreen instanceof GuiCrafting; + + + return enabled; +} + + public static Minecraft resolveMinecraft19(UhcCrafts uhcCrafts) { + return uhcCrafts.mc; +} + + public static Minecraft resolveMinecraft20(UhcCrafts uhcCrafts) { + return uhcCrafts.mc; +} + + static { + handleInt(9); + } + + public UhcCrafts(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.uhcScrollBarList = new ArrayList<>(); + this.uhcRecipeEntryField = new UhcRecipeEntry(this, this); + this.timer = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.uhcProfessionRegistryField = new UhcProfessionRegistry(this.mc); + this.cachedText4 = "packages"; + this.cachedText3 = "success"; + this.cachedText2 = "player"; + this.cachedText = "stats"; + this.textValue = "UHC"; + this.stopMoving = BooleanProperty.of(true); + Setting setting = new Setting("UHC_CRAFTS_STOP_MOVING", "Stop Moving", SettingType.CHECKBOX, this, this.stopMoving); + SettingManager.register(setting); + setting = new Setting("UHC_CRAFTS_REINITIALIZE", "Reinitialize", SettingType.BUTTON, this, this::lambdaImpl$new$0); + SettingManager.register(setting); +} + + public static Minecraft resolveMinecraft21(UhcCrafts uhcCrafts) { + return uhcCrafts.mc; +} + + public static void executeUhcCrafts2(UhcCrafts uhcCrafts, String text, String str, int value, NotificationType notificationType) { + uhcCrafts.applyUpdate5(text, str, value, notificationType); +} + + public static void handleInt(int value) { + Y = value; +} + + public boolean isReadyState8() { + boolean flag; + List itemList = this.mc.ingameGUI.getTabList().obtainList(); + Iterator iter = itemList.iterator(); + + while (true) { + if (iter.hasNext()) { + NetworkPlayerInfo networkPlayerInfo = (NetworkPlayerInfo)iter.next(); + HypixelLobbyType lobbyType = HypixelLobbyType.PRE; + flag = ServerUtils.serverIs(lobbyType); + + label54: { + if (flag) { + break label54; + } + + HypixelLobbyType lobbyType2 = HypixelLobbyType.LOBBY; + flag = ServerUtils.serverIs(lobbyType2); + + if (flag) { + break label54; + } + + EntityPlayerSP player = this.mc.thePlayer; + flag = player.getGameProfile().getName().equals(networkPlayerInfo.getGameProfile().getName()); + + if (flag) { + break label54; + } + + GuiIngame guiIngame = this.mc.ingameGUI; + flag = ColorPaletteUtil.checkNetworkPlayerInfo(guiIngame.getTabList().checkNetworkPlayerInfo(networkPlayerInfo)); + + if (flag) { + return true; + } + } + + continue; + } + + flag = false; + break; + } + + return flag; +} + + private void lambdaImpl$new$0(String text) { + Novoline novolineInst = Novoline.getInstance(); + NotificationManager notifManager = novolineInst.getNotificationManager(); + String displayName = this.getDisplayName(); + notifManager.pop(displayName, "Requesting Info", 2000, NotificationType.WARNING); + this.uhcProfessionRegistryField = new UhcProfessionRegistry(this.mc); + TimerUtil timerUtil = this.timer; + timerUtil.reset(); + this.stateFlag2 = true; +} + + public static Minecraft resolveMinecraft22(UhcCrafts uhcCrafts) { + return uhcCrafts.mc; +} + + public static Minecraft resolveMinecraft23(UhcCrafts uhcCrafts) { + return uhcCrafts.mc; +} + + public static int getIntValue4() { + int intVal = g(); + return intVal == 0 ? 39 : 0; +} + + public static Minecraft resolveMinecraft24(UhcCrafts uhcCrafts) { + return uhcCrafts.mc; +} + + public static Minecraft resolveMinecraft25(UhcCrafts uhcCrafts) { + return uhcCrafts.mc; +} + + public static Minecraft resolveMinecraft26(UhcCrafts uhcCrafts) { + return uhcCrafts.mc; +} + + public static Minecraft resolveMinecraft27(UhcCrafts uhcCrafts) { + return uhcCrafts.mc; +} + + public void performStep13() { + List itemList = this.uhcScrollBarList; + List itemList2 = this.uhcProfessionRegistryField.getQueuedRecipes(); + Stream stream2 = itemList2.stream(); + Function mapper = (UhcCraftRecipe uhcCraftRecipe) -> new UhcScrollBar(this, this, uhcCraftRecipe); + Stream stream3 = stream2.map(mapper); + Collector collector = Collectors.toList(); + Collection collection = (java.util.Collection) stream3.collect(collector); + itemList.addAll(collection); +} + + @EventTarget + public void onRenderGui(RenderGuiEvent event) { + if (!(event.getGuiScreen() instanceof GuiCrafting)) { + return; + } + + GuiCrafting gui = (GuiCrafting)event.getGuiScreen(); + int guiLeft = (gui.width - gui.xSize) / 2; + int guiTop = (gui.height - gui.ySize) / 2; + float panelWidth = 145.0F; + float panelHeight = (float)(gui.ySize - 3); + float margin = 7.0F; + float panelX = (float)guiLeft - margin - panelWidth; + float panelY = (float)(guiTop + 1); + + if (event.getState() == GuiState.RENDER) { + if (this.uhcScrollBarList.isEmpty()) { + this.performStep13(); + return; + } + + java.awt.Color bgColor = new java.awt.Color(23, 23, 23); + int bgRgb = bgColor.getRGB(); + RenderUtils.drawElement11(panelX, panelY, panelX + panelWidth, panelY + panelHeight, bgRgb); + + double[] scissorBounds = new double[]{ + (double)panelX, + (double)panelY, + (double)(panelX + panelWidth), + (double)(panelY + panelHeight - 1.0F) + }; + this.uhcRecipeEntryField.handleFloat(panelX + panelWidth - 7.5F, panelY + 5.0F); + this.uhcRecipeEntryField.applyUpdate(event.getMouseX(), event.getMouseY(), panelHeight - 10.0F, scissorBounds); + this.uhcRecipeEntryField.applyFlag(toBooleanArg(1)); + + float itemY = panelY + 3.5F; + Iterator craftIter = this.uhcScrollBarList.iterator(); + + while (true) { + if (!craftIter.hasNext()) { + break; + } + + UhcScrollBar entry = craftIter.next(); + if (entry.checkInt(event.getMouseX(), event.getMouseY()) && (float)event.getMouseY() > panelY && (float)event.getMouseY() < panelY + panelHeight) { + double slotX = (double)guiLeft; + + for (int slot = 0; slot < 9; slot++) { + net.minecraft.item.Item ingredient = entry.getUhcCraftRecipeField().getItemArray()[slot]; + net.minecraft.item.ItemStack stack = ingredient == null ? null : entry.createUhcCraftRecipe(ingredient); + if (stack != null) { + String craftName = entry.getUhcCraftRecipeField().getCachedText(); + if (craftName.equals("Flaming Artifact")) { + if (ingredient == net.minecraft.item.Item.getItemFromBlock(net.minecraft.init.Blocks.blockStainedGlass)) { + stack.setItemDamage(1); + } + } else if (craftName.equals("Eve's Temptation") || craftName.equals("Healing Fruit")) { + if (ingredient == net.minecraft.init.Items.item112) { + stack.setItemDamage(15); + } + } else if (craftName.equals("Potion of Velocity")) { + if (ingredient == net.minecraft.init.Items.item112) { + stack.setItemDamage(3); + } + } else if (craftName.equals("Sugar Rush")) { + if (ingredient == net.minecraft.item.Item.getItemFromBlock(net.minecraft.init.Blocks.block19)) { + stack.setItemDamage(0); + } + } else if (craftName.equals("Treasure of El Dorado")) { + if (ingredient == net.minecraft.item.Item.getItemFromBlock(net.minecraft.init.Blocks.block28)) { + if (slot == 1) { + stack.setItemDamage(14); + } else if (slot == 3 || slot == 5) { + stack.setItemDamage(0); + } + } + } else if (craftName.equals("Flask of Ichor")) { + if (ingredient == net.minecraft.init.Items.item135) { + stack.setItemDamage(3); + } else if (ingredient == net.minecraft.init.Items.item112) { + stack.setItemDamage(0); + } + } + } + + int alpha = 255; + int seenSameItem = 0; + net.minecraft.item.Item[] recipeArray = entry.getUhcCraftRecipeField().getItemArray(); + List recipeList = java.util.Arrays.asList(recipeArray); + int idx = 0; + + while (true) { + if (idx >= recipeList.size()) { + break; + } + + net.minecraft.item.Item candidate = recipeList.get(idx); + if (candidate == ingredient) { + int ownedCount; + if (stack == null) { + EntityPlayerSP player = this.mc.thePlayer; + ownedCount = player.countItemInInventory(candidate); + } else { + EntityPlayerSP player = this.mc.thePlayer; + int meta = stack.getItemDamage(); + ownedCount = player.applyArmorCalculations(candidate, meta); + } + + if (idx == slot && seenSameItem > ownedCount - 1) { + alpha = 50; + } + seenSameItem++; + } + idx++; + } + + int rowShiftX = slot > 5 ? 108 : (slot > 2 ? 54 : 0); + int rowIndexY = slot > 5 ? 3 : (slot > 2 ? 2 : 1); + double renderX = slotX + 30.0 - (double)rowShiftX; + double renderY = (double)guiTop + 17.5 * (double)rowIndexY; + RenderUtils.drawElement9(stack, renderX, renderY, alpha); + slotX += 18.0; + } + } + + entry.applyUpdate2(panelX + 3.0F, itemY - this.uhcRecipeEntryField.getCachedAngle6()); + if ((entry.getCachedAngle3() > panelY || entry.getCachedAngle3() + 22.0F > panelY) && entry.getCachedAngle3() < panelY + panelHeight) { + entry.createUhcCraftRecipe(scissorBounds); + } + itemY += 22.0F + 4.0F; + } + + StencilUtil.initStencilToWrite(toBooleanArg(0)); + double x1 = scissorBounds[0]; + double y1 = scissorBounds[1]; + double x2 = scissorBounds[2]; + double y2 = scissorBounds[3]; + java.awt.Color borderColor = new java.awt.Color(255, 255, 255); + int borderRgb = borderColor.getRGB(); + RenderUtils.drawElement11(x1, y1, x2, y2, borderRgb); + StencilUtil.readStencilBuffer(toBooleanArg(1)); + + Iterator overlayIter = this.uhcScrollBarList.iterator(); + while (true) { + if (!overlayIter.hasNext()) { + break; + } + UhcScrollBar entry = overlayIter.next(); + entry.applyUpdate2(event.getMouseX(), event.getMouseY()); + } + StencilUtil.uninitStencilBuffer(); + } else if (event.getState() == GuiState.CLICK) { + this.uhcRecipeEntryField.applyUpdate(event.getMouseX(), event.getMouseY(), event.getMouseButton(), (float)(gui.ySize - 3)); + if ((float)event.getMouseY() > panelY && (float)event.getMouseY() < panelY + panelHeight) { + Iterator clickIter = this.uhcScrollBarList.iterator(); + while (true) { + if (!clickIter.hasNext()) { + break; + } + UhcScrollBar entry = clickIter.next(); + entry.applyUpdate(event.getMouseX(), event.getMouseY(), event.getMouseButton()); + } + } + } else if (event.getState() == GuiState.RELEASE) { + this.uhcRecipeEntryField.performAction(); + } + } + + private JSONObject mapString(String text) { + String textStr = ""; + CloseableHttpClient closeableHttpClient = HttpClients.createDefault(); + StringBuilder sb = new StringBuilder(); + sb = sb.append("https://api.hypixel.net/player?key=").append(text); + sb = sb.append("&uuid="); + EntityPlayerSP player2 = this.mc.thePlayer; + GameProfile gameProfile = player2.getGameProfile(); + String textStr3 = gameProfile.getId().toString(); + HttpGet httpGet = new HttpGet(sb.append(textStr3).toString()); + httpGet.setHeader("xf-api-key", text); + httpGet.setHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"); + CloseableHttpResponse closeableHttpResponse = null; + + try { + closeableHttpResponse = closeableHttpClient.execute(httpGet); + } catch (IOException ex) { + ex.printStackTrace(); + } + + String textStr2 = null; + + try { + InputStream inputStream = closeableHttpResponse.getEntity().getContent(); + Charset charset = StandardCharsets.UTF_8; + textStr2 = IOUtils.toString(inputStream, charset); + } catch (IOException ex2) { + ex2.printStackTrace(); + } + + return new JSONObject(textStr2); +} + + public static Minecraft resolveMinecraft(UhcCrafts uhcCrafts) { + return uhcCrafts.mc; +} + + @EventTarget + public void onLoadWorld(LoadWorldEvent event) { + this.applyUpdate5(this.getDisplayName(), "Requesting Info", 2000, NotificationType.WARNING); + this.timer.reset(); + this.stateFlag2 = true; +} + + private CompletableFuture getCompletableFutureA(String text) { + return CompletableFuture.supplyAsync(((java.util.function.Supplier) () -> this.mapString(text)), ForkJoinPool.commonPool()); +} + + public static void executeUhcCrafts3(UhcCrafts uhcCrafts, String text, String str, int value, NotificationType notificationType) { + uhcCrafts.applyUpdate5(text, str, value, notificationType); +} + + + public static Minecraft applyInt5(UhcCrafts uhcCrafts) { + return uhcCrafts.mc; +} + + + public static Minecraft resolveMinecraft29(UhcCrafts uhcCrafts) { + return uhcCrafts.mc; +} + + + public static void executeUhcCrafts4(UhcCrafts uhcCrafts, String text, String str, int value, NotificationType notificationType) { + uhcCrafts.applyUpdate5(text, str, value, notificationType); +} + + public static Minecraft resolveMinecraft30(UhcCrafts uhcCrafts) { + return uhcCrafts.mc; +} + + + private static boolean toBooleanArg(int value) { return value != 0; } +} diff --git a/src/main/java/cc/novoline/modules/misc/uhc/HypixelAutoRewards.java b/src/main/java/cc/novoline/modules/misc/uhc/HypixelAutoRewards.java new file mode 100644 index 0000000..71c031b --- /dev/null +++ b/src/main/java/cc/novoline/modules/misc/uhc/HypixelAutoRewards.java @@ -0,0 +1,225 @@ +package cc.novoline.modules.misc.uhc; + +import cc.novoline.Novoline; +import cc.novoline.events.EventManager; +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.modules.misc.UhcCrafts; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.notifications.NotificationManager; +import cc.novoline.utils.notifications.NotificationType; +import java.util.Arrays; +import java.util.List; +import java.util.function.Predicate; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraft.network.play.server.S30PacketWindowItems; +import net.minecraft.client.multiplayer.PlayerControllerMP; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraft.network.play.server.S2DPacketOpenWindow; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IChatComponent; + +public class HypixelAutoRewards { + private int stateTicks; + private boolean stateFlag; + private static final String CONST_STRING = "/rewards"; + private boolean flagValue; + private TimerUtil timer; + private Minecraft mcClient; + private boolean stateFlag2; + private boolean stateFlag3; + + + @EventTarget + public void onPacket(PacketEvent event) { + cc.novoline.modules.misc.uhc.HypixelAutoRewards hypixelAutoRewards; + java.lang.Object obj; + Object obj2; + int intVal = UhcCrafts.getIntValue4(); + PacketEvent packetEvent = event; + + if (event.getState() == State.OUTGOING) { + boolean flag = event.getPacket() instanceof C03PacketPlayer; + + if (!flag) { + return; + } + + flag = this.stateFlag; + + + if (!flag) { + return; + } + + hypixelAutoRewards = this; + + TimerUtil timerUtil = this.timer; + flag = timerUtil.delay(50L); + + if (flag) { + Minecraft mcClient2 = this.mcClient; + NetHandlerPlayClient netHandler = mcClient2.getNetHandler(); + netHandler.sendPacketNoEvent(new C01PacketChatMessage("/rewards")); + TimerUtil timerUtil2 = this.timer; + timerUtil2.reset(); + } + + hypixelAutoRewards = this; + + hypixelAutoRewards.stateFlag = false; + return; + } + + packetEvent = event; + + + boolean flag2 = packetEvent.getPacket() instanceof S2DPacketOpenWindow; + + if (flag2) { + S2DPacketOpenWindow openWindowPacket = (S2DPacketOpenWindow)event.getPacket(); + IChatComponent chatComp = openWindowPacket.getWindowTitle(); + if (chatComp.getUnformattedText().equals("Hypixel Leveling")) { + boolean flag3 = this.stateFlag2 = this.flagValue = true; + event.setCancelled(flag3); + } + + return; + } + + flag2 = event.getPacket() instanceof S30PacketWindowItems; + + + { + if (intVal == 0) { + if (flag2) { + label146: { + + S30PacketWindowItems windowItemsPacket = (S30PacketWindowItems)event.getPacket(); + ItemStack[] stackArr = windowItemsPacket.getItemStacks(); + List itemList = Arrays.asList(stackArr); + String textStr = "\u00a7aHypixel Level Reward"; + Predicate predicate = ((java.util.function.Predicate) (($a0) -> HypixelAutoRewards.invokeCallback(textStr, ((net.minecraft.item.ItemStack) $a0)))); + this.stateTicks = windowItemsPacket.getWindowId(); + boolean flag4 = this.flagValue; + + if (!this.flagValue) { + break label146; + } + + obj = itemList.stream(); + + flag4 = ((java.util.stream.Stream) obj).anyMatch(predicate); + + + if (flag4) { + int intVal2 = 0; + + while (true) { + if (intVal2 >= itemList.size()) { + break; + } + + ItemStack stack = (ItemStack)itemList.get(intVal2); + + + if (stack != null) { + String displayName = stack.getDisplayName(); + if (displayName.startsWith(textStr)) { + PlayerControllerMP controller = this.mcClient.playerController; + int ticks = this.stateTicks; + EntityPlayerSP player = this.mcClient.thePlayer; + controller.windowClickDirect(ticks, intVal2, 0, 0, player); + this.flagValue = false; + break; + } + } + + intVal2++; + + } + + break label146; + } + + obj = itemList.get(26); + + if (obj == null) { + Minecraft mcClient3 = this.mcClient; + Novoline novolineInst = mcClient3.obtainNovoline(); + NotificationManager notifManager = novolineInst.getNotificationManager(); + notifManager.pop("Hypixel", "All rewards were received", 2000, NotificationType.INFO); + Minecraft mcClient4 = this.mcClient; + NetHandlerPlayClient netHandler2 = mcClient4.getNetHandler(); + C0DPacketCloseWindow closeWindowPacket = new C0DPacketCloseWindow(this.stateTicks); + netHandler2.sendPacketNoEvent(closeWindowPacket); + EventManager.unregister(this); + this.flagValue = false; + break label146; + } + + PlayerControllerMP controller2 = this.mcClient.playerController; + int ticks2 = this.stateTicks; + EntityPlayerSP player2 = this.mcClient.thePlayer; + controller2.windowClickDirect(ticks2, 26, 0, 0, player2); + } + + return; + } + + obj2 = event.getPacket(); + + flag2 = obj2 instanceof S02PacketChat; + } + + if (!flag2) { + return; + } + + obj2 = event.getPacket(); + } + + S02PacketChat chatPacket = (S02PacketChat)obj2; + IChatComponent chatComp2 = chatPacket.getChatComponent(); + String msgText = chatComp2.getFormattedText(); + if (!msgText.startsWith("\u00a7aYou claimed your")) { + return; + } + + Minecraft mcClient5 = this.mcClient; + NetHandlerPlayClient netHandler3 = mcClient5.getNetHandler(); + C0DPacketCloseWindow closeWindowPacket2 = new C0DPacketCloseWindow(this.stateTicks); + netHandler3.sendPacketNoEvent(closeWindowPacket2); + this.stateFlag2 = false; + + this.stateFlag = true; +} + + private static boolean invokeCallback(String text, ItemStack stack) { + ItemStack stack2 = stack; + if (stack == null) { + return false; + } + + stack2 = stack; + + String displayName = stack2.getDisplayName(); + return displayName.startsWith(text); +} + + public HypixelAutoRewards(Minecraft minecraft) { + Minecraft mcClient2 = minecraft; + this.timer = new TimerUtil(); + this.stateFlag3 = true; + NetHandlerPlayClient netHandler = mcClient2.getNetHandler(); + netHandler.sendPacketNoEvent(new C01PacketChatMessage("/rewards")); + this.mcClient = mcClient2; +} + +} diff --git a/src/main/java/cc/novoline/modules/misc/uhc/UhcCraftRecipe.java b/src/main/java/cc/novoline/modules/misc/uhc/UhcCraftRecipe.java new file mode 100644 index 0000000..1e07630 --- /dev/null +++ b/src/main/java/cc/novoline/modules/misc/uhc/UhcCraftRecipe.java @@ -0,0 +1,178 @@ +package cc.novoline.modules.misc.uhc; + +import cc.novoline.utils.TimerUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class UhcCraftRecipe { + private final int stateTicks; + private int stateTicks2; + private boolean stateFlag; + private final String cachedText; + private final Item itemField; + private final Item[] itemArrayField; + final UhcProfessionRegistry uhcProfessionRegistryField; + private boolean stateFlag2; + + public Item[] getItemArray() { + return this.itemArrayField; +} + + public String getCachedText() { + return this.cachedText; +} + + public int evaluateInt(Item item2) { + net.minecraft.item.Item item3; + int intVal = 0; + InventoryPlayer inventory2 = Minecraft.getMinecraft().thePlayer.inventory; + int intVal2 = 9; + + while (intVal2 < 45) { + label31: { + ItemStack stack; + stack = inventory2.getStackInSlot(intVal2); + ItemStack stack2 = stack; + if (stack != null) { + item3 = stack.getItem(); + + if (item3 != null) { + break label31; + } + } + + stack2 = stack; + + item3 = stack2.getItem(); + + if (item3 == item2) { + intVal += stack.stackSize; + } + } + + intVal2++; + + } + + return intVal; +} + + public Item getItemField() { + return this.itemField; +} + + public boolean isReadyState() { + int intVal3 = TimerUtil.g(); + Item[] itemArr = this.getItemArray(); + int intVal = intVal3; + int len = itemArr.length; + int intVal2 = 0; + + while (true) { + if (intVal2 < len) { + Item item = itemArr[intVal2]; + if (intVal != 0) { + EntityPlayerSP player = this.uhcProfessionRegistryField.getMinecraft().thePlayer; + intVal3 = player.countItemInInventory(item); + if (intVal == 0) { + break; + } + + EntityPlayerSP player2 = this.uhcProfessionRegistryField.getMinecraft().thePlayer; + Item[] itemArr2 = this.getItemArray(); + if (intVal3 < player2.countItemInArray(itemArr2, item)) { + return false; + } + + intVal2++; + } + + continue; + } + + intVal3 = 1; + break; + } + + return ((((intVal3 & 1)) != 0)); +} + + public boolean isStateFlag2() { + return this.stateFlag2; +} + + public int getStateTicks2() { + return this.stateTicks2; +} + + public void setStateFlag(boolean flag) { + this.stateFlag = flag; +} + + public void updateHelper() { + this.evaluateInt(this.stateTicks2 + 1); +} + + public boolean isReadyState2() { + int intVal = (this.stateFlag2 ? 1 : 0); + + if (!this.stateFlag2) { + return false; + } + + intVal = this.stateTicks2; + + + UhcCraftRecipe uhcCraftRecipe = this; + + if (this.stateFlag) { + return intVal < this.stateTicks + 1; + } + + uhcCraftRecipe = this; + + + return intVal < uhcCraftRecipe.stateTicks; +} + + public UhcCraftRecipe(UhcProfessionRegistry uhcProfessionRegistry, String text, Item item, int value, Item[] itemArray) { + this.uhcProfessionRegistryField = uhcProfessionRegistry; + this.cachedText = text; + this.itemField = item; + this.stateTicks = value; + this.itemArrayField = itemArray; +} + + public void evaluateInt(boolean flag) { + this.stateFlag2 = flag; +} + + public boolean isStateFlag() { + return this.stateFlag; +} + + public int getStateTicks() { + return this.stateTicks; +} + + public void evaluateInt(int value) { + this.stateTicks2 = value; +} + + public String getName() { return this.getCachedText(); } + public Item getResultItem() { return this.getItemField(); } + public Item[] getIngredients() { return this.getItemArray(); } + public int getMaxCrafts() { return this.getStateTicks(); } + public int getCraftedCount() { return this.getStateTicks2(); } + public void setCraftedCount(int count) { this.evaluateInt(count); } + public void incrementCraftedCount() { this.updateHelper(); } + public boolean canCraft() { return this.isReadyState(); } + public boolean shouldAutoCraft() { return this.isReadyState2(); } + public boolean isQueued() { return this.isStateFlag2(); } + public void setQueued(boolean queued) { this.evaluateInt(queued); } + public boolean hasExtraCraft() { return this.isStateFlag(); } + public void setExtraCraft(boolean extra) { this.setStateFlag(extra); } +} diff --git a/src/main/java/cc/novoline/modules/misc/uhc/UhcProfession.java b/src/main/java/cc/novoline/modules/misc/uhc/UhcProfession.java new file mode 100644 index 0000000..80eac7a --- /dev/null +++ b/src/main/java/cc/novoline/modules/misc/uhc/UhcProfession.java @@ -0,0 +1,59 @@ +package cc.novoline.modules.misc.uhc; + +import cc.novoline.utils.TimerUtil; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.function.Predicate; +import java.util.stream.Stream; + +public class UhcProfession { + private String cachedText; + private List uhcCraftRecipeList; + final UhcProfessionRegistry uhcProfessionRegistryField; + + public UhcCraftRecipe createUhcCraftRecipe(String text) { + Stream stream2 = this.uhcCraftRecipeList.stream(); + Predicate predicate = ((java.util.function.Predicate) (uhcCraftRecipe) -> UhcProfession.invokeCallback(text, uhcCraftRecipe)); + Stream stream3 = stream2.filter(predicate); + Optional optional = stream3.findFirst(); + return (UhcCraftRecipe)optional.orElse(null); +} + + public void createUhcCraftRecipe(boolean flag) { + Iterator iter = this.uhcCraftRecipeList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + UhcCraftRecipe uhcCraftRecipe = (UhcCraftRecipe)iter.next(); + uhcCraftRecipe.setStateFlag(flag); + } +} + + private static boolean invokeCallback(String name, UhcCraftRecipe uhcCraftRecipe) { + String textStr = uhcCraftRecipe.getCachedText(); + return textStr.equalsIgnoreCase(name); +} + + public String getCachedText() { + return this.cachedText; +} + + public UhcProfession(UhcProfessionRegistry uhcProfessionRegistry, String text, List list) { + this.uhcProfessionRegistryField = uhcProfessionRegistry; + this.cachedText = text; + this.uhcCraftRecipeList = list; +} + + public List getUhcCraftRecipeList() { + return this.uhcCraftRecipeList; +} + + public List getRecipes() { return this.getUhcCraftRecipeList(); } + public String getName() { return this.getCachedText(); } + public UhcCraftRecipe getRecipeByName(String name) { return this.createUhcCraftRecipe(name); } + public void setExtraCraftEnabled(boolean enabled) { this.createUhcCraftRecipe(enabled); } +} diff --git a/src/main/java/cc/novoline/modules/misc/uhc/UhcProfessionRegistry.java b/src/main/java/cc/novoline/modules/misc/uhc/UhcProfessionRegistry.java new file mode 100644 index 0000000..669141f --- /dev/null +++ b/src/main/java/cc/novoline/modules/misc/uhc/UhcProfessionRegistry.java @@ -0,0 +1,258 @@ +package cc.novoline.modules.misc.uhc; + + +import cc.novoline.utils.TimerUtil; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.function.Predicate; +import java.util.stream.Stream; + + +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemPotion; +import net.minecraft.potion.Potion; + +public class UhcProfessionRegistry { + private final UhcProfession uhcProfessionField; + private final UhcProfession uhcProfession; + private final List uhcProfessionList; + private final UhcProfession uhcProfessionField8; + private final UhcProfession uhcProfessionField2; + private final UhcProfession uhcProfessionField9; + private final UhcProfession uhcProfessionField3; + private final UhcProfession uhcProfessionField10; + private Minecraft mc; + private final UhcProfession uhcProfessionField11; + private final UhcProfession uhcProfessionField12; + private final UhcProfession uhcProfessionField4; + private final UhcProfession uhcProfessionField13; + private final UhcProfession uhcProfessionField5; + private Item itemField = null; + private final UhcProfession uhcProfessionField6; + private final UhcProfession uhcProfessionField7; + + public UhcProfessionRegistry(Minecraft minecraft) { + UhcCraftRecipe[] uhcCraftsHelperArray = new UhcCraftRecipe[]{new UhcCraftRecipe(this, "Vorpal Sword", Items.iron_sword, 3, new Item[]{this.itemField, Items.bone, this.itemField, this.itemField, Items.iron_sword, this.itemField, this.itemField, Items.rotten_flesh, this.itemField}), new UhcCraftRecipe(this, "Book of Sharpening", (Item)Items.enchanted_book, 3, new Item[]{Items.flint, this.itemField, this.itemField, this.itemField, Items.paper, Items.paper, this.itemField, Items.paper, Items.iron_sword}), new UhcCraftRecipe(this, "Book of Power", (Item)Items.enchanted_book, 3, new Item[]{Items.flint, this.itemField, this.itemField, this.itemField, Items.paper, Items.paper, this.itemField, Items.paper, Items.bone}), new UhcCraftRecipe(this, "Dragon Sword", Items.diamond_sword, 1, new Item[]{this.itemField, Items.blaze_powder, this.itemField, this.itemField, Items.diamond_sword, this.itemField, this.getItemFromBlock(Blocks.obsidian), Items.blaze_powder, this.getItemFromBlock(Blocks.obsidian)})}; + this.uhcProfessionField8 = new UhcProfession(this, "Weaponsmithing", Arrays.asList(uhcCraftsHelperArray)); + UhcCraftRecipe[] uhcCraftsHelperArray2 = new UhcCraftRecipe[]{new UhcCraftRecipe(this, "Leather Economy", Items.leather, 3, new Item[]{Items.stick, Items.leather, Items.stick, Items.stick, Items.leather, Items.stick, Items.stick, Items.leather, Items.stick}), new UhcCraftRecipe(this, "Book of Protection", (Item)Items.enchanted_book, 3, new Item[]{this.itemField, this.itemField, this.itemField, this.itemField, Items.paper, Items.paper, this.itemField, Items.paper, Items.iron_ingot}), new UhcCraftRecipe(this, "Artemis' Book", (Item)Items.enchanted_book, 3, new Item[]{this.itemField, this.itemField, this.itemField, this.itemField, Items.paper, Items.paper, this.itemField, Items.paper, Items.arrow}), new UhcCraftRecipe(this, "Dragon Armor", (Item)Items.diamond_chestplate, 1, new Item[]{this.itemField, Items.magma_cream, this.itemField, this.itemField, Items.diamond_chestplate, this.itemField, this.getItemFromBlock(Blocks.obsidian), this.getItemFromBlock(Blocks.anvil), this.getItemFromBlock(Blocks.obsidian)})}; + this.uhcProfessionField7 = new UhcProfession(this, "Armorsmithing", Arrays.asList(uhcCraftsHelperArray2)); + UhcCraftRecipe[] uhcCraftsHelperArray3 = new UhcCraftRecipe[4]; + uhcCraftsHelperArray3[0] = new UhcCraftRecipe(this, "Dust of Light", Items.glowstone_dust, 3, new Item[]{Items.redstone, Items.redstone, Items.redstone, Items.redstone, Items.flint_and_steel, Items.redstone, Items.redstone, Items.redstone, Items.redstone}); + uhcCraftsHelperArray3[1] = new UhcCraftRecipe(this, "Brewing Artifact", Items.nether_wart, 3, new Item[]{this.itemField, Items.wheat_seeds, this.itemField, Items.wheat_seeds, Items.fermented_spider_eye, Items.wheat_seeds, this.itemField, Items.wheat_seeds, this.itemField}); + uhcCraftsHelperArray3[2] = new UhcCraftRecipe(this, "Nectar", ItemPotion.getItemById(Potion.regeneration.computeInt()), 3, new Item[]{this.itemField, Items.emerald, this.itemField, Items.gold_ingot, Items.melon, Items.gold_ingot, this.itemField, Items.glass_bottle, this.itemField}); + uhcCraftsHelperArray3[3] = new UhcCraftRecipe(this, "Flaming Artifact", Items.blaze_rod, 1, new Item[]{this.getItemFromBlock(Blocks.stained_glass), Items.lava_bucket, this.getItemFromBlock(Blocks.stained_glass), this.getItemFromBlock(Blocks.stained_glass), Items.fireworks, this.getItemFromBlock(Blocks.stained_glass), this.getItemFromBlock(Blocks.stained_glass), Items.lava_bucket, this.getItemFromBlock(Blocks.stained_glass)}); + this.uhcProfessionField13 = new UhcProfession(this, "Alchemy", Arrays.asList(uhcCraftsHelperArray3)); + UhcCraftRecipe[] uhcCraftsHelperArray4 = new UhcCraftRecipe[4]; + uhcCraftsHelperArray4[0] = new UhcCraftRecipe(this, "Delicious Meal", Items.cooked_beef, 3, new Item[]{Items.beef, Items.beef, Items.beef, Items.beef, Items.coal, Items.beef, Items.beef, Items.beef, Items.beef}); + uhcCraftsHelperArray4[1] = new UhcCraftRecipe(this, "Potion of Toughness", ItemPotion.getItemById(Potion.resistance.computeInt()), 3, new Item[]{this.itemField, Items.slime_ball, this.itemField, this.itemField, this.getItemFromBlock(Blocks.snow), this.itemField, this.itemField, Items.glass_bottle, this.itemField}); + uhcCraftsHelperArray4[2] = new UhcCraftRecipe(this, "Spiked Armor", (Item)Items.leather_chestplate, 3, new Item[]{this.itemField, this.getItemFromBlock(Blocks.waterlily), this.itemField, this.itemField, this.getItemFromBlock(Blocks.cactus), this.itemField, this.itemField, Items.leather_chestplate, this.itemField}); + uhcCraftsHelperArray4[3] = new UhcCraftRecipe(this, "Seven-league Boots", (Item)Items.diamond_boots, 1, new Item[]{Items.feather, Items.ender_pearl, Items.feather, Items.feather, Items.diamond_boots, Items.feather, Items.feather, Items.water_bucket, Items.feather}); + this.uhcProfessionField12 = new UhcProfession(this, "Survivalism", Arrays.asList(uhcCraftsHelperArray4)); + UhcCraftRecipe[] uhcCraftsHelperArray5 = new UhcCraftRecipe[]{new UhcCraftRecipe(this, "Iron Pack", Items.iron_ingot, 3, new Item[]{this.getItemFromBlock(Blocks.iron_ore), this.getItemFromBlock(Blocks.iron_ore), this.getItemFromBlock(Blocks.iron_ore), this.getItemFromBlock(Blocks.iron_ore), Items.coal, this.getItemFromBlock(Blocks.iron_ore), this.getItemFromBlock(Blocks.iron_ore), this.getItemFromBlock(Blocks.iron_ore), this.getItemFromBlock(Blocks.iron_ore)}), new UhcCraftRecipe(this, "Obsidian", this.getItemFromBlock(Blocks.obsidian), 3, new Item[]{this.itemField, this.itemField, this.itemField, this.itemField, Items.water_bucket, this.itemField, this.itemField, Items.lava_bucket, this.itemField}), new UhcCraftRecipe(this, "Tarnhelm", (Item)Items.diamond_helmet, 3, new Item[]{Items.diamond, Items.iron_ingot, Items.diamond, Items.diamond, this.getItemFromBlock(Blocks.redstone_block), Items.diamond, this.itemField, this.itemField, this.itemField}), new UhcCraftRecipe(this, "Philosopher's Pickaxe", Items.diamond_pickaxe, 1, new Item[]{this.getItemFromBlock(Blocks.iron_ore), this.getItemFromBlock(Blocks.gold_ore), this.getItemFromBlock(Blocks.iron_ore), this.getItemFromBlock(Blocks.lapis_block), Items.stick, this.getItemFromBlock(Blocks.lapis_block), this.itemField, Items.stick, this.itemField})}; + this.uhcProfessionField = new UhcProfession(this, "Engineering", Arrays.asList(uhcCraftsHelperArray5)); + UhcCraftRecipe[] uhcCraftsHelperArray6 = new UhcCraftRecipe[]{new UhcCraftRecipe(this, "Enlightening Pack", Items.experience_bottle, 3, new Item[]{this.itemField, this.getItemFromBlock(Blocks.redstone_block), this.itemField, this.getItemFromBlock(Blocks.redstone_block), Items.glass_bottle, this.getItemFromBlock(Blocks.redstone_block), this.itemField, this.getItemFromBlock(Blocks.redstone_block), this.itemField}), new UhcCraftRecipe(this, "Light Anvil", this.getItemFromBlock(Blocks.anvil), 3, new Item[]{Items.iron_ingot, Items.iron_ingot, Items.iron_ingot, this.itemField, this.getItemFromBlock(Blocks.iron_block), this.itemField, Items.iron_ingot, Items.iron_ingot, Items.iron_ingot}), new UhcCraftRecipe(this, "Light Enchantment Table", this.getItemFromBlock(Blocks.enchanting_table), 3, new Item[]{this.itemField, this.getItemFromBlock(Blocks.bookshelf), this.itemField, this.getItemFromBlock(Blocks.obsidian), Items.diamond, this.getItemFromBlock(Blocks.obsidian), this.getItemFromBlock(Blocks.obsidian), Items.experience_bottle, this.getItemFromBlock(Blocks.obsidian)}), new UhcCraftRecipe(this, "Book of Thoth", (Item)Items.enchanted_book, 1, new Item[]{Items.ender_pearl, this.itemField, this.itemField, this.itemField, Items.paper, Items.paper, this.itemField, Items.paper, Items.fire_charge})}; + this.uhcProfessionField2 = new UhcProfession(this, "Enchanting", Arrays.asList(uhcCraftsHelperArray6)); + UhcCraftRecipe[] uhcCraftsHelperArray7 = new UhcCraftRecipe[4]; + uhcCraftsHelperArray7[0] = new UhcCraftRecipe(this, "Eve's Temptation", Items.apple, 3, new Item[]{this.itemField, this.itemField, this.itemField, this.itemField, Items.dye, this.itemField, this.itemField, Items.apple, this.itemField}); + uhcCraftsHelperArray7[1] = new UhcCraftRecipe(this, "Healing Fruit", this.getItemFromBlock(Blocks.melon_block), 3, new Item[]{Items.dye, Items.wheat_seeds, Items.dye, Items.wheat_seeds, Items.apple, Items.wheat_seeds, Items.dye, Items.wheat_seeds, Items.dye}); + uhcCraftsHelperArray7[2] = new UhcCraftRecipe(this, "Holy Water", ItemPotion.getItemById(Potion.absorption.computeInt()), 3, new Item[]{Items.gold_ingot, this.getItemFromBlock(Blocks.redstone_block), Items.gold_ingot, this.itemField, Items.record_13, this.itemField, this.itemField, Items.glass_bottle, this.itemField}); + uhcCraftsHelperArray7[3] = new UhcCraftRecipe(this, "Light Apple", Items.golden_apple, 1, new Item[]{this.itemField, Items.gold_ingot, this.itemField, Items.gold_ingot, Items.apple, Items.gold_ingot, this.itemField, Items.gold_ingot, this.itemField}); + this.uhcProfessionField11 = new UhcProfession(this, "Cooking", Arrays.asList(uhcCraftsHelperArray7)); + int uhcProfessionField6 = TimerUtil.f(); + UhcCraftRecipe[] uhcCraftsHelperArray8 = new UhcCraftRecipe[4]; + uhcCraftsHelperArray8[0] = new UhcCraftRecipe(this, "Golden Head", Items.skull, 3, new Item[]{Items.gold_ingot, Items.gold_ingot, Items.gold_ingot, Items.gold_ingot, Items.skull, Items.gold_ingot, Items.gold_ingot, Items.gold_ingot, Items.gold_ingot}); + uhcCraftsHelperArray8[1] = new UhcCraftRecipe(this, "Pandora's Box", this.getItemFromBlock(Blocks.chest), 3, new Item[]{this.getItemFromBlock(Blocks.chest), this.getItemFromBlock(Blocks.chest), this.getItemFromBlock(Blocks.chest), this.getItemFromBlock(Blocks.chest), Items.skull, this.getItemFromBlock(Blocks.chest), this.getItemFromBlock(Blocks.chest), this.getItemFromBlock(Blocks.chest), this.getItemFromBlock(Blocks.chest)}); + uhcCraftsHelperArray8[2] = new UhcCraftRecipe(this, "Panacea", ItemPotion.getItemById(Potion.healthBoost.computeInt()), 3, new Item[]{this.itemField, this.itemField, this.itemField, Items.skull, Items.speckled_melon, Items.skull, this.itemField, Items.glass_bottle, this.itemField}); + uhcCraftsHelperArray8[3] = new UhcCraftRecipe(this, "Cupid's Bow", (Item)Items.bow, 1, new Item[]{this.itemField, Items.blaze_rod, this.itemField, Items.skull, Items.bow, Items.skull, this.itemField, Items.lava_bucket, this.itemField}); + this.uhcProfessionField9 = new UhcProfession(this, "Bloodcraft", Arrays.asList(uhcCraftsHelperArray8)); + UhcCraftRecipe[] uhcCraftsHelperArray9 = new UhcCraftRecipe[4]; + uhcCraftsHelperArray9[0] = new UhcCraftRecipe(this, "Arrow Economy", Items.arrow, 3, new Item[]{Items.flint, Items.flint, Items.flint, Items.stick, Items.stick, Items.stick, Items.feather, Items.feather, Items.feather}); + uhcCraftsHelperArray9[1] = new UhcCraftRecipe(this, "Saddle", Items.saddle, 3, new Item[]{Items.leather, Items.leather, Items.leather, Items.string, Items.leather, Items.string, Items.iron_ingot, this.itemField, Items.iron_ingot}); + uhcCraftsHelperArray9[2] = new UhcCraftRecipe(this, "Potion of Velocity", ItemPotion.getItemById(Potion.moveSpeed.computeInt()), 3, new Item[]{this.itemField, Items.dye, this.itemField, this.itemField, Items.sugar, this.itemField, this.itemField, Items.glass_bottle, this.itemField}); + uhcCraftsHelperArray9[3] = new UhcCraftRecipe(this, "Fenrir", Items.spawn_egg, 1, new Item[]{Items.leather, Items.leather, Items.leather, Items.bone, Items.experience_bottle, Items.bone, Items.leather, Items.leather, Items.leather}); + this.uhcProfession = new UhcProfession(this, "Hunter", Arrays.asList(uhcCraftsHelperArray9)); + UhcCraftRecipe[] uhcCraftsHelperArray10 = new UhcCraftRecipe[]{new UhcCraftRecipe(this, "Forge", this.getItemFromBlock(Blocks.furnace), 3, new Item[]{this.getItemFromBlock(Blocks.cobblestone), this.getItemFromBlock(Blocks.cobblestone), this.getItemFromBlock(Blocks.cobblestone), this.getItemFromBlock(Blocks.cobblestone), this.getItemFromBlock(Blocks.obsidian), this.getItemFromBlock(Blocks.cobblestone), this.getItemFromBlock(Blocks.cobblestone), this.getItemFromBlock(Blocks.cobblestone), this.getItemFromBlock(Blocks.cobblestone)}), new UhcCraftRecipe(this, "Quick Pick", Items.iron_pickaxe, 3, new Item[]{this.getItemFromBlock(Blocks.iron_ore), this.getItemFromBlock(Blocks.iron_ore), this.getItemFromBlock(Blocks.iron_ore), Items.coal, Items.stick, Items.coal, this.itemField, Items.stick, this.itemField}), new UhcCraftRecipe(this, "Lumberjack's Axe", Items.iron_axe, 3, new Item[]{Items.iron_ingot, Items.iron_ingot, Items.flint, Items.iron_ingot, Items.stick, this.itemField, this.itemField, Items.stick, this.itemField}), new UhcCraftRecipe(this, "Enhancement Book", (Item)Items.enchanted_book, 1, new Item[]{Items.experience_bottle, Items.experience_bottle, Items.experience_bottle, Items.iron_pickaxe, this.getItemFromBlock(Blocks.enchanting_table), Items.iron_axe, this.getItemFromBlock(Blocks.bookshelf), this.getItemFromBlock(Blocks.bookshelf), this.getItemFromBlock(Blocks.bookshelf)})}; + this.uhcProfessionField4 = new UhcProfession(this, "Toolsmithing", Arrays.asList(uhcCraftsHelperArray10)); + UhcCraftRecipe[] uhcCraftsHelperArray11 = new UhcCraftRecipe[]{new UhcCraftRecipe(this, "Apprentice Helmet", (Item)Items.iron_helmet, 1, new Item[]{Items.iron_ingot, Items.iron_ingot, Items.iron_ingot, Items.iron_ingot, this.getItemFromBlock(Blocks.redstone_torch), Items.iron_ingot, this.itemField, this.itemField, this.itemField}), new UhcCraftRecipe(this, "Apprentice Sword", Items.iron_sword, 1, new Item[]{this.itemField, this.itemField, this.itemField, this.itemField, this.itemField, this.itemField, this.itemField, this.itemField, this.itemField}), new UhcCraftRecipe(this, "Apprentice Bow", (Item)Items.bow, 1, new Item[]{this.itemField, this.getItemFromBlock(Blocks.redstone_torch), Items.string, this.getItemFromBlock(Blocks.redstone_torch), this.itemField, Items.string, this.itemField, this.getItemFromBlock(Blocks.redstone_torch), Items.string}), new UhcCraftRecipe(this, "Master's Compass", Items.compass, 1, new Item[]{Items.redstone, this.getItemFromBlock(Blocks.redstone_torch), Items.redstone, Items.redstone, Items.compass, Items.redstone, Items.redstone, Items.redstone, Items.redstone})}; + this.uhcProfessionField6 = new UhcProfession(this, "Apprentice", Arrays.asList(uhcCraftsHelperArray11)); + UhcCraftRecipe[] uhcCraftsHelperArray12 = new UhcCraftRecipe[]{new UhcCraftRecipe(this, "Gold Pack", Items.gold_ingot, 3, new Item[]{this.getItemFromBlock(Blocks.gold_ore), this.getItemFromBlock(Blocks.gold_ore), this.getItemFromBlock(Blocks.gold_ore), this.getItemFromBlock(Blocks.gold_ore), Items.coal, this.getItemFromBlock(Blocks.gold_ore), this.getItemFromBlock(Blocks.gold_ore), this.getItemFromBlock(Blocks.gold_ore), this.getItemFromBlock(Blocks.gold_ore)}), new UhcCraftRecipe(this, "Sugar Rush", Items.reeds, 3, new Item[]{this.itemField, this.getItemFromBlock(Blocks.sapling), this.itemField, Items.wheat_seeds, Items.sugar, Items.wheat_seeds, this.itemField, this.itemField, this.itemField}), new UhcCraftRecipe(this, "Backpack", this.getItemFromBlock(Blocks.chest), 1, new Item[]{Items.stick, Items.leather, Items.stick, Items.stick, this.getItemFromBlock(Blocks.chest), Items.stick, Items.stick, Items.leather, Items.stick}), new UhcCraftRecipe(this, "Fusion Armor", (Item)Items.diamond_chestplate, 1, new Item[]{Items.diamond_helmet, Items.diamond_chestplate, Items.diamond_leggings, Items.diamond_leggings, Items.diamond_boots, this.itemField, this.itemField, this.itemField, this.itemField})}; + this.uhcProfessionField3 = new UhcProfession(this, "Invention", Arrays.asList(uhcCraftsHelperArray12)); + UhcCraftRecipe[] uhcCraftsHelperArray13 = new UhcCraftRecipe[]{new UhcCraftRecipe(this, "Lucky Shears", (Item)Items.shears, 3, new Item[]{this.getItemFromBlock(Blocks.leaves), this.getItemFromBlock(Blocks.leaves), this.getItemFromBlock(Blocks.leaves), this.getItemFromBlock(Blocks.leaves), Items.shears, this.getItemFromBlock(Blocks.leaves), this.getItemFromBlock(Blocks.leaves), this.getItemFromBlock(Blocks.leaves), this.getItemFromBlock(Blocks.leaves)}), new UhcCraftRecipe(this, "The Deep", (Item)Items.fishing_rod, 3, new Item[]{this.itemField, this.itemField, Items.bone, this.itemField, Items.bone, Items.string, Items.bone, this.itemField, Items.string}), new UhcCraftRecipe(this, "Swan Song", (Item)Items.enchanted_book, 1, new Item[]{Items.feather, this.itemField, this.itemField, this.itemField, Items.paper, Items.paper, this.itemField, Items.paper, Items.record_13}), new UhcCraftRecipe(this, "Treasure of El Dorado", (Item)Items.map, 1, new Item[]{this.itemField, this.getItemFromBlock(Blocks.wool), this.itemField, this.getItemFromBlock(Blocks.wool), this.getItemFromBlock(Blocks.chest), this.getItemFromBlock(Blocks.wool), Items.string, this.itemField, Items.string}), new UhcCraftRecipe(this, "Forge", this.itemField, 3, new Item[]{this.itemField, this.itemField, this.itemField, this.itemField, this.itemField, this.itemField, this.itemField, this.itemField, this.itemField})}; + this.uhcProfessionField10 = new UhcProfession(this, "Strategist", Arrays.asList(uhcCraftsHelperArray13)); + int n3 = uhcProfessionField6; + UhcCraftRecipe[] uhcCraftsHelperArray14 = new UhcCraftRecipe[30]; + uhcCraftsHelperArray14[0] = new UhcCraftRecipe(this, "Artemis' Bow", (Item)Items.bow, 1, new Item[]{Items.feather, Items.diamond, Items.feather, Items.feather, Items.bow, Items.feather, Items.feather, Items.ender_pearl, Items.feather}); + uhcCraftsHelperArray14[1] = new UhcCraftRecipe(this, "Flask of Ichor", ItemPotion.getItemById(Potion.harm.computeInt()), 1, new Item[]{this.itemField, Items.skull, this.itemField, this.getItemFromBlock(Blocks.brown_mushroom), Items.glass_bottle, this.getItemFromBlock(Blocks.brown_mushroom), this.itemField, Items.dye, this.itemField}); + uhcCraftsHelperArray14[2] = new UhcCraftRecipe(this, "Exodus", (Item)Items.diamond_helmet, 1, new Item[]{Items.diamond, Items.diamond, Items.diamond, Items.diamond, Items.skull, Items.diamond, Items.emerald, Items.golden_carrot, Items.emerald}); + uhcCraftsHelperArray14[3] = new UhcCraftRecipe(this, "Hide of Leviathan", (Item)Items.diamond_leggings, 1, new Item[]{this.getItemFromBlock(Blocks.lapis_block), Items.water_bucket, this.getItemFromBlock(Blocks.lapis_block), Items.diamond, Items.diamond_leggings, Items.diamond, this.getItemFromBlock(Blocks.waterlily), this.itemField, this.getItemFromBlock(Blocks.waterlily)}); + uhcCraftsHelperArray14[4] = new UhcCraftRecipe(this, "Tablets of Destiny", (Item)Items.enchanted_book, 1, new Item[]{this.itemField, Items.magma_cream, this.itemField, Items.diamond_sword, Items.writable_book, Items.bow, Items.experience_bottle, Items.experience_bottle, Items.experience_bottle}); + uhcCraftsHelperArray14[5] = new UhcCraftRecipe(this, "Axe of Perun", Items.diamond_axe, 1, new Item[]{Items.diamond, this.getItemFromBlock(Blocks.tnt), Items.fire_charge, Items.diamond, Items.stick, this.itemField, this.itemField, Items.stick, this.itemField}); + uhcCraftsHelperArray14[6] = new UhcCraftRecipe(this, "And\u016bril", Items.iron_sword, 1, new Item[]{Items.feather, this.getItemFromBlock(Blocks.iron_block), Items.feather, Items.feather, this.getItemFromBlock(Blocks.iron_block), Items.feather, Items.feather, Items.blaze_rod, Items.feather}); + uhcCraftsHelperArray14[7] = new UhcCraftRecipe(this, "Death's Scythe", Items.iron_hoe, 1, new Item[]{this.itemField, Items.skull, Items.skull, this.itemField, Items.bone, Items.clock, Items.bone, this.itemField, this.itemField}); + uhcCraftsHelperArray14[8] = new UhcCraftRecipe(this, "Chest of Fate", this.getItemFromBlock(Blocks.chest), 1, new Item[]{this.getItemFromBlock(Blocks.planks), this.getItemFromBlock(Blocks.planks), this.getItemFromBlock(Blocks.planks), this.getItemFromBlock(Blocks.planks), Items.skull, this.getItemFromBlock(Blocks.planks), this.getItemFromBlock(Blocks.planks), this.getItemFromBlock(Blocks.planks), this.getItemFromBlock(Blocks.planks)}); + uhcCraftsHelperArray14[9] = new UhcCraftRecipe(this, "Cornucopia", Items.golden_carrot, 1, new Item[]{Items.carrot, Items.carrot, Items.carrot, Items.carrot, Items.golden_apple, Items.carrot, Items.carrot, Items.carrot, Items.carrot}); + uhcCraftsHelperArray14[10] = new UhcCraftRecipe(this, "Essence of Yggdrasil", Items.experience_bottle, 1, new Item[]{this.getItemFromBlock(Blocks.leaves), this.getItemFromBlock(Blocks.enchanting_table), this.getItemFromBlock(Blocks.leaves), this.getItemFromBlock(Blocks.glowstone), Items.glass_bottle, this.getItemFromBlock(Blocks.glowstone), this.getItemFromBlock(Blocks.leaves), this.getItemFromBlock(Blocks.redstone_block), this.getItemFromBlock(Blocks.leaves)}); + uhcCraftsHelperArray14[11] = new UhcCraftRecipe(this, "Voidbox", this.getItemFromBlock(Blocks.ender_chest), 1, new Item[]{this.getItemFromBlock(Blocks.obsidian), this.getItemFromBlock(Blocks.glass), this.getItemFromBlock(Blocks.obsidian), this.getItemFromBlock(Blocks.glass), Items.skull, this.getItemFromBlock(Blocks.glass), this.getItemFromBlock(Blocks.obsidian), this.getItemFromBlock(Blocks.glass), this.getItemFromBlock(Blocks.obsidian)}); + uhcCraftsHelperArray14[12] = new UhcCraftRecipe(this, "Deus Ex Machina", ItemPotion.getItemById(Potion.resistance.computeInt()), 1, new Item[]{this.itemField, Items.emerald, this.itemField, this.itemField, Items.skull, this.itemField, this.itemField, Items.glass_bottle, this.itemField}); + uhcCraftsHelperArray14[13] = new UhcCraftRecipe(this, "Dice of God", this.getItemFromBlock(Blocks.end_portal_frame), 1, new Item[]{this.getItemFromBlock(Blocks.mossy_cobblestone), Items.skull, this.getItemFromBlock(Blocks.mossy_cobblestone), this.getItemFromBlock(Blocks.mossy_cobblestone), this.getItemFromBlock(Blocks.jukebox), this.getItemFromBlock(Blocks.mossy_cobblestone), this.getItemFromBlock(Blocks.mossy_cobblestone), this.getItemFromBlock(Blocks.mossy_cobblestone), this.getItemFromBlock(Blocks.mossy_cobblestone)}); + uhcCraftsHelperArray14[14] = new UhcCraftRecipe(this, "King's Rod", (Item)Items.fishing_rod, 1, new Item[]{this.itemField, Items.fishing_rod, this.itemField, this.getItemFromBlock(Blocks.waterlily), Items.compass, this.getItemFromBlock(Blocks.waterlily), this.itemField, Items.water_bucket, this.itemField}); + uhcCraftsHelperArray14[15] = new UhcCraftRecipe(this, "Daredevil", Items.spawn_egg, 1, new Item[]{Items.skull, Items.saddle, this.itemField, Items.bone, Items.bone, Items.bone, Items.bone, this.itemField, Items.bone}); + uhcCraftsHelperArray14[16] = new UhcCraftRecipe(this, "Excalibur", Items.diamond_sword, 1, new Item[]{this.getItemFromBlock(Blocks.soul_sand), Items.fire_charge, this.getItemFromBlock(Blocks.soul_sand), this.getItemFromBlock(Blocks.soul_sand), this.getItemFromBlock(Blocks.tnt), this.getItemFromBlock(Blocks.soul_sand), this.getItemFromBlock(Blocks.soul_sand), Items.diamond_sword, this.getItemFromBlock(Blocks.soul_sand)}); + uhcCraftsHelperArray14[17] = new UhcCraftRecipe(this, "Flask of Cleansing", ItemPotion.getItemById(Potion.weakness.computeInt()), 1, new Item[]{this.itemField, Items.skull, this.itemField, this.itemField, Items.milk_bucket, this.itemField, this.itemField, Items.glass_bottle, this.itemField}); + uhcCraftsHelperArray14[18] = new UhcCraftRecipe(this, "Shoes of Vidar", (Item)Items.diamond_boots, 1, new Item[]{this.itemField, Items.fish, this.itemField, Items.potionitem, Items.diamond_boots, Items.potionitem, this.itemField, Items.fishing_rod, this.itemField}); + uhcCraftsHelperArray14[19] = new UhcCraftRecipe(this, "Potion of Vitality", ItemPotion.getItemById(Potion.moveSpeed.computeInt()), 1, new Item[]{this.itemField, Items.skull, this.itemField, this.itemField, Items.nether_wart, this.itemField, this.itemField, Items.glass_bottle, this.itemField}); + uhcCraftsHelperArray14[20] = new UhcCraftRecipe(this, "Miner's Blessing", Items.diamond_pickaxe, 1, new Item[]{Items.experience_bottle, Items.iron_sword, Items.experience_bottle, Items.experience_bottle, Items.diamond_sword, Items.experience_bottle, this.getItemFromBlock(Blocks.bookshelf), this.getItemFromBlock(Blocks.bookshelf), this.getItemFromBlock(Blocks.bookshelf)}); + uhcCraftsHelperArray14[21] = new UhcCraftRecipe(this, "Ambrosia", Items.glowstone_dust, 1, new Item[]{Items.blaze_powder, Items.skull, Items.blaze_powder, this.getItemFromBlock(Blocks.glowstone), Items.ghast_tear, this.getItemFromBlock(Blocks.glowstone), this.getItemFromBlock(Blocks.glowstone), this.getItemFromBlock(Blocks.glowstone), this.getItemFromBlock(Blocks.glowstone)}); + uhcCraftsHelperArray14[22] = new UhcCraftRecipe(this, "Bloodlust", Items.diamond_sword, 1, new Item[]{this.getItemFromBlock(Blocks.redstone_block), Items.diamond, this.getItemFromBlock(Blocks.redstone_block), this.getItemFromBlock(Blocks.redstone_block), Items.diamond_sword, this.getItemFromBlock(Blocks.redstone_block), this.getItemFromBlock(Blocks.redstone_block), Items.experience_bottle, this.getItemFromBlock(Blocks.redstone_block)}); + uhcCraftsHelperArray14[23] = new UhcCraftRecipe(this, "Modular Bow", (Item)Items.bow, 1, new Item[]{this.itemField, Items.clock, this.itemField, Items.blaze_powder, Items.bow, Items.blaze_powder, Items.spider_eye, Items.slime_ball, Items.spider_eye}); + uhcCraftsHelperArray14[24] = new UhcCraftRecipe(this, "Expert Seal", Items.nether_star, 1, new Item[]{Items.experience_bottle, this.getItemFromBlock(Blocks.iron_block), Items.experience_bottle, this.getItemFromBlock(Blocks.gold_block), this.getItemFromBlock(Blocks.diamond_block), this.getItemFromBlock(Blocks.gold_block), Items.experience_bottle, this.getItemFromBlock(Blocks.iron_block), Items.experience_bottle}); + uhcCraftsHelperArray14[25] = new UhcCraftRecipe(this, "Hermes' Boots", (Item)Items.diamond_boots, 1, new Item[]{Items.diamond, Items.skull, Items.diamond, Items.blaze_powder, Items.diamond_boots, Items.blaze_powder, Items.feather, this.itemField, Items.feather}); + Item[] itemArray = new Item[9]; + itemArray[0] = Items.blaze_rod; + itemArray[1] = Items.diamond_chestplate; + itemArray[2] = Items.blaze_rod; + itemArray[3] = this.getItemFromBlock(Blocks.iron_block); + itemArray[4] = ItemPotion.getItemById(Potion.heal.computeInt()); + itemArray[5] = this.getItemFromBlock(Blocks.iron_block); + itemArray[6] = this.itemField; + itemArray[7] = this.itemField; + itemArray[8] = this.itemField; + uhcCraftsHelperArray14[26] = new UhcCraftRecipe(this, "Barbarian Chestplate", (Item)Items.diamond_chestplate, 1, itemArray); + uhcCraftsHelperArray14[27] = new UhcCraftRecipe(this, "Fate's Call", Items.flower_pot, 1, new Item[]{this.itemField, this.getItemFromBlock(Blocks.redstone_lamp), this.itemField, this.getItemFromBlock(Blocks.redstone_lamp), Items.firework_charge, this.getItemFromBlock(Blocks.redstone_lamp), this.itemField, this.getItemFromBlock(Blocks.redstone_lamp), this.itemField}); + uhcCraftsHelperArray14[28] = new UhcCraftRecipe(this, "The Mark", Items.snowball, 1, new Item[]{this.getItemFromBlock(Blocks.iron_block), Items.blaze_powder, this.getItemFromBlock(Blocks.iron_block), Items.diamond, Items.clock, Items.diamond, this.getItemFromBlock(Blocks.iron_block), Items.blaze_powder, this.getItemFromBlock(Blocks.iron_block)}); + uhcCraftsHelperArray14[29] = new UhcCraftRecipe(this, "Warlock Pants", (Item)Items.diamond_leggings, 1, new Item[]{this.getItemFromBlock(Blocks.iron_bars), this.getItemFromBlock(Blocks.iron_bars), this.getItemFromBlock(Blocks.iron_bars), this.getItemFromBlock(Blocks.iron_bars), Items.diamond, this.getItemFromBlock(Blocks.iron_bars), Items.blaze_powder, this.itemField, Items.blaze_powder}); + this.uhcProfessionField5 = new UhcProfession(this, "Extra Ultimates", Arrays.asList(uhcCraftsHelperArray14)); + this.mc = minecraft; + UhcProfession[] weaponsmithingVorpHelperArray = new UhcProfession[]{this.uhcProfessionField8, this.uhcProfessionField7, this.uhcProfessionField13, this.uhcProfessionField12, this.uhcProfessionField, this.uhcProfessionField2, this.uhcProfessionField11, this.uhcProfessionField9, this.uhcProfession, this.uhcProfessionField4, this.uhcProfessionField6, this.uhcProfessionField3, this.uhcProfessionField10, this.uhcProfessionField5}; + this.uhcProfessionList = Arrays.asList(weaponsmithingVorpHelperArray); +} + + public Item resolveHelper(Block block) { + return Item.getItemFromBlock(block); +} + + public void updateHelper() { + int uhcProfessionField6 = TimerUtil.f(); + Iterator iterator = this.uhcProfessionList.iterator(); + int n3 = uhcProfessionField6; + while (true) { + if (!iterator.hasNext()) break; + UhcProfession weaponsmithingVorpHelper = iterator.next(); + List list = weaponsmithingVorpHelper.getUhcCraftRecipeList(); + Iterator iterator2 = list.iterator(); + while (true) { + if (!iterator2.hasNext()) break; + UhcCraftRecipe uhcCraftsHelper = (UhcCraftRecipe)iterator2.next(); + uhcCraftsHelper.evaluateInt(0); + + } + if (n3 != 0) break; + } +} + + private static boolean invokeCallback(String string, UhcProfession weaponsmithingVorpHelper) { + String string2 = weaponsmithingVorpHelper.getCachedText(); + return string2.equalsIgnoreCase(string); +} + + public List getList() { + ArrayList arrayList; + ArrayList arrayList2 = new ArrayList(); + Iterator iterator = this.uhcProfessionList.iterator(); + while (true) { + if (!iterator.hasNext()) break; + UhcProfession weaponsmithingVorpHelper = iterator.next(); + arrayList = arrayList2; + + List list = weaponsmithingVorpHelper.getUhcCraftRecipeList(); + arrayList.addAll(list); + } + arrayList = arrayList2; + return arrayList; +} + + static Minecraft resolveHelper(UhcProfessionRegistry weaponsmithingVorpalHelper) { + return weaponsmithingVorpalHelper.mc; +} + + public List getUhcProfessionList() { + return this.uhcProfessionList; +} + + public List getList2() { + int uhcProfessionField6 = TimerUtil.f(); + ArrayList arrayList = new ArrayList(); + Iterator iterator = this.uhcProfessionList.iterator(); + int n3 = uhcProfessionField6; + block0: while (true) { + boolean bl = iterator.hasNext(); + while (bl) { + UhcProfession weaponsmithingVorpHelper = iterator.next(); + List list = weaponsmithingVorpHelper.getUhcCraftRecipeList(); + Iterator iterator2 = list.iterator(); + do { + if (!iterator2.hasNext()) continue block0; + UhcCraftRecipe uhcCraftsHelper = (UhcCraftRecipe)iterator2.next(); + bl = uhcCraftsHelper.isReadyState(); + + if (!bl) continue; + arrayList.add(uhcCraftsHelper); + } while (n3 == 0); + if (n3 == 0) continue block0; + } + break; + } + return arrayList; +} + + public List getList3() { + ArrayList arrayList = new ArrayList(); + int uhcProfessionField6 = TimerUtil.g(); + Iterator iterator = this.uhcProfessionList.iterator(); + block0: while (true) { + boolean bl = iterator.hasNext(); + while (bl) { + UhcProfession weaponsmithingVorpHelper = iterator.next(); + List list = weaponsmithingVorpHelper.getUhcCraftRecipeList(); + Iterator iterator2 = list.iterator(); + do { + if (!iterator2.hasNext()) continue block0; + UhcCraftRecipe uhcCraftsHelper = (UhcCraftRecipe)iterator2.next(); + bl = uhcCraftsHelper.isReadyState2(); + + if (!bl) continue; + arrayList.add(uhcCraftsHelper); + } while (uhcProfessionField6 != 0); + if (uhcProfessionField6 != 0) continue block0; + } + break; + } + return arrayList; +} + + public UhcProfession resolveHelper(String string) { + Stream stream = this.uhcProfessionList.stream(); + Predicate predicate = arg_0 -> UhcProfessionRegistry.invokeCallback(string, arg_0); + Stream stream2 = stream.filter(predicate); + Optional optional = stream2.findFirst(); + return optional.orElse(null); +} + + public Item getItemFromBlock(Block block) { return this.resolveHelper(block); } + public List getProfessions() { return this.getUhcProfessionList(); } + public List getAllRecipes() { return this.getList(); } + public List getCraftableRecipes() { return this.getList2(); } + public List getQueuedRecipes() { return this.getList3(); } + public void resetCraftCounts() { this.updateHelper(); } + public UhcProfession getProfessionByName(String name) { return this.resolveHelper(name); } + + public net.minecraft.client.Minecraft getMinecraft() { return this.mc; } +} + diff --git a/src/main/java/cc/novoline/modules/misc/uhc/UhcRecipeEntry.java b/src/main/java/cc/novoline/modules/misc/uhc/UhcRecipeEntry.java new file mode 100644 index 0000000..d86a5dc --- /dev/null +++ b/src/main/java/cc/novoline/modules/misc/uhc/UhcRecipeEntry.java @@ -0,0 +1,216 @@ +package cc.novoline.modules.misc.uhc; + +import cc.novoline.modules.misc.UhcCrafts; +import cc.novoline.utils.shader.RoundedTextureShader; +import java.awt.Color; +import java.util.Iterator; +import java.util.List; +import net.minecraft.util.MathHelper; +import org.lwjgl.input.Mouse; + +public class UhcRecipeEntry { + private float cachedAngle; + private float cachedAngle2; + private float cachedAngle3; + private float cachedAngle4; + private final UhcCrafts uhcCraftsField; + private boolean stateFlag; + private float cachedAngle5; + private float cachedAngle6; + final UhcCrafts uhcCraftsField2; + private float cachedAngle7; + + public float getCachedAngle2() { + return this.cachedAngle2; +} + + public void applyFlag(boolean flag) { + int intVal = Mouse.getDWheel(); + int intVal3 = (flag ? 1 : 0); + + if (flag == false) { + return; + } + + intVal3 = intVal; + + + + if (intVal3 == 0) { + return; + } + + intVal3 = intVal; + + + if (intVal3 < 0) { + this.cachedAngle += 10.0F; + return; + } + + this.cachedAngle -= 10.0F; +} + + public void performAction() { + this.stateFlag = false; +} + + public void updateHelper() { + this.cachedAngle = 0.0F; + this.cachedAngle2 = 0.0F; + this.cachedAngle6 = 0.0F; +} + + public UhcRecipeEntry(UhcCrafts uhcCrafts, UhcCrafts uhcCraftsIn) { + this.uhcCraftsField2 = uhcCrafts; + this.uhcCraftsField = uhcCraftsIn; +} + + public boolean checkCondition(int value, int index, float amount) { + if (value <= this.getCachedAngle4()) { + return false; + } + + if (value >= (this.getCachedAngle4() + 5.0F)) { + return false; + } + + if (index <= this.getCachedAngle3()) { + return false; + } + + return index < (this.getCachedAngle3() + amount); +} + + public float getCachedAngle6() { + return this.cachedAngle6; +} + + public void handleFloat(float value, float amount) { + this.cachedAngle4 = value; + this.cachedAngle3 = amount; +} + + public float getCachedAngle3() { + return this.cachedAngle3; +} + + public float getCachedAngle4() { + return this.cachedAngle4; +} + + public float computeFloatValue() { + float floatVal; + float floatVal2 = 3.5F; + List itemList = this.uhcCraftsField.getListValue(); + Iterator iter = itemList.iterator(); + + while (true) { + if (iter.hasNext()) { + UhcScrollBar uhcScrollBar = (UhcScrollBar)iter.next(); + floatVal = floatVal2 + (22.0F + 4.0F); + + floatVal2 = floatVal; + continue; + } + + floatVal = floatVal2 - 8.0F; + break; + } + + return floatVal; +} + + public void applyUpdate(int value, int index, float amount, double[] doubleArray) { + cc.novoline.modules.misc.uhc.UhcRecipeEntry uhcRecipeEntry; + float floatVal6 = this.computeFloatValue(); + if (floatVal6 < amount) { + this.cachedAngle6 = 0.0F; + this.cachedAngle2 = 0.0F; + return; + } + + floatVal6 = this.computeFloatValue(); + + float floatVal; + label42: { + label40: { + float floatVal2 = floatVal6; + floatVal = amount / floatVal2 * amount; + float floatVal3 = amount - floatVal; + float floatVal4 = floatVal2 - amount; + float floatVal5 = floatVal4 / floatVal3; + this.cachedAngle6 = this.cachedAngle6 + (this.cachedAngle2 - this.cachedAngle6) * 0.1F; + this.cachedAngle2 = this.cachedAngle * floatVal5; + UhcRecipeEntry uhcRecipeEntry2 = this; + if (!this.checkCondition(value, index, amount)) { + uhcRecipeEntry = this; + + if (!this.stateFlag) { + break label40; + } + } + + uhcRecipeEntry2 = this; + + uhcRecipeEntry2.cachedAngle7 = this.cachedAngle7 + (1.0F - this.cachedAngle7) * 0.02F; + break label42; + } + + uhcRecipeEntry = this; + + uhcRecipeEntry.cachedAngle7 = uhcRecipeEntry.cachedAngle7 - this.cachedAngle7 * 0.02F; + } + + float floatVal7 = this.cachedAngle; + float floatVal8 = amount - floatVal; + this.cachedAngle = MathHelper.clamp_float(floatVal7, 0.0F, floatVal8); + if (this.stateFlag && index - this.cachedAngle5 != 0.0F) { + this.cachedAngle = this.cachedAngle + (index - this.cachedAngle5); + floatVal7 = this.cachedAngle; + floatVal8 = amount - floatVal; + this.cachedAngle = MathHelper.clamp_float(floatVal7, 0.0F, floatVal8); + this.cachedAngle5 = index; + } + + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal = this.getCachedAngle4(); + double doubleVal3 = this.getCachedAngle3(); + double doubleVal4 = amount; + Color awtColor = new Color(20, 20, 20); + roundedTextureShader.applyUpdate2(doubleVal, doubleVal3, 5.0, doubleVal4, 5.0, 2.0, awtColor, doubleArray, false); + RoundedTextureShader roundedTextureShader2 = RoundedTextureShader.getInstance(); + double doubleVal2 = this.getCachedAngle4(); + doubleVal3 = this.getCachedAngle3() + this.cachedAngle; + doubleVal4 = floatVal; + awtColor = new Color(40, 40, 40); + roundedTextureShader2.applyUpdate2(doubleVal2, doubleVal3, 5.0, doubleVal4, 5.0, 2.0, awtColor, doubleArray, false); +} + + public void applyUpdate(int value, int index, int count, float amount) { + cc.novoline.modules.misc.uhc.UhcRecipeEntry uhcRecipeEntry; + int intVal = (this.checkCondition(value, index, amount) ? 1 : 0); + + if (intVal == 0) { + return; + } + + intVal = count; + + + if (intVal != 0) { + return; + } + + uhcRecipeEntry = this; + + if (this.computeFloatValue() <= amount) { + return; + } + + this.stateFlag = true; + uhcRecipeEntry = this; + + uhcRecipeEntry.cachedAngle5 = index; +} +} diff --git a/src/main/java/cc/novoline/modules/misc/uhc/UhcScrollBar.java b/src/main/java/cc/novoline/modules/misc/uhc/UhcScrollBar.java new file mode 100644 index 0000000..df5bec7 --- /dev/null +++ b/src/main/java/cc/novoline/modules/misc/uhc/UhcScrollBar.java @@ -0,0 +1,372 @@ +package cc.novoline.modules.misc.uhc; + +import cc.novoline.modules.misc.UhcCrafts; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.utils.shader.RoundedTextureShader; +import java.awt.Color; +import java.util.Arrays; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import net.minecraft.block.BlockStainedGlass; +import net.minecraft.client.multiplayer.PlayerControllerMP; +import cc.novoline.utils.fonts.api.FontFamily; +import cc.novoline.utils.fonts.holders.FontFamilyPOSTERAMA; +import net.minecraft.block.Block; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class UhcScrollBar { + private UhcCrafts uhcCraftsField; + final UhcCrafts uhcCrafts2; + private final float floatValue; + private final float cachedAngle; + private int stateTicks; + private float cachedAngle2; + private float cachedAngle3; + private UhcCraftRecipe uhcCraftRecipeField; + + public void applyUpdate(String text, Item item, int value) { + boolean flag = text.equals("Flaming Artifact"); + + if (flag) { + BlockStainedGlass blockStainedGlass = Blocks.stained_glass; + Item item2 = Item.getItemFromBlock(blockStainedGlass); + if (item == item2) { + this.stateTicks = UhcCrafts.resolveMinecraft23(this.uhcCrafts2).thePlayer.attackDragonFrom(item, 1); + } + + return; + } + + flag = text.equals("Eve's Temptation"); + + + + if (flag) { + if (item != Items.dye) { + return; + } + + EntityPlayerSP player = UhcCrafts.resolveMinecraft18(this.uhcCrafts2).thePlayer; + this.stateTicks = player.attackDragonFrom(item, 15); + return; + } + + flag = text.equals("Healing Fruit"); + + + + if (flag) { + if (item != Items.dye) { + return; + } + + EntityPlayerSP player2 = UhcCrafts.resolveMinecraft(this.uhcCrafts2).thePlayer; + this.stateTicks = player2.attackDragonFrom(item, 15); + return; + } + + flag = text.equals("Potion of Velocity"); + + + + if (flag) { + if (item != Items.dye) { + return; + } + + EntityPlayerSP player3 = UhcCrafts.resolveMinecraft15(this.uhcCrafts2).thePlayer; + this.stateTicks = player3.attackDragonFrom(item, 3); + return; + } + + flag = text.equals("Sugar Rush"); + + + + if (flag) { + Block block = Blocks.sapling; + Item item3 = Item.getItemFromBlock(block); + if (item == item3) { + EntityPlayerSP player4 = UhcCrafts.resolveMinecraft17(this.uhcCrafts2).thePlayer; + this.stateTicks = player4.attackDragonFrom(item, 0); + } + + return; + } + + flag = text.equals("Treasure of El Dorado"); + + + + if (flag) { + Block block2 = Blocks.wool; + Item item4 = Item.getItemFromBlock(block2); + if (item == item4) { + EntityPlayerSP player5 = UhcCrafts.resolveMinecraft29(this.uhcCrafts2).thePlayer; + int intVal = value == 1 ? 14 : 0; + + this.stateTicks = player5.attackDragonFrom(item, intVal); + } + + return; + } + + flag = text.equals("Flask of Ichor"); + + + if (flag) { + Item item5 = item; + Item item6 = Items.skull; + if (item == Items.skull) { + EntityPlayerSP player6 = UhcCrafts.resolveMinecraft13(this.uhcCrafts2).thePlayer; + Item item7 = Items.skull; + this.stateTicks = player6.attackDragonFrom(item7, 3); + return; + } + + item5 = item; + item6 = Items.dye; + + if (item5 == item6) { + EntityPlayerSP player7 = UhcCrafts.resolveMinecraft24(this.uhcCrafts2).thePlayer; + Item item8 = Items.dye; + this.stateTicks = player7.attackDragonFrom(item8, 0); + } + } +} + + public static UhcCraftRecipe createUhcCraftRecipe(UhcScrollBar uhcScrollBar) { + return uhcScrollBar.uhcCraftRecipeField; +} + + public float getCachedAngle3() { + return this.cachedAngle3; +} + + public boolean checkInt(int value, int index) { + if (value <= this.cachedAngle2) { + return false; + } + + if (value >= (this.cachedAngle2 + 132.0F)) { + return false; + } + + if (index <= this.cachedAngle3) { + return false; + } + + return index < (this.cachedAngle3 + 22.0F); +} + + public UhcScrollBar(UhcCrafts uhcCrafts, UhcCrafts uhcCraftsIn, UhcCraftRecipe uhcCraftRecipe) { + this.uhcCrafts2 = uhcCrafts; + this.floatValue = 132.0F; + this.cachedAngle = 22.0F; + this.uhcCraftRecipeField = uhcCraftRecipe; + this.uhcCraftsField = uhcCraftsIn; +} + + public List getList() { + Item[] itemArr = this.uhcCraftRecipeField.getIngredients(); + Stream stream2 = Arrays.stream(itemArr); + Function mapper = (Item item2) -> new ItemStack(item2, 1); + Stream stream3 = stream2.map(mapper); + Collector collector = Collectors.toList(); + return (java.util.List) stream3.collect(collector); +} + + public void applyUpdate(int value, int index, int count) { + cc.novoline.modules.misc.uhc.UhcScrollBar uhcScrollBar; + int intVal = (this.checkInt(value, index) ? 1 : 0); + + if (intVal == 0) { + return; + } + + intVal = count; + + + + if (intVal != 0) { + return; + } + + uhcScrollBar = this; + + intVal = (this.uhcCraftRecipeField.canCraft() ? 1 : 0); + + + if (intVal != 0) { + int intVal2 = 0; + + label124: { + + while (true) { + if (intVal2 < this.uhcCraftRecipeField.getIngredients().length) { + Item item2 = this.uhcCraftRecipeField.getIngredients()[intVal2]; + + if (item2 != null) { + this.stateTicks = UhcCrafts.applyInt5(this.uhcCrafts2).thePlayer.applyInt5(item2); + this.applyUpdate(this.uhcCraftRecipeField.getName(), item2, intVal2); + + if (this.stateTicks == -1) { + UhcCrafts.executeUhcCrafts(this.uhcCrafts2, this.uhcCrafts2.getDisplayName(), "Not enough items to craft", 2500, NotificationType.ERROR); + return; + } + } + + intVal2++; + + continue; + } + + intVal = (this.uhcCraftRecipeField.getName().equals("Lucky Shears") ? 1 : 0); + + if (intVal != 0) { + EntityPlayerSP player = UhcCrafts.resolveMinecraft21(this.uhcCrafts2).thePlayer; + if (player.getHealth() >= 10.0F) { + UhcCrafts.executeUhcCrafts4(this.uhcCrafts2, this.uhcCrafts2.getDisplayName(), "Your health must be below 5 hearts to craft this item!", 2500, NotificationType.ERROR); + return; + } + break label124; + } + break; + } + + intVal = (this.uhcCraftRecipeField.getName().equals("Swan Song") ? 1 : 0); + + if (intVal != 0) { + EntityPlayerSP player2 = UhcCrafts.resolveMinecraft16(this.uhcCrafts2).thePlayer; + if (player2.getHealth() >= 10.0F) { + intVal = (this.uhcCrafts2.isReadyState8() ? 1 : 0); + + if (intVal == 0) { + UhcCrafts.executeUhcCrafts3(this.uhcCrafts2, this.uhcCrafts2.getDisplayName(), "Your health is above 5 hearts OR you have alive teammates", 2500, NotificationType.ERROR); + return; + } + } + } + } + + intVal2 = UhcCrafts.resolveMinecraft30(this.uhcCrafts2).thePlayer.openContainer.a; + intVal = 0; + + int intVal3 = intVal; + + while (intVal3 < this.uhcCraftRecipeField.getIngredients().length) { + Item item3 = this.uhcCraftRecipeField.getIngredients()[intVal3]; + + + if (item3 != null) { + EntityPlayerSP player3 = UhcCrafts.resolveMinecraft19(this.uhcCrafts2).thePlayer; + this.stateTicks = player3.applyInt5(item3); + this.applyUpdate(this.uhcCraftRecipeField.getName(), item3, intVal3); + PlayerControllerMP controller = UhcCrafts.resolveMinecraft22(this.uhcCrafts2).playerController; + int ticks = this.stateTicks; + EntityPlayerSP player4 = UhcCrafts.resolveMinecraft14(this.uhcCrafts2).thePlayer; + controller.resolveFloat(intVal2, ticks, 0, 0, player4); + PlayerControllerMP controller2 = UhcCrafts.resolveMinecraft27(this.uhcCrafts2).playerController; + ticks = intVal3 + 1; + player4 = UhcCrafts.resolveMinecraft26(this.uhcCrafts2).thePlayer; + controller2.resolveFloat(intVal2, ticks, 1, 0, player4); + PlayerControllerMP controller3 = UhcCrafts.resolveMinecraft20(this.uhcCrafts2).playerController; + ticks = this.stateTicks; + player4 = UhcCrafts.resolveMinecraft25(this.uhcCrafts2).thePlayer; + controller3.resolveFloat(intVal2, ticks, 0, 0, player4); + } + + intVal3++; + + + } + + return; + } + + uhcScrollBar = this; + + UhcCrafts.executeUhcCrafts2(uhcScrollBar.uhcCrafts2, this.uhcCrafts2.getDisplayName(), "Not enough items to craft", 2500, NotificationType.ERROR); +} + + public void createUhcCraftRecipe(double[] doubleArray) { + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal = this.cachedAngle2; + double doubleVal2 = this.cachedAngle3; + Color awtColor = new Color(31, 31, 31); + roundedTextureShader.applyUpdate2(doubleVal, doubleVal2, 132.0, 22.0, 6.0, 2.0, awtColor, doubleArray, true); +} + + public void applyUpdate2(float value, float amount) { + this.cachedAngle2 = value; + this.cachedAngle3 = amount; +} + + public ItemStack createUhcCraftRecipe(Item item) { + return new ItemStack(item, 1); +} + + public ItemStack applyUpdate2(Item item, int value) { + return new ItemStack(item, 1, value); +} + + public void applyUpdate2(int value, int index) { + FontFamily fontFam = FontFamilyPOSTERAMA.FAMILY; + FontRenderer font = fontFam.ofSize(17); + String nameStr = this.uhcCraftRecipeField.getName(); + double doubleVal = this.cachedAngle2 + 23.0F; + double doubleVal2 = this.cachedAngle3 + 3.0F; + int intVal3 = (this.checkInt(value, index) ? 1 : 0); + if (intVal3 != 0) { + intVal3 = -1; + } else { + Color awtColor = new Color(200, 200, 200); + intVal3 = awtColor.getRGB(); + } + + font.drawString(nameStr, doubleVal, doubleVal2, intVal3, true); + fontFam = FontFamilyPOSTERAMA.FAMILY; + FontRenderer font2 = fontFam.ofSize(15); + StringBuilder sb = new StringBuilder(); + int intVal = this.uhcCraftRecipeField.getCraftedCount(); + StringBuilder sb2 = sb.append(intVal); + StringBuilder sb3 = sb2.append("/"); + int intVal2 = this.uhcCraftRecipeField.getMaxCrafts(); + StringBuilder sb4 = sb3.append(intVal2); + nameStr = sb4.append(" crafted").toString(); + doubleVal = this.cachedAngle2 + 23.0F; + doubleVal2 = this.cachedAngle3 + 12.5F; + int intVal4 = (this.checkInt(value, index) ? 1 : 0); + if (intVal4 != 0) { + intVal4 = -1; + } else { + Color awtColor2 = new Color(200, 200, 200); + intVal4 = awtColor2.getRGB(); + } + + font2.drawString(nameStr, doubleVal, doubleVal2, intVal4, true); + ItemStack stack = this.getItemStack(); + float floatVal = this.cachedAngle2 + 3.0F; + float floatVal2 = this.cachedAngle3 + 3.0F; + RenderUtils.drawElement7(stack, floatVal, floatVal2); +} + + public ItemStack getItemStack() { + return new ItemStack(this.uhcCraftRecipeField.getResultItem(), 1); +} + + public ItemStack createUhcCraftRecipe(int value) { + return new ItemStack(this.uhcCraftRecipeField.getResultItem(), 1, value); +} + + public cc.novoline.modules.misc.uhc.UhcCraftRecipe getUhcCraftRecipeField() { return this.uhcCraftRecipeField; } +} diff --git a/src/main/java/cc/novoline/modules/move/AutoJump.java b/src/main/java/cc/novoline/modules/move/AutoJump.java new file mode 100644 index 0000000..3046dc6 --- /dev/null +++ b/src/main/java/cc/novoline/modules/move/AutoJump.java @@ -0,0 +1,31 @@ +package cc.novoline.modules.move; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.entity.EntityPlayerSP; +import org.jetbrains.annotations.NotNull; + +public class AutoJump extends AbstractModule { + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + if (event.getState() == State.PRE) { + EntityPlayerSP player = this.mc.thePlayer; + if (!this.mc.thePlayer.onGround) { + return; + } + + player = this.mc.thePlayer; + + player.jump(); + } +} + + public AutoJump(@NotNull ModuleManager moduleManager, @NotNull EnumModuleType enumModuleType, @NotNull String text, @NotNull String str) { + super(moduleManager, enumModuleType, text, str); +} +} diff --git a/src/main/java/cc/novoline/modules/move/DamageBoost.java b/src/main/java/cc/novoline/modules/move/DamageBoost.java new file mode 100644 index 0000000..3b40efe --- /dev/null +++ b/src/main/java/cc/novoline/modules/move/DamageBoost.java @@ -0,0 +1,73 @@ +package cc.novoline.modules.move; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.network.Packet; +import net.minecraft.network.play.client.C0BPacketEntityAction$Action; +import org.jetbrains.annotations.NotNull; + +public class DamageBoost extends AbstractModule { + private boolean stateFlag; + private int stateTicks; + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + if (event.getState() == State.PRE && this.mc.thePlayer.offGroundTicks == 16) { + event.setOnGround(true); + } +} + + public DamageBoost(@NotNull ModuleManager moduleManager, @NotNull EnumModuleType enumModuleType, @NotNull String text) { + super(moduleManager, enumModuleType, text); +} + + @Override + public void onDisable() { + this.sendPacketNoEvent(new C0BPacketEntityAction(this.mc.thePlayer, C0BPacketEntityAction$Action.STOP_SPRINTING)); +} + + @Override + public void onEnable() { + this.stateTicks = 0; + this.stateFlag = false; + this.sendPacketNoEvent(new C0BPacketEntityAction(this.mc.thePlayer, C0BPacketEntityAction$Action.START_SPRINTING)); +} + + @EventTarget + public void onPacket(PacketEvent event) { + PacketEvent packetEvent = event; + if (event.getState() != cc.novoline.events.State.INCOMING) { + return; + } + + packetEvent = event; + + Packet packet = packetEvent.getPacket(); + if (!(packet instanceof S12PacketEntityVelocity)) { + return; + } + + packet = event.getPacket(); + + S12PacketEntityVelocity entityVelocityPacket = (S12PacketEntityVelocity)packet; + int intVal = entityVelocityPacket.getEntityID(); + EntityPlayerSP player = this.mc.thePlayer; + if (intVal != player.getEntityId()) { + return; + } + + this.mc.thePlayer.intState3 = 20; + EntityPlayerSP player2 = this.mc.thePlayer; + player2.setMoveSpeed(6.0); + + this.checkModule(this.getClass()); +} +} diff --git a/src/main/java/cc/novoline/modules/move/FastSneak.java b/src/main/java/cc/novoline/modules/move/FastSneak.java new file mode 100644 index 0000000..24413fa --- /dev/null +++ b/src/main/java/cc/novoline/modules/move/FastSneak.java @@ -0,0 +1,53 @@ +package cc.novoline.modules.move; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.player.Scaffold; +import cc.novoline.modules.ModuleRegistry; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.network.play.client.C0BPacketEntityAction$Action; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class FastSneak extends AbstractModule { + + public FastSneak(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); +} + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + Scaffold scaffold = ModuleRegistry.SCAFFOLD.getModule(); + EntityPlayerSP player = this.mc.thePlayer; + boolean sneaking = player.getMovementInput().isSneak(); + if (!sneaking) { + return; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + sneaking = player2.isMoving(); + + if (!sneaking) { + return; + } + + sneaking = scaffold.isEnabled(); + + if (sneaking) { + return; + } + + sneaking = event.getState().equals(State.PRE); + + if (sneaking) { + this.sendPacketNoEvent(new C0BPacketEntityAction(this.mc.thePlayer, C0BPacketEntityAction$Action.STOP_SNEAKING)); + return; + } + + this.sendPacketNoEvent(new C0BPacketEntityAction(this.mc.thePlayer, C0BPacketEntityAction$Action.START_SNEAKING)); +} +} diff --git a/src/main/java/cc/novoline/modules/move/Fly.java b/src/main/java/cc/novoline/modules/move/Fly.java new file mode 100644 index 0000000..53c126a --- /dev/null +++ b/src/main/java/cc/novoline/modules/move/Fly.java @@ -0,0 +1,616 @@ +package cc.novoline.modules.move; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ServerUtils; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.CollideWithBlockEvent; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.MoveEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.player.Scaffold; +import cc.novoline.modules.ModuleRegistry; +import java.util.List; +import net.minecraft.item.ItemIronSword; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C06PacketPlayerPosLook; +import net.minecraft.util.MathHelper; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.item.ItemStack; +import net.minecraft.network.Packet; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; + +public class Fly extends AbstractModule { + @Property("glide") + private BooleanProperty glide; + private String cachedText; + @Property("motion-speed") + private DoubleProperty motionSpeed; + private double cachedValue; + private double cachedValue2; + @Property("toggle-jump") + private BooleanProperty toggleJump; + private double cachedValue3; + @Property("mode") + private StringProperty mode; + @Property("air-walk") + private BooleanProperty airWalk; + private double cachedValue4; + private int stateTicks; + private boolean stateFlag; + @Property("auto-motion") + private BooleanProperty autoMotion; + + + private Boolean supplyBoolean() { + boolean flag; + flag = this.mode.equals("Motion"); + label17: { + if (!flag) { + BooleanProperty boolProp = this.autoMotion; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + flag = false; + break label17; + } + } + + flag = true; + } + + return flag; +} + + + @EventTarget + public void onPacket(PacketEvent event) { + int intVal; + Object obj; + cc.novoline.modules.move.Fly fly; + cc.novoline.modules.move.Fly fly2; + int[] intArr = Scaffold.getIntArrayValue(); + PacketEvent packetEvent = event; + if (event.getState() == State.INCOMING) { + { + boolean flag = event.getPacket() instanceof S08PacketPlayerPosLook; + if (flag) { + String textStr = this.cachedText; + List itemList = this.mode.getAcceptableValues(); + if (!textStr.equals(itemList.get(1))) { + return; + } + + S08PacketPlayerPosLook playerPosLookPacket = (S08PacketPlayerPosLook)event.getPacket(); + this.sendPacketNoEvent(new C06PacketPlayerPosLook(playerPosLookPacket.getX(), playerPosLookPacket.getY(), playerPosLookPacket.getZ(), playerPosLookPacket.getYaw(), playerPosLookPacket.getPitch(), false)); + EntityPlayerSP player = this.mc.thePlayer; + double doubleVal = playerPosLookPacket.getX(); + double doubleVal2 = playerPosLookPacket.getY(); + double doubleVal3 = playerPosLookPacket.getZ(); + player.setPosition(doubleVal, doubleVal2, doubleVal3); + BooleanProperty boolProp = this.airWalk; + Boolean propFlag = boolProp.get(); + intVal = (propFlag ? 1 : 0); + if (intVal != 0) { + if (this.mc.thePlayer.posY >= this.cachedValue2) { + Minecraft mcClient = this.mc; + mcClient.getRenderViewEntity().posY = this.mc.thePlayer.prevPosY; + } + } + + EntityPlayerSP player2 = this.mc.thePlayer; + this.cachedValue = player2.resolveDouble2(true) * 0.98; + this.mc.thePlayer.motionY = 0.42F; + this.mc.thePlayer.offGroundTicks = 0; + + Minecraft mcClient2 = this.mc; + intVal = (mcClient2.getNetHandler().doneLoadingTerrain ? 1 : 0); + + if (intVal == 0) { + Minecraft mcClient3 = this.mc; + mcClient3.displayGuiScreen(null); + Minecraft mcClient4 = this.mc; + mcClient4.getNetHandler().doneLoadingTerrain = true; + } + + event.setCancelled(true); + + return; + } + + obj = event.getPacket(); + + flag = obj instanceof S12PacketEntityVelocity; + + if (!flag) { + return; + } + + obj = event.getPacket(); + } + + label137: { + S12PacketEntityVelocity entityVelocityPacket = (S12PacketEntityVelocity)obj; + int intVal2 = entityVelocityPacket.getEntityID(); + EntityPlayerSP player3 = this.mc.thePlayer; + if (intVal2 != player3.getEntityId()) { + break label137; + } + + intVal2 = (ServerUtils.isCubeCraft() ? 1 : 0); + + label95: { + + if (intVal2 == 0) { + break label95; + } + + fly = this; + + String textStr2 = this.cachedText; + StringProperty strProp = this.mode; + List itemList2 = strProp.getAcceptableValues(); + intVal2 = (textStr2.equals(itemList2.get(0)) ? 1 : 0); + + if (intVal2 == 0) { + break label95; + } + + fly = this; + + fly.mc.thePlayer.motionY = entityVelocityPacket.getMotionY() / 8000.0; + } + + event.setCancelled(true); + } + + return; + } + + packetEvent = event; + + Packet packet = packetEvent.getPacket(); + if (intArr == null) { + if (!(packet instanceof C08PacketPlayerBlockPlacement)) { + return; + } + + packet = event.getPacket(); + } + + C08PacketPlayerBlockPlacement playerBlockPlacementPacket = (C08PacketPlayerBlockPlacement)packet; + int intVal3 = playerBlockPlacementPacket.getPlacedBlockDirection2(); + if (intVal3 != 255) { + return; + } + + fly2 = this; + + String textStr3 = this.cachedText; + StringProperty strProp2 = this.mode; + List itemList3 = strProp2.getAcceptableValues(); + intVal3 = (textStr3.equals(itemList3.get(1)) ? 1 : 0); + + if (intVal3 == 0) { + return; + } + + fly2 = this; + + EntityPlayerSP player4 = fly2.mc.thePlayer; + ItemStack stack = player4.getHeldItem(); + if (stack == null) { + return; + } + + EntityPlayerSP player5 = this.mc.thePlayer; + stack = player5.getHeldItem(); + + if (stack.getItem() instanceof ItemIronSword) { + event.setCancelled(true); + } +} + + public StringProperty getMode() { + return this.mode; +} + + public StringProperty getStringProperty() { + return this.getMode(); +} + + @EventTarget + public void onMove(MoveEvent event) { + cc.novoline.modules.move.Fly fly; + AbstractModule mod; + + String textStr2 = this.cachedText; + StringProperty strProp = this.mode; + List itemList = strProp.getAcceptableValues(); + boolean flag = textStr2.equals(itemList.get(1)); + + if (flag) { + + label68: { + label81: { + boolean onGround2 = this.mc.thePlayer.onGround; + + if (this.mc.thePlayer.onGround) { + break label81; + } + + fly = this; + + EntityPlayerSP player = this.mc.thePlayer; + onGround2 = player.getMovementInput().evaluateCondition2(); + + + if (!onGround2) { + break label68; + } + + fly = this; + + if (this.mc.thePlayer.offGroundTicks <= 6) { + break label68; + } + } + + event.setMoveSpeed(0.0); + + return; + + } + + fly = this; + + fly.cachedValue = fly.cachedValue - this.cachedValue / 229.0; + event.setMoveSpeed(this.cachedValue); + + return; + + } + + mod = this; + + String textStr = this.cachedText; + strProp = this.mode; + List itemList2 = strProp.getAcceptableValues(); + flag = textStr.equals(itemList2.get(0)); + + + if (!flag) { + return; + } + + ModuleRegistry modEntry = ModuleRegistry.TARGETSTRAFE; + mod = modEntry.getModule(); + + TargetStrafe targetStrafe; + float floatVal; + label42: { + targetStrafe = (TargetStrafe)mod; + TargetStrafe targetStrafe2 = targetStrafe; + + if (!targetStrafe.checkState15()) { + EntityPlayerSP player2 = this.mc.thePlayer; + floatVal = player2.getFloat2(); + break label42; + } + + targetStrafe2 = targetStrafe; + + + floatVal = targetStrafe2.getFloatValue2(); + } + + double doubleVal2; + label36: { + Object obj = targetStrafe; + + if (targetStrafe.checkState15()) { + doubleVal2 = 0.7; + break label36; + } + + DoubleProperty doubleProp = this.motionSpeed; + obj = doubleProp.get(); + + + Double doubleVal = (Double)obj; + doubleVal2 = doubleVal; + } + + event.handleFloat(floatVal, doubleVal2); +} + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + net.minecraft.client.entity.EntityPlayerSP player; + int intVal; + cc.novoline.modules.move.Fly fly; + if (event.getState() == cc.novoline.events.type.State.PRE) { + String textStr = this.cachedText; + StringProperty strProp = this.mode; + List itemList = strProp.getAcceptableValues(); + boolean flag = textStr.equals(itemList.get(1)); + if (flag) { + BooleanProperty boolProp = this.airWalk; + Boolean propFlag = boolProp.get(); + intVal = (propFlag ? 1 : 0); + if (intVal != 0) { + if (event.getY() >= this.cachedValue2) { + EntityPlayerSP player2 = this.mc.thePlayer; + EntityPlayerSP player3 = this.mc.thePlayer; + double doubleVal = this.mc.thePlayer.getDouble8(); + player2.cameraYaw = player3.resolveFloat12(doubleVal); + Minecraft mcClient = this.mc; + mcClient.getRenderViewEntity().posY = this.cachedValue2; + this.mc.thePlayer.cameraPitch = 0.0F; + } + } + + EntityPlayerSP player4 = this.mc.thePlayer; + intVal = (player4.getMovementInput().evaluateCondition2() ? 1 : 0); + + if (intVal != 0) { + double doubleVal2 = event.getY(); + this.cachedValue2 = MathHelper.floor_double(doubleVal2) - 1.0; + int ticks = this.mc.thePlayer.offGroundTicks; + byte byteVal = 6; + if (this.mc.thePlayer.offGroundTicks <= 6) { + return; + } + + this.mc.thePlayer.motionY = 0.0; + + ticks = this.mc.thePlayer.offGroundTicks; + byteVal = 7; + + if (ticks != byteVal) { + return; + } + + event.setY(-999.0); + + return; + } + + intVal = this.mc.thePlayer.intState8; + + if (intVal != 1) { + return; + } + + event.setY(-999.0); + return; + } + + textStr = this.cachedText; + strProp = this.mode; + List itemList2 = strProp.getAcceptableValues(); + flag = textStr.equals(itemList2.get(0)); + + if (!flag) { + return; + } + + EntityPlayerSP player5 = this.mc.thePlayer; + EntityPlayerSP player6 = this.mc.thePlayer; + EntityPlayerSP player7 = this.mc.thePlayer; + double doubleVal3 = player7.getDouble8(); + player5.cameraYaw = player6.resolveFloat12(doubleVal3); + this.mc.thePlayer.cameraPitch = 0.0F; + EntityPlayerSP player8 = this.mc.thePlayer; + flag = player8.getMovementInput().evaluateCondition2(); + + if (flag) { + ModuleRegistry modEntry = ModuleRegistry.TARGETSTRAFE; + TargetStrafe targetStrafe = modEntry.getModule(); + this.mc.thePlayer.motionY = targetStrafe.checkState15() ? 0.0 : 0.42F; + return; + } + + EntityPlayerSP player9 = this.mc.thePlayer; + flag = player9.getMovementInput().isSneak(); + + if (flag) { + this.mc.thePlayer.motionY = -0.42F; + return; + } + + fly = this; + + BooleanProperty boolProp2 = this.toggleJump; + Boolean propFlag2 = boolProp2.get(); + flag = propFlag2; + + if (flag) { + player = this.mc.thePlayer; + + if (this.mc.thePlayer.offGroundTicks <= 4) { + return; + } + } + + fly = this; + + player = fly.mc.thePlayer; + + BooleanProperty boolProp3 = this.glide; + Boolean propFlag3 = boolProp3.get(); + player.motionY = propFlag3 ? -0.024 : 0.0; + EntityPlayerSP player10 = this.mc.thePlayer; + if (player10.matchesDouble(1.0E-4)) { + event.setOnGround(true); + } + } +} + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + this.handleString3(this.cachedText); + this.stateTicks++; +} + + @EventTarget + public void onCollideWithBlock(CollideWithBlockEvent event) { + int intVal; + EntityPlayerSP player = this.mc.thePlayer; + int intVal2 = (player.getMovementInput().evaluateCondition2() ? 1 : 0); + if (intVal2 != 0) { + return; + } + + String textStr = this.cachedText; + List itemList = this.mode.getAcceptableValues(); + intVal2 = (textStr.equals(itemList.get(1)) ? 1 : 0); + + if (intVal2 == 0) { + return; + } + + BlockPos pos = event.getPos(); + intVal2 = pos.getY(); + + double doubleVal; + label23: { + intVal = intVal2; + double doubleVal2 = this.cachedValue2 % 1.0; + if (doubleVal2 == 0.0) { + doubleVal = 1.0; + break label23; + } + + doubleVal = this.cachedValue2 % 1.0; + } + + if (intVal == this.cachedValue2 - doubleVal) { + BlockPos pos2 = event.getPos(); + BlockPos pos3 = event.getPos(); + event.setBoundingBox(new AxisAlignedBB(pos2, pos3.add(1, 1, 1))); + } +} + + @Override + public void onEnable() { + net.minecraft.client.entity.EntityPlayerSP player; + boolean onGround2; + this.handleClassArray(Scaffold.class, Speed.class, LongJump.class); + StringProperty strProp = this.mode; + this.cachedText = strProp.get(); + this.stateTicks = 0; + onGround2 = this.mc.thePlayer.onGround; + + if (!this.mc.thePlayer.onGround) { + BooleanProperty boolProp = this.autoMotion; + Boolean propFlag = boolProp.get(); + onGround2 = propFlag; + + if (onGround2) { + strProp = this.mode; + List itemList = strProp.getAcceptableValues(); + this.cachedText = (String)itemList.get(0); + } + } + + this.handleString3(this.cachedText); + String textStr = this.cachedText; + strProp = this.mode; + List itemList2 = strProp.getAcceptableValues(); + onGround2 = textStr.equals(itemList2.get(1)); + + label53: + if (onGround2) { + EntityPlayerSP player2 = this.mc.thePlayer; + this.cachedValue = player2.resolveDouble2(true) * 0.98; + Fly fly = this; + + if (this.mc.thePlayer.onGround) { + this.cachedValue2 = this.mc.thePlayer.posY; + EntityPlayerSP player3 = this.mc.thePlayer; + player3.jump(); + break label53; + } + + fly = this; + + + double posY2 = this.mc.thePlayer.posY; + fly.cachedValue2 = MathHelper.incValue(posY2, 0.125) - 1.0; + } + + String textStr2 = this.cachedText; + strProp = this.mode; + List itemList3 = strProp.getAcceptableValues(); + onGround2 = textStr2.equals(itemList3.get(0)); + + if (!onGround2) { + return; + } + + BooleanProperty boolProp2 = this.toggleJump; + Boolean propFlag2 = boolProp2.get(); + onGround2 = propFlag2; + + + if (!onGround2) { + return; + } + + player = this.mc.thePlayer; + + onGround2 = this.mc.thePlayer.onGround; + + + if (!onGround2) { + return; + } + + player = this.mc.thePlayer; + + player.motionY = 0.42F; +} + + + public Fly(ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + StringProperty strProp = StringProperty.of("Hypixel"); + String[] stringArr = new String[]{"Motion", "Hypixel"}; + this.mode = strProp.acceptableValues(stringArr); + this.motionSpeed = DoubleProperty.of(1.0).minimum(0.25).maximum(5.0); + this.autoMotion = BooleanProperty.of(true); + this.airWalk = BooleanProperty.of(false); + this.toggleJump = BooleanProperty.of(false); + this.glide = BooleanProperty.of(false); + Setting setting = new Setting("FLY_MODE", "Mode", SettingType.COMBOBOX, this, this.mode); + SettingManager.register(setting); + setting = new Setting("FLY_AIRWALK", "Airwalk", SettingType.CHECKBOX, this, this.airWalk, () -> this.mode.equals("Hypixel")); + SettingManager.register(setting); + setting = new Setting("FLY_AUTO_MOTION", "Auto Motion", SettingType.CHECKBOX, this, this.autoMotion, () -> this.mode.equals("Hypixel")); + SettingManager.register(setting); + setting = new Setting("FLY_TOGGLE_JUMP", "Toggle Jump", SettingType.CHECKBOX, this, this.toggleJump, () -> this.mode.equals("Motion")); + SettingManager.register(setting); + setting = new Setting("FLY_GLIDE", "Glide", SettingType.CHECKBOX, this, this.glide, () -> this.mode.equals("Motion")); + SettingManager.register(setting); + setting = new Setting("FLY_MOTION_SPEED", "Motion Speed", SettingType.SLIDER, this, this.motionSpeed, 0.25, this::supplyBoolean); + SettingManager.register(setting); +} + +} diff --git a/src/main/java/cc/novoline/modules/move/GuiMove.java b/src/main/java/cc/novoline/modules/move/GuiMove.java new file mode 100644 index 0000000..d5c6c5b --- /dev/null +++ b/src/main/java/cc/novoline/modules/move/GuiMove.java @@ -0,0 +1,156 @@ +package cc.novoline.modules.move; + +import cc.novoline.events.events.SneakEvent; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ServerUtils; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventManager; +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.misc.UhcCrafts; +import cc.novoline.modules.player.ChestStealer; +import cc.novoline.modules.ModuleRegistry; +import cc.novoline.modules.ModuleManager; +import net.minecraft.util.MovementInput; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.client.entity.EntityPlayerSP; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.lwjgl.input.Keyboard; + +public final class GuiMove extends AbstractModule { + @Property("sneak") + private final BooleanProperty sneak; + + + @Override + public void onEnable() { + this.handleString3(ServerUtils.isHypixel() ? "Hypixel" : ""); +} + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + this.handleString3(ServerUtils.isHypixel() ? "Hypixel" : ""); +} + + public GuiMove(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.sneak = BooleanProperty.of(false); + SettingManager.register(new Setting("GM_SNEAK", "Sneak", SettingType.CHECKBOX, this, this.sneak)); +} + + public void performStep14() { + boolean flag; + cc.novoline.modules.AbstractModule mod; + int intVal2 = UhcCrafts.g(); + MovementInput movementInput = this.mc.thePlayer.getMovementInput(); + SneakEvent sneakEvent = new SneakEvent(); + EventManager.call(sneakEvent); + int intVal = intVal2; + boolean flag2 = sneakEvent.isCancelled(); + if (flag2) { + movementInput.applyFloat(0.0F); + movementInput.applyFlag(0.0F); + movementInput.applyFlag(false); + movementInput.applyFloat(false); + return; + } + + movementInput.applyFlag(0.0F); + movementInput.applyFloat(0.0F); + KeyBinding keyBinding = this.mc.gameSettings.bj; + intVal2 = keyBinding.getKeyCode(); + flag2 = Keyboard.isKeyDown(intVal2); + + if (flag2) { + movementInput.applyFloat(movementInput.getMoveForward() + 1.0F); + } + + KeyBinding keyBinding2 = this.mc.gameSettings.b4; + intVal2 = keyBinding2.getKeyCode(); + flag2 = Keyboard.isKeyDown(intVal2); + + if (flag2) { + movementInput.applyFloat(movementInput.getMoveForward() - 1.0F); + } + + KeyBinding keyBinding3 = this.mc.gameSettings.B; + intVal2 = keyBinding3.getKeyCode(); + flag2 = Keyboard.isKeyDown(intVal2); + + if (flag2) { + movementInput.applyFlag(movementInput.getMoveStrafe() + 1.0F); + } + + KeyBinding keyBinding4 = this.mc.gameSettings.b6; + intVal2 = keyBinding4.getKeyCode(); + flag2 = Keyboard.isKeyDown(intVal2); + + if (flag2) { + movementInput.applyFlag(movementInput.getMoveStrafe() - 1.0F); + } + + label73: { + KeyBinding keyBinding5 = this.mc.gameSettings.am; + int keyCode = keyBinding5.getKeyCode(); + movementInput.applyFloat(Keyboard.isKeyDown(keyCode)); + GuiMove guiMove = this; + if (intVal != 0) { + BooleanProperty boolProp = this.sneak; + Boolean propFlag = boolProp.get(); + if (propFlag) { + KeyBinding keyBinding6 = this.mc.gameSettings.E; + int keyCode2 = keyBinding6.getKeyCode(); + flag = Keyboard.isKeyDown(keyCode2); + break label73; + } + + guiMove = this; + } + + KeyBinding keyBinding7 = guiMove.mc.gameSettings.E; + flag = keyBinding7.isKeyDown(); + } + + label66: { + movementInput.applyFlag(flag); + boolean sneaking = movementInput.isSneak(); + if (!sneaking) { + break label66; + } + + ModuleRegistry modEntry = ModuleRegistry.FASTSNEAK; + mod = modEntry.getModule(); + + sneaking = mod.isEnabled(); + + if (!sneaking) { + movementInput.applyFlag(movementInput.getMoveStrafe() * 0.3F); + movementInput.applyFloat(movementInput.getMoveForward() * 0.3F); + } + } + + ModuleRegistry modEntry2 = ModuleRegistry.CHESTSTEALER; + mod = modEntry2.getModule(); + + ChestStealer stealer = (ChestStealer)mod; + ModuleRegistry modEntry3 = ModuleRegistry.UHCCRAFTS; + UhcCrafts uhcCrafts = modEntry3.getModule(); + if (intVal != 0) { + if (!stealer.isReadyState13() && !uhcCrafts.checkState9()) { + return; + } + + movementInput.applyFlag(0.0F); + } + + movementInput.applyFloat(0.0F); +} + + +} diff --git a/src/main/java/cc/novoline/modules/move/HClip.java b/src/main/java/cc/novoline/modules/move/HClip.java new file mode 100644 index 0000000..f6deb4b --- /dev/null +++ b/src/main/java/cc/novoline/modules/move/HClip.java @@ -0,0 +1,114 @@ +package cc.novoline.modules.move; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.MoveEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C04PacketPlayerPosition; +import net.minecraft.util.MathHelper; +import net.minecraft.client.entity.EntityPlayerSP; + +public class HClip extends AbstractModule { + private int stateTicks; + @Property("mode") + private StringProperty mode; + + @Override + public void onDisable() { + this.mc.timer.timerSpeed = 1.0F; +} + + + public HClip(ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + StringProperty strProp = StringProperty.of("Basic"); + String[] stringArr = new String[]{"Basic", "Toggle"}; + this.mode = strProp.acceptableValues(stringArr); + SettingManager.register(new Setting("HCLIP_MODE", "Mode", SettingType.COMBOBOX, this, this.mode)); +} + + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + if (event.getState() == State.PRE) { + HClip hClip; + label24: { + double posX2 = this.mc.thePlayer.posX; + double posY2 = this.mc.thePlayer.posY; + double posZ2 = this.mc.thePlayer.posZ; + StringProperty strProp = this.mode; + int intVal = (strProp.equals("Toggle") ? 1 : 0); + if (intVal != 0) { + EntityPlayerSP player = this.mc.thePlayer; + double doubleVal = player.getFloat2(); + double angleRad = Math.toRadians(doubleVal); + double doubleVal2 = -MathHelper.sin(angleRad); + EntityPlayerSP player2 = this.mc.thePlayer; + double doubleVal3 = player2.getFloat2(); + double angleRad2 = Math.toRadians(doubleVal3); + double doubleVal4 = MathHelper.cos(angleRad2); + this.sendPacket(new C04PacketPlayerPosition(posX2 + doubleVal2 * 7.5, posY2 - 1.75, posZ2 + doubleVal4 * 7.5, true)); + EntityPlayerSP player3 = this.mc.thePlayer; + double doubleVal5 = posX2 + doubleVal2 * 7.5; + double posY3 = posY2 - 1.75; + double doubleVal6 = posZ2 + doubleVal4 * 7.5; + player3.setPosition(doubleVal5, posY3, doubleVal6); + this.toggle(); + break label24; + } + + this.mc.timer.timerSpeed = 0.5F; + this.mc.thePlayer.cameraYaw = 0.1F; + this.stateTicks++; + hClip = this; + + intVal = this.stateTicks; + + if (intVal > 12) { + this.sendPacket(new C04PacketPlayerPosition(posX2, posY2 - 1.75, posZ2, true)); + EntityPlayerSP player4 = this.mc.thePlayer; + double posY4 = posY2 - 1.75; + player4.setPosition(posX2, posY4, posZ2); + this.stateTicks = 0; + } + } + + hClip = this; + + hClip.mc.thePlayer.motionY = 0.0; + event.setCancelled(true); + } +} + + + @EventTarget + public void onMove(MoveEvent event) { + label16: { + if (!this.mode.equals("Toggle")) { + break label16; + } + + event.setMoveSpeed(0.0); + + return; + } + + EntityPlayerSP player = this.mc.thePlayer; + event.setMoveSpeed(player.resolveDouble(true) * 2.0); +} + + @Override + public void onEnable() { + this.stateTicks = 0; +} + +} diff --git a/src/main/java/cc/novoline/modules/move/LongJump.java b/src/main/java/cc/novoline/modules/move/LongJump.java new file mode 100644 index 0000000..b0a8773 --- /dev/null +++ b/src/main/java/cc/novoline/modules/move/LongJump.java @@ -0,0 +1,736 @@ +package cc.novoline.modules.move; + +import cc.novoline.events.events.SneakEvent; +import cc.novoline.events.events.SoundPlayEvent; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.Timer; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.tasks.TaskManager; +import cc.novoline.utils.tasks.TaskStage; +import cc.novoline.utils.tasks.impl.LongJumpTask; + +import cc.novoline.Novoline; +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.CollideWithBlockEvent; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.PlayerUpdateEvent; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.exploits.Disabler; +import cc.novoline.modules.player.Scaffold; +import cc.novoline.modules.ModuleRegistry; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.network.play.client.C0BPacketEntityAction$Action; +import net.minecraft.potion.Potion; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import org.lwjgl.opengl.GL11; + +public class LongJump extends AbstractModule { + private Disabler disablerModule; + private boolean stateFlag; + @Property("autism") + private BooleanProperty autism; + private float cachedAngle; + private int stateTicks; + @Property("view-bobbing") + private BooleanProperty viewBobbing; + private boolean stateFlag2; + private double doubleValue; + private boolean stateFlag3; + @Property("visual-airwalk") + private BooleanProperty visualAirwalk; + private int stateTicks2; + private boolean stateFlag4; + @Property("auto-disable") + private BooleanProperty autoDisable; + private boolean stateFlag5; + private boolean stateFlag6; + private Timer msTimer; + + + @Override + public void onEnable() { + cc.novoline.modules.move.LongJump longJump; + this.disablerModule = ModuleRegistry.DISABLER.getModule(); + this.msTimer.reset(); + this.handleString3("Hypixel"); + LongJump longJump2 = this; + label24: + if (this.disablerModule.isEnabled()) { + Disabler disabler = this.disablerModule; + boolean flag = disabler.checkState4(); + if (!flag) { + break label24; + } + + this.cachedAngle = this.mc.thePlayer.rotationYaw; + this.doubleValue = this.mc.thePlayer.posY; + this.stateTicks2 = this.intTable[0]; + this.stateTicks = this.intTable[0]; + this.stateFlag = this.fieldVal2[0]; + this.stateFlag2 = this.fieldVal2[0]; + this.stateFlag3 = this.fieldVal2[0]; + this.stateFlag5 = this.fieldVal2[0]; + this.stateFlag4 = this.fieldVal2[1]; + longJump = this; + + EntityPlayerSP player = this.mc.thePlayer; + flag = player.isMoving(); + + if (flag) { + longJump = this; + + if (this.mc.thePlayer.onGround) { + this.sendPacketNoEvent(new C0BPacketEntityAction(this.mc.thePlayer, C0BPacketEntityAction$Action.START_SPRINTING)); + this.stateFlag6 = this.fieldVal2[1]; + return; + } + } + + longJump = this; + + longJump.applyString2("To turn on the module you should move and be on the ground", 4000); + return; + } + + longJump2 = this; + + longJump2.applyString2("You need to enabled Disabler module and Ping Spoof option in it to use HYPIXEL mode", 4000); +} + + @EventTarget + public void applyInt5(SoundPlayEvent event) { + this.handleSoundPlayEvent(event); +} + + private void applyInt5(CollideWithBlockEvent event) { + cc.novoline.events.events.CollideWithBlockEvent collideWithBlockEvent; + EntityPlayerSP player = this.mc.thePlayer; + if (this.mc.thePlayer == null) { + return; + } + + player = this.mc.thePlayer; + + double posY2; + int intVal = (posY2 = player.posY - (this.doubleValue + this.intTable[1])) == 0.0 ? 0 : (posY2 < 0.0 ? -1 : 1); + if (intVal > 0) { + return; + } + + intVal = (this.stateFlag ? 1 : 0); + + if (intVal != 0) { + return; + } + + BooleanProperty boolProp = this.autism; + Boolean propFlag = boolProp.get(); + intVal = (propFlag ? 1 : 0); + + if (intVal == 0) { + return; + } + + collideWithBlockEvent = event; + + BlockPos pos = event.getPos(); + if (pos.getY() != (this.doubleValue - this.intTable[1])) { + return; + } + + collideWithBlockEvent = event; + + BlockPos pos2 = event.getPos(); + BlockPos pos3 = event.getPos(); + int intVal2 = this.intTable[1]; + int intVal3 = this.intTable[1]; + int intVal4 = this.intTable[1]; + collideWithBlockEvent.setBoundingBox(new AxisAlignedBB(pos2, pos3.add(intVal2, intVal3, intVal4))); +} + + private void applyInt5(PlayerUpdateEvent event) { + cc.novoline.modules.move.LongJump longJump; + int intVal; + if (this.mc.thePlayer.motionY < this.intTable[0]) { + intVal = (this.stateFlag4 ? 1 : 0); + + if (!this.stateFlag4) { + this.stateFlag3 = this.fieldVal2[1]; + } + } + + intVal = (this.stateFlag3 ? 1 : 0); + + + if (intVal == 0) { + return; + } + + longJump = this; + + intVal = this.stateTicks2; + + + if (intVal <= this.intTable[0]) { + return; + } + + longJump = this; + + longJump.stateTicks2--; +} + + + public LongJump(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.visualAirwalk = BooleanProperty.of(false); + this.autoDisable = BooleanProperty.of(true); + this.autism = BooleanProperty.of(true); + this.viewBobbing = BooleanProperty.of(false); + this.msTimer = new Timer(); + Setting setting = new Setting("LJ_FEATURES", "FEATURES", SettingType.SEPARATOR, this); + SettingManager.register(setting); + setting = new Setting("LJ_AUTISM", "Autism", SettingType.CHECKBOX, this, this.autism); + SettingManager.register(setting); + setting = new Setting("LJ_VISUAL_AIRWALK", "Airwalk", SettingType.CHECKBOX, this, this.visualAirwalk); + SettingManager.register(setting); + setting = new Setting("LJ_VIEW_BOBBING", "View Bobbing", SettingType.CHECKBOX, this, this.viewBobbing, this::lambdaImpl$new$0); + SettingManager.register(setting); + setting = new Setting("LJ_AUTO_DISABLE", "Auto Disable", SettingType.CHECKBOX, this, this.autoDisable); + SettingManager.register(setting); +} + + private void handleMotionUpdateEvent(MotionUpdateEvent event) { + net.minecraft.client.entity.EntityPlayerSP player; + net.minecraft.client.entity.EntityPlayerSP player2; + if (event.getState() == State.PRE) { + int ticks; + ticks = this.stateTicks; + + if (this.stateTicks < this.getIntValue5()) { + ticks = (this.mc.thePlayer.onGround ? 1 : 0); + + if (this.mc.thePlayer.onGround) { + this.mc.thePlayer.motionY = this.doubleTable[0]; + boolean flag3 = this.fieldVal2[0]; + event.setOnGround(flag3); + this.stateTicks++; + ticks = this.stateTicks; + + if (this.stateTicks == this.getIntValue5()) { + this.stateFlag4 = this.fieldVal2[0]; + } + } + } + + ticks = (this.mc.thePlayer.onGround ? 1 : 0); + + + label237: { + + if (ticks != 0) { + ticks = (this.stateFlag5 ? 1 : 0); + + if (this.stateFlag5) { + label211: { + LongJump longJump = this; + if (!this.stateFlag) { + player = this.mc.thePlayer; + + Block block = player.getBlockUnderPlayer(); + Material material = block.getMaterial(); + if (!material.isSolid()) { + break label211; + } + } + + longJump = this; + + longJump.applyInt5(this.getClass()); + break label237; + } + + this.callbackTask5.run(); + this.mc.thePlayer.motionY = this.doubleTable[0]; + player = this.mc.thePlayer; + + double doubleVal = this.doubleTable[1]; + float floatVal2 = this.cachedAngle; + player.setSpeedDegrees(doubleVal, floatVal2); + this.stateFlag = this.fieldVal2[1]; + break label237; + } + } + + ticks = (this.stateFlag4 ? 1 : 0); + + + if (ticks != 0) { + EntityPlayerSP player3 = this.mc.thePlayer; + double doubleVal2 = this.intTable[0]; + player3.setMoveSpeed(doubleVal2); + break label237; + } + + ticks = (this.mc.thePlayer.onGround ? 1 : 0); + + + if (ticks != 0) { + this.mc.thePlayer.motionY = this.doubleTable[0]; + EntityPlayerSP player4 = this.mc.thePlayer; + EntityPlayerSP player5 = this.mc.thePlayer; + boolean flag = this.fieldVal2[1]; + double doubleVal7 = this.doubleTable[2]; + double doubleVal3 = player5.applyArmorCalculations(flag, doubleVal7) * this.doubleTable[3]; + float yaw = this.cachedAngle = this.mc.thePlayer.rotationYaw; + player4.setSpeedDegrees(doubleVal3, yaw); + boolean flag2 = this.fieldVal2[0]; + event.setOnGround(flag2); + break label237; + } + + ticks = this.mc.thePlayer.offGroundTicks; + + + int intVal = this.intTable[2]; + if (ticks == intVal) { + ticks = (this.stateFlag ? 1 : 0); + + if (this.stateFlag) { + break label237; + } + + int intVal2 = (this.stateFlag5 = this.fieldVal2[1]) ? 1 : 0; + event.setOnGround(intVal2 != 0); + ticks = (this.disablerModule.isEnabled() ? 1 : 0); + + if (ticks == 0) { + break label237; + } + + Disabler disabler = this.disablerModule; + ticks = (disabler.checkState4() ? 1 : 0); + + if (ticks == 0) { + break label237; + } + + Disabler disabler2 = this.disablerModule; + intVal2 = this.intTable[0]; + disabler2.applyUpdate2(intVal2); + break label237; + } + + ticks = this.stateTicks2; + intVal = this.intTable[9] + this.intTable[8] + this.intTable[2]; + + + if (ticks == intVal) { + this.mc.thePlayer.motionY = this.doubleTable[8]; + EntityPlayerSP player6 = this.mc.thePlayer; + double doubleVal4 = this.doubleTable[7]; + player6.applyInt5(doubleVal4); + this.mc.thePlayer.fallDistance = this.intTable[0]; + break label237; + } + + ticks = this.stateTicks2; + + intVal = this.intTable[9] * this.intTable[2]; + + + if (ticks == intVal) { + this.mc.thePlayer.motionY = this.doubleTable[0]; + break label237; + } + + ticks = (this.stateFlag ? 1 : 0); + + + if (ticks != 0) { + ticks = this.mc.thePlayer.offGroundTicks; + if (this.mc.thePlayer.offGroundTicks == this.intTable[1]) { + double doubleVal5; + label148: { + LongJump longJump2 = this; + + EntityPlayerSP player7 = this.mc.thePlayer; + Potion potion = Potion.moveSpeed; + if (player7.isPotionActive(potion)) { + doubleVal5 = this.intTable[0]; + break label148; + } + + longJump2 = this; + + + doubleVal5 = longJump2.doubleTable[5]; + } + + this.mc.thePlayer.motionY += doubleVal5; + break label237; + } + + if (this.mc.thePlayer.motionY <= this.intTable[0]) { + break label237; + } + + this.mc.thePlayer.motionY = this.mc.thePlayer.motionY + this.doubleTable[4]; + break label237; + } + + ticks = this.mc.thePlayer.offGroundTicks; + + + if (ticks > this.intTable[5]) { + if (this.mc.thePlayer.motionY > this.intTable[0]) { + this.mc.thePlayer.motionY = this.mc.thePlayer.motionY + this.doubleTable[4]; + } + } + } + + ticks = (this.stateFlag4 ? 1 : 0); + + if (ticks == 0) { + ticks = this.mc.thePlayer.offGroundTicks; + + if (this.mc.thePlayer.offGroundTicks > this.intTable[2]) { + EntityPlayerSP player8 = this.mc.thePlayer; + double doubleVal6 = this.doubleTable[6]; + player8.applyInt5(doubleVal6); + } + } + + ticks = (this.stateFlag4 ? 1 : 0); + + if (ticks == 0) { + ticks = (this.stateFlag ? 1 : 0); + + if (!this.stateFlag) { + BooleanProperty boolProp = this.visualAirwalk; + Boolean propFlag = boolProp.get(); + ticks = (propFlag ? 1 : 0); + + if (ticks == 0) { + return; + } + } + } + + if (event.getY() > this.doubleValue) { + float floatVal; + label101: { + Minecraft mcClient = this.mc; + mcClient.getRenderViewEntity().posY = this.doubleValue; + player2 = this.mc.thePlayer; + BooleanProperty boolProp2 = this.viewBobbing; + Boolean propFlag2 = boolProp2.get(); + int intVal3 = (propFlag2 ? 1 : 0); + + if (intVal3 != 0) { + EntityPlayerSP player9 = this.mc.thePlayer; + EntityPlayerSP player10 = this.mc.thePlayer; + double doubleVal8 = player10.getDouble8(); + floatVal = player9.resolveFloat12(doubleVal8); + break label101; + } + + intVal3 = this.intTable[0]; + + + floatVal = intVal3; + } + + player2.cameraYaw = floatVal; + this.mc.thePlayer.cameraPitch = this.intTable[0]; + } + } +} + + private Boolean lambdaImpl$new$0() { + boolean flag; + Boolean propFlag = this.autism.get(); + flag = propFlag; + label17: { + if (!flag) { + BooleanProperty boolProp = this.visualAirwalk; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + flag = false; + break label17; + } + } + + flag = true; + } + + return flag; +} + + public static Minecraft resolveMinecraft(LongJump longJump) { + return longJump.mc; +} + + @EventTarget + public void onRender2D(Render2DEvent event) { + this.applyInt5(event); +} + + private int computeIntValue() { + return this.mc.thePlayer.findHotbarItemSlot(Items.fire_charge); +} + + private void handleSneakEvent(SneakEvent event) { + if (this.stateFlag4) { + event.setCancelled(this.fieldVal2[1]); + } +} + + @EventTarget + public void onPacket(PacketEvent event) { + this.handlePacketEvent(event); +} + + @EventTarget + public void applyInt5(SneakEvent event) { + this.handleSneakEvent(event); +} + + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + this.handleString3("Hypixel"); +} + + private void applyInt5(Render2DEvent event) { + int intVal2 = (this.stateFlag4 ? 1 : 0); + if (!this.stateFlag4) { + return; + } + + ScaledResolution scaledRes = event.getResolution(); + intVal2 = scaledRes.getScaledWidth(); + + int intVal = intVal2; + ScaledResolution scaledRes2 = event.getResolution(); + int scaledHeight = scaledRes2.getScaledHeight(); + double doubleVal = intVal / 2; + double doubleVal2 = scaledHeight / 2 + 20; + double doubleVal8 = 100.0; + double doubleVal3 = 6.0; + long longVal = 36L + 12L * (this.getIntValue5() - 4); + double doubleVal4 = this.msTimer.getScaledElapsed(longVal * 50L, doubleVal8); + double doubleVal5 = doubleVal - doubleVal8 / 2.0; + double doubleVal9 = doubleVal2 - doubleVal3 / 2.0; + double doubleVal6 = doubleVal5 - 1.0; + double doubleVal10 = doubleVal9 - 1.0; + double doubleVal11 = doubleVal5 + doubleVal8 + 1.0; + double doubleVal12 = doubleVal9 + doubleVal3 + 1.0; + int color = ColorTheme.BLACK.getRGB(); + int color3 = ColorTheme.reAlpha(color, 150); + RenderUtils.drawRect(doubleVal6, doubleVal10, doubleVal11, doubleVal12, color3); + byte byteVal = 0; + double doubleVal7 = doubleVal5; + + while (true) { + if (doubleVal7 < doubleVal5 + doubleVal4) { + doubleVal11 = doubleVal7 + 0.5; + doubleVal12 = doubleVal9 + doubleVal3; + long longVal2 = byteVal; + int color2 = ColorTheme.getHudColor(longVal2); + int color4 = ColorTheme.reAlpha(color2, 150); + RenderUtils.drawRect(doubleVal7, doubleVal9, doubleVal11, doubleVal12, color4); + byteVal -= 15; + doubleVal7 += 0.5; + + continue; + } + + doubleVal = doubleVal5 + (doubleVal8 / 2.0 - 5.0); + doubleVal9++; + GL11.glPushMatrix(); + GL11.glTranslated(doubleVal, doubleVal9, 0.0); + GL11.glScaled(0.5, 0.5, 0.0); + GL11.glTranslated(-doubleVal, -doubleVal9, 0.0); + FontRenderer font = this.mc.crackFontRenderer; + StringBuilder sb = new StringBuilder(); + String textStr = "%.2f"; + Object[] objArr = new Object[1]; + objArr[0] = doubleVal4; + String textStr2 = String.format(textStr, objArr); + StringBuilder sb2 = sb.append(textStr2); + String textStr3 = sb2.append("%").toString(); + float floatVal = (float)doubleVal; + float floatVal2 = (float)doubleVal9; + font.drawStringWithShadow(textStr3, floatVal, floatVal2, 16777215); + GL11.glPopMatrix(); + break; + } +} + + private int getIntValue5() { + EntityPlayerSP player = this.mc.thePlayer; + Potion potion = Potion.jump; + int intVal = player.computePotionInt(potion); + int intVal2 = 3; + int intVal3 = intVal; + byte byteVal = 1; + if (intVal == 1) { + intVal2 = 4; + return intVal2 + 1; + } + + intVal3 = intVal; + byteVal = 2; + + if (intVal3 == byteVal) { + intVal2 = 5; + return intVal2 + 1; + } + + intVal3 = intVal; + byteVal = 3; + + if (intVal3 == byteVal) { + intVal2 = 5; + return intVal2 + 1; + } + + intVal3 = intVal; + byteVal = 4; + + if (intVal3 == byteVal) { + intVal2 = 6; + return intVal2 + 1; + } + + intVal3 = intVal; + byteVal = 4; + + if (intVal3 > byteVal) { + intVal2 = 3 + intVal; + } + + return intVal2 + 1; +} + + private void handlePacketEvent(PacketEvent event) { + cc.novoline.modules.move.LongJump longJump; + PacketEvent packetEvent = event; + if (event.getState() != cc.novoline.events.State.INCOMING) { + return; + } + + packetEvent = event; + + boolean flag = packetEvent.getPacket() instanceof S12PacketEntityVelocity; + if (flag) { + label36: { + S12PacketEntityVelocity entityVelocityPacket = (S12PacketEntityVelocity)event.getPacket(); + int intVal = entityVelocityPacket.getEntityID(); + EntityPlayerSP player = this.mc.thePlayer; + if (intVal != player.getEntityId()) { + break label36; + } + + boolean flag2 = this.fieldVal2[1]; + event.setCancelled(flag2); + longJump = this; + + intVal = (this.stateFlag ? 1 : 0); + + if (intVal != 0) { + break label36; + } + + longJump = this; + + longJump.stateTicks2 = this.intTable[5] * this.intTable[4]; + } + + return; + } + + flag = event.getPacket() instanceof S08PacketPlayerPosLook; + + if (flag) { + this.applyInt5(this.getClass()); + } +} + + @Override + public void onDisable() { + LongJump longJump; + boolean flag = this.stateFlag6; + if (!this.stateFlag6) { + return; + } + + this.sendPacketNoEvent(new C0BPacketEntityAction(this.mc.thePlayer, C0BPacketEntityAction$Action.STOP_SPRINTING)); + longJump = this; + + flag = this.mc.thePlayer.onGround; + + if (flag) { + Novoline novolineInst = this.novoline; + TaskManager taskManager = novolineInst.getTaskManager(); + taskManager.applyFutureTask(new LongJumpTask(this, 40, TaskStage.UPDATE)); + } + + longJump = this; + + longJump.stateFlag6 = this.fieldVal2[0]; +} + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + this.handleMotionUpdateEvent(event); +} + + private void handleSoundPlayEvent(SoundPlayEvent event) { + SoundPlayEvent soundPlayEvent = event; + if (!event.getStringValue().equals(this.textField)) { + return; + } + + soundPlayEvent = event; + + soundPlayEvent.setCancelled(true); +} + + + @EventTarget + public void onPlayerUpdate(PlayerUpdateEvent event) { + this.applyInt5(event); +} + + @EventTarget + public void onCollideWithBlock(CollideWithBlockEvent event) { + this.applyInt5(event); +} + +} diff --git a/src/main/java/cc/novoline/modules/move/NoJumpDelay.java b/src/main/java/cc/novoline/modules/move/NoJumpDelay.java new file mode 100644 index 0000000..71700b4 --- /dev/null +++ b/src/main/java/cc/novoline/modules/move/NoJumpDelay.java @@ -0,0 +1,13 @@ +package cc.novoline.modules.move; + +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.ModuleManager; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class NoJumpDelay extends AbstractModule { + + public NoJumpDelay(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); +} +} diff --git a/src/main/java/cc/novoline/modules/move/NoSlowDown.java b/src/main/java/cc/novoline/modules/move/NoSlowDown.java new file mode 100644 index 0000000..3eabdc1 --- /dev/null +++ b/src/main/java/cc/novoline/modules/move/NoSlowDown.java @@ -0,0 +1,642 @@ +package cc.novoline.modules.move; + +import cc.novoline.events.events.SlowdownEvent; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.render.RotationAngleUtil; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.SettingEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.combat.KillAura; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.player.Scaffold; +import cc.novoline.modules.ModuleRegistry; +import net.minecraft.item.ItemMilkBucket; +import net.minecraft.item.ItemIronSword; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBow; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemPotion; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C07PacketPlayerDigging$Action; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; + +public final class NoSlowDown extends AbstractModule { + private float cachedAngle; + private float cachedAngle2; + private TimerUtil timer; + private boolean stateFlag; + @Property("mode") + private final StringProperty mode; + @Property("items") + private final ListProperty items; + + @EventTarget + public void handleSlowdownEvent(SlowdownEvent event) { + label27: { + boolean flag = this.isStateReady2(); + if (flag) { + break label27; + } + + flag = this.checkState11(); + + if (flag) { + break label27; + } + + flag = this.checkState10(); + + if (!flag) { + return; + } + } + + event.setCancelled(true); +} + + public boolean evaluateFlag3(String text) { + boolean flag = this.mode.equals(text); + if (!flag) { + return false; + } + + flag = this.checkState10(); + + return flag; +} + + public boolean checkState10() { + ListProperty listProp = this.items; + boolean flag = listProp.contains("Bow"); + if (flag) { + EntityPlayerSP player = this.mc.thePlayer; + ItemStack stack = player.getHeldItem(); + boolean enabled = this.isEnabled(); + if (!enabled) { + return false; + } + + KeyBinding keyBinding = this.mc.gameSettings.keyBindUseItem; + enabled = keyBinding.isKeyDown(); + + if (!enabled) { + return false; + } + + InventoryPlayer inventory2 = this.mc.thePlayer.inventory; + Item item = Items.arrow; + enabled = inventory2.matchesItem(item); + + if (enabled) { + ItemStack stack2 = stack; + if (stack == null) { + return false; + } + + stack2 = stack; + + boolean flag2 = stack2.getItem() instanceof ItemBow; + + if (flag2) { + return true; + } + } + + return false; + } + + flag = false; + + return flag; +} + + public boolean isStateReady2() { + KillAura killAura = ModuleRegistry.KILLAURA.getModule(); + boolean enabled = this.isEnabled(); + if (enabled) { + boolean flag = killAura.isReadyState3(); + + label51: + if (!flag) { + boolean enabled2 = this.isEnabled(ModuleRegistry.SCAFFOLD); + if (enabled2) { + break label51; + } + + ListProperty listProp = this.items; + enabled2 = listProp.contains("Sword"); + + if (enabled2) { + EntityPlayerSP player = this.mc.thePlayer; + ItemStack stack = player.getHeldItem(); + KeyBinding keyBinding = this.mc.gameSettings.keyBindUseItem; + if (keyBinding.isKeyDown()) { + ItemStack stack2 = stack; + if (stack == null) { + return false; + } + + stack2 = stack; + + boolean flag2 = stack2.getItem() instanceof ItemIronSword; + + if (flag2) { + return true; + } + } + + return false; + } + + enabled2 = false; + + return enabled2; + } + } + + enabled = false; + + return enabled; +} + + public boolean evaluateFlag4(String text) { + boolean flag = this.mode.equals(text); + if (!flag) { + return false; + } + + flag = this.checkState11(); + + return flag; +} + + public boolean evaluateFlag5(String text) { + boolean flag = this.mode.equals(text); + if (!flag) { + return false; + } + + flag = this.isStateReady2(); + + return flag; +} + + + public StringProperty getMode() { + return this.mode; +} + + public StringProperty getStringProperty() { + return this.getMode(); +} + + public NoSlowDown(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + StringProperty strProp = StringProperty.of("Hypixel"); + String[] stringArr = new String[]{"NCP", "Vanilla", "Hypixel"}; + this.mode = strProp.acceptableValues(stringArr); + ListProperty listProp = ListProperty.of("Sword", "Consumables"); + stringArr = new String[]{"Bow", "Sword", "Consumables"}; + this.items = listProp.acceptableValues((Object[])stringArr); + this.timer = new TimerUtil(); + Setting setting = new Setting("NS_MODE", "Mode", SettingType.COMBOBOX, this, this.mode); + SettingManager.register(setting); + setting = new Setting("NS_ITEMS", "Items", SettingType.SELECTBOX, this, this.items); + SettingManager.register(setting); +} + + + public ListProperty getItems() { + return this.items; +} + + public ListProperty getListPropertyE() { + return this.getItems(); +} + + public boolean checkState11() { + net.minecraft.item.Item item2; + ListProperty listProp = this.items; + boolean flag = listProp.contains("Consumables"); + if (flag) { + EntityPlayerSP player = this.mc.thePlayer; + ItemStack stack = player.getHeldItem(); + boolean enabled = this.isEnabled(); + if (!enabled) { + return false; + } + + KeyBinding keyBinding = this.mc.gameSettings.keyBindUseItem; + enabled = keyBinding.isKeyDown(); + + if (enabled) { + ItemStack stack2 = stack; + if (stack == null) { + return false; + } + + stack2 = stack; + + boolean flag2 = stack2.getItem() instanceof ItemFood; + if (flag2) { + EntityPlayerSP player2 = this.mc.thePlayer; + boolean flag3 = player2.getFoodStats().needFood(); + + if (flag3) { + return true; + } + + item2 = stack.getItem(); + Item item3 = Items.golden_apple; + if (item2 == Items.golden_apple) { + return true; + } + + item2 = stack.getItem(); + + item3 = Items.golden_carrot; + + if (item2 == item3) { + return true; + } + } + + item2 = stack.getItem(); + + flag2 = item2 instanceof ItemMilkBucket; + + if (flag2) { + return true; + } + + boolean flag4 = stack.getItem() instanceof ItemPotion; + + if (!flag4) { + return false; + } + + flag4 = ItemPotion.isSplash(stack.getMetadata()); + + + if (!flag4) { + return true; + } + } + + return false; + } + + flag = false; + + return flag; +} + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + this.handleString3(this.mode.get()); +} + + @Override + public void onEnable() { + this.handleString3(this.mode.get()); +} + + public void handleSettingEvent(SettingEvent event) { + boolean flag; + StringProperty strProp; + String textStr; + + label36: { + SettingEvent settingEvent = event; + + if (event == null) { + break label36; + } + + settingEvent = event; + + + flag = settingEvent.getCachedText2().equals("NS_MODE"); + + if (!flag) { + return; + } + } + + strProp = this.mode; + textStr = "Hypixel"; + + flag = strProp.equals(textStr); + + if (flag) { + return; + } + + textStr = this.getDisplayName(); + StringBuilder sb = new StringBuilder(); + sb = sb.append("Mode was set to HYPIXEL due to unstable "); + StringProperty strProp2 = this.mode; + String propStr = strProp2.get(); + sb = sb.append(propStr); + this.popNotification(textStr, sb.append(" bypass").toString(), 3500, NotificationType.WARNING); + strProp = this.mode; + textStr = "Hypixel"; + + strProp.set(textStr); +} + + + @EventTarget + public void onPacket(PacketEvent event) { + Object obj; + PacketEvent packetEvent = event; + if (event.getState() != State.OUTGOING) { + return; + } + + packetEvent = event; + + { + boolean flag = packetEvent.getPacket() instanceof C08PacketPlayerBlockPlacement; + if (flag) { + label82: { + C08PacketPlayerBlockPlacement playerBlockPlacementPacket = (C08PacketPlayerBlockPlacement)event.getPacket(); + int intVal = playerBlockPlacementPacket.getPlacedBlockDirection2(); + if (intVal != 255) { + break label82; + } + + StringProperty strProp = this.mode; + intVal = (strProp.equals("Hypixel") ? 1 : 0); + + if (intVal == 0) { + break label82; + } + + intVal = (this.checkState11() ? 1 : 0); + + label83: { + if (intVal != 0) { + break label83; + } + + intVal = (this.checkState10() ? 1 : 0); + + if (intVal != 0) { + break label83; + } + + intVal = (this.isStateReady2() ? 1 : 0); + + if (intVal == 0) { + break label82; + } + } + + event.setCancelled(true); + } + + return; + } + + obj = event.getPacket(); + + flag = obj instanceof C07PacketPlayerDigging; + + if (!flag) { + return; + } + + obj = event.getPacket(); + } + + C07PacketPlayerDigging playerDiggingPacket = (C07PacketPlayerDigging)obj; + if (playerDiggingPacket.getStatus2() == C07PacketPlayerDigging$Action.RELEASE_USE_ITEM && this.stateFlag) { + event.setCancelled(true); + } +} + + @EventTarget(0) + public void onMotionUpdate(MotionUpdateEvent event) { + cc.novoline.modules.move.NoSlowDown noSlowDown; + cc.novoline.modules.move.NoSlowDown noSlowDown2; + boolean flag; + + label93: { + + boolean flag2 = this.evaluateFlag5("NCP"); + + if (flag2) { + if (event.getState() == cc.novoline.events.type.State.PRE) { + this.callbackTask.run(); + + return; + + } + + EntityPlayerSP player = this.mc.thePlayer; + this.sendPacketNoEvent(new C08PacketPlayerBlockPlacement(player.getHeldItem())); + + return; + + } + + noSlowDown = this; + + flag2 = this.evaluateFlag4("Hypixel"); + + + if (!flag2) { + flag = this.evaluateFlag3("Hypixel"); + + if (!flag) { + break label93; + } + } + + noSlowDown = this; + + EntityPlayerSP player2 = noSlowDown.mc.thePlayer; + + if (player2.getBlockPos() == null) { + return; + } + + player2 = this.mc.thePlayer; + + + + if (player2.getInt27() != 1) { + return; + } + + player2 = this.mc.thePlayer; + + + label96: { + BlockPos pos = player2.getBlockPos(); + if (event.getState() == cc.novoline.events.type.State.PRE) { + float[] floatArr = RotationAngleUtil.computeFloatArray(pos); + float floatVal = floatArr[0]; + event.setYaw(floatVal); + floatVal = floatArr[1]; + event.setPitch(floatVal); + + break label96; + + } + + EnumFacing facing = Block.resolveEnumFacing(pos); + float[] floatArr2 = RotationAngleUtil.evaluateFloat(pos, facing); + // Allocation resugared at its constructor call below. + Minecraft mcClient = this.mc; + int intVal; + if (mcClient.isSingleplayer()) { + intVal = 255; + } else { + intVal = facing.getIndex(); + } + + EntityPlayerSP player3 = this.mc.thePlayer; + C08PacketPlayerBlockPlacement playerBlockPlacementPacket = new C08PacketPlayerBlockPlacement(pos, intVal, player3.getHeldItem(), floatArr2[0], floatArr2[1], floatArr2[2]); + this.applyInt5(playerBlockPlacementPacket); + } + + + return; + + } + + flag = this.evaluateFlag5("Hypixel"); + + + if (flag) { + if (event.getState() != cc.novoline.events.type.State.POST) { + return; + } + + this.sendPacketNoEvent(new C08PacketPlayerBlockPlacement(this.itemStack)); + this.stateFlag = true; + + return; + + } + + noSlowDown2 = this; + + flag = this.stateFlag; + + + if (!flag) { + return; + } + + this.callbackTask2.run(); + noSlowDown2 = this; + + noSlowDown2.stateFlag = false; +} + + public boolean matchesBlockPos(BlockPos pos) { + IBlockState blockState = this.mc.theWorld.getBlockState(pos); + Block block = blockState.getBlock(); + Block block2 = block; + Block block3 = Blocks.chest; + if (block == Blocks.chest) { + return true; + } + + block2 = block; + block3 = Blocks.crafting_table; + + if (block2 == block3) { + return true; + } + + block2 = block; + block3 = Blocks.dropper; + + if (block2 == block3) { + return true; + } + + block2 = block; + block3 = Blocks.dispenser; + + if (block2 == block3) { + return true; + } + + block2 = block; + block3 = Blocks.trapped_chest; + + if (block2 == block3) { + return true; + } + + block2 = block; + + block3 = Blocks.furnace; + + if (block2 == block3) { + return true; + } + + block2 = block; + + Block block4 = Blocks.hopper; + if (block2 == Blocks.hopper) { + return true; + } + + block2 = block; + block4 = Blocks.command_block; + + if (block2 == block4) { + return true; + } + + block2 = block; + block4 = Blocks.ender_chest; + + return block2 == block4; +} + + private void handleMotionUpdateEvent(MotionUpdateEvent event) { + if (this.isStateReady2()) { + if (event.getState() == cc.novoline.events.type.State.PRE) { + this.callbackTask.run(); + return; + } + + EntityPlayerSP player = this.mc.thePlayer; + this.sendPacketNoEvent(new C08PacketPlayerBlockPlacement(player.getHeldItem())); + } +} + +} diff --git a/src/main/java/cc/novoline/modules/move/SafeWalk.java b/src/main/java/cc/novoline/modules/move/SafeWalk.java new file mode 100644 index 0000000..b80a2ff --- /dev/null +++ b/src/main/java/cc/novoline/modules/move/SafeWalk.java @@ -0,0 +1,127 @@ +package cc.novoline.modules.move; + +import cc.novoline.events.events.MoveInputEvent; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.render.RotationAngleUtil; + +import cc.novoline.events.EventTarget; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.misc.UhcCrafts; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class SafeWalk extends AbstractModule { + @Property("ground-check") + private BooleanProperty groundCheck; + @Property("void-check") + private BooleanProperty voidCheck; + @Property("auto-sneak") + private BooleanProperty autoSneak; + + public boolean checkState12() { + Boolean propFlag = this.voidCheck.get(); + boolean flag = propFlag; + + if (flag) { + EntityPlayerSP player = this.mc.thePlayer; + boolean flag2 = player.isConditionMet13(); + + if (flag2) { + return false; + } + } + + flag = true; + + + return flag; +} + + + public boolean isReadyState9() { + Boolean propFlag = this.groundCheck.get(); + boolean flag = propFlag; + + if (flag) { + + if (!this.mc.thePlayer.onGround) { + return false; + } + } + + flag = true; + + + return flag; +} + + private MovingObjectPosition getMovingObjectPositionValue() { + double posX2 = this.mc.thePlayer.posX; + double posY2 = this.mc.thePlayer.posY; + EntityPlayerSP player = this.mc.thePlayer; + Vec3 vec = new Vec3(posX2, posY2 + player.getEyeHeight(), this.mc.thePlayer.posZ); + Vec3 vec2 = RotationAngleUtil.getVectorForRotation(90.0F, this.mc.thePlayer.rotationYaw); + EntityPlayerSP player2 = this.mc.thePlayer; + double speed = player2.getBaseMoveSpeed(); + double posX3 = vec2.xCoord * speed; + double posY3 = vec2.yCoord; + BooleanProperty boolProp = this.voidCheck; + Boolean propFlag = boolProp.get(); + int intVal = (propFlag ? 1 : 0); + intVal = (intVal != 0 ? 999 : 2); + + posY3 *= intVal; + posX2 = vec2.zCoord * speed; + Vec3 vec3 = vec.addVector(posX3, posY3, posX2); + WorldClient world = this.mc.theWorld; + return world.rayTraceBlocks(vec, vec3, false, false, false); +} + + @EventTarget + public void handleMoveInputEvent(MoveInputEvent event) { + SafeWalk safeWalk; + Boolean sneaking = this.autoSneak.get(); + boolean flag = sneaking; + if (!flag) { + return; + } + + safeWalk = this; + + flag = this.isReadyState9(); + + if (!flag) { + return; + } + + safeWalk = this; + + if (safeWalk.getMovingObjectPositionValue() == null) { + event.setStateFlag(true); + } +} + + + public SafeWalk(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.autoSneak = BooleanProperty.of(false); + this.voidCheck = BooleanProperty.of(false); + this.groundCheck = BooleanProperty.of(false); + Setting setting = new Setting("SW_AUTO_SNEAK", "Auto Sneak", SettingType.CHECKBOX, this, this.autoSneak); + SettingManager.register(setting); + setting = new Setting("SW_GROUND_CHECK", "Ground Check", SettingType.CHECKBOX, this, this.groundCheck); + SettingManager.register(setting); + setting = new Setting("SW_VOID_CHECK", "Void Check", SettingType.CHECKBOX, this, this.voidCheck); + SettingManager.register(setting); +} + +} diff --git a/src/main/java/cc/novoline/modules/move/Speed.java b/src/main/java/cc/novoline/modules/move/Speed.java new file mode 100644 index 0000000..da8a6a5 --- /dev/null +++ b/src/main/java/cc/novoline/modules/move/Speed.java @@ -0,0 +1,1164 @@ +package cc.novoline.modules.move; + +import cc.novoline.events.events.JumpEvent; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.MoveEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.PlayerUpdateEvent; +import cc.novoline.events.events.SettingEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.exploits.Disabler; +import cc.novoline.modules.player.Scaffold; +import cc.novoline.modules.ModuleRegistry; +import cc.novoline.modules.ModuleManager; +import net.minecraft.util.MathHelper; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.potion.Potion; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class Speed extends AbstractModule { + private double cachedValue; + @Property("damage-boost") + private BooleanProperty damageBoost; + @Property("collide") + private BooleanProperty collide; + private double cachedValue2; + @Property("strafe-mode") + private StringProperty strafeMode; + @Property("down-motion") + private BooleanProperty downMotion; + @Property("ice-boost") + private BooleanProperty iceBoost; + private double cachedValue3; + private boolean stateFlag; + private double cachedValue4; + private boolean stateFlag2; + private boolean stateFlag3; + private float cachedAngle; + private double doubleValue; + @Property("in-liquid") + private BooleanProperty inLiquid; + private double cachedValue5; + @Property("lagback-check") + private BooleanProperty lagbackCheck; + private float cachedAngle2; + @Property("mode") + private StringProperty mode; + @Property("damage-boost-multiplier") + private DoubleProperty damageBoostMultiplier; + @Property("speed-amplifier") + private DoubleProperty speedAmplifier; + + @EventTarget + public void onMove(MoveEvent event) { + Speed speedMod; + StringProperty strProp = this.mode; + boolean flag = strProp.equals("Hypixel"); + if (flag) { + this.applyInt5(event); + return; + } + + speedMod = this; + + StringProperty strProp2 = this.mode; + flag = strProp2.equals("NCP"); + + if (!flag) { + return; + } + + speedMod = this; + + speedMod.applyMoveEvent(event); +} + + private Boolean supplyBoolean() { + boolean flag = this.mode.equals("Hypixel"); + flag = !flag; + + return flag; +} + + public boolean isStateReady2() { + boolean enabled = this.isEnabled(); + if (!enabled) { + return false; + } + + StringProperty strProp = this.mode; + enabled = strProp.equals("Hypixel"); + + if (!enabled) { + return false; + } + + EntityPlayerSP player = this.mc.thePlayer; + enabled = player.isMoving(); + + return enabled; +} + + + public void applyInt5(double value) { + this.cachedValue = value; +} + + public double getCachedValue3() { + return this.cachedValue3; +} + + + private void applyMoveEvent(MoveEvent event) { + cc.novoline.modules.move.Speed speedMod; + cc.novoline.modules.AbstractModule mod; + cc.novoline.modules.move.Speed speedMod2; + int intVal; + cc.novoline.modules.move.Speed speedMod3; + int[] intArr = Scaffold.getIntArrayValue(); + EntityPlayerSP player = this.mc.thePlayer; + int intVal2 = (player.isMoving() ? 1 : 0); + if (intVal2 == 0) { + return; + } + + player = this.mc.thePlayer; + Potion potion = Potion.moveSpeed; + int intVal3 = player.computePotionInt(potion); + EntityPlayerSP player2 = this.mc.thePlayer; + Potion potion2 = Potion.moveSlowdown; + intVal2 = intVal3 - player2.computePotionInt(potion2); + + label227: { + int intVal4 = intVal2; + int intVal5 = (this.mc.thePlayer.onGround ? 1 : 0); + if (this.mc.thePlayer.onGround) { + EntityPlayerSP player3 = this.mc.thePlayer; + EntityPlayerSP player4 = this.mc.thePlayer; + event.setCachedValue32(player3.motionY = player4.getBaseJumpMotion()); + this.cachedValue = this.cachedValue2 * 2.13999998; + break label227; + } + + speedMod = this; + + intVal5 = this.mc.thePlayer.offGroundTicks; + + if (intVal5 == 1) { + double doubleVal; + label240: { + this.cachedValue = this.cachedValue3 - 0.81999 * (this.cachedValue3 - this.cachedValue2); + int intVal6 = intVal4; + if (intVal4 == 0) { + doubleVal = 0.9808305162963192; + break label240; + } + + intVal6 = intVal4; + + byte byteVal = 1; + if (intVal6 == 1) { + doubleVal = 0.9775896153661018; + break label240; + } + + intVal6 = intVal4; + byteVal = 2; + + doubleVal = intVal6 == byteVal ? 0.9746325193602489 : 0.9719226917746409; + } + + label241: { + this.cachedValue4 = doubleVal; + int intVal7 = intVal4; + if (intVal4 == 0) { + doubleVal = 0.00138324022307878; + break label241; + } + + intVal7 = intVal4; + + byte byteVal2 = 1; + if (intVal7 == 1) { + doubleVal = 0.0015492432535351; + break label241; + } + + intVal7 = intVal4; + byteVal2 = 2; + + doubleVal = intVal7 == byteVal2 ? 0.00168274354355435 : 0.001789345235545; + } + + label242: { + this.cachedValue5 = doubleVal; + int intVal8 = intVal4; + + if (intVal4 == 0) { + doubleVal = 7.03245479062E-5; + break label242; + } + + intVal8 = intVal4; + + + byte byteVal3 = 1; + if (intVal8 == 1) { + doubleVal = 7.069516069901E-5; + break label242; + } + + intVal8 = intVal4; + byteVal3 = 2; + + doubleVal = intVal8 == byteVal3 ? 7.43379728481E-5 : 7.63243776977E-5; + } + + this.doubleValue = doubleVal; + mod = this; + + if (this.mc.thePlayer.intState3 <= 8) { + break label227; + } + + mod = this; + + BooleanProperty boolProp = this.damageBoost; + Boolean propFlag = boolProp.get(); + if (!propFlag) { + break label227; + } + + doubleVal = this.cachedValue; + DoubleProperty doubleProp = this.damageBoostMultiplier; + Double propDouble = doubleProp.get(); + this.cachedValue = doubleVal * propDouble; + this.stateFlag = false; + break label227; + } + + double doubleVal2 = this.cachedValue; + double doubleVal3 = this.cachedValue4; + this.cachedValue = doubleVal2 * Math.min(doubleVal3, 1.0); + doubleVal2 = this.cachedValue4; + doubleVal3 = this.cachedValue5; + this.cachedValue4 = doubleVal2 + Math.max(doubleVal3, 0.0); + speedMod = this; + + speedMod.cachedValue5 = speedMod.cachedValue5 - this.doubleValue; + } + + ModuleRegistry modEntry = ModuleRegistry.TARGETSTRAFE; + mod = modEntry.getModule(); + + TargetStrafe targetStrafe; + boolean flag; + label243: { + label166: { + + targetStrafe = (TargetStrafe)mod; + flag = targetStrafe.checkState15(); + boolean flag2 = flag; + if (flag) { + this.cachedAngle2 = targetStrafe.getFloatValue2(); + break label243; + } + + speedMod2 = this; + + StringProperty strProp = this.strafeMode; + flag2 = strProp.equals("Bypass"); + + if (!flag2) { + StringProperty strProp2 = this.strafeMode; + intVal = (strProp2.equals("Vanilla") ? 1 : 0); + + if (intVal == 0) { + break label166; + } + } + + speedMod2 = this; + + EntityPlayerSP player5 = this.mc.thePlayer; + speedMod2.cachedAngle2 = player5.getFloat2(); + + break label243; + + } + + intVal = (this.mc.thePlayer.onGround ? 1 : 0); + + if (intVal != 0) { + EntityPlayerSP player6 = this.mc.thePlayer; + this.cachedAngle2 = player6.getFloat2(); + } + } + + double doubleVal4 = this.cachedAngle - this.cachedAngle2; + double doubleVal5 = MathHelper.wrapAngleTo180_double(doubleVal4); + intVal = (int)Math.abs(doubleVal5); + + int intVal9 = intVal; + speedMod3 = this; + + label142: + if (this.mc.thePlayer.offGroundTicks > 0) { + boolean flag3 = flag; + if (flag) { + speedMod3 = this; + + if (!this.stateFlag) { + break label142; + } + + StringProperty strProp3 = targetStrafe.getStringProperty2(); + int intVal10 = (strProp3.equals("Bypass") ? 1 : 0); + + if (intVal10 == 0) { + break label142; + } + + intVal10 = intVal9; + + + byte byteVal4 = 40; + if (intVal10 > 40) { + this.cachedValue *= 0.56; + break label142; + } + + intVal10 = intVal9; + byteVal4 = 25; + + if (intArr == null) { + if (intVal10 > byteVal4) { + this.cachedValue *= 0.72; + break label142; + } + + intVal10 = intVal9; + byteVal4 = 10; + } + + if (intVal10 <= byteVal4) { + break label142; + } + + this.cachedValue *= 0.82; + break label142; + } + + speedMod3 = this; + + StringProperty strProp4 = this.strafeMode; + flag3 = strProp4.equals("Bypass"); + + label116: + if (flag3) { + int intVal11 = intVal9; + short shortVal = 180; + if (intVal9 >= 180) { + this.cachedValue *= 0.24; + break label116; + } + + intVal11 = intVal9; + shortVal = 10; + + if (intVal11 > shortVal) { + this.cachedValue *= 0.64; + } + } + } + + event.setMoveSpeedYaw(this.cachedAngle2, this.cachedValue); + double doubleVal6 = this.cachedValue; + this.cachedValue = Math.max(doubleVal6, 0.22); + speedMod3 = this; + + speedMod3.cachedAngle = this.cachedAngle2; +} + + + @EventTarget + public void handleJumpEvent(JumpEvent event) { + if (!this.mode.equals("Motion")) { + event.setCancelled(true); + } +} + + public StringProperty getMode() { + return this.mode; +} + + public StringProperty getStringPropertyValue2() { + return this.getMode(); +} + + private void applyInt5(MoveEvent event) { + boolean flag; + cc.novoline.modules.move.Speed speedMod; + cc.novoline.modules.move.Speed speedMod2; + cc.novoline.modules.move.Speed speedMod3; + EntityPlayerSP player = this.mc.thePlayer; + int intVal = (player.isMoving() ? 1 : 0); + if (intVal == 0) { + return; + } + + player = this.mc.thePlayer; + Potion potion = Potion.moveSpeed; + int intVal2 = player.computePotionInt(potion); + EntityPlayerSP player2 = this.mc.thePlayer; + Potion potion2 = Potion.moveSlowdown; + intVal = intVal2 - player2.computePotionInt(potion2); + + label200: { + int intVal3 = intVal; + int intVal4 = (this.mc.thePlayer.onGround ? 1 : 0); + if (this.mc.thePlayer.onGround) { + boolean flag2; + label194: { + label212: { + BooleanProperty boolProp = this.iceBoost; + Boolean propFlag = boolProp.get(); + flag2 = propFlag; + if ((!flag2)) { + break label212; + } + + EntityPlayerSP player3 = this.mc.thePlayer; + if (player3.getBlockUnderPlayer().slipperiness == 0.98F) { + flag2 = true; + break label194; + } + } + + flag2 = false; + } + + label183: { + label213: { + this.stateFlag3 = flag2; + BooleanProperty boolProp2 = this.inLiquid; + Boolean propFlag2 = boolProp2.get(); + flag = propFlag2; + if (!flag) { + break label213; + } + + EntityPlayerSP player4 = this.mc.thePlayer; + flag = player4.isConditionMet2(); + + if (flag) { + flag = true; + break label183; + } + } + + flag = false; + } + + double doubleVal; + label172: { + this.stateFlag2 = flag; + EntityPlayerSP player5 = this.mc.thePlayer; + this.cachedAngle2 = player5.getFloat2(); + EntityPlayerSP player6 = this.mc.thePlayer; + EntityPlayerSP player7 = this.mc.thePlayer; + event.setCachedValue32(player6.motionY = player7.getBaseJumpMotion()); + boolean flag3 = this.stateFlag2; + if (this.stateFlag2) { + doubleVal = 0.42999998; + break label172; + } + + flag3 = this.stateFlag3; + + doubleVal = flag3 ? 2.01399998 : 2.13999998; + } + + this.cachedValue = this.cachedValue2 * doubleVal; + break label200; + } + + speedMod = this; + + intVal4 = this.mc.thePlayer.offGroundTicks; + + if (intVal4 == 1) { + label215: { + speedMod2 = this; + + if (this.stateFlag3) { + speedMod2 = this; + + if (!this.stateFlag2) { + this.cachedValue *= 0.93598615916; + break label215; + } + } + + speedMod2 = this; + + speedMod2.cachedValue = this.cachedValue3 - (intVal3 > 0 ? 0.66 : 0.77499) * (this.cachedValue3 - this.cachedValue2); + } + + double doubleVal2; + label216: { + int intVal5 = intVal3; + + if (intVal3 == 0) { + doubleVal2 = 0.9808305162963192; + break label216; + } + + intVal5 = intVal3; + + + byte byteVal = 1; + if (intVal5 == 1) { + doubleVal2 = 0.9775896153661018; + break label216; + } + + intVal5 = intVal3; + byteVal = 2; + + doubleVal2 = intVal5 == byteVal ? 0.9746325193602489 : 0.9719226917746409; + } + + label217: { + this.cachedValue4 = doubleVal2; + int intVal6 = intVal3; + + if (intVal3 == 0) { + doubleVal2 = 0.00138324022307878; + break label217; + } + + intVal6 = intVal3; + + + byte byteVal2 = 1; + if (intVal6 == 1) { + doubleVal2 = 0.0015492432535351; + break label217; + } + + intVal6 = intVal3; + byteVal2 = 2; + + doubleVal2 = intVal6 == byteVal2 ? 0.00168274354355435 : 0.001789345235545; + } + + label218: { + this.cachedValue5 = doubleVal2; + int intVal7 = intVal3; + + if (intVal3 == 0) { + doubleVal2 = 7.03245479062E-5; + break label218; + } + + intVal7 = intVal3; + + + byte byteVal3 = 1; + if (intVal7 == 1) { + doubleVal2 = 7.069516069901E-5; + break label218; + } + + intVal7 = intVal3; + byteVal3 = 2; + + doubleVal2 = intVal7 == byteVal3 ? 7.43379728481E-5 : 7.63243776977E-5; + } + + this.doubleValue = doubleVal2; + Speed speedMod4 = this; + + if (!this.stateFlag3) { + break label200; + } + + speedMod4 = this; + + + speedMod4.cachedValue4 -= 0.026479009717; + break label200; + } + + double doubleVal3 = this.cachedValue; + double doubleVal4 = this.cachedValue4; + this.cachedValue = doubleVal3 * Math.min(doubleVal4, 1.0); + doubleVal3 = this.cachedValue4; + doubleVal4 = this.cachedValue5; + this.cachedValue4 = doubleVal3 + Math.max(doubleVal4, 0.0); + speedMod = this; + + speedMod.cachedValue5 = speedMod.cachedValue5 - this.doubleValue; + } + + double doubleVal6; + label106: { + speedMod3 = this; + + BooleanProperty boolProp3 = this.collide; + Boolean propFlag3 = boolProp3.get(); + if (propFlag3) { + speedMod3 = this; + + if (this.mc.thePlayer.isCollidedHorizontally) { + doubleVal6 = 0.02; + break label106; + } + } + + speedMod3 = this; + + doubleVal6 = speedMod3.cachedValue; + } + + event.setMoveSpeedYaw(this.cachedAngle2, doubleVal6); + double doubleVal5 = this.cachedValue; + this.cachedValue = Math.max(doubleVal5, 0.1); +} + + public boolean checkState13() { + int intVal; + int intVal2; + TargetStrafe targetStrafe = ModuleRegistry.TARGETSTRAFE.getModule(); + EntityPlayerSP player = this.mc.thePlayer; + Potion potion = Potion.moveSpeed; + intVal2 = player.computePotionInt(potion); + EntityPlayerSP player2 = this.mc.thePlayer; + Potion potion2 = Potion.moveSlowdown; + intVal = intVal2 - player2.computePotionInt(potion2); + StringProperty strProp = this.strafeMode; + intVal2 = (strProp.equals("Bypass") ? 1 : 0); + label103: { + label94: + if (intVal2 == 0) { + label107: { + intVal2 = (targetStrafe.checkState15() ? 1 : 0); + if (intVal2 == 0) { + break label107; + } + + StringProperty strProp2 = targetStrafe.getStringProperty2(); + intVal2 = (strProp2.equals("Bypass") ? 1 : 0); + + if (intVal2 != 0) { + break label94; + } + } + + intVal2 = 0; + break label103; + } + + intVal2 = 1; + } + + byte byteVal = (byte)intVal2; + int intVal3 = (this.isEnabled() ? 1 : 0); + if (intVal3 == 0) { + return false; + } + + StringProperty strProp3 = this.mode; + intVal3 = (strProp3.equals("Hypixel") ? 1 : 0); + + + if (intVal3 == 0) { + return false; + } + + intVal3 = this.mc.thePlayer.offGroundTicks; + + + byte byteVal2 = 1; + if (intVal3 <= 1) { + return false; + } + + intVal3 = this.mc.thePlayer.offGroundTicks; + byteVal2 = 2; + + int intVal4 = intVal3 % byteVal2; + if (intVal4 != 0) { + return false; + } + + if (this.cachedValue3 <= 0.09) { + return false; + } + + if (this.mc.thePlayer.fallDistance >= 1.1455) { + return false; + } + + intVal4 = this.mc.thePlayer.intState3; + + + if (intVal4 >= 19) { + return false; + } + + EntityPlayerSP player3 = this.mc.thePlayer; + intVal4 = (player3.isConditionMet2() ? 1 : 0); + + + if (intVal4 != 0) { + return false; + } + + intVal4 = intVal; + + + if (intVal4 > 0) { + return true; + } else { + return byteVal != 0; + } +} + + public double getDoubleValue2() { + return this.cachedValue; +} + + @Override + public void onDisable() {} + + @EventTarget + public void onPacket(PacketEvent event) { + cc.novoline.modules.move.Speed speedMod; + PacketEvent packetEvent = event; + if (event.getState() != State.INCOMING) { + return; + } + + packetEvent = event; + + boolean flag = packetEvent.getPacket() instanceof S08PacketPlayerPosLook; + if (!flag) { + return; + } + + speedMod = this; + + BooleanProperty boolProp = this.lagbackCheck; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + return; + } + + speedMod = this; + + speedMod.applyInt5(this.getClass()); +} + + private Boolean supplyBoolean2() { + boolean flag = this.mode.equals("Motion"); + flag = !flag; + + return flag; +} + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + if (event.getState() == cc.novoline.events.type.State.PRE) { + int intVal; + StringProperty strProp = this.mode; + intVal = (strProp.equals("Motion") ? 1 : 0); + + if (intVal != 0) { + EntityPlayerSP player = this.mc.thePlayer; + intVal = (player.isMoving() ? 1 : 0); + + label63: + if (intVal != 0) { + Speed speedMod = this; + if (this.mc.thePlayer.onGround) { + EntityPlayerSP player2 = this.mc.thePlayer; + player2.jump(); + EntityPlayerSP player3 = this.mc.thePlayer; + EntityPlayerSP player4 = this.mc.thePlayer; + Double speed = this.speedAmplifier.get(); + double speed5 = speed / 10.0; + double doubleVal = player4.applyArmorCalculations(true, speed5) * 1.69; + player3.setMoveSpeed(doubleVal); + break label63; + } + + EntityPlayerSP player5 = this.mc.thePlayer; + this.cachedAngle2 = player5.getFloat2(); + speedMod = this; + + label73: { + double speed2 = speedMod.cachedAngle - this.cachedAngle2; + double doubleVal2 = MathHelper.wrapAngleTo180_double(speed2); + double doubleVal3 = Math.abs(doubleVal2); + StringProperty strProp2 = this.strafeMode; + intVal = (strProp2.equals("Vanilla") ? 1 : 0); + if (intVal != 0) { + EntityPlayerSP player6 = this.mc.thePlayer; + EntityPlayerSP player7 = this.mc.thePlayer; + double speed3 = player7.getSpeed(); + player6.setMoveSpeed(speed3); + break label73; + } + + StringProperty strProp3 = this.strafeMode; + intVal = (strProp3.equals("Bypass") ? 1 : 0); + + if (intVal != 0) { + if (doubleVal3 > 14.0) { + EntityPlayerSP player8 = this.mc.thePlayer; + EntityPlayerSP player9 = this.mc.thePlayer; + double speed4 = player9.getSpeed() * 0.72; + player8.setMoveSpeed(speed4); + } + } + } + + this.cachedAngle = this.cachedAngle2; + BooleanProperty boolProp = this.downMotion; + Boolean propFlag = boolProp.get(); + intVal = (propFlag ? 1 : 0); + + if (intVal != 0) { + intVal = this.mc.thePlayer.offGroundTicks; + + if (this.mc.thePlayer.offGroundTicks == 4) { + this.mc.thePlayer.motionY -= 0.184; + } + } + } + } + + intVal = (this.checkState13() ? 1 : 0); + + if (intVal != 0) { + event.setOnGround(true); + } + } +} + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + this.handleString3(this.mode.get()); +} + + @EventTarget + public void onPlayerUpdate(PlayerUpdateEvent event) { + net.minecraft.client.entity.EntityPlayerSP player; + label51: { + Speed speedMod = this; + + StringProperty strProp = this.mode; + if (strProp.equals("Hypixel")) { + double doubleVal; + label55: { + ModuleRegistry modEntry = ModuleRegistry.DISABLER; + Disabler disabler = modEntry.getModule(); + player = this.mc.thePlayer; + boolean flag = this.stateFlag2; + + if (this.stateFlag2) { + doubleVal = 0.0; + break label55; + } + + flag = disabler.isEnabled(); + + + label40: { + + if (!flag) { + break label40; + } + + flag = disabler.checkState4(); + + + if (flag) { + doubleVal = 0.06; + break label55; + } + } + + doubleVal = 0.005; + } + + this.cachedValue2 = player.applyArmorCalculations(true, doubleVal); + + break label51; + + } + + speedMod = this; + + + EntityPlayerSP player2 = this.mc.thePlayer; + speedMod.cachedValue2 = player2.applyArmorCalculations(true, 0.18); + } + + EntityPlayerSP player3 = this.mc.thePlayer; + this.cachedValue3 = player3.getDouble8(); + Speed speedMod2 = this; + + if (!this.mc.thePlayer.onGround) { + return; + } + + speedMod2 = this; + + + speedMod2.stateFlag = true; +} + + @Override + public void onEnable() { + this.handleString3(this.mode.get()); + this.handleClassArray(LongJump.class, Scaffold.class, Fly.class); + EntityPlayerSP player = this.mc.thePlayer; + this.cachedValue = this.cachedValue2 = player.applyArmorCalculations(true, 0.05); + player = this.mc.thePlayer; + this.cachedAngle2 = this.cachedAngle = player.getFloat2(); + this.stateFlag = true; +} + + + public void handleSettingEvent(SettingEvent event) { + boolean flag; + cc.novoline.modules.configurations.property.object.BooleanProperty boolProp; + cc.novoline.modules.configurations.property.object.BooleanProperty boolProp2; + Object obj; + + label116: { + label117: { + obj = event; + + if (event == null) { + break label117; + } + + obj = event; + + + if (!((cc.novoline.events.events.SettingEvent) obj).getSettingName().equals("SPEED_MODE")) { + break label116; + } + } + + StringProperty strProp = this.mode; + String textStr3 = "NCP"; + + if (!strProp.equals(textStr3)) { + break label116; + } + + textStr3 = this.getDisplayName(); + StringBuilder sb = new StringBuilder(); + sb = sb.append("Mode was set to HYPIXEL due to unstable "); + StringProperty strProp2 = this.mode; + String propStr = strProp2.get(); + propStr = propStr.toUpperCase(); + sb = sb.append(propStr); + this.popNotification(textStr3, sb.append(" bypass").toString(), 3500, NotificationType.WARNING); + strProp = this.mode; + textStr3 = "Hypixel"; + + + strProp.set(textStr3); + } + + obj = event; + + label118: { + label119: { + + if (obj == null) { + break label119; + } + + obj = event; + + + if (!((cc.novoline.events.events.SettingEvent) obj).getSettingName().equals("SPEED_STRAFE_MODE")) { + break label118; + } + } + + StringProperty strProp3 = this.strafeMode; + String textStr = "Disabled"; + + if (strProp3.equals(textStr)) { + break label118; + } + + textStr = this.getDisplayName(); + StringBuilder sb2 = new StringBuilder(); + String textStr2 = "Strafe Mode was set to DISABLED due to unstable "; + sb2 = sb2.append(textStr2); + StringProperty strProp4 = this.strafeMode; + textStr2 = strProp4.get(); + textStr2 = textStr2.toUpperCase(); + sb2 = sb2.append(textStr2); + textStr2 = " bypass"; + this.popNotification(textStr, sb2.append(textStr2).toString(), 3500, NotificationType.WARNING); + strProp3 = this.strafeMode; + textStr = "Disabled"; + + + strProp3.set(textStr); + } + + obj = event; + + label76: { + + + if (obj != null) { + obj = event; + + if (!event.getSettingName().equals("SPEED_DOWN_MOTION")) { + break label76; + } + } + + boolProp = this.downMotion; + + obj = boolProp.get(); + + + Boolean flag2 = (Boolean)obj; + if (!flag2) { + break label76; + } + + this.popNotification(this.getDisplayName(), "Down Motion keept disabled due to unstable bypass", 3500, NotificationType.WARNING); + boolProp = this.downMotion; + + Boolean flag3 = false; + boolProp.set(flag3); + } + + obj = event; + + + if (obj != null) { + flag = event.getSettingName().equals("SPEED_DAMAGE_BOOST"); + + if (!flag) { + return; + } + } + + boolProp2 = this.damageBoost; + + obj = boolProp2.get(); + + + Boolean flag4 = (Boolean)obj; + flag = flag4; + + if (!flag) { + return; + } + + this.popNotification(this.getDisplayName(), "Damage Boost keept disabled due to unstable bypass", 3500, NotificationType.WARNING); + boolProp2 = this.damageBoost; + + Boolean flag5 = false; + boolProp2.set(flag5); +} + + public Speed(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + StringProperty strProp = StringProperty.of("Hypixel"); + String[] stringArr = new String[]{"NCP", "Hypixel", "Motion"}; + this.mode = strProp.acceptableValues(stringArr); + StringProperty strProp2 = StringProperty.of("Bypass"); + stringArr = new String[]{"Vanilla", "Bypass", "Disabled"}; + this.strafeMode = strProp2.acceptableValues(stringArr); + this.damageBoost = BooleanProperty.of(false); + this.damageBoostMultiplier = DoubleProperty.of(1.3).minimum(1.1).maximum(1.8); + this.downMotion = BooleanProperty.of(false); + this.lagbackCheck = BooleanProperty.of(false); + this.iceBoost = BooleanProperty.of(false); + this.inLiquid = BooleanProperty.of(true); + this.collide = BooleanProperty.of(true); + this.speedAmplifier = DoubleProperty.of(1.0).minimum(0.5).maximum(2.0); + Setting setting = new Setting("SPEED_MODE", "Mode", SettingType.COMBOBOX, this, this.mode); + SettingManager.register(setting); + setting = new Setting("SPEED_STRAFE_MODE", "Strafe Mode", SettingType.COMBOBOX, this, this.strafeMode); + SettingManager.register(setting); + setting = new Setting("SPEED_AMPLIFIER", "Speed Amplifier", SettingType.SLIDER, this, this.speedAmplifier, 0.1, () -> this.mode.equals("Motion")); + SettingManager.register(setting); + setting = new Setting("SPEED_COMMON", "COMMON", SettingType.SEPARATOR, this, () -> this.mode.equals("Hypixel")); + SettingManager.register(setting); + setting = new Setting("SPEED_ICE_BOOST", "Ice Boost", SettingType.CHECKBOX, this, this.iceBoost, () -> this.mode.equals("Hypixel")); + SettingManager.register(setting); + setting = new Setting("SPEED_IN_LIQUID_CHECK", "Slowdown in Liquid", SettingType.CHECKBOX, this, this.inLiquid, () -> this.mode.equals("Hypixel")); + SettingManager.register(setting); + setting = new Setting("SPEED_COLLIDE_CHECK", "Slowdown on Collide", SettingType.CHECKBOX, this, this.collide, () -> this.mode.equals("Hypixel")); + SettingManager.register(setting); + setting = new Setting("SPEED_FEATURES", "FEATURES", SettingType.SEPARATOR, this); + SettingManager.register(setting); + setting = new Setting("SPEED_DOWN_MOTION", "Down Motion", SettingType.CHECKBOX, this, this.downMotion, this::supplyBoolean); + SettingManager.register(setting); + setting = new Setting("SPEED_LAGBACK_CHECK", "Disable on Lagback", SettingType.CHECKBOX, this, this.lagbackCheck); + SettingManager.register(setting); + setting = new Setting("SPEED_DAMAGE_BOOST", "Damage Boost", SettingType.CHECKBOX, this, this.damageBoost, this::supplyBoolean2); + SettingManager.register(setting); + setting = new Setting("SPEED_DAMAGE_BOOST_MULTIPLIER", "Boost Multiplier", SettingType.SLIDER, this, this.damageBoostMultiplier, 0.1, this::supplyBoolean3); + SettingManager.register(setting); +} + + private Boolean supplyBoolean3() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.damageBoost.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + StringProperty strProp = this.mode; + flag = strProp.equals("Motion"); + + if (!flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + +} diff --git a/src/main/java/cc/novoline/modules/move/Sprint.java b/src/main/java/cc/novoline/modules/move/Sprint.java new file mode 100644 index 0000000..f6dfac0 --- /dev/null +++ b/src/main/java/cc/novoline/modules/move/Sprint.java @@ -0,0 +1,200 @@ +package cc.novoline.modules.move; + +import cc.novoline.events.events.RightClickEvent; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.combat.KillAura; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.player.Scaffold; +import cc.novoline.modules.ModuleRegistry; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.network.play.client.C0BPacketEntityAction$Action; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class Sprint extends AbstractModule { + @Property("keep-sprint") + private BooleanProperty keepSprint; + @Property("all-directions") + private BooleanProperty allDirections; + @Property("mode") + private StringProperty mode; + + @Override + public void onEnable() { + this.handleString3(this.mode.get()); +} + + + @EventTarget + public void handleRightClickEvent(RightClickEvent event) { + event.setCancelled(true); +} + + + public boolean isReadyState10() { + boolean enabled = this.isEnabled(); + if (!enabled) { + return false; + } + + BooleanProperty boolProp = this.keepSprint; + Boolean propFlag = boolProp.get(); + enabled = propFlag; + + return enabled; +} + + public Sprint(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + StringProperty strProp = StringProperty.of("Basic"); + String[] stringArr = new String[]{"Basic", "Packet"}; + this.mode = strProp.acceptableValues(stringArr); + this.allDirections = BooleanProperty.of(true); + this.keepSprint = BooleanProperty.of(true); + Setting setting = new Setting("SPRINT_MODE", "Mode", SettingType.COMBOBOX, this, this.mode); + SettingManager.register(setting); + setting = new Setting("SPRINT_ALL_DIRECTIONS", "All Directions", SettingType.CHECKBOX, this, this.allDirections); + SettingManager.register(setting); + setting = new Setting("SPRINT_KEEP_SPRINT", "Keep Sprint", SettingType.CHECKBOX, this, this.keepSprint); + SettingManager.register(setting); +} + + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + boolean var7; + cc.novoline.modules.move.Sprint var13; + if (event.getState() == State.PRE) { + EntityPlayerSP var16; + label116: { + StringProperty var10000 = this.mode; + String var10001 = "Basic"; + var7 = var10000.equals(var10001); + if (var7) { + var16 = this.mc.thePlayer; + ModuleRegistry var18 = ModuleRegistry.KILLAURA; + KillAura var19 = var18.getModule(); + byte var3 = (byte)(var16.matchesKillAura(var19) ? 1 : 0); + var16 = this.mc.thePlayer; + byte var4 = (byte)(var16.isSneaking() ? 1 : 0); + var16 = this.mc.thePlayer; + int var11 = var16.getFoodStats().getFoodLevel(); + var11 = var11 < 6 ? 1 : 0; + + label102: { + label118: { + int var5 = var11; + byte var6 = (byte)(this.mc.thePlayer.isCollidedHorizontally ? 1 : 0); + int var12 = var3; + if (var3 != 0) { + break label118; + } + + var12 = var4; + + if (var12 != 0) { + break label118; + } + + var12 = var5; + + if (var12 != 0) { + break label118; + } + + var12 = var6; + + if (var12 != 0) { + break label118; + } + + var13 = this; + + + var12 = (this.isEnabled(ModuleRegistry.SCAFFOLD) ? 1 : 0); + + if (var12 == 0) { + break label102; + } + } + + var13 = this; + + var16 = var13.mc.thePlayer; + var16.setSprinting(false); + } + + break label116; + } + + var7 = this.isEnabled(ModuleRegistry.SCAFFOLD); + + + + if (var7) { + var16 = this.mc.thePlayer; + var16.setSprinting(false); + } + } + + var16 = this.mc.thePlayer; + + + var7 = var16.isConditionMet20(); + + if (var7 != this.mc.thePlayer.stateFlag) { + EntityPlayerSP var10003 = this.mc.thePlayer; + EntityPlayerSP var10004 = this.mc.thePlayer; + this.sendPacket(new C0BPacketEntityAction(var10003, var10004.isConditionMet20() ? C0BPacketEntityAction$Action.START_SPRINTING : C0BPacketEntityAction$Action.STOP_SPRINTING)); + var16 = this.mc.thePlayer; + EntityPlayerSP var20 = this.mc.thePlayer; + var16.stateFlag = var20.isConditionMet20(); + } + + var16 = this.mc.thePlayer; + + int var23; + label63: { + BooleanProperty var21 = this.allDirections; + Boolean var22 = var21.get(); + var23 = (var22 ? 1 : 0); + if (var23 != 0) { + EntityPlayerSP var24 = this.mc.thePlayer; + var23 = (var24.isMoving() ? 1 : 0); + break label63; + } + + float var25; + var23 = (var25 = this.mc.thePlayer.moveForward - 0.0F) == 0.0F ? 0 : (var25 < 0.0F ? -1 : 1); + + var23 = var23 > 0 ? 1 : 0; + } + + var16.setSprinting(toBooleanArg(var23)); + } + } + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + this.handleString3(this.mode.get()); +} + + + // The build removes this conversion to retain the original JVM argument. + private static boolean toBooleanArg(int value) { + return value != 0; +} + +} diff --git a/src/main/java/cc/novoline/modules/move/Step.java b/src/main/java/cc/novoline/modules/move/Step.java new file mode 100644 index 0000000..9dc7d39 --- /dev/null +++ b/src/main/java/cc/novoline/modules/move/Step.java @@ -0,0 +1,685 @@ +package cc.novoline.modules.move; + +import cc.novoline.events.events.StepConfirmEvent; +import cc.novoline.events.type.StepState; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.CollideWithBlockEvent; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.MoveEvent; +import cc.novoline.events.events.Render3DEvent; +import cc.novoline.events.events.SettingEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.FloatProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.player.Scaffold; +import com.google.common.collect.Lists; +import cc.novoline.modules.ModuleRegistry; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Consumer; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C04PacketPlayerPosition; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.util.MathHelper; +import net.minecraft.client.MinecraftHelper; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.init.Blocks; +import net.minecraft.network.Packet; +import net.minecraft.util.BlockPos; + +public class Step extends AbstractModule { + public double doubleValue; + public double doubleValueField; + @Property("timer-speed") + private FloatProperty timerSpeed; + private TimerUtil timer2; + private List doubleList; + private int stateTicks; + private List doubleList2; + @Property("height") + private FloatProperty height; + public double Y; + private List doubleList3; + private List doubleList4; + private List packetList; + @Property("mode") + private StringProperty mode; + private boolean stateFlag; + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + int intVal; + net.minecraft.block.Block block2; + cc.novoline.modules.move.Step step; + cc.novoline.modules.move.Step step2; + cc.novoline.modules.move.Step step3; + if (event.getState() != State.PRE) { + return; + } + + this.mc.thePlayer.stepHeight = 0.625F; + + int intVal5 = (this.isEnabled(ModuleRegistry.SPEED, ModuleRegistry.SCAFFOLD, ModuleRegistry.LONGJUMP, ModuleRegistry.FLY) ? 1 : 0); + if (intVal5 != 0) { + return; + } + + EntityPlayerSP player = this.mc.thePlayer; + intVal5 = (player.getMovementInput().evaluateCondition2() ? 1 : 0); + + if (intVal5 != 0) { + return; + } + + intVal5 = (this.mc.thePlayer.onGround ? 1 : 0); + + if (intVal5 == 0) { + return; + } + + StringProperty strProp = this.mode; + intVal5 = (strProp.equals("Motion") ? 1 : 0); + + if (intVal5 != 0) { + double posY3; + Block block3; + Block block4; + label247: { + label275: { + double posX2 = this.mc.thePlayer.posX; + double posY2 = this.mc.thePlayer.posY; + posY3 = MathHelper.floor_double(posY2); + double posZ2 = this.mc.thePlayer.posZ; + EntityPlayerSP player2 = this.mc.thePlayer; + double doubleVal = player2.getFloat2(); + double angleRad = Math.toRadians(doubleVal); + double doubleVal2 = -MathHelper.sin(angleRad); + EntityPlayerSP player3 = this.mc.thePlayer; + double doubleVal3 = player3.getFloat2(); + double angleRad2 = Math.toRadians(doubleVal3); + double doubleVal4 = MathHelper.cos(angleRad2); + double doubleVal5 = 0.5; + WorldClient world = this.mc.theWorld; + BlockPos pos = new BlockPos(posX2 + doubleVal2 * doubleVal5, posY3 + 2.0, posZ2 + doubleVal4 * doubleVal5); + IBlockState blockState = world.getBlockState(pos); + Block block5 = blockState.getBlock(); + WorldClient world2 = this.mc.theWorld; + pos = new BlockPos(posX2 + doubleVal2 * doubleVal5, posY3 + 1.0, posZ2 + doubleVal4 * doubleVal5); + IBlockState blockState2 = world2.getBlockState(pos); + block3 = blockState2.getBlock(); + WorldClient world3 = this.mc.theWorld; + pos = new BlockPos(posX2 + doubleVal2 * doubleVal5, posY3, posZ2 + doubleVal4 * doubleVal5); + IBlockState blockState3 = world3.getBlockState(pos); + block4 = blockState3.getBlock(); + Block block6 = block5; + if (block5 == Blocks.air) { + break label275; + } + + block6 = block5; + + Material material = block6.getMaterial(); + intVal = (material.isLiquid() ? 1 : 0); + + if (intVal == 0) { + intVal = 0; + break label247; + } + } + + intVal = 1; + } + + int intVal2; + label236: { + label276: { + + intVal2 = intVal; + block2 = block3; + Block block7 = Blocks.snow_layer; + if (block3 == Blocks.snow_layer) { + intVal5 = (block3.computeDouble() == 0.125) ? 1 : 0; + break label236; + } + + block2 = block3; + + block7 = Blocks.air; + + if (block2 == block7) { + break label276; + } + + block2 = block3; + + Material material2 = block2.getMaterial(); + intVal5 = (material2.isLiquid() ? 1 : 0); + + if (intVal5 == 0) { + intVal5 = 0; + break label236; + } + } + + intVal5 = 1; + } + + label219: { + label279: { + int intVal3 = intVal5; + byte byteVal = (byte)(block4.evaluateCondition4() ? 1 : 0); + intVal5 = intVal2; + + if (intVal2 == 0) { + break label279; + } + + intVal5 = intVal3; + + + + if (intVal5 == 0) { + break label279; + } + + intVal5 = byteVal; + + + if (intVal5 != 0) { + intVal5 = 1; + break label219; + } + } + + intVal5 = 0; + } + + label202: { + + int intVal4 = intVal5; + intVal5 = (this.mc.thePlayer.isCollidedHorizontally ? 1 : 0); + + if (this.mc.thePlayer.isCollidedHorizontally) { + intVal5 = (this.mc.thePlayer.onGround ? 1 : 0); + + if (this.mc.thePlayer.onGround) { + intVal5 = intVal4; + + if (intVal4 != 0) { + this.mc.thePlayer.motionY = 0.42F; + this.stateFlag = true; + break label202; + } + } + } + + step = this; + + intVal5 = (this.mc.thePlayer.onGround ? 1 : 0); + + if (intVal5 == 0) { + EntityPlayerSP player4 = this.mc.thePlayer; + intVal5 = (player4.isMoving() ? 1 : 0); + + if (intVal5 != 0) { + break label202; + } + } + + step = this; + + step.stateFlag = false; + } + + intVal5 = (this.stateFlag ? 1 : 0); + + label294: { + if (intVal5 == 0) { + break label294; + } + + this.mc.thePlayer.cameraPitch = 0.0F; + this.mc.thePlayer.cameraYaw = 0.0F; + intVal5 = this.mc.thePlayer.offGroundTicks; + + byte byteVal2; + byteVal2 = 2; + + if (intVal5 > 2) { + intVal5 = this.mc.thePlayer.offGroundTicks; + byteVal2 = 7; + + if (this.mc.thePlayer.offGroundTicks < 7) { + this.mc.thePlayer.motionY = 0.0; + } + } + + intVal5 = this.mc.thePlayer.offGroundTicks; + byteVal2 = 4; + + if (intVal5 == byteVal2) { + double doubleVal6 = posY3 + 0.166109260938216; + event.setY(doubleVal6); + break label294; + } + + intVal5 = this.mc.thePlayer.offGroundTicks; + byteVal2 = 5; + + if (intVal5 == byteVal2) { + double doubleVal7 = posY3 + 0.249187078744683; + event.setY(doubleVal7); + break label294; + } + + intVal5 = this.mc.thePlayer.offGroundTicks; + byteVal2 = 6; + + if (intVal5 == byteVal2) { + double doubleVal8 = posY3 + 0.170783338727846; + event.setY(doubleVal8); + break label294; + } + + intVal5 = this.mc.thePlayer.offGroundTicks; + byteVal2 = 7; + + if (intVal5 == byteVal2) { + double doubleVal9 = posY3 + 0.015547670490035; + event.setY(doubleVal9); + } + } + + return; + } + + EntityPlayerSP player5 = this.mc.thePlayer; + Float propFloat = this.height.get(); + player5.stepHeight = propFloat; + this.stateTicks++; + StringProperty strProp2 = this.mode; + intVal5 = (strProp2.equals("Hypixel") ? 1 : 0); + + + if (intVal5 != 0) { + int ticks = this.stateTicks; + byte byteVal3 = 1; + if (this.stateTicks == 1) { + List itemList = this.packetList; + C03PacketPlayer playerPacket = event.toPlayerPacket(); + itemList.add(playerPacket); + event.setCancelled(true); + return; + } + + ticks = this.stateTicks; + byteVal3 = 2; + + if (ticks == byteVal3) { + List itemList2 = this.packetList; + Consumer> consumer = this::handlePacket; + itemList2.forEach(consumer); + List itemList3 = this.packetList; + itemList3.clear(); + this.mc.timer.timerSpeed = 0.6F; + return; + } + + step2 = this; + + ticks = this.stateTicks; + byteVal3 = 3; + + if (ticks != byteVal3) { + return; + } + + step2 = this; + + step2.mc.timer.timerSpeed = 1.0F; + return; + } + + step3 = this; + + intVal5 = this.stateTicks; + + + if (intVal5 != 2) { + return; + } + + step3 = this; + + step3.mc.timer.timerSpeed = 1.0F; +} + + @Override + public void onDisable() { + Step step = this; + List itemList = this.packetList; + if (!itemList.isEmpty()) { + List itemList2 = this.packetList; + Consumer> consumer = this::handlePacket; + itemList2.forEach(consumer); + List itemList3 = this.packetList; + itemList3.clear(); + } + + this.mc.timer.timerSpeed = 1.0F; + this.mc.thePlayer.stepHeight = 0.625F; + step = this; + + step.stateFlag = false; +} + + public void handleSettingEvent(SettingEvent event) { + boolean flag; + StringProperty strProp; + String textStr; + + + label42: { + SettingEvent settingEvent = event; + + if (event == null) { + break label42; + } + + settingEvent = event; + + + flag = settingEvent.getCachedText2().equals("STEP_MODE"); + + if (!flag) { + return; + } + } + + strProp = this.mode; + textStr = "Packet"; + + flag = strProp.equals(textStr); + + if (!flag) { + strProp = this.mode; + textStr = "Motion"; + + if (!strProp.equals(textStr)) { + return; + } + } + + textStr = this.getDisplayName(); + StringBuilder sb = new StringBuilder(); + sb = sb.append("Mode was set to HYPIXEL due to unstable "); + StringProperty strProp2 = this.mode; + String propStr = strProp2.get(); + propStr = propStr.toUpperCase(); + sb = sb.append(propStr); + this.popNotification(textStr, sb.append(" bypass").toString(), 3500, NotificationType.WARNING); + strProp = this.mode; + textStr = "Hypixel"; + + strProp.set(textStr); +} + + public FloatProperty getHeight() { + return this.height; +} + + public FloatProperty getFloatPropertyValue() { + return this.getHeight(); +} + + @EventTarget + public void handleStepConfirmEvent(StepConfirmEvent event) { + double doubleVal; + double doubleVal2; + net.minecraft.client.entity.EntityPlayerSP player; + if (event.getZnA() == StepState.CONFIRM) { + boolean enabled = this.isEnabled(ModuleRegistry.SPEED, ModuleRegistry.SCAFFOLD, ModuleRegistry.LONGJUMP, ModuleRegistry.FLY); + if (enabled) { + return; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + enabled = player2.getMovementInput().evaluateCondition2(); + + if (enabled) { + return; + } + + player = this.mc.thePlayer; + + enabled = this.mc.thePlayer.onGround; + + if (!enabled) { + return; + } + + player = this.mc.thePlayer; + + double posX2 = player.posX; + double posY2 = this.mc.thePlayer.posY; + double posZ2 = this.mc.thePlayer.posZ; + EntityPlayerSP player3 = this.mc.thePlayer; + double posY3 = player3.getAxisAlignedBB().minY - posY2; + StringProperty strProp = this.mode; + byte byteVal = (byte)(strProp.equals("Hypixel") ? 1 : 0); + if (byteVal != 0) { + double doubleVal3 = posY3; + if (posY3 != 1.0) { + return; + } + + this.mc.timer.timerSpeed = 0.18F; + this.stateTicks = 0; + EntityPlayerSP player4 = this.mc.thePlayer; + double doubleVal4 = player4.getFloat2(); + double angleRad = Math.toRadians(doubleVal4); + doubleVal3 = -MathHelper.sin(angleRad); + + double doubleVal5 = doubleVal3; + EntityPlayerSP player5 = this.mc.thePlayer; + double doubleVal6 = player5.getFloat2(); + double angleRad2 = Math.toRadians(doubleVal6); + double doubleVal7 = MathHelper.cos(angleRad2); + List itemList = this.packetList; + C04PacketPlayerPosition playerPositionPacket = new C04PacketPlayerPosition(posX2 - doubleVal5 * 0.28, posY2 + 0.42F, posZ2 - doubleVal7 * 0.28, false); + itemList.add(playerPositionPacket); + List itemList2 = this.packetList; + C04PacketPlayerPosition playerPositionPacket2 = new C04PacketPlayerPosition(posX2 - doubleVal5 * 0.12, posY2 + 0.7531999805212, posZ2 - doubleVal7 * 0.12, false); + itemList2.add(playerPositionPacket2); + List itemList3 = this.packetList; + C04PacketPlayerPosition playerPositionPacket3 = new C04PacketPlayerPosition(posX2 + doubleVal5 * 0.04, posY2 + 1.001335979112147, posZ2 + doubleVal7 * 0.04, false); + itemList3.add(playerPositionPacket3); + List itemList4 = this.packetList; + C04PacketPlayerPosition playerPositionPacket4 = new C04PacketPlayerPosition(posX2 + doubleVal5 * 0.2, posY2 + 1.0, posZ2 + doubleVal7 * 0.2, true); + itemList4.add(playerPositionPacket4); + return; + } + + StringProperty strProp2 = this.mode; + byteVal = (byte)(strProp2.equals("Packet") ? 1 : 0); + + if (byteVal == 0) { + return; + } + + if (posY3 <= 0.625) { + return; + } + + if (posY3 > 2.5) { + return; + } + + MinecraftHelper minecraftHelper = this.mc.timer; + Float timerSpeed2 = this.timerSpeed.get(); + minecraftHelper.timerSpeed = (float)(timerSpeed2.floatValue() * (1.0 - 0.15 * posY3 / 0.5)) + 0.075F; + this.stateTicks = 0; + if (posY3 == 1.5) { + List itemList5 = this.doubleList3; + Consumer consumer = ((java.util.function.Consumer) ((value0) -> { this.sendPacket(new C04PacketPlayerPosition(posX2, posY2 + value0, posZ2, false)); })); + itemList5.forEach(consumer); + return; + } + + if (posY3 == 2.0) { + List itemList6 = this.doubleList2; + Consumer consumer2 = ((java.util.function.Consumer) ((value0) -> { this.sendPacket(new C04PacketPlayerPosition(posX2, posY2 + value0, posZ2, false)); })); + itemList6.forEach(consumer2); + return; + } + + if (posY3 == 2.5) { + List itemList7 = this.doubleList4; + Consumer consumer3 = ((java.util.function.Consumer) ((value0) -> { this.sendPacket(new C04PacketPlayerPosition(posX2, posY2 + value0, posZ2, false)); })); + itemList7.forEach(consumer3); + return; + } + + doubleVal = posY3; + + if (posY3 <= 0.625) { + return; + } + + List itemList8 = this.doubleList; + Double doubleVal8 = (Double)itemList8.get(0); + doubleVal = doubleVal8; + + double doubleVal9; + double doubleVal10; + label66: { + + double doubleVal11 = doubleVal; + List itemList9 = this.doubleList; + Double doubleVal12 = (Double)itemList9.get(1); + doubleVal10 = doubleVal12; + doubleVal9 = doubleVal11 * posY3; + doubleVal10 *= posY3; + if (doubleVal9 > 0.425) { + doubleVal9 = 0.425F; + } + + doubleVal2 = doubleVal9; + + if (doubleVal9 <= 0.78) { + break label66; + } + + doubleVal2 = 0.78F; + + doubleVal9 = doubleVal2; + } + + this.sendPacket(new C04PacketPlayerPosition(posX2, posY2 + doubleVal9, posZ2, false)); + this.sendPacket(new C04PacketPlayerPosition(posX2, posY2 + doubleVal10, posZ2, false)); + } +} + + @EventTarget + public void onRender3D(Render3DEvent event) {} + + + public boolean isReadyState11() { + boolean enabled = this.isEnabled(); + if (!enabled) { + return false; + } + + StringProperty strProp = this.mode; + enabled = strProp.equals("Motion"); + + if (!enabled) { + return false; + } + + return this.stateFlag; +} + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + this.handleString3(this.mode.get()); +} + + @Override + public void onEnable() { + this.handleString3(this.mode.get()); +} + + + public Step(ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + Double[] doubleArr = new Double[2]; + doubleArr[0] = (double)0.42F; + doubleArr[1] = 0.7531999805212; + this.doubleList = Lists.newArrayList(doubleArr); + Double[] doubleArr2 = new Double[5]; + doubleArr2[0] = (double)0.42F; + doubleArr2[1] = 0.7531999805212; + doubleArr2[2] = 1.00133597911214; + doubleArr2[3] = 1.084; + doubleArr2[4] = 1.006; + this.doubleList3 = Lists.newArrayList(doubleArr2); + doubleArr2 = new Double[8]; + doubleArr2[0] = (double)0.425F; + doubleArr2[1] = 0.821; + doubleArr2[2] = 0.699; + doubleArr2[3] = 0.599; + doubleArr2[4] = 1.022; + doubleArr2[5] = 1.372; + doubleArr2[6] = 1.652; + doubleArr2[7] = 1.869; + this.doubleList2 = Lists.newArrayList(doubleArr2); + Double[] doubleArr3 = new Double[10]; + doubleArr3[0] = (double)0.425F; + doubleArr3[1] = 0.821; + doubleArr3[2] = 0.699; + doubleArr3[3] = 0.599; + doubleArr3[4] = 1.022; + doubleArr3[5] = 1.372; + doubleArr3[6] = 1.652; + doubleArr3[7] = 1.869; + doubleArr3[8] = 2.019; + doubleArr3[9] = 1.907; + this.doubleList4 = Lists.newArrayList(doubleArr3); + StringProperty strProp = StringProperty.of("Motion"); + String[] stringArr = new String[]{"Packet", "Motion", "Hypixel"}; + this.mode = strProp.acceptableValues(stringArr); + this.height = FloatProperty.of(1.5F).minimum(1.0F).maximum(2.5F); + this.timerSpeed = FloatProperty.of(0.6F).minimum(0.1F).maximum(1.0F); + this.packetList = new ArrayList<>(); + this.timer2 = new TimerUtil(); + Setting setting = new Setting("STEP_MODE", "Mode", SettingType.COMBOBOX, this, this.mode); + SettingManager.register(setting); + setting = new Setting("STEP_HEIGHT", "Height", SettingType.SLIDER, this, this.height, 0.5, () -> this.mode.equals("Packet")); + SettingManager.register(setting); + setting = new Setting("STEP_TIMER_SPEED", "Timer Speed", SettingType.SLIDER, this, this.timerSpeed, 0.05F, () -> this.mode.equals("Packet")); + SettingManager.register(setting); +} + + @EventTarget + public void onMove(MoveEvent event) {} + + + @EventTarget + public void onCollideWithBlock(CollideWithBlockEvent event) {} + +} diff --git a/src/main/java/cc/novoline/modules/move/TargetStrafe.java b/src/main/java/cc/novoline/modules/move/TargetStrafe.java new file mode 100644 index 0000000..c332090 --- /dev/null +++ b/src/main/java/cc/novoline/modules/move/TargetStrafe.java @@ -0,0 +1,929 @@ +package cc.novoline.modules.move; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.modules.PlayerManager; +import cc.novoline.modules.PlayerRelationType; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.ServerUtils; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.helper.StrafeCirclePoint; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.render.RotationAngleUtil; + +import cc.novoline.Novoline; +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.PlayerUpdateEvent; +import cc.novoline.events.events.Render3DEvent; +import cc.novoline.events.events.SettingEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.combat.KillAura; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.player.Scaffold; +import cc.novoline.modules.ModuleRegistry; +import java.awt.Color; +import java.util.Comparator; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.MathHelper; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.lwjgl.opengl.GL11; + +public final class TargetStrafe extends AbstractModule { + @Property("range") + private final DoubleProperty range; + @Property("auto-third-person") + private BooleanProperty autoThirdPerson; + @Property("only-target") + private final BooleanProperty onlyTarget; + private final TimerUtil timer; + private boolean stateFlag; + private int stateTicks; + @Property("strafe-on") + private ListProperty strafeOn; + private boolean stateFlag2; + @Property("modules-support") + private ListProperty modulesSupport; + private static final double CONST_DOUBLE = 3.5; + @Property("avoid-edges") + private final BooleanProperty avoidEdges; + @Property("points") + private final BooleanProperty points; + @Property("strafe-mode") + private StringProperty strafeMode; + private static final double CONST_DOUBLE_2 = Math.PI * 2; + private double cachedValue; + @Property("height") + private final IntProperty height; + private float cachedAngle; + + @EventTarget + public void onRender3D(Render3DEvent event) { + cc.novoline.modules.move.TargetStrafe targetStrafe; + KillAura killAura = ModuleRegistry.KILLAURA.getModule(); + Object obj = killAura.getTrackedEntity(); + if (obj == null) { + return; + } + + BooleanProperty boolProp = this.points; + obj = boolProp.get(); + + Boolean flag = (Boolean)obj; + byte byteVal = (byte)(flag ? 1 : 0); + if (byteVal == 0) { + return; + } + + EntityPlayerSP player = this.mc.thePlayer; + Entity entity = killAura.getTrackedEntity(); + double dist = player.getDistanceToEntity(entity); + DoubleProperty doubleProp = killAura.getDoublePropertyA(); + Double propDouble = doubleProp.get(); + if (dist >= propDouble) { + return; + } + + Entity entity2 = killAura.getTrackedEntity(); + byteVal = (byte)(entity2.isConditionMet16() ? 1 : 0); + + if (byteVal == 0) { + return; + } + + targetStrafe = this; + + byteVal = (byte)(this.checkState15() ? 1 : 0); + + if (byteVal == 0) { + return; + } + + RenderUtils.renderVisual10(); + this.renderRender3DEvent(event, killAura.getTrackedEntity(), 4.0F, Color.BLACK); + targetStrafe = this; + + targetStrafe.applyUpdate4(event, killAura.getTrackedEntity(), 2.0F); + GlStateManager.disableBlend(); + RenderUtils.renderVisual9(); +} + + public double getDoubleValue3() { + return this.cachedValue; +} + + private boolean isReadyState12() { + byte byteVal; + label96: { + ListProperty listProp = this.strafeOn; + int intVal = (listProp.isEmpty() ? 1 : 0); + + label70: + if (intVal == 0) { + ListProperty listProp2 = this.strafeOn; + byteVal = (byte)(listProp2.contains("Damage") ? 1 : 0); + + if (byteVal != 0) { + ListProperty listProp3 = this.strafeOn; + byteVal = (byte)(listProp3.contains("Jump Key") ? 1 : 0); + + if (byteVal != 0) { + break label70; + } + } + + ListProperty listProp4 = this.strafeOn; + byteVal = (byte)(listProp4.contains("Damage") ? 1 : 0); + break label96; + } + + intVal = this.mc.thePlayer.intState3; + + + + if (intVal > 4) { + KeyBinding keyBinding = this.mc.gameSettings.am; + boolean flag = keyBinding.isKeyDown(); + + if (flag) { + return true; + } + } + + intVal = 0; + + + return ((intVal & 1) != 0); + } + + + if (byteVal != 0) { + + if (this.mc.thePlayer.intState3 > 4) { + return true; + } + } + + ListProperty listProp5 = this.strafeOn; + byteVal = (byte)(listProp5.contains("Jump Key") ? 1 : 0); + + + + if (byteVal == 0) { + return false; + } + + KeyBinding keyBinding2 = this.mc.gameSettings.am; + byteVal = (byte)(keyBinding2.isKeyDown() ? 1 : 0); + + + return byteVal != 0; +} + + public boolean isStateFlag() { + return this.stateFlag; +} + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + AbstractModule mod = this; + if (this.checkState14()) { + TimerUtil timerUtil = this.timer; + if (timerUtil.delay(200L)) { + int intVal3 = (this.stateFlag ? 1 : 0); + intVal3 = (!this.stateFlag ? 1 : 0); + + label48: { + this.stateFlag = (intVal3 & 1) != 0; + int intVal = (this.stateFlag ? 1 : 0); + if (this.stateFlag) { + intVal3 = this.stateTicks - 1; + break label48; + } + + intVal = this.stateTicks; + + intVal3 = intVal + 1; + } + + this.stateTicks = intVal3; + } + + timerUtil = this.timer; + + timerUtil.reset(); + } + + ModuleRegistry modEntry = ModuleRegistry.KILLAURA; + mod = modEntry.getModule(); + + KillAura killAura = (KillAura)mod; + DoubleProperty doubleProp = this.range; + Double propDouble = doubleProp.get(); + double doubleVal = propDouble; + int intVal2 = (int)(Math.PI * doubleVal); + double doubleVal2 = (Math.PI * 2) / intVal2; + Entity entity = killAura.getTrackedEntity(); + double doubleVal3 = doubleVal2 * (this.stateTicks + 1) * doubleVal; + double doubleVal4 = MathHelper.sin(doubleVal3); + double doubleVal5 = doubleVal2 * (this.stateTicks + 1); + double doubleVal6 = MathHelper.cos(doubleVal5) * doubleVal; + TargetStrafe targetStrafe = this; + if (!this.applyUpdate4(entity.posX + doubleVal4, entity.posY, entity.posZ + doubleVal6)) { + boolean flag = this.stateFlag; + flag = !this.stateFlag; + + this.stateFlag = flag; + } + + targetStrafe = this; + + targetStrafe.cachedAngle = 0.7F; +} + + public boolean isFlagI() { + boolean enabled = this.isEnabled(); + if (!enabled) { + return false; + } + + enabled = this.checkState15(); + + if (!enabled) { + return false; + } + + BooleanProperty boolProp = this.autoThirdPerson; + Boolean propFlag = boolProp.get(); + enabled = propFlag; + + return enabled; +} + + private void renderRender3DEvent(Render3DEvent event, Entity entity, float value, Color color) { + GL11.glLineWidth(value); + GL11.glBegin(3); + Double propDouble = this.range.get(); + double doubleVal = propDouble; + double doubleVal2 = (Math.PI * 2) / (Math.PI * doubleVal * this.computeDoubleValue()); + RenderUtils.glColor(color); + double doubleVal3 = 0.0; + + while (true) { + if (doubleVal3 < Math.PI * 2) { + double posX2 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * event.getPartialTicks(); + double angleRad = posX2 + Math.sin(doubleVal3) * doubleVal; + Minecraft mcClient = this.mc; + double doubleVal4 = angleRad - mcClient.getRenderManager().renderPosX; + double posY2 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * event.getPartialTicks(); + Minecraft mcClient2 = this.mc; + double posY4 = posY2 - mcClient2.getRenderManager().renderPosY; + double posZ2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * event.getPartialTicks(); + double angleRad2 = posZ2 + Math.cos(doubleVal3) * doubleVal; + Minecraft mcClient3 = this.mc; + double doubleVal5 = angleRad2 - mcClient3.getRenderManager().renderPosZ; + GL11.glVertex3d(doubleVal4, posY4, doubleVal5); + doubleVal3 += doubleVal2; + + continue; + } + + double posX3 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * event.getPartialTicks(); + double angleRad3 = posX3 + Math.sin(0.0) * doubleVal; + Minecraft mcClient4 = this.mc; + doubleVal3 = angleRad3 - mcClient4.getRenderManager().renderPosX; + double posY3 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * event.getPartialTicks(); + Minecraft mcClient5 = this.mc; + double posY5 = posY3 - mcClient5.getRenderManager().renderPosY; + double posZ3 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * event.getPartialTicks(); + double angleRad4 = posZ3 + Math.cos(0.0) * doubleVal; + Minecraft mcClient6 = this.mc; + double doubleVal6 = angleRad4 - mcClient6.getRenderManager().renderPosZ; + GL11.glVertex3d(doubleVal3, posY5, doubleVal6); + GL11.glEnd(); + break; + } +} + + private int computeEntityInt(Entity entity) { + List itemList = this.resolveList(entity); + Stream stream2 = itemList.stream(); + Comparator comparator = Comparator.comparingDouble(StrafeCirclePoint::getDoubleValue); + Stream stream3 = stream2.sorted(comparator); + Collector collector = Collectors.toList(); + itemList = (java.util.List) stream3.collect(collector); + return ((StrafeCirclePoint)itemList.get(0)).intField; +} + + + public TargetStrafe(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + DoubleProperty doubleProp = DoubleProperty.of(2.0); + Double doubleVal = 0.7; + DoubleProperty doubleProp2 = doubleProp.minimum(doubleVal); + this.range = doubleProp2.maximum(4.5); + this.onlyTarget = BooleanProperty.of(false); + this.points = BooleanProperty.of(false); + this.avoidEdges = BooleanProperty.of(false); + this.height = IntProperty.of(5).minimum(4).maximum(10); + ListProperty listProp = ListProperty.of("Speed"); + String[] stringArr = new String[]{"Fly", "Speed"}; + this.modulesSupport = listProp.acceptableValues((Object[])stringArr); + ListProperty listProp2 = ListProperty.of("Damage"); + String[] stringArr2 = new String[]{"Damage", "Jump Key"}; + this.strafeOn = listProp2.acceptableValues((Object[])stringArr2); + StringProperty strProp = StringProperty.of("Bypass"); + String[] stringArr3 = new String[]{"Bypass", "Vanilla"}; + this.strafeMode = strProp.acceptableValues(stringArr3); + this.autoThirdPerson = BooleanProperty.of(false); + this.timer = new TimerUtil(); + this.cachedAngle = 0.0F; + Setting setting = new Setting("TS_RADIUS", "Radius", SettingType.SLIDER, this, this.range, 0.1); + SettingManager.register(setting); + setting = new Setting("TS_STRAFE_MODE", "Strafe Mode", SettingType.COMBOBOX, this, this.strafeMode); + SettingManager.register(setting); + setting = new Setting("TS_TAR", "Only target", SettingType.CHECKBOX, this, this.onlyTarget); + SettingManager.register(setting); + setting = new Setting("TS_TARGET_ON", "Target On", SettingType.SELECTBOX, this, this.strafeOn); + SettingManager.register(setting); + setting = new Setting("POINTS", "Draw circle", SettingType.CHECKBOX, this, this.points); + SettingManager.register(setting); + setting = new Setting("TS_AUTO_THIRD_PERSON", "Auto Third Person", SettingType.CHECKBOX, this, this.autoThirdPerson); + SettingManager.register(setting); + setting = new Setting("TS_EDGES", "Stop on Edges", SettingType.CHECKBOX, this, this.avoidEdges); + SettingManager.register(setting); + setting = new Setting("TS_EDGES_MIN_AMOUNT", "Maximum Height", SettingType.SLIDER, this, this.height, 1.0, this.avoidEdges::get); + SettingManager.register(setting); + setting = new Setting("TS_SUPPORT", "Modules Support", SettingType.SELECTBOX, this, this.modulesSupport); + SettingManager.register(setting); +} + + private boolean checkState14() { + WorldClient world = this.mc.theWorld; + EntityPlayerSP player = this.mc.thePlayer; + EntityPlayerSP player2 = this.mc.thePlayer; + AxisAlignedBB boundingBox = player2.getAxisAlignedBB(); + AxisAlignedBB boundingBox5 = boundingBox.offset(0.0, 0.0, -0.5); + List itemList = world.getCollidingBoundingBoxes(player, boundingBox5); + boolean empty = itemList.isEmpty(); + if (empty) { + world = this.mc.theWorld; + player = this.mc.thePlayer; + player2 = this.mc.thePlayer; + AxisAlignedBB boundingBox2 = player2.getAxisAlignedBB(); + AxisAlignedBB boundingBox6 = boundingBox2.offset(0.5, 0.0, 0.0); + List itemList2 = world.getCollidingBoundingBoxes(player, boundingBox6); + boolean empty2 = itemList2.isEmpty(); + + if (empty2) { + world = this.mc.theWorld; + player = this.mc.thePlayer; + player2 = this.mc.thePlayer; + AxisAlignedBB boundingBox3 = player2.getAxisAlignedBB(); + AxisAlignedBB boundingBox7 = boundingBox3.offset(0.0, 0.0, 0.5); + List itemList3 = world.getCollidingBoundingBoxes(player, boundingBox7); + boolean empty3 = itemList3.isEmpty(); + + if (empty3) { + world = this.mc.theWorld; + player = this.mc.thePlayer; + player2 = this.mc.thePlayer; + AxisAlignedBB boundingBox4 = player2.getAxisAlignedBB(); + AxisAlignedBB boundingBox8 = boundingBox4.offset(-0.5, 0.0, 0.0); + List itemList4 = world.getCollidingBoundingBoxes(player, boundingBox8); + boolean empty4 = itemList4.isEmpty(); + + if (empty4) { + return false; + } + } + } + } + + empty = true; + + return empty; +} + + public BooleanProperty getOnlyTarget() { + return this.onlyTarget; +} + + public BooleanProperty getBooleanPropertyC() { + return this.getOnlyTarget(); +} + + public StringProperty getStrafeMode() { + return this.strafeMode; +} + + public StringProperty getStringProperty2() { + return this.getStrafeMode(); +} + + public void handleSettingEvent(SettingEvent event) { + boolean flag; + StringProperty strProp; + String textStr; + + label36: { + SettingEvent settingEvent = event; + + if (event == null) { + break label36; + } + + settingEvent = event; + + + flag = settingEvent.getCachedText2().equals("TS_STRAFE_MODE"); + + if (!flag) { + return; + } + } + + strProp = this.strafeMode; + textStr = "Vanilla"; + + flag = strProp.equals(textStr); + + if (!flag) { + return; + } + + this.applyUpdate5(this.getDisplayName(), "Strafe Mode was set to BYPASS due to unstable VANILLA bypass", 3500, NotificationType.WARNING); + strProp = this.strafeMode; + textStr = "Bypass"; + + strProp.set(textStr); +} + + + public void applyUpdate2(boolean flag) { + this.stateFlag = flag; +} + + + @EventTarget + public void onPacket(PacketEvent event) { + PacketEvent packetEvent = event; + if (event.getState() != State.INCOMING) { + return; + } + + packetEvent = event; + + boolean flag = packetEvent.getPacket() instanceof S08PacketPlayerPosLook; + if (!flag) { + return; + } + + flag = this.checkState15(); + + if (flag) { + S08PacketPlayerPosLook playerPosLookPacket = (S08PacketPlayerPosLook)event.getPacket(); + } +} + + public float getFloatValue2() { + KillAura killAura = ModuleRegistry.KILLAURA.getModule(); + Entity entity = killAura.getTrackedEntity(); + DoubleProperty doubleProp = this.range; + Double propDouble = doubleProp.get(); + double doubleVal = propDouble; + int intVal = (int)((int)(Math.PI * doubleVal) * this.computeDoubleValue()); + double doubleVal2 = (Math.PI * 2) / intVal; + double doubleVal3 = doubleVal2 * this.stateTicks; + double doubleVal4 = MathHelper.sin(doubleVal3) * doubleVal; + double doubleVal5 = doubleVal2 * this.stateTicks; + double doubleVal6 = MathHelper.cos(doubleVal5) * doubleVal; + double posX2 = this.mc.thePlayer.posX; + double posY2 = this.mc.thePlayer.posY; + EntityPlayerSP player = this.mc.thePlayer; + Vec3 vec = new Vec3(posX2, posY2 + player.getEyeHeight(), this.mc.thePlayer.posZ); + Vec3 vec2 = this.resolveVec3(90.0F, 0.0F); + double posX3 = vec2.xCoord; + IntProperty intProp = this.height; + Integer intVal2 = intProp.get(); + posX3 *= intVal2.intValue(); + posX2 = vec2.yCoord; + IntProperty intProp2 = this.height; + Integer intVal3 = intProp2.get(); + posX2 *= intVal3.intValue(); + posY2 = vec2.zCoord; + IntProperty intProp3 = this.height; + Integer intVal4 = intProp3.get(); + posY2 *= intVal4.intValue(); + Vec3 vec3 = vec.addVector(posX3, posX2, posY2); + WorldClient world = this.mc.theWorld; + MovingObjectPosition rayTrace = world.rayTraceBlocks(vec, vec3, false, false, false); + posX3 = entity.posX + doubleVal4 - this.mc.thePlayer.posX; + double doubleVal7 = Math.abs(posX3); + posX3 = entity.posZ + doubleVal6 - this.mc.thePlayer.posZ; + double doubleVal8 = Math.abs(posX3); + posX3 = doubleVal7 * doubleVal7 + doubleVal8 * doubleVal8; + this.cachedValue = Math.sqrt(posX3); + if (this.cachedValue <= this.cachedAngle) { + int intVal5 = (this.stateFlag ? 1 : 0); + intVal5 = this.stateFlag ? -1 : 1; + + this.stateTicks += intVal5 % intVal; + this.stateFlag2 = this.stateFlag; + return RotationAngleUtil.buildFloatArray(entity.posX + doubleVal4, entity.posY, entity.posZ + doubleVal6)[0]; + } + + if (this.cachedValue > 3.0) { + this.stateTicks = this.computeEntityInt(entity); + } + + return RotationAngleUtil.buildFloatArray(entity.posX + doubleVal4, entity.posY, entity.posZ + doubleVal6)[0]; +} + + private List resolveList(Entity entity) { + java.util.concurrent.CopyOnWriteArrayList copyOnWriteArrayList; + CopyOnWriteArrayList copyOnWriteArrayList2 = new CopyOnWriteArrayList(); + DoubleProperty doubleProp = this.range; + Double propDouble = doubleProp.get(); + double doubleVal = propDouble; + int intVal = (int)((int)(Math.PI * doubleVal) * this.computeDoubleValue()); + int intVal2 = 0; + + while (true) { + if (intVal2 <= intVal) { + double doubleVal2 = (Math.PI * 2) / intVal; + double doubleVal3 = doubleVal2 * intVal2; + double doubleVal4 = MathHelper.sin(doubleVal3) * doubleVal; + double doubleVal5 = doubleVal2 * intVal2; + double doubleVal6 = MathHelper.cos(doubleVal5) * doubleVal; + copyOnWriteArrayList = copyOnWriteArrayList2; + + copyOnWriteArrayList2.add(new StrafeCirclePoint(entity.posX + doubleVal4, entity.posZ + doubleVal6, intVal2)); + intVal2++; + continue; + } + + copyOnWriteArrayList = copyOnWriteArrayList2; + break; + } + + return copyOnWriteArrayList; +} + + + private double computeDoubleValue() { + return 8.0; +} + + @EventTarget + public void onPlayerUpdate(PlayerUpdateEvent event) { + if (ServerUtils.isHypixel()) { + this.applyUpdate5(this.getDisplayName(), "Module does not bypass on Hypixel", 3500, NotificationType.ERROR); + this.toggle(); + } +} + + public boolean applyUpdate3(boolean flag) { + cc.novoline.modules.combat.KillAura killAura; + KillAura killAura2 = ModuleRegistry.KILLAURA.getModule(); + boolean enabled = this.isEnabled(); + if (!enabled) { + return false; + } + + enabled = flag; + + label124: { + if (!enabled) { + break label124; + } + + killAura = killAura2; + + enabled = killAura2.isReadyState2(); + + if (!enabled) { + return false; + } + } + + killAura = killAura2; + + if (killAura.getTrackedEntity() != null) { + EntityPlayerSP player = this.mc.thePlayer; + Entity entity = killAura2.getTrackedEntity(); + byte byteVal = (byte)(player.matchesCriteria(entity) ? 1 : 0); + if (byteVal == 0) { + return false; + } + + BooleanProperty boolProp = this.onlyTarget; + Boolean propFlag = boolProp.get(); + byteVal = (byte)(propFlag ? 1 : 0); + + if (byteVal != 0) { + Novoline novolineInst = this.novoline; + PlayerManager playerManager = novolineInst.getPlayerManager(); + byteVal = (byte)(playerManager.hasType(killAura2.getTrackedEntity().getName(), PlayerRelationType.TARGET) ? 1 : 0); + + if (byteVal == 0) { + return false; + } + } + + EntityPlayerSP player2 = this.mc.thePlayer; + Entity entity2 = killAura2.getTrackedEntity(); + double doubleVal = player2.resolveDouble6(entity2); + DoubleProperty doubleProp = killAura2.getDoublePropertyA(); + Double propDouble = doubleProp.get(); + if (doubleVal >= (propDouble + 2.0)) { + return false; + } + + double posY2 = this.mc.thePlayer.posY; + if (posY2 < (killAura2.getTrackedEntity().posY - 3.4)) { + return false; + } + + Entity entity3 = killAura2.getTrackedEntity(); + byteVal = (byte)(entity3.isConditionMet16() ? 1 : 0); + + if (byteVal == 0) { + return false; + } + + EntityPlayerSP player3 = this.mc.thePlayer; + byteVal = (byte)(player3.isMoving() ? 1 : 0); + + if (byteVal == 0) { + return false; + } + + double posY3 = this.mc.thePlayer.posY; + if (posY3 > (killAura2.getTrackedEntity().posY + 3.4)) { + return false; + } + + byteVal = (byte)(this.isReadyState12() ? 1 : 0); + + + if (byteVal == 0) { + return false; + } + + ListProperty listProp = this.modulesSupport; + byteVal = (byte)(listProp.contains("Speed") ? 1 : 0); + + if (byteVal != 0) { + ModuleRegistry modEntry = ModuleRegistry.SPEED; + if (modEntry.obtainAbstractModule().isEnabled()) { + return true; + } + } + + ListProperty listProp2 = this.modulesSupport; + byteVal = (byte)(listProp2.contains("Fly") ? 1 : 0); + + if (byteVal == 0) { + return false; + } + + ModuleRegistry modEntry2 = ModuleRegistry.FLY; + byteVal = (byte)(modEntry2.obtainAbstractModule().isEnabled() ? 1 : 0); + + if (byteVal != 0) { + return true; + } + } + + return false; +} + + public boolean checkState15() { + KillAura killAura; + KillAura killAura2; + + killAura = ModuleRegistry.KILLAURA.getModule(); + boolean enabled = this.isEnabled(); + + if (!enabled) { + return false; + } + + killAura2 = killAura; + + enabled = killAura.isReadyState2(); + + + if (!enabled) { + return false; + } + + killAura2 = killAura; + + if (killAura2.getTrackedEntity() != null) { + EntityPlayerSP player = this.mc.thePlayer; + Entity entity = killAura.getTrackedEntity(); + byte byteVal = (byte)(player.matchesCriteria(entity) ? 1 : 0); + if (byteVal == 0) { + return false; + } + + BooleanProperty boolProp = this.onlyTarget; + Boolean propFlag = boolProp.get(); + byteVal = (byte)(propFlag ? 1 : 0); + + if (byteVal != 0) { + Novoline novolineInst = this.novoline; + PlayerManager playerManager = novolineInst.getPlayerManager(); + byteVal = (byte)(playerManager.hasType(killAura.getTrackedEntity().getName(), PlayerRelationType.TARGET) ? 1 : 0); + + if (byteVal == 0) { + return false; + } + } + + EntityPlayerSP player2 = this.mc.thePlayer; + entity = killAura.getTrackedEntity(); + double doubleVal = player2.resolveDouble6(entity); + DoubleProperty doubleProp = killAura.getDoublePropertyA(); + Double propDouble = doubleProp.get(); + if (doubleVal >= (propDouble + 2.0)) { + return false; + } + + double posY2 = this.mc.thePlayer.posY; + if (posY2 < (killAura.getTrackedEntity().posY - 3.4)) { + return false; + } + + Entity entity2 = killAura.getTrackedEntity(); + byteVal = (byte)(entity2.isConditionMet16() ? 1 : 0); + + if (byteVal == 0) { + return false; + } + + EntityPlayerSP player3 = this.mc.thePlayer; + byteVal = (byte)(player3.isMoving() ? 1 : 0); + + if (byteVal == 0) { + return false; + } + + double posY3 = this.mc.thePlayer.posY; + if (posY3 > (killAura.getTrackedEntity().posY + 3.4)) { + return false; + } + + byteVal = (byte)(this.isReadyState12() ? 1 : 0); + + + if (byteVal == 0) { + return false; + } + + ListProperty listProp = this.modulesSupport; + byteVal = (byte)(listProp.contains("Speed") ? 1 : 0); + + if (byteVal != 0) { + ModuleRegistry modEntry = ModuleRegistry.SPEED; + if (modEntry.obtainAbstractModule().isEnabled()) { + return true; + } + } + + ListProperty listProp2 = this.modulesSupport; + byteVal = (byte)(listProp2.contains("Fly") ? 1 : 0); + + if (byteVal == 0) { + return false; + } + + ModuleRegistry modEntry2 = ModuleRegistry.FLY; + byteVal = (byte)(modEntry2.obtainAbstractModule().isEnabled() ? 1 : 0); + + if (byteVal != 0) { + return true; + } + } + + return false; +} + + private boolean applyUpdate4(double x, double y, double z) { + int intVal = (int)y; + + while (intVal > 0) { + WorldClient world = this.mc.theWorld; + IBlockState blockState = world.getBlockState(new BlockPos(x, intVal, z)); + if (blockState.getBlock() != Blocks.air) { + return true; + } + + intVal--; + + } + + return false; +} + + private void applyUpdate4(Render3DEvent event, Entity entity, float value) { + GL11.glLineWidth(value); + GL11.glBegin(3); + DoubleProperty doubleProp = this.range; + Double propDouble = doubleProp.get(); + double doubleVal = propDouble; + double doubleVal2 = (Math.PI * 2) / (Math.PI * doubleVal * this.computeDoubleValue()); + short shortVal = 0; + double doubleVal3 = 0.0; + + while (true) { + if (doubleVal3 < Math.PI * 2) { + double posX2 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * event.getPartialTicks(); + double angleRad = posX2 + Math.sin(doubleVal3) * doubleVal; + Minecraft mcClient = this.mc; + double doubleVal4 = angleRad - mcClient.getRenderManager().renderPosX; + double posY2 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * event.getPartialTicks(); + mcClient = this.mc; + double posY4 = posY2 - mcClient.getRenderManager().renderPosY; + double posZ2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * event.getPartialTicks(); + double angleRad2 = posZ2 + Math.cos(doubleVal3) * doubleVal; + mcClient = this.mc; + double doubleVal5 = angleRad2 - mcClient.getRenderManager().renderPosZ; + long longVal = shortVal; + int color = ColorTheme.getHudColor(longVal); + RenderUtils.glColor(color); + GL11.glVertex3d(doubleVal4, posY4, doubleVal5); + shortVal -= 360; + doubleVal3 += doubleVal2; + + continue; + } + + double posX3 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * event.getPartialTicks(); + double angleRad3 = posX3 + Math.sin(0.0) * doubleVal; + Minecraft mcClient2 = this.mc; + doubleVal3 = angleRad3 - mcClient2.getRenderManager().renderPosX; + double posY3 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * event.getPartialTicks(); + mcClient2 = this.mc; + double posY5 = posY3 - mcClient2.getRenderManager().renderPosY; + double posZ3 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * event.getPartialTicks(); + double angleRad4 = posZ3 + Math.cos(0.0) * doubleVal; + mcClient2 = this.mc; + double doubleVal6 = angleRad4 - mcClient2.getRenderManager().renderPosZ; + long longVal2 = shortVal; + int color2 = ColorTheme.getHudColor(longVal2); + RenderUtils.glColor(color2); + GL11.glVertex3d(doubleVal3, posY5, doubleVal6); + GL11.glEnd(); + break; + } +} + + private Vec3 resolveVec3(float value, float amount) { + double doubleVal = -amount; + doubleVal = Math.toRadians(doubleVal) - (float) Math.PI; + float floatVal = MathHelper.cos(doubleVal); + doubleVal = -amount; + doubleVal = Math.toRadians(doubleVal) - (float) Math.PI; + float floatVal2 = MathHelper.sin(doubleVal); + doubleVal = -value; + doubleVal = Math.toRadians(doubleVal); + float floatVal3 = -MathHelper.cos(doubleVal); + doubleVal = -value; + doubleVal = Math.toRadians(doubleVal); + float floatVal4 = MathHelper.sin(doubleVal); + return new Vec3(floatVal2 * floatVal3, floatVal4, floatVal * floatVal3); +} + + +} diff --git a/src/main/java/cc/novoline/modules/move/WaterWalk.java b/src/main/java/cc/novoline/modules/move/WaterWalk.java new file mode 100644 index 0000000..cab9781 --- /dev/null +++ b/src/main/java/cc/novoline/modules/move/WaterWalk.java @@ -0,0 +1,612 @@ +package cc.novoline.modules.move; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ServerUtils; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.CollideWithBlockEvent; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.MoveEvent; +import cc.novoline.events.events.SettingEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.player.Scaffold; +import cc.novoline.modules.ModuleRegistry; +import io.netty.util.internal.ThreadLocalRandom; +import cc.novoline.modules.ModuleManager; +import net.minecraft.util.MathHelper; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class WaterWalk extends AbstractModule { + private boolean stateFlag; + private int stateTicks; + private int stateTicks2; + @Property("mode") + private StringProperty mode; + private double cachedValue; + + private boolean matchesMotionUpdateEvent(MotionUpdateEvent event) { + WorldClient world = this.mc.theWorld; + double doubleVal = event.getX(); + double posY = this.mc.thePlayer.getAxisAlignedBB().maxY - 1.0; + IBlockState blockState = world.getBlockState(new BlockPos(doubleVal, posY, event.getZ())); + return blockState.getBlock() instanceof BlockLiquid; +} + + + public WaterWalk(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + StringProperty strProp = StringProperty.of("Solid"); + String[] stringArr = new String[]{"Solid", "Bounce", "Dolphin", "Hypixel"}; + this.mode = strProp.acceptableValues(stringArr); + SettingManager.register(new Setting("WW_MODE", "Mode", SettingType.COMBOBOX, this, this.mode)); +} + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + this.handleString3(this.mode.get()); +} + + private boolean evaluateFlag2(double value) { + WorldClient world = this.mc.theWorld; + IBlockState blockState = world.getBlockState(new BlockPos(this.mc.thePlayer.posX, value, this.mc.thePlayer.posZ)); + Block block = blockState.getBlock(); + Material material = block.getMaterial(); + return material.isLiquid(); +} + + + @Override + public void onDisable() { + this.mc.thePlayer.stepHeight = 0.625F; + this.stateFlag = false; + this.stateTicks = 0; + this.stateTicks2 = 0; +} + + + public StringProperty getMode() { + return this.mode; +} + + public StringProperty getStringProperty() { + return this.getMode(); +} + + + @EventTarget + public void onMove(MoveEvent event) { + Speed speedMod = ModuleRegistry.SPEED.getModule(); + int intVal = (ServerUtils.isHypixel() ? 1 : 0); + if (intVal == 0) { + return; + } + + EntityPlayerSP player = this.mc.thePlayer; + intVal = (player.getMovementInput().isSneak() ? 1 : 0); + + if (intVal != 0) { + return; + } + + intVal = (speedMod.isEnabled() ? 1 : 0); + + if (intVal != 0) { + return; + } + + StringProperty strProp = this.mode; + intVal = (strProp.equals("Solid") ? 1 : 0); + + if (intVal != 0) { + EntityPlayerSP player2 = this.mc.thePlayer; + boolean flag = player2.isConditionMet5(); + if (!flag) { + return; + } + + EntityPlayerSP player3 = this.mc.thePlayer; + flag = player3.isConditionMet2(); + + if (flag) { + return; + } + + event.setMoveSpeed(0.16); + return; + } + + StringProperty strProp2 = this.mode; + intVal = (strProp2.equals("Bounce") ? 1 : 0); + + if (intVal == 0) { + return; + } + + double posY2 = this.mc.thePlayer.posY; + intVal = (this.evaluateFlag2(MathHelper.incValue(posY2, 1.0) - 0.001) ? 1 : 0); + + if (intVal == 0) { + return; + } + + intVal = (this.evaluateFlag2(this.mc.thePlayer.posY + 0.5) ? 1 : 0); + + + if (intVal != 0) { + return; + } + + intVal = this.mc.thePlayer.ticksExisted % 8; + + + if (intVal == 0) { + event.setMoveSpeed(0.16); + return; + } + + event.setMoveSpeed(0.16); +} + + @EventTarget + public void onCollideWithBlock(CollideWithBlockEvent event) { + AbstractModule mod = this; + StringProperty strProp = this.mode; + if (!strProp.equals("Solid")) { + return; + } + + ModuleRegistry modEntry = ModuleRegistry.SPEED; + mod = modEntry.getModule(); + + Speed speedMod = (Speed)mod; + Block block = event.getBlock(); + Material material = block.getMaterial(); + boolean flag = material.isLiquid(); + if (!flag) { + return; + } + + EntityPlayerSP player = this.mc.thePlayer; + flag = player.isConditionMet2(); + + if (flag) { + return; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + flag = player2.getMovementInput().isSneak(); + + if (flag) { + return; + } + + BlockPos pos = event.getPos(); + double doubleVal = pos.getX(); + BlockPos pos2 = event.getPos(); + double doubleVal2 = pos2.getY(); + BlockPos pos3 = event.getPos(); + flag = this.checkDouble(doubleVal, doubleVal2, pos3.getZ()); + + if (!flag) { + return; + } + + flag = speedMod.isEnabled(); + + if (!flag) { + BlockPos pos4 = event.getPos(); + BlockPos pos5 = event.getPos(); + event.setBoundingBox(new AxisAlignedBB(pos4, pos5.add(1, 1, 1))); + } +} + + private boolean checkDouble(double x, double y, double z) { + WorldClient world = this.mc.theWorld; + IBlockState blockState = world.getBlockState(new BlockPos(x, y, z)); + Integer intVal = (Integer)(Comparable)blockState.getProperties().get(BlockLiquid.LEVEL); + int intVal2 = intVal; + intVal2 = intVal2 < 4 ? 1 : 0; + + return ((intVal2 & 1) != 0); +} + + @Override + public void onEnable() { + this.handleString3(this.mode.get()); +} + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + net.minecraft.client.entity.EntityPlayerSP player; + cc.novoline.modules.move.WaterWalk waterWalk; + cc.novoline.modules.move.WaterWalk waterWalk2; + cc.novoline.modules.move.WaterWalk waterWalk3; + net.minecraft.client.entity.EntityPlayerSP player2; + int intVal2 = (event.getState().equals(State.PRE) ? 1 : 0); + if ((intVal2 == 0)) { + return; + } + + intVal2 = (this.isEnabled(ModuleRegistry.SPEED) ? 1 : 0); + + if ((intVal2 != 0)) { + return; + } + + StringProperty strProp = this.mode; + intVal2 = (strProp.equals("Hypixel") ? 1 : 0); + + if ((intVal2 != 0)) { + EntityPlayerSP player3 = this.mc.thePlayer; + byte byteVal = (byte)(player3.isConditionMet2() ? 1 : 0); + if (byteVal == 0) { + return; + } + + byteVal = (byte)(this.checkDouble(this.mc.thePlayer.posX, this.mc.thePlayer.posY, this.mc.thePlayer.posZ) ? 1 : 0); + + if (byteVal == 0) { + return; + } + + EntityPlayerSP player4 = this.mc.thePlayer; + byteVal = (byte)(player4.getMovementInput().isSneak() ? 1 : 0); + + label349: { + if (byteVal != 0) { + this.mc.thePlayer.motionY = -0.15; + break label349; + } + + EntityPlayerSP player5 = this.mc.thePlayer; + byteVal = (byte)(player5.getMovementInput().evaluateCondition2() ? 1 : 0); + + if (byteVal != 0) { + this.mc.thePlayer.motionY = 0.0735; + break label349; + } + + if (event.getY() % 1.0 < 0.6) { + this.mc.thePlayer.motionY = 0.008; + } + } + + EntityPlayerSP player6 = this.mc.thePlayer; + byteVal = (byte)(player6.isMoving() ? 1 : 0); + + if (byteVal == 0) { + return; + } + + player = this.mc.thePlayer; + + if (this.mc.thePlayer.motionY < 0.0) { + player = this.mc.thePlayer; + + if (!player.getMovementInput().isSneak()) { + EntityPlayerSP player7 = this.mc.thePlayer; + player7.setMoveSpeed(0.22); + return; + } + } + + player = this.mc.thePlayer; + + player.setMoveSpeed(0.11); + return; + } + + StringProperty strProp2 = this.mode; + intVal2 = (strProp2.equals("Solid") ? 1 : 0); + + if ((intVal2 != 0)) { + EntityPlayerSP player8 = this.mc.thePlayer; + intVal2 = (player8.getMovementInput().isSneak() ? 1 : 0); + + if ((intVal2 == 0)) { + EntityPlayerSP player9 = this.mc.thePlayer; + intVal2 = (player9.isConditionMet5() ? 1 : 0); + + if ((intVal2 != 0)) { + EntityPlayerSP player10 = this.mc.thePlayer; + intVal2 = (player10.isConditionMet2() ? 1 : 0); + + if ((intVal2 == 0)) { + float distanceF; + int intVal = (distanceF = this.mc.thePlayer.fallDistance - 0.0F) == 0.0F ? 0 : (distanceF < 0.0F ? -1 : 1); + if (intVal != 0) { + return; + } + + this.mc.thePlayer.stepHeight = 0.015625F; + this.stateTicks2++; + intVal = (ServerUtils.isHypixel() ? 1 : 0); + + + if (intVal != 0) { + label355: { + int ticks = this.stateTicks2; + byte byteVal2 = 1; + if (this.stateTicks2 == 1) { + double doubleVal = event.getY(); + ThreadLocalRandom threadLocalRandom = ThreadLocalRandom.current(); + double doubleVal2 = doubleVal - threadLocalRandom.nextDouble(0.015525, 0.015625); + event.setY(doubleVal2); + break label355; + } + + ticks = this.stateTicks2; + byteVal2 = 2; + + if (ticks == byteVal2) { + double doubleVal3 = event.getY(); + ThreadLocalRandom threadLocalRandom2 = ThreadLocalRandom.current(); + double doubleVal4 = doubleVal3 + threadLocalRandom2.nextDouble(0.0149, 0.015); + event.setY(doubleVal4); + break label355; + } + + ticks = this.stateTicks2; + byteVal2 = 3; + + if (ticks == byteVal2) { + double doubleVal5 = event.getY(); + ThreadLocalRandom threadLocalRandom3 = ThreadLocalRandom.current(); + double doubleVal6 = doubleVal5 + threadLocalRandom3.nextDouble(0.0199, 0.02); + event.setY(doubleVal6); + break label355; + } + + waterWalk = this; + + ticks = this.stateTicks2; + byteVal2 = 4; + + if (ticks < byteVal2) { + break label355; + } + + double doubleVal7 = event.getY() + 0.015625; + event.setY(doubleVal7); + waterWalk = this; + + waterWalk.stateTicks2 = 0; + } + + EntityPlayerSP player11 = this.mc.thePlayer; + double doubleVal8 = event.getY(); + boolean flag = player11.matchesDouble2(doubleVal8); + event.setOnGround(flag); + return; + } + + intVal = this.stateTicks2 % 2; + + + if (intVal == 0) { + double doubleVal9 = event.getY() - 1.0E-13; + event.setY(doubleVal9); + return; + } + + double doubleVal10 = event.getY() + 1.0E-13; + event.setY(doubleVal10); + return; + } + } + } + + this.stateTicks2 = 0; + this.mc.thePlayer.stepHeight = 0.625F; + EntityPlayerSP player12 = this.mc.thePlayer; + intVal2 = (player12.getMovementInput().isSneak() ? 1 : 0); + + if ((intVal2 != 0)) { + return; + } + + EntityPlayerSP player13 = this.mc.thePlayer; + intVal2 = (player13.isConditionMet2() ? 1 : 0); + + if ((intVal2 == 0)) { + return; + } + + waterWalk2 = this; + + intVal2 = (this.checkDouble(this.mc.thePlayer.posX, this.mc.thePlayer.posY, this.mc.thePlayer.posZ) ? 1 : 0); + + if ((intVal2 == 0)) { + waterWalk2 = this; + + if (!this.evaluateFlag2(this.mc.thePlayer.posY - 1.0)) { + waterWalk2 = this; + + if (!this.evaluateFlag2(this.mc.thePlayer.posY + 1.0)) { + return; + } + } + } + + waterWalk2 = this; + + waterWalk2.mc.thePlayer.motionY = 0.11999998688698; + return; + } + + StringProperty strProp3 = this.mode; + intVal2 = (strProp3.equals("Bounce") ? 1 : 0); + + if ((intVal2 != 0)) { + EntityPlayerSP player14 = this.mc.thePlayer; + intVal2 = (player14.isConditionMet2() ? 1 : 0); + + if ((intVal2 != 0)) { + EntityPlayerSP player15 = this.mc.thePlayer; + intVal2 = (player15.getMovementInput().isSneak() ? 1 : 0); + + if ((intVal2 == 0)) { + this.mc.thePlayer.motionY = 0.11999998688698; + return; + } + } + } + + StringProperty strProp4 = this.mode; + intVal2 = (strProp4.equals("Dolphin") ? 1 : 0); + + if ((intVal2 == 0)) { + return; + } + + EntityPlayerSP player16 = this.mc.thePlayer; + intVal2 = (player16.getMovementInput().isSneak() ? 1 : 0); + + label193: { + + + if ((intVal2 != 0)) { + return; + } + + waterWalk3 = this; + + intVal2 = (this.mc.thePlayer.onGround ? 1 : 0); + + + if ((intVal2 == 0)) { + EntityPlayerSP player17 = this.mc.thePlayer; + intVal2 = (player17.isOnLadder() ? 1 : 0); + + if (intVal2 == 0) { + break label193; + } + } + + waterWalk3 = this; + + waterWalk3.stateFlag = false; + } + + if (this.mc.thePlayer.motionY > 0.0) { + intVal2 = (this.stateFlag ? 1 : 0); + + if (this.stateFlag) { + EntityPlayerSP player18 = this.mc.thePlayer; + + if (this.mc.thePlayer.motionY <= 0.1127) { + this.mc.thePlayer.motionY *= 1.267; + } + + player18 = this.mc.thePlayer; + + + player18.motionY += 0.05172; + } + } + + EntityPlayerSP player19 = this.mc.thePlayer; + intVal2 = (player19.isConditionMet2() ? 1 : 0); + + + if (intVal2 == 0) { + return; + } + + intVal2 = (this.matchesMotionUpdateEvent(event) ? 1 : 0); + + + + if (intVal2 == 0) { + WaterWalk waterWalk4 = this; + if (this.stateTicks < 3) { + this.mc.thePlayer.motionY = 0.13; + this.stateTicks++; + this.stateFlag = false; + return; + } + + this.mc.thePlayer.motionY = 0.5; + this.stateTicks = 0; + waterWalk4 = this; + + waterWalk4.stateFlag = true; + return; + } + + player2 = this.mc.thePlayer; + + intVal2 = (player2.getMovementInput().evaluateCondition2() ? 1 : 0); + + + if (intVal2 != 0) { + return; + } + + player2 = this.mc.thePlayer; + + player2.motionY = 0.09; +} + + public void handleSettingEvent(SettingEvent event) { + boolean flag; + StringProperty strProp; + String textStr; + + label36: { + SettingEvent settingEvent = event; + + if (event == null) { + break label36; + } + + settingEvent = event; + + + flag = settingEvent.getCachedText2().equals("WW_MODE"); + + if (!flag) { + return; + } + } + + strProp = this.mode; + textStr = "Hypixel"; + + flag = strProp.equals(textStr); + + if (flag) { + return; + } + + textStr = this.getDisplayName(); + StringBuilder sb = new StringBuilder(); + sb = sb.append("Mode was set to HYPIXEL due to unstable "); + StringProperty strProp2 = this.mode; + String propStr = strProp2.get(); + propStr = propStr.toUpperCase(); + sb = sb.append(propStr); + this.popNotification(textStr, sb.append(" bypass").toString(), 3500, NotificationType.WARNING); + strProp = this.mode; + textStr = "Hypixel"; + + strProp.set(textStr); +} + +} diff --git a/src/main/java/cc/novoline/modules/player/AntiCactus.java b/src/main/java/cc/novoline/modules/player/AntiCactus.java new file mode 100644 index 0000000..df30435 --- /dev/null +++ b/src/main/java/cc/novoline/modules/player/AntiCactus.java @@ -0,0 +1,32 @@ +package cc.novoline.modules.player; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.CollideWithBlockEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.ModuleManager; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class AntiCactus extends AbstractModule { + + public AntiCactus(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); +} + + @EventTarget + private void onCollideWithBlock(CollideWithBlockEvent event) { + CollideWithBlockEvent collideWithBlockEvent = event; + if (event.getBlock() != Blocks.cactus) { + return; + } + + collideWithBlockEvent = event; + + BlockPos pos = event.getPos(); + BlockPos pos2 = event.getPos(); + collideWithBlockEvent.setBoundingBox(new AxisAlignedBB(pos, pos2.add(1, 1, 1))); +} +} diff --git a/src/main/java/cc/novoline/modules/player/AntiObbyTrap.java b/src/main/java/cc/novoline/modules/player/AntiObbyTrap.java new file mode 100644 index 0000000..2e11b27 --- /dev/null +++ b/src/main/java/cc/novoline/modules/player/AntiObbyTrap.java @@ -0,0 +1,124 @@ +package cc.novoline.modules.player; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import net.minecraft.block.BlockFurnace; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.multiplayer.PlayerControllerMP; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.network.play.client.C0APacketAnimation; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.init.Blocks; +import net.minecraft.network.play.client.C07PacketPlayerDigging$Action; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class AntiObbyTrap extends AbstractModule { + private boolean stateFlag; + private float cachedAngle; + + public AntiObbyTrap(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); +} + + public boolean isStateFlag() { + return this.stateFlag; +} + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + net.minecraft.block.Block block2; + if (event.getState().equals(State.PRE)) { + AntiObbyTrap antiObbyTrap; + label55: { + WorldClient world = this.mc.theWorld; + double doubleVal = event.getX(); + double doubleVal2 = event.getY() + 1.0; + BlockPos pos = new BlockPos(doubleVal, doubleVal2, event.getZ()); + IBlockState blockState = world.getBlockState(pos); + block2 = blockState.getBlock(); + if (block2 != Blocks.obsidian) { + WorldClient world2 = this.mc.theWorld; + doubleVal = event.getX(); + doubleVal2 = event.getY() + 1.0; + pos = new BlockPos(doubleVal, doubleVal2, event.getZ()); + IBlockState blockState2 = world2.getBlockState(pos); + block2 = blockState2.getBlock(); + + if (block2 != Blocks.cobblestone) { + antiObbyTrap = this; + + WorldClient world3 = this.mc.theWorld; + doubleVal = event.getX(); + doubleVal2 = event.getY() + 2.0; + pos = new BlockPos(doubleVal, doubleVal2, event.getZ()); + IBlockState blockState3 = world3.getBlockState(pos); + if (!(blockState3.getBlock() instanceof BlockFurnace)) { + break label55; + } + } + } + + event.setPitch(90.0F); + WorldClient world4 = this.mc.theWorld; + doubleVal = event.getX(); + doubleVal2 = event.getY() - 1.0; + pos = new BlockPos(doubleVal, doubleVal2, event.getZ()); + IBlockState blockState4 = world4.getBlockState(pos); + block2 = blockState4.getBlock(); + + label38: { + Block block3 = block2; + double doubleVal3 = event.getX(); + doubleVal = event.getY() - 1.0; + BlockPos pos2 = new BlockPos(doubleVal3, doubleVal, event.getZ()); + if (this.cachedAngle == 0.0F) { + this.stateFlag = true; + this.sendPacket(new C07PacketPlayerDigging(C07PacketPlayerDigging$Action.START_DESTROY_BLOCK, pos2, EnumFacing.UP)); + } + + EntityPlayerSP player = this.mc.thePlayer; + player.selectBestTool(pos2); + this.sendPacket(new C0APacketAnimation()); + float floatVal = this.cachedAngle; + EntityPlayerSP player2 = this.mc.thePlayer; + WorldClient world6 = this.mc.theWorld; + this.cachedAngle = floatVal + block3.getPlayerRelativeBlockHardness(player2, world6, pos2); + WorldClient world5 = this.mc.theWorld; + EntityPlayerSP player3 = this.mc.thePlayer; + int intVal = player3.getEntityId(); + int intVal2 = (int)(this.cachedAngle * 10.0F) - 1; + world5.sendBlockBreakProgress(intVal, pos2, intVal2); + antiObbyTrap = this; + + if (this.cachedAngle < 1.0F) { + break label38; + } + + this.sendPacket(new C07PacketPlayerDigging(C07PacketPlayerDigging$Action.STOP_DESTROY_BLOCK, pos2, EnumFacing.UP)); + PlayerControllerMP controller = this.mc.playerController; + EnumFacing facing = EnumFacing.UP; + controller.updateState(pos2, facing); + this.cachedAngle = 0.0F; + antiObbyTrap = this; + + antiObbyTrap.stateFlag = false; + } + + return; + } + + this.cachedAngle = 0.0F; + antiObbyTrap = this; + + antiObbyTrap.stateFlag = false; + } +} +} diff --git a/src/main/java/cc/novoline/modules/player/AntiVoid.java b/src/main/java/cc/novoline/modules/player/AntiVoid.java new file mode 100644 index 0000000..091df34 --- /dev/null +++ b/src/main/java/cc/novoline/modules/player/AntiVoid.java @@ -0,0 +1,197 @@ +package cc.novoline.modules.player; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.ModuleRegistry; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Consumer; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.network.Packet; + +public final class AntiVoid extends AbstractModule { + private double cachedValue; + private List packetList; + private double cachedValue2; + private double cachedValue3; + private double cachedValue4; + @Property("mode") + private StringProperty mode; + private boolean stateFlag; + @Property("fall-dist") + private final IntProperty fallDist; + @Property("void-check") + private final BooleanProperty voidCheck; + + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) {} + + + public AntiVoid(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + StringProperty strProp = StringProperty.of("Basic"); + String[] stringArr = new String[]{"Basic", "Blink"}; + this.mode = strProp.acceptableValues(stringArr); + this.fallDist = IntProperty.of(20).minimum(5).maximum(50); + this.voidCheck = BooleanProperty.of(true); + this.packetList = new ArrayList<>(); + Setting setting = new Setting("AV_MODE", "Mode", SettingType.COMBOBOX, this, this.mode); + SettingManager.register(setting); + setting = new Setting("AV_FALL_DISTANCE", "Fall Distance", SettingType.SLIDER, this, this.fallDist, 1.0); + SettingManager.register(setting); + setting = new Setting("AV_VOID_CHECK", "Void Check", SettingType.CHECKBOX, this, this.voidCheck, () -> this.mode.equals("Basic")); + SettingManager.register(setting); +} + + + @EventTarget + public void onPacket(PacketEvent event) { + java.util.List packetList2; + PacketEvent packetEvent = event; + if (event.getState() != State.OUTGOING) { + return; + } + + packetEvent = event; + + Packet packet = packetEvent.getPacket(); + if (!(packet instanceof C03PacketPlayer)) { + return; + } + + packet = event.getPacket(); + + C03PacketPlayer playerPacket = (C03PacketPlayer)packet; + StringProperty strProp = this.mode; + byte byteVal = (byte)(strProp.equals("Basic") ? 1 : 0); + if (byteVal != 0) { + byte byteVal2 = (byte)(playerPacket.isMoving() ? 1 : 0); + if (byteVal2 == 0) { + return; + } + + float distanceF = this.mc.thePlayer.fallDistance; + IntProperty intProp = this.fallDist; + Integer intVal = intProp.get(); + if (distanceF <= intVal.intValue()) { + return; + } + + BooleanProperty boolProp = this.voidCheck; + Boolean propFlag = boolProp.get(); + byteVal2 = (byte)(propFlag ? 1 : 0); + + label59: { + if (byteVal2 == 0) { + break label59; + } + + EntityPlayerSP player = this.mc.thePlayer; + byteVal2 = (byte)(player.isConditionMet13() ? 1 : 0); + + if (byteVal2 != 0) { + return; + } + } + + playerPacket.setPositionY(playerPacket.getPositionY() + this.mc.thePlayer.fallDistance); + return; + } + + ModuleRegistry modEntry = ModuleRegistry.SCAFFOLD; + byteVal = (byte)(modEntry.getModule().isEnabled() ? 1 : 0); + + if (byteVal != 0) { + return; + } + + ModuleRegistry modEntry2 = ModuleRegistry.LONGJUMP; + byteVal = (byte)(modEntry2.getModule().isEnabled() ? 1 : 0); + + if (byteVal != 0) { + return; + } + + byteVal = (byte)(this.mc.thePlayer.onGround ? 1 : 0); + + if (byteVal != 0) { + this.cachedValue = this.mc.thePlayer.posX; + this.cachedValue4 = this.mc.thePlayer.posY; + this.cachedValue3 = this.mc.thePlayer.posZ; + } + + if (this.mc.thePlayer.motionY < -0.0785) { + EntityPlayerSP player2 = this.mc.thePlayer; + byteVal = (byte)(player2.isConditionMet13() ? 1 : 0); + + if (byteVal == 0) { + List itemList = this.packetList; + Packet packet2 = event.getPacket(); + itemList.add(packet2); + event.setCancelled(true); + EntityPlayerSP player3 = this.mc.thePlayer; + + float distanceF2 = this.mc.thePlayer.fallDistance; + IntProperty intProp2 = this.fallDist; + Integer intVal2 = intProp2.get(); + if (!(distanceF2 > intVal2.intValue())) { + return; + } + + player3 = this.mc.thePlayer; + + + double doubleVal = this.cachedValue; + double doubleVal2 = this.cachedValue4; + double doubleVal3 = this.cachedValue3; + player3.setPosition(doubleVal, doubleVal2, doubleVal3); + List itemList2 = this.packetList; + itemList2.clear(); + return; + } + } + + packetList2 = this.packetList; + + byteVal = (byte)(packetList2.isEmpty() ? 1 : 0); + + if (byteVal != 0) { + return; + } + + List itemList3 = this.packetList; + Consumer> consumer = this::applyInt5; + itemList3.forEach(consumer); + packetList2 = this.packetList; + + packetList2.clear(); +} + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + this.handleString3(this.mode.get()); +} + + + @Override + public void onEnable() { + this.handleString3(this.mode.get()); +} + +} diff --git a/src/main/java/cc/novoline/modules/player/AutoArmor.java b/src/main/java/cc/novoline/modules/player/AutoArmor.java new file mode 100644 index 0000000..f50a7a2 --- /dev/null +++ b/src/main/java/cc/novoline/modules/player/AutoArmor.java @@ -0,0 +1,452 @@ +package cc.novoline.modules.player; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.HypixelLobbyType; +import cc.novoline.utils.ServerUtils; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.SettingEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.exploits.Disabler; +import cc.novoline.modules.ModuleRegistry; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.client.renderer.InventoryEffectRendererSupport; + +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class AutoArmor extends AbstractModule { + @Property("no-move") + private final BooleanProperty noMove; + @Property("open-inventory") + private final BooleanProperty openInventory; + private final TimerUtil timer; + @Property("equip-delay") + private final IntProperty equipDelay; + + public int getIntValue2() { + Integer intVal = this.equipDelay.get(); + return intVal; +} + + public TimerUtil getXHC() { + return this.timer; +} + + boolean matchesItemStack(@NonNull ItemStack stack, int value) { + boolean flag; + String textStr3 = ChestStealer.getFlowMarker(); + String textStr = ""; + String textStr2 = textStr3; + int intVal = value; + if (textStr2 == null) { + switch (value) { + case 1: + textStr = "helmet"; + if (textStr2 == null) { + break; + } + case 2: + textStr = "chestplate"; + if (textStr2 == null) { + break; + } + case 3: + textStr = "leggings"; + if (textStr2 == null) { + break; + } + case 4: + textStr = "boots"; + } + + textStr3 = stack.getUnlocalizedName(); + intVal = (textStr3.contains(textStr) ? 1 : 0); + } + + if (textStr2 == null) { + if (intVal != 0) { + float floatVal = this.computeFloat(stack); + int intVal2 = 5; + + while (true) { + if (intVal2 < 45) { + label72: { + Container container = this.mc.thePlayer.inventoryContainer; + Slot slot = container.getSlot(intVal2); + flag = slot.getHasStack(); + if (textStr2 != null) { + break; + } + + if (!flag) { + break label72; + } + + Container container2 = this.mc.thePlayer.inventoryContainer; + slot = container2.getSlot(intVal2); + + ItemStack stack2 = slot.getStack(); + + if (this.computeFloat(stack2) > floatVal) { + textStr3 = stack2.getUnlocalizedName(); + boolean flag2 = textStr3.contains(textStr); + + if (flag2) { + return false; + } + } + } + + intVal2++; + + continue; + } + + flag = true; + break; + } + + return flag; + } + + intVal = 0; + } + + return ((intVal & 1) != 0); +} + + + public AutoArmor(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.timer = new TimerUtil(); + IntProperty intProp = IntProperty.of(3); + Integer intVal = 1; + IntProperty intProp2 = intProp.minimum(intVal); + this.equipDelay = intProp2.maximum(10); + this.openInventory = BooleanProperty.of(false); + this.noMove = BooleanProperty.of(false); + Setting setting = new Setting("AA_EQUIP_DELAY", "Delay", SettingType.SLIDER, this, this.equipDelay, 1.0); + SettingManager.register(setting); + setting = new Setting("AA_OPEN_INV", "Open Inventory", SettingType.CHECKBOX, this, this.openInventory); + SettingManager.register(setting); + setting = new Setting("AA_NO_MOVE", "No Moving", SettingType.CHECKBOX, this, this.noMove); + SettingManager.register(setting); +} + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + cc.novoline.modules.player.AutoArmor autoArmor; + TimerUtil timerUtil; + String textStr = ChestStealer.getFlowMarker(); + byte byteVal = (byte)(event.getState().equals(State.PRE) ? 1 : 0); + if ((byteVal == 0)) { + return; + } + + HypixelLobbyType lobbyType = HypixelLobbyType.PRE; + byteVal = (byte)(ServerUtils.serverIs(lobbyType) ? 1 : 0); + + if ((byteVal != 0)) { + return; + } + + HypixelLobbyType lobbyType2 = HypixelLobbyType.LOBBY; + byteVal = (byte)(ServerUtils.serverIs(lobbyType2) ? 1 : 0); + + if ((byteVal != 0)) { + return; + } + + BooleanProperty boolProp = this.noMove; + Boolean propFlag = boolProp.get(); + byteVal = (byte)(propFlag ? 1 : 0); + + label167: { + { + if ((byteVal != 0)) { + EntityPlayerSP player2 = this.mc.thePlayer; + byteVal = (byte)(player2.isMoving() ? 1 : 0); + + if ((byteVal != 0)) { + return; + } + } + + autoArmor = this; + + BooleanProperty boolProp2 = this.openInventory; + Boolean propFlag2 = boolProp2.get(); + byteVal = (byte)(propFlag2 ? 1 : 0); + + if ((byteVal != 0)) { + if (!(this.mc.currentScreen instanceof InventoryEffectRendererSupport)) { + return; + } + break label167; + } + + autoArmor = this; + } + + GuiScreen guiScreen = autoArmor.mc.currentScreen; + if (autoArmor.mc.currentScreen == null) { + break label167; + } + + guiScreen = this.mc.currentScreen; + + byteVal = (byte)(guiScreen instanceof InventoryEffectRendererSupport ? 1 : 0); + + if (byteVal == 0) { + byteVal = (byte)(this.mc.currentScreen instanceof GuiChat ? 1 : 0); + + if (byteVal == 0) { + return; + } + } + } + + byteVal = 1; + + int intVal6 = byteVal; + + do { + int intVal = intVal6; + + label114: + while (true) { + if (intVal >= 5) { + return; + } + + Container container = this.mc.thePlayer.inventoryContainer; + int intVal7 = 4 + intVal6; + Slot slot = container.getSlot(intVal7); + byteVal = (byte)(slot.getHasStack() ? 1 : 0); + + if (byteVal != 0) { + Container container2 = this.mc.thePlayer.inventoryContainer; + intVal7 = 4 + intVal6; + Slot slot2 = container2.getSlot(intVal7); + ItemStack stack = slot2.getStack(); + byteVal = (byte)(this.matchesItemStack(stack, intVal6) ? 1 : 0); + if (byteVal != 0) { + break; + } + + TimerUtil timerUtil2 = this.timer; + IntProperty intProp = this.equipDelay; + Integer intVal2 = intProp.get(); + long longVal = intVal2 * 50; + byteVal = (byte)(timerUtil2.delay(longVal) ? 1 : 0); + + if (byteVal != 0) { + EntityPlayerSP player3 = this.mc.thePlayer; + intVal7 = 4 + intVal6; + player3.dropSlot(intVal7); + TimerUtil timerUtil3 = this.timer; + timerUtil3.reset(); + } + } + + byteVal = 9; + + int intVal3 = byteVal; + + while (true) { + if (intVal3 >= 45) { + break label114; + } + + label175: { + Container container3 = this.mc.thePlayer.inventoryContainer; + Slot slot3 = container3.getSlot(intVal3); + intVal = (slot3.getHasStack() ? 1 : 0); + + if (intVal == 0) { + break label175; + } + + Container container4 = this.mc.thePlayer.inventoryContainer; + slot3 = container4.getSlot(intVal3); + + ItemStack stack2 = slot3.getStack(); + + label101: + if (this.matchesItemStack(stack2, intVal6)) { + float floatVal; + int intVal4 = (floatVal = this.computeFloat(stack2) - 0.0F) == 0.0F ? 0 : (floatVal < 0.0F ? -1 : 1); + if (intVal4 <= 0) { + break label101; + } + + timerUtil = this.timer; + + IntProperty intProp2 = this.equipDelay; + Integer intVal5 = intProp2.get(); + long longVal2 = intVal5 * 50; + intVal4 = (timerUtil.delay(longVal2) ? 1 : 0); + + if (intVal4 == 0) { + break label101; + } + + EntityPlayerSP player4 = this.mc.thePlayer; + player4.shiftClick(intVal3); + timerUtil = this.timer; + + timerUtil.reset(); + } + } + + intVal3++; + + } + } + + intVal6++; + } while (textStr == null); +} + + + public IntProperty getEquipDelay() { + return this.equipDelay; +} + + public IntProperty getIntPropertyE() { + return this.getEquipDelay(); +} + + public BooleanProperty getOpenInventory() { + return this.openInventory; +} + + public BooleanProperty getBooleanProperty() { + return this.getOpenInventory(); +} + + private void performStep15() { + Disabler disabler; + boolean enabled2; + disabler = ModuleRegistry.DISABLER.getModule(); + enabled2 = disabler.isEnabled(); + + if (enabled2) { + enabled2 = disabler.isFlagK(); + + if (enabled2) { + return; + } + } + + BooleanProperty boolProp = this.noMove; + Boolean propFlag = boolProp.get(); + enabled2 = propFlag; + + + if (enabled2) { + return; + } + + enabled2 = disabler.isEnabled(); + + + label20: { + if (!enabled2) { + this.popNotification(this.getTextValue2(), "No Moving keept enabled for your safety, enable Disabler module to bypass inventory moving click", 5000, NotificationType.WARNING); + break label20; + } + + this.popNotification(this.getTextValue2(), "No Moving keept enabled for your safety, enable Inventory Click Bypass feature in Disabler to bypass inventory move click", 5000, NotificationType.WARNING); + } + + BooleanProperty boolProp2 = this.noMove; + Boolean flag = true; + boolProp2.set(flag); +} + + public void handleSettingEvent(SettingEvent event) { + label27: { + SettingEvent settingEvent = event; + if (event == null) { + break label27; + } + + settingEvent = event; + + boolean flag = settingEvent.getSettingName().equals("AA_NO_MOVE"); + if (flag) { + break label27; + } + + flag = event.getSettingName().equals("DISABLER_CLICK_BYPASS_ENABLED"); + + if (!flag) { + return; + } + } + + this.performStep15(); +} + + public BooleanProperty getNoMove() { + return this.noMove; +} + + public BooleanProperty getBooleanPropertyF() { + return this.getNoMove(); +} + + + private float computeFloat(@NonNull ItemStack stack) { + float floatVal = 0.0F; + Item item = stack.getItem(); + if (!(item instanceof ItemArmor)) { + return floatVal; + } + + item = stack.getItem(); + + ItemArmor armorItem = (ItemArmor)item; + double doubleVal = floatVal; + double doubleVal7 = armorItem.damageReduceAmount; + int intVal6 = 100 - armorItem.damageReduceAmount; + int intVal7 = Enchantment.protection.effectId; + floatVal = (float)(doubleVal + (doubleVal7 + intVal6 * ChestStealerSupport.getEnchantmentLevel(intVal7, stack) * 0.0075)); + double doubleVal2 = floatVal; + int intVal = Enchantment.blastProtection.effectId; + floatVal = (float)(doubleVal2 + ChestStealerSupport.getEnchantmentLevel(intVal, stack) / 100.0); + double doubleVal3 = floatVal; + int intVal2 = Enchantment.fireProtection.effectId; + floatVal = (float)(doubleVal3 + ChestStealerSupport.getEnchantmentLevel(intVal2, stack) / 100.0); + double doubleVal4 = floatVal; + int intVal3 = Enchantment.thorns.effectId; + floatVal = (float)(doubleVal4 + ChestStealerSupport.getEnchantmentLevel(intVal3, stack) / 100.0); + double doubleVal5 = floatVal; + int intVal4 = Enchantment.unbreaking.effectId; + floatVal = (float)(doubleVal5 + ChestStealerSupport.getEnchantmentLevel(intVal4, stack) / 50.0); + double doubleVal6 = floatVal; + int intVal5 = Enchantment.projectileProtection.effectId; + return (float)(doubleVal6 + ChestStealerSupport.getEnchantmentLevel(intVal5, stack) / 100.0); +} + +} diff --git a/src/main/java/cc/novoline/modules/player/BedBreaker.java b/src/main/java/cc/novoline/modules/player/BedBreaker.java new file mode 100644 index 0000000..ca86253 --- /dev/null +++ b/src/main/java/cc/novoline/modules/player/BedBreaker.java @@ -0,0 +1,555 @@ +package cc.novoline.modules.player; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.TimerUtil; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.render.RotationAngleUtil; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.PlayerUpdateEvent; +import cc.novoline.events.events.Render3DEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import com.google.common.collect.Lists; +import cc.novoline.modules.ModuleRegistry; +import java.awt.Color; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.function.Predicate; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import net.minecraft.network.play.server.S22PacketMultiBlockChangePacketHandler; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.server.S22PacketMultiBlockChange; +import net.minecraft.client.multiplayer.PlayerControllerMP; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C07PacketPlayerDigging$Action; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; + +public class BedBreaker extends AbstractModule { + private BlockPos targetPos; + private boolean stateFlag; + private List blockPosList; + @Property("esp") + private BooleanProperty esp; + @Property("mode") + private StringProperty mode; + private List blockPosList2; + private float cachedAngle; + @Property("range") + private DoubleProperty range; + private TimerUtil timer; + + private MovingObjectPosition resolveMovingObjectPosition(float[] floatArray) { + double posX2 = this.mc.thePlayer.posX; + double posY2 = this.mc.thePlayer.posY; + EntityPlayerSP player = this.mc.thePlayer; + Vec3 vec = new Vec3(posX2, posY2 + player.getEyeHeight(), this.mc.thePlayer.posZ); + Vec3 vec2 = RotationAngleUtil.getVectorForRotation(floatArray[1], floatArray[0]); + double posX3 = vec2.xCoord * 5.0; + posX2 = vec2.yCoord * 5.0; + posY2 = vec2.zCoord * 5.0; + Vec3 vec3 = vec.addVector(posX3, posX2, posY2); + return this.mc.theWorld.rayTraceBlocks(vec, vec3, false, false, false); +} + + @EventTarget + public void onPacket(PacketEvent event) { + Object obj; + PacketEvent packetEvent = event; + if (event.getState() != State.INCOMING) { + return; + } + + packetEvent = event; + + { + boolean flag = packetEvent.getPacket() instanceof S22PacketMultiBlockChange; + if (flag) { + S22PacketMultiBlockChange multiBlockChangePacket = (S22PacketMultiBlockChange)event.getPacket(); + S22PacketMultiBlockChangePacketHandler[] s22PacketMultiBlockChangePacketHandlerArr = multiBlockChangePacket.obtainS22PacketMultiBlockChangePacketHandlerArray(); + int len = s22PacketMultiBlockChangePacketHandlerArr.length; + int intVal = 0; + + while (intVal < len) { + S22PacketMultiBlockChangePacketHandler multiBlockChangePacketHandlerPacket = s22PacketMultiBlockChangePacketHandlerArr[intVal]; + + if (multiBlockChangePacketHandlerPacket.obtainBlockPos().equals(this.targetPos)) { + IBlockState blockState = multiBlockChangePacketHandlerPacket.obtainBlockState(); + if (blockState.getBlock() == Blocks.air) { + this.targetPos = null; + this.stateFlag = true; + } + } + + intVal++; + + } + + return; + } + + obj = event.getPacket(); + + flag = obj instanceof S23PacketBlockChange; + + if (!flag) { + return; + } + + obj = event.getPacket(); + } + + S23PacketBlockChange blockChangePacket = (S23PacketBlockChange)obj; + S23PacketBlockChange blockChangePacket2 = blockChangePacket; + if (!blockChangePacket.getBlockPosition().equals(this.targetPos)) { + return; + } + + blockChangePacket2 = blockChangePacket; + + IBlockState blockState2 = blockChangePacket2.getBlockState(); + if (blockState2.getBlock() == Blocks.air) { + this.targetPos = null; + this.stateFlag = true; + } +} + + + private List resolveList(BlockPos pos, BedCheckMode bedCheckMode) { + ArrayList itemList = Lists.newArrayList(); + BlockPos pos2 = pos.add(0, 0, 1); + itemList.add(pos2); + pos2 = pos.add(1, 0, 0); + itemList.add(pos2); + pos2 = pos.add(0, 1, 0); + itemList.add(pos2); + pos2 = pos.add(0, 0, -1); + itemList.add(pos2); + pos2 = pos.add(-1, 0, 0); + itemList.add(pos2); + if (bedCheckMode == BedCheckMode.AIR_BLOCK) { + Predicate predicate = (BlockPos blockPos2) -> this.resolveBlock(blockPos2) == Blocks.bed; + itemList.removeIf(predicate); + return itemList; + } + + Predicate predicate2 = (BlockPos blockPos3) -> this.resolveBlock(blockPos3) != Blocks.bed; + itemList.removeIf(predicate2); + + return itemList; +} + + private boolean applyInt5(List list) { + Stream stream2 = list.stream(); + Predicate predicate = (BlockPos pos) -> this.resolveBlock(pos) == Blocks.air; + return stream2.anyMatch(predicate); +} + + private List resolveList2(List list, List listIn) { + list.removeAll(listIn); + return list; +} + + public List getBlockPosList2() { + return this.blockPosList2; +} + + private Block resolveBlock(BlockPos pos) { + IBlockState blockState = this.mc.theWorld.getBlockState(pos); + return blockState.getBlock(); +} + + + @EventTarget(1) + public void onMotionUpdate(MotionUpdateEvent event) { + int intVal; + cc.novoline.modules.player.BedBreaker bedBreaker; + cc.novoline.modules.player.BedBreaker bedBreaker2; + if (event.getState() == cc.novoline.events.type.State.PRE) { + List itemList = this.resolveList2(this.blockPosList2, this.blockPosList); + BlockPos pos = this.targetPos; + if (this.targetPos != null) { + pos = this.targetPos; + } else { + label130: { + Object obj = itemList; + if (itemList.isEmpty()) { + pos = null; + break label130; + } + + List itemList2 = this.resolveList3(itemList); + obj = itemList2.get(0); + + pos = (BlockPos)obj; + } + } + + BlockPos pos2 = pos; + if (pos2 != null) { + EntityPlayerSP player2 = this.mc.thePlayer; + double doubleVal = player2.resolveDouble4(pos2); + Double propDouble = this.range.get(); + double doubleVal2; + intVal = (doubleVal2 = doubleVal - (propDouble + (this.targetPos != null ? 1.0 : 0.0))) == 0.0 ? 0 : (doubleVal2 < 0.0 ? -1 : 1); + + if (intVal < 0) { + EntityPlayerSP player3 = this.mc.thePlayer; + if (player3.resolveDouble3(pos2) < 2.4) { + TimerUtil timerUtil = this.timer; + intVal = (timerUtil.delay(180L) ? 1 : 0); + + if (intVal != 0) { + BedBreaker bedBreaker3 = this; + if (this.targetPos == null) { + StringProperty strProp = this.mode; + boolean flag = strProp.equals("Basic"); + if (flag) { + this.targetPos = pos2; + return; + } + + StringProperty strProp2 = this.mode; + flag = strProp2.equals("Advanced"); + + if (flag) { + this.applyInt5(pos2); + return; + } + + bedBreaker = this; + + StringProperty strProp3 = this.mode; + flag = strProp3.equals("Hypixel"); + + if (!flag) { + return; + } + + bedBreaker = this; + + bedBreaker.handleBlockPos(pos2); + return; + } + + bedBreaker3 = this; + + + if (!bedBreaker3.stateFlag) { + return; + } + + bedBreaker3 = this; + + + bedBreaker3.applyMotionUpdateEvent(event, ModuleRegistry.SPEEDMINE.getModule()); + return; + } + } + } + } + + bedBreaker2 = this; + + if (this.cachedAngle > 0.0F) { + this.performStep16(); + } + + bedBreaker2 = this; + + + if (bedBreaker2.targetPos != null) { + this.targetPos = null; + } + + bedBreaker2 = this; + + + bedBreaker2.stateFlag = true; + } +} + + @EventTarget + public void onRender3D(Render3DEvent event) { + BedBreaker bedBreaker = this; + BooleanProperty boolProp = this.esp; + Boolean propFlag = boolProp.get(); + if (!propFlag) { + return; + } + + bedBreaker = this; + + List itemList = bedBreaker.resolveList2(this.resolveList4(this.blockPosList2, this.targetPos), this.blockPosList); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + BlockPos pos = (BlockPos)iter.next(); + int color = Color.WHITE.getRGB(); + RenderUtils.createVector4d(pos, color); + + } + + List itemList2 = this.blockPosList; + iter = itemList2.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + BlockPos pos2 = (BlockPos)iter.next(); + Color awtColor = Color.CYAN; + int color2 = awtColor.getRGB(); + RenderUtils.createVector4d(pos2, color2); + + } + + BlockPos pos3 = this.targetPos; + if (this.targetPos == null) { + return; + } + + pos3 = this.targetPos; + + Color awtColor2 = Color.ORANGE; + int color3 = awtColor2.getRGB(); + RenderUtils.createVector4d(pos3, color3); +} + + @Override + public void onEnable() { + this.stateFlag = true; +} + + @EventTarget + public void onPlayerUpdate(PlayerUpdateEvent event) { + List itemList2 = this.blockPosList2; + Predicate predicate = (BlockPos blockPos4) -> this.resolveBlock(blockPos4) != Blocks.bed; + itemList2.removeIf(predicate); + List itemList = this.blockPosList; + Predicate predicate2 = (BlockPos blockPos5) -> this.resolveBlock(blockPos5) != Blocks.bed; + itemList.removeIf(predicate2); + BedBreaker bedBreaker = this; + if (!(this.mc.thePlayer.fallDistance > 1.8)) { + return; + } + + bedBreaker = this; + + TimerUtil timerUtil = bedBreaker.timer; + timerUtil.reset(); +} + + private void performStep16() { + this.sendPacket(new C07PacketPlayerDigging(C07PacketPlayerDigging$Action.ABORT_DESTROY_BLOCK, this.targetPos, EnumFacing.DOWN)); + WorldClient world = this.mc.theWorld; + int intVal = this.mc.thePlayer.getEntityId(); + world.sendBlockBreakProgress(intVal, this.targetPos, -1); + this.cachedAngle = 0.0F; +} + + private static boolean invokeCallback(BlockPos pos, BlockPos blockPos) { + boolean flag = blockPos.equals(pos); + flag = !flag; + + return flag; +} + + + public List getListValue2() { + return this.blockPosList; +} + + + private void applyMotionUpdateEvent(MotionUpdateEvent event, SpeedMine speedMine) { + cc.novoline.modules.player.BedBreaker bedBreaker; + float floatVal; + int intVal3 = (floatVal = this.cachedAngle - 0.0F) == 0.0F ? 0 : (floatVal < 0.0F ? -1 : 1); + if (intVal3 == 0) { + this.sendPacket(new C07PacketPlayerDigging(C07PacketPlayerDigging$Action.START_DESTROY_BLOCK, this.targetPos, this.resolveEnumFacing2(this.targetPos))); + } + + float floatVal3 = this.cachedAngle; + PlayerControllerMP controller = this.mc.playerController; + BlockPos pos = this.targetPos; + ItemStack stack = this.mc.thePlayer.getHeldItem(); + this.cachedAngle = floatVal3 + controller.updateState(pos, stack); + WorldClient world = this.mc.theWorld; + EntityPlayerSP player2 = this.mc.thePlayer; + int intVal = player2.getEntityId(); + BlockPos pos3 = this.targetPos; + int intVal4 = (int)(this.cachedAngle * 10.0F - 1.0F); + world.sendBlockBreakProgress(intVal, pos3, intVal4); + EntityPlayerSP player3 = this.mc.thePlayer; + player3.executeAction2(); + if (this.cachedAngle + this.mc.playerController.floatState >= 1.0) { + if (this.cachedAngle < 1.0) { + float[] floatArr = RotationAngleUtil.computeFloatArray(this.targetPos); + float floatVal2 = floatArr[0]; + event.setYaw(floatVal2); + floatVal2 = floatArr[1]; + event.setPitch(floatVal2); + intVal3 = (speedMine.checkState18() ? 1 : 0); + + if (intVal3 != 0) { + event.setOnGround(true); + } + } + } + + bedBreaker = this; + + if (this.cachedAngle < 1.0) { + return; + } + + this.sendPacket(new C07PacketPlayerDigging(C07PacketPlayerDigging$Action.STOP_DESTROY_BLOCK, this.targetPos, this.resolveEnumFacing2(this.targetPos))); + WorldClient world2 = this.mc.theWorld; + EntityPlayerSP player4 = this.mc.thePlayer; + int intVal2 = player4.getEntityId(); + BlockPos pos4 = this.targetPos; + world2.sendBlockBreakProgress(intVal2, pos4, -1); + PlayerControllerMP controller2 = this.mc.playerController; + BlockPos pos2 = this.targetPos; + EnumFacing facing = EnumFacing.DOWN; + controller2.updateState(pos2, facing); + this.cachedAngle = 0.0F; + bedBreaker = this; + + bedBreaker.stateFlag = false; +} + + public BedBreaker(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + StringProperty strProp = StringProperty.of("Hypixel"); + String[] stringArr = new String[]{"Basic", "Hypixel", "Advanced"}; + this.mode = strProp.acceptableValues(stringArr); + this.range = DoubleProperty.of(4.5).minimum(3.0).maximum(5.0); + this.esp = BooleanProperty.of(true); + this.blockPosList2 = new ArrayList<>(); + this.blockPosList = new ArrayList<>(); + this.timer = new TimerUtil(); + Setting setting = new Setting("BB_MODE", "Mode", SettingType.COMBOBOX, this, this.mode); + SettingManager.register(setting); + setting = new Setting("BB_RANGE", "Range", SettingType.SLIDER, this, this.range, 0.1); + SettingManager.register(setting); +} + + private Double mapBlockPos(BlockPos pos) { + double doubleVal = this.mc.thePlayer.resolveDouble2(pos); + return doubleVal; +} + + public List resolveList3(List list) { + Stream stream2 = list.stream(); + Comparator comparator = Comparator.comparing(this::mapBlockPos); + stream2 = stream2.sorted(comparator); + Collector collector = Collectors.toList(); + return (java.util.List) stream2.collect(collector); +} + + public float getCachedAngle() { + return this.cachedAngle; +} + + private EnumFacing resolveEnumFacing2(BlockPos pos) { + return Block.resolveEnumFacing(pos); +} + + @Override + public void onDisable() { + BedBreaker bedBreaker = this; + if (this.cachedAngle > 0.0F) { + this.performStep16(); + } + + bedBreaker = this; + + if (bedBreaker.targetPos == null) { + return; + } + + bedBreaker = this; + + bedBreaker.targetPos = null; +} + + private void applyInt5(BlockPos pos) { + MovingObjectPosition rayTrace = this.resolveMovingObjectPosition(RotationAngleUtil.evaluateFloat2(pos)); + if (rayTrace != null) { + this.targetPos = rayTrace.getBlockPos(); + } +} + + private List resolveList4(List list, BlockPos pos) { + Stream stream2 = list.stream(); + Predicate predicate = ((java.util.function.Predicate) (blockPos) -> BedBreaker.invokeCallback(pos, blockPos)); + stream2 = stream2.filter(predicate); + Collector collector = Collectors.toList(); + return (java.util.List) stream2.collect(collector); +} + + private void handleBlockPos(BlockPos pos) { + BedBreaker bedBreaker = this; + if (this.applyInt5(this.resolveList(pos, BedCheckMode.AIR_BLOCK))) { + this.targetPos = pos; + return; + } + + bedBreaker = this; + + Object obj; + label27: { + List itemList = bedBreaker.resolveList(pos, BedCheckMode.BED_PART); + boolean empty = itemList.isEmpty(); + if (empty) { + break label27; + } + + bedBreaker = this; + obj = this.resolveList((BlockPos)itemList.get(0), BedCheckMode.AIR_BLOCK); + + empty = this.applyInt5((List)obj); + + if (empty) { + this.targetPos = (BlockPos)itemList.get(0); + return; + } + } + + bedBreaker = this; + List itemList2 = this.resolveList3(this.resolveList(pos, BedCheckMode.AIR_BLOCK)); + obj = itemList2.get(0); + + bedBreaker.targetPos = (BlockPos)obj; +} + +} diff --git a/src/main/java/cc/novoline/modules/player/BedCheckMode.java b/src/main/java/cc/novoline/modules/player/BedCheckMode.java new file mode 100644 index 0000000..f440e5f --- /dev/null +++ b/src/main/java/cc/novoline/modules/player/BedCheckMode.java @@ -0,0 +1,8 @@ +package cc.novoline.modules.player; + +public enum BedCheckMode { + BED_PART, + AIR_BLOCK; + + private static final BedCheckMode[] bedCheckModeArray = new BedCheckMode[]{BedCheckMode.BED_PART, BedCheckMode.AIR_BLOCK}; +} diff --git a/src/main/java/cc/novoline/modules/player/ChestStealer.java b/src/main/java/cc/novoline/modules/player/ChestStealer.java new file mode 100644 index 0000000..1a29d55 --- /dev/null +++ b/src/main/java/cc/novoline/modules/player/ChestStealer.java @@ -0,0 +1,2244 @@ +package cc.novoline.modules.player; + +import cc.novoline.events.events.DisplayChestGuiEvent; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ArmorPart; +import cc.novoline.utils.HypixelLobbyType; +import cc.novoline.utils.ServerUtils; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.ToolType; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.render.RotationAngleUtil; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.LoadWorldEvent; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.ModuleRegistry; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.ThreadLocalRandom; +import java.util.function.Consumer; +import java.util.function.Predicate; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import net.minecraft.item.ItemIronSword; +import net.minecraft.item.ItemIronAxe; +import net.minecraft.item.ItemImpl; +import net.minecraft.item.ItemIronShovel; +import net.minecraft.item.ItemGlassBottle; +import net.minecraft.item.ItemIronPickaxe; +import cc.novoline.viaversion.ViaSupportUtil; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.gui.inventory.GuiChest; +import net.minecraft.network.play.server.S30PacketWindowItems; +import net.minecraft.client.multiplayer.PlayerControllerMP; + +import net.minecraft.util.MathHelper; + +import net.minecraft.network.play.server.S2DPacketOpenWindow; +import net.minecraft.network.play.client.C0EPacketClickWindow; +import net.minecraft.block.Block; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemBow; +import net.minecraft.item.ItemPotion; +import net.minecraft.item.ItemStack; +import net.minecraft.network.Packet; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.Vec3; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class ChestStealer extends AbstractModule { + private String[] stringArray; + @Property("no-move") + private final BooleanProperty noMove; + private List integerList; + private List packetList; + @Property("silent") + private BooleanProperty silent; + @Property("start-delay") + private final IntProperty startDelay; + @Property("cs-aura") + private final BooleanProperty csAura; + private TimerUtil timer; + @Property("close-delay") + private final IntProperty closeDelay; + private int stateTicks; + private boolean stateFlag; + @Property("rotate-camera") + private final BooleanProperty rotateCamera; + private List stringList; + private int stateTicks2; + private static String N; + @Property("extra-packet") + private final BooleanProperty extraPacket; + private TimerUtil timer2; + @Property("ignore") + private final BooleanProperty ignore; + private TimerUtil timer3; + @Property("delay") + private final IntProperty delay; + private TimerUtil timer4; + @Property("auto-disable") + private final BooleanProperty autoDisable; + @Property("aura-range") + private final DoubleProperty auraRange; + private boolean stateFlag2; + + private static int compareItemStack(ItemStack stack, ItemStack itemStack) { + int intVal = itemStack.getItemDamage(); + int intVal2 = stack.getItemDamage(); + return Integer.compare(intVal, intVal2); +} + + public String applyInt5(ArmorPart armorPart) { + boolean flag = armorPart.equals(ArmorPart.LEGGINS); + if (flag) { + return "leggings"; + } + + flag = armorPart.equals(ArmorPart.CHESTPLATE); + + if (flag) { + return "chestplate"; + } + + flag = armorPart.equals(ArmorPart.BOOTS); + + if (flag) { + return "boots"; + } + + flag = armorPart.equals(ArmorPart.HELMET); + + return flag ? "helmet" : ""; +} + + private float applyUpdate2(@NonNull ItemStack stack) { + float floatVal; + label17: { + floatVal = 0.0F; + Item item = stack.getItem(); + boolean flag = item instanceof ItemImpl; + if (flag) { + floatVal += ((ItemImpl)item).getDamageVsEntity3(); + break label17; + } + + flag = item instanceof ItemIronSword; + + if (flag) { + floatVal += ((ItemIronSword)item).getAttackDamage(); + } + } + + float floatVal2 = ChestStealerSupport.getEnchantmentLevel(Enchantment.sharpness.effectId, stack) * 1.25F; + int intVal = Enchantment.fireAspect.effectId; + return floatVal + (floatVal2 + ChestStealerSupport.getEnchantmentLevel(intVal, stack) * 0.3F); +} + + private boolean invokeCallback(ArmorPart armorPart, ItemStack stack) { + ItemStack stack2 = stack; + if (stack == null) { + return false; + } + + stack2 = stack; + + Item item = stack2.getItem(); + String textStr = item.getUnlocalizedName(); + String textStr2 = this.applyInt5(armorPart); + return textStr.contains(textStr2); +} + + private float[] resolveFloatArray(TileEntity tileEntity) { + BlockPos pos = tileEntity.getPos(); + double doubleVal = pos.getX() + 0.5; + double doubleVal2 = pos.getY() + 0.5; + double doubleVal3 = pos.getZ() + 0.5; + return RotationAngleUtil.buildFloatArray2(doubleVal, doubleVal3, doubleVal2); +} + + @EventTarget + public void onPacket(PacketEvent event) { + Object obj; + String textStr = getFlowMarker(); + boolean flag4 = event.getState().equals(State.INCOMING); + if (!flag4) { + return; + } + + flag4 = event.getPacket() instanceof S2DPacketOpenWindow; + + + if (flag4) { + S2DPacketOpenWindow openWindowPacket = (S2DPacketOpenWindow)event.getPacket(); + ChestStealer stealer = this; + String textStr4 = openWindowPacket.getGuiId(); + StringBuilder sb = new StringBuilder(); + sb = sb.append("minecraft:"); + ViaSupportUtil viaSupport = ViaSupportUtil.getInstance(); + String textStr5 = viaSupport.getStateTicks() > 340 ? "container" : "chest"; + + label159: { + boolean flag = textStr4.equals(sb.append(textStr5).toString()); + this.stateFlag2 = flag; + HypixelLobbyType lobbyType = HypixelLobbyType.LOBBY; + if (!ServerUtils.serverIs(lobbyType)) { + HypixelLobbyType lobbyType2 = HypixelLobbyType.PRE; + if (!ServerUtils.serverIs(lobbyType2)) { + break label159; + } + } + + stealer = this; + flag = false; + + stealer.stateFlag2 = flag; + } + + String[] stringArr = this.stringArray; + int len = stringArr.length; + int intVal = 0; + + while (intVal < len) { + String textStr2 = stringArr[intVal]; + IChatComponent chatComp = openWindowPacket.getWindowTitle(); + String textStr3 = chatComp.getUnformattedText(); + String lowerStr = textStr3.toLowerCase(); + flag4 = lowerStr.contains(textStr2); + + if (flag4) { + this.stateFlag2 = false; + break; + } + + intVal++; + + } + + flag4 = this.stateFlag2; + + if (flag4) { + this.stateTicks = openWindowPacket.getSlotCount(); + this.stateTicks2 = openWindowPacket.getWindowId(); + List itemList = this.integerList; + itemList.clear(); + this.stateFlag = false; + TimerUtil timerUtil = this.timer; + timerUtil.reset(); + TimerUtil timerUtil2 = this.timer2; + timerUtil2.reset(); + } + } + + flag4 = this.stateFlag2; + + + { + if (textStr == null) { + if (!flag4) { + return; + } + + obj = event.getPacket(); + + flag4 = obj instanceof S30PacketWindowItems; + } + + if (!flag4) { + return; + } + + obj = event.getPacket(); + } + + S30PacketWindowItems windowItemsPacket = (S30PacketWindowItems)obj; + int intVal2 = windowItemsPacket.getWindowId(); + + if (intVal2 != this.stateTicks2) { + return; + } + + intVal2 = (this.stateFlag ? 1 : 0); + + + + if (intVal2 != 0) { + return; + } + + intVal2 = 0; + + + int intVal3 = intVal2; + + while (intVal3 < this.stateTicks) { + ItemStack stack = windowItemsPacket.getItemStacks()[intVal3]; + + + if (stack != null) { + BooleanProperty boolProp = this.ignore; + Boolean propFlag = boolProp.get(); + boolean flag2 = propFlag; + label103: { + if (flag2) { + boolean flag3 = this.matchesCondition(stack); + + if (!flag3) { + break label103; + } + + flag3 = this.checkCondition(stack, windowItemsPacket); + + + + if (!flag3) { + break label103; + } + + flag3 = this.matchesItemStack6(stack, windowItemsPacket); + + + + if (!flag3) { + break label103; + } + + flag3 = this.resolveHelper2(stack, windowItemsPacket); + + + + if (!flag3) { + break label103; + } + + flag3 = this.createItemStack(stack, windowItemsPacket); + + + if (!flag3) { + break label103; + } + } + + List itemList2 = this.integerList; + Integer intVal4 = intVal3; + itemList2.add(intVal4); + } + } + + intVal3++; + + + } + + this.stateFlag = true; +} + + private int compareItemStack2(ItemStack stack, ItemStack itemStack) { + float floatVal = this.applyUpdate2(itemStack); + float floatVal2 = this.applyUpdate2(stack); + return Float.compare(floatVal, floatVal2); +} + + public ItemStack resolveItemStack(ArmorPart armorPart) { + boolean flag; + flag = this.resolveHelper2(this.playerContents(), armorPart); + + if (flag) { + flag = this.resolveHelper2(this.chestContents(), armorPart); + + if (flag) { + ItemStack[] stackArr = new ItemStack[2]; + ItemStack[] stackArr2 = this.playerContents(); + Stream stream2 = Arrays.stream(stackArr2); + Predicate predicate = ((java.util.function.Predicate) (itemStack2) -> this.invokeCallback5(armorPart, itemStack2)); + Stream stream3 = stream2.filter(predicate); + Comparator comparator = ((java.util.Comparator) this::compareItemStack3); + Stream stream4 = stream3.sorted(comparator); + Collector collector = Collectors.toList(); + List itemList = (java.util.List) stream4.collect(collector); + Stream stream5 = itemList.stream(); + Optional optional = stream5.findFirst(); + stackArr[0] = (ItemStack)optional.get(); + stackArr2 = this.chestContents(); + Stream stream6 = Arrays.stream(stackArr2); + predicate = ((java.util.function.Predicate) (itemStack3) -> this.invokeCallback3(armorPart, itemStack3)); + Stream stream7 = stream6.filter(predicate); + Comparator comparator2 = ((java.util.Comparator) this::compareItemStack20); + Stream stream8 = stream7.sorted(comparator2); + Collector collector2 = Collectors.toList(); + List itemList2 = (java.util.List) stream8.collect(collector2); + Stream stream9 = itemList2.stream(); + Optional optional2 = stream9.findFirst(); + stackArr[1] = (ItemStack)optional2.get(); + Stream stream10 = Stream.of(stackArr); + Predicate predicate2 = ((java.util.function.Predicate) (itemStack4) -> this.invokeCallback6(armorPart, itemStack4)); + Stream stream11 = stream10.filter(predicate2); + Comparator comparator3 = ((java.util.Comparator) ChestStealer::compareItemStack19); + Stream stream12 = stream11.sorted(comparator3); + Comparator comparator4 = ((java.util.Comparator) this::compareItemStack4); + Stream stream13 = stream12.sorted(comparator4); + Collector collector3 = Collectors.toList(); + List itemList3 = (java.util.List) stream13.collect(collector3); + Stream stream14 = itemList3.stream(); + Optional optional3 = stream14.findFirst(); + return (ItemStack)optional3.get(); + } + } + + flag = this.resolveHelper2(this.playerContents(), armorPart); + + + if (flag) { + ItemStack[] stackArr3 = this.playerContents(); + Stream stream15 = Arrays.stream(stackArr3); + Predicate predicate3 = ((java.util.function.Predicate) (itemStack5) -> this.invokeCallback4(armorPart, itemStack5)); + Stream stream16 = stream15.filter(predicate3); + Comparator comparator5 = ((java.util.Comparator) ChestStealer::compareItemStack10); + Stream stream17 = stream16.sorted(comparator5); + Comparator comparator6 = ((java.util.Comparator) this::compareItemStack12); + Stream stream18 = stream17.sorted(comparator6); + Collector collector4 = Collectors.toList(); + List itemList4 = (java.util.List) stream18.collect(collector4); + Stream stream19 = itemList4.stream(); + Optional optional4 = stream19.findFirst(); + return (ItemStack)optional4.get(); + } + + flag = this.resolveHelper2(this.chestContents(), armorPart); + + + if (!flag) { + return null; + } + + ItemStack[] stackArr4 = this.chestContents(); + Stream stream20 = Arrays.stream(stackArr4); + Predicate predicate4 = ((java.util.function.Predicate) (itemStack6) -> this.invokeCallback2(armorPart, itemStack6)); + Stream stream21 = stream20.filter(predicate4); + Comparator comparator7 = ((java.util.Comparator) ChestStealer::compareItemStack9); + Stream stream22 = stream21.sorted(comparator7); + Comparator comparator8 = ((java.util.Comparator) this::compareItemStack6); + Stream stream23 = stream22.sorted(comparator8); + Collector collector5 = Collectors.toList(); + List itemList5 = (java.util.List) stream23.collect(collector5); + Stream stream24 = itemList5.stream(); + Optional optional5 = stream24.findFirst(); + return (ItemStack)optional5.get(); +} + + public ItemStack createItemStack(ItemStack[] itemStackArray, ToolType toolType) { + boolean flag = this.matchesItemStackArray(itemStackArray, toolType); + if (!flag) { + return null; + } + + flag = toolType.equals(ToolType.PICKAXE); + + if (flag) { + Stream stream = Stream.of(itemStackArray); + Predicate predicate = ChestStealer::matchesItemStack; + Stream stream2 = stream.filter(predicate); + Comparator comparator = ((java.util.Comparator) ChestStealer::compareItemStack16); + Stream stream3 = stream2.sorted(comparator); + Comparator comparator2 = ((java.util.Comparator) this::compareItemStack17); + Optional optional = stream3.min(comparator2); + return (ItemStack)optional.get(); + } + + flag = toolType.equals(ToolType.SHOVEL); + + if (flag) { + Stream stream4 = Stream.of(itemStackArray); + Predicate predicate2 = ChestStealer::matchesItemStack5; + Stream stream5 = stream4.filter(predicate2); + Comparator comparator3 = ((java.util.Comparator) ChestStealer::compareItemStack11); + Stream stream6 = stream5.sorted(comparator3); + Comparator comparator4 = ((java.util.Comparator) this::compareItemStack7); + Optional optional2 = stream6.min(comparator4); + return (ItemStack)optional2.get(); + } + + flag = toolType.equals(ToolType.AXE); + + if (flag) { + Stream stream7 = Stream.of(itemStackArray); + Predicate predicate3 = ChestStealer::matchesItemStack2; + Stream stream8 = stream7.filter(predicate3); + Comparator comparator5 = ((java.util.Comparator) ChestStealer::compareItemStack15); + Stream stream9 = stream8.sorted(comparator5); + Comparator comparator6 = ((java.util.Comparator) this::compareItemStack8); + Optional optional3 = stream9.min(comparator6); + return (ItemStack)optional3.get(); + } else { + return null; + } +} + + private int compareItemStack3(ItemStack stack, ItemStack itemStack) { + float floatVal = this.applyInt5(itemStack); + float floatVal2 = this.applyInt5(stack); + return Float.compare(floatVal, floatVal2); +} + + private int applyInt5(ItemStack[] itemStackArray) { + int intVal = 0; + + while (intVal < itemStackArray.length) { + label37: { + ItemStack stack = itemStackArray[intVal]; + if (stack == null) { + break label37; + } + + stack = itemStackArray[intVal]; + + if (stack.getItem() instanceof ItemBow) { + return intVal; + } + } + + intVal++; + + } + + return -1; +} + + public boolean isStateFlag2() { + return this.stateFlag2; +} + + public boolean applyUpdate3(ItemStack[] itemStackArray) { + int intVal = this.applyUpdate2(itemStackArray); + int intVal2 = intVal; + return intVal >= 0; +} + + public ItemStack createItemStack(ItemStack[] itemStackArray, ArmorPart armorPart) { + Object obj = this; + if (!this.resolveHelper2(itemStackArray, armorPart)) { + return null; + } + + Stream stream2 = Arrays.stream(itemStackArray); + Predicate predicate = ((java.util.function.Predicate) (itemStack2) -> this.invokeCallback(armorPart, itemStack2)); + stream2 = stream2.filter(predicate); + Comparator comparator = ((java.util.Comparator) ChestStealer::compareItemStack18); + stream2 = stream2.sorted(comparator); + Comparator comparator2 = ((java.util.Comparator) this::compareItemStack14); + stream2 = stream2.sorted(comparator2); + Comparator comparator3 = ((java.util.Comparator) ChestStealer::compareItemStack); + stream2 = stream2.sorted(comparator3); + Collector collector = Collectors.toList(); + List itemList = (java.util.List) stream2.collect(collector); + stream2 = itemList.stream(); + Optional optional = stream2.findFirst(); + obj = optional.get(); + + return (ItemStack)obj; +} + + + private int compareItemStack4(ItemStack stack, ItemStack itemStack) { + float floatVal = this.applyInt5(itemStack); + float floatVal2 = this.applyInt5(stack); + return Float.compare(floatVal, floatVal2); +} + + private boolean resolveHelper2(ItemStack stack, S30PacketWindowItems packet) { + cc.novoline.modules.player.ChestStealer stealer; + if (stack.getItem() instanceof ItemIronSword) { + ChestStealer stealer2; + ItemStack stack2 = stack; + if (!stack.equals(this.resolveItemStack2(packet.getItemStacks()))) { + return false; + } + + stealer = this; + stealer2 = this; + + stack2 = this.resolveItemStack2(this.playerContents()); + + if (stack2 == null) { + return true; + } + + stealer = this; + stealer2 = this; + + if (stealer.applyUpdate2(stealer2.resolveItemStack2(packet.getItemStacks())) > this.applyUpdate2(this.resolveItemStack2(this.playerContents()))) { + return true; + } + + return false; + } + + return true; +} + + public ChestStealer(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.stringArray = new String[]{ + "mode", + "delivery", + "menu", + "selector", + "game", + "gui", + "server", + "inventory", + "play", + "teleporter", + "shop", + "melee", + "armor", + "block", + "castle", + "mini", + "warp", + "teleport", + "user", + "team", + "tool", + "sure", + "trade", + "cancel", + "accept", + "soul", + "book", + "recipe", + "profile", + "tele", + "port", + "map", + "kit", + "select", + "lobby", + "vault", + "lock", + "anticheat", + "travel", + "settings", + "user", + "preference", + "compass", + "cake", + "wars", + "buy", + "upgrade", + "ranged", + "potions", + "utility" + }; + this.timer4 = new TimerUtil(); + this.timer3 = new TimerUtil(); + this.timer = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.integerList = new ArrayList<>(); + this.packetList = new ArrayList<>(); + this.stringList = new ArrayList<>(); + this.autoDisable = BooleanProperty.of(true); + IntProperty intProp = IntProperty.of(80); + Integer intVal = 50; + IntProperty intProp2 = intProp.minimum(intVal); + this.delay = intProp2.maximum(200); + this.extraPacket = BooleanProperty.of(false); + this.ignore = BooleanProperty.of(false); + this.noMove = BooleanProperty.of(false); + this.rotateCamera = BooleanProperty.of(false); + this.csAura = BooleanProperty.of(false); + this.auraRange = DoubleProperty.of(4.0).minimum(3.0).maximum(4.5); + IntProperty intProp3 = IntProperty.of(50); + IntProperty intProp4 = intProp3.minimum(0); + this.closeDelay = intProp4.maximum(200); + IntProperty intProp5 = IntProperty.of(50); + IntProperty intProp6 = intProp5.minimum(0); + this.startDelay = intProp6.maximum(200); + this.silent = BooleanProperty.of(false); + Setting setting = new Setting("CS_NO_MOVE", "Stop Moving", SettingType.CHECKBOX, this, this.noMove); + SettingManager.register(setting); + Setting setting2 = new Setting("CS_CAM_MOVE", "Camera Move", SettingType.CHECKBOX, this, this.rotateCamera); + SettingManager.register(setting2); + Setting setting3 = new Setting("CS_IGNORE", "Ignore", SettingType.CHECKBOX, this, this.ignore); + SettingManager.register(setting3); + Setting setting4 = new Setting("CS_SILENT", "Silent", SettingType.CHECKBOX, this, this.silent); + SettingManager.register(setting4); + Setting setting5 = new Setting("CS_EXTRA", "Extra Packet", SettingType.CHECKBOX, this, this.extraPacket); + SettingManager.register(setting5); + Setting setting6 = new Setting("CS_AURA", "Chest Aura", SettingType.CHECKBOX, this, this.csAura); + SettingManager.register(setting6); + Setting setting7 = new Setting("CS_AURA_RANGE", "Aura Range", SettingType.SLIDER, this, this.auraRange, 0.1, this.csAura::get); + SettingManager.register(setting7); + Setting setting8 = new Setting("CS_DELAY", "Delay", SettingType.SLIDER, this, this.delay, 5.0, "ms", this::lambdaImpl$new$0); + SettingManager.register(setting8); + Setting setting9 = new Setting("CS_START_DELAY", "Start Delay", SettingType.SLIDER, this, this.startDelay, 5.0, "ms", this::supplyBoolean); + SettingManager.register(setting9); + Setting setting10 = new Setting("CS_CLOSE_DELAY", "Close Delay", SettingType.SLIDER, this, this.closeDelay, 5.0, "ms", this::supplyBoolean3); + SettingManager.register(setting10); + Setting setting11 = new Setting("CS_AUTO_DISABLE", "Auto Disable", SettingType.CHECKBOX, this, this.autoDisable); + SettingManager.register(setting11); +} + + private int compareItemStack5(ItemStack stack, ItemStack itemStack) { + float floatVal = this.evaluateFloat(itemStack); + float floatVal2 = this.evaluateFloat(stack); + return Float.compare(floatVal, floatVal2); +} + + public boolean resolveHelper2(ItemStack[] itemStackArray, ArmorPart armorPart) { + int intVal = this.computeItemStackArrayInt(itemStackArray, armorPart); + int intVal2 = intVal; + return intVal >= 0; +} + + private int resolveHelper2(ItemStack[] itemStackArray, ToolType toolType) { + String textStr2 = getFlowMarker(); + int intVal = 0; + String textStr = textStr2; + + while (intVal < itemStackArray.length) { + label37: { + ItemStack stack = itemStackArray[intVal]; + if (textStr == null) { + if (stack == null) { + break label37; + } + + stack = itemStackArray[intVal]; + } + + Item item = stack.getItem(); + textStr2 = item.getUnlocalizedName(); + String textStr3 = this.resolveString(toolType); + if (textStr2.contains(textStr3)) { + return intVal; + } + } + + intVal++; + if (textStr != null) { + break; + } + } + + return -1; +} + + private static boolean matchesItemStack(ItemStack stack) { + ItemStack stack2 = stack; + if (stack == null) { + return false; + } + + stack2 = stack; + + return stack2.getItem() instanceof ItemIronPickaxe; +} + + private ItemStack[] chestContents() { + return this.mc.thePlayer.inventory.armorInventory; +} + + public static void handleAction(String text) { + N = text; +} + + private int applyUpdate2(ItemStack[] itemStackArray) { + int intVal = 0; + + while (intVal < itemStackArray.length) { + label37: { + ItemStack stack = itemStackArray[intVal]; + if (stack == null) { + break label37; + } + + stack = itemStackArray[intVal]; + + if (stack.getItem() instanceof ItemIronSword) { + return intVal; + } + } + + intVal++; + + } + + return -1; +} + + private int compareItemStack6(ItemStack stack, ItemStack itemStack) { + float floatVal = this.applyInt5(itemStack); + float floatVal2 = this.applyInt5(stack); + return Float.compare(floatVal, floatVal2); +} + + static { + handleAction((String)null); + } + + private int compareItemStack7(ItemStack stack, ItemStack itemStack) { + float floatVal = this.applyUpdate3(itemStack); + float floatVal2 = this.applyUpdate3(stack); + return Float.compare(floatVal, floatVal2); +} + + private ItemStack[] playerContents() { + return this.mc.thePlayer.inventory.itemStackArray; +} + + @EventTarget + public void handleDisplayChestGuiEvent(DisplayChestGuiEvent event) { + cc.novoline.modules.player.ChestStealer stealer; + String textStr = event.getTextValue(); + StringBuilder sb = new StringBuilder(); + sb = sb.append("minecraft:"); + ViaSupportUtil viaSupport = ViaSupportUtil.getInstance(); + String textStr2 = viaSupport.getStateTicks() > 340 ? "container" : "chest"; + + boolean flag = textStr.equals(sb.append(textStr2).toString()); + if (!flag) { + return; + } + + stealer = this; + + flag = this.shouldRotateCamera(); + + if (!flag) { + return; + } + + stealer = this; + + stealer.mc.mouseHelper.performAction(); +} + + private boolean invokeCallback2(ArmorPart armorPart, ItemStack stack) { + ItemStack stack2 = stack; + if (stack == null) { + return false; + } + + stack2 = stack; + + Item item = stack2.getItem(); + String textStr = item.getUnlocalizedName(); + String textStr2 = this.applyInt5(armorPart); + return textStr.contains(textStr2); +} + + private boolean invokeCallback3(ArmorPart armorPart, ItemStack stack) { + ItemStack stack2 = stack; + if (stack == null) { + return false; + } + + stack2 = stack; + + Item item = stack2.getItem(); + String textStr = item.getUnlocalizedName(); + String textStr2 = this.applyInt5(armorPart); + return textStr.contains(textStr2); +} + + private int compareItemStack8(ItemStack stack, ItemStack itemStack) { + float floatVal = this.applyUpdate3(itemStack); + float floatVal2 = this.applyUpdate3(stack); + return Float.compare(floatVal, floatVal2); +} + + private boolean invokeCallback4(ArmorPart armorPart, ItemStack stack) { + ItemStack stack2 = stack; + if (stack == null) { + return false; + } + + stack2 = stack; + + Item item = stack2.getItem(); + String textStr = item.getUnlocalizedName(); + String textStr2 = this.applyInt5(armorPart); + return textStr.contains(textStr2); +} + + private static int compareItemStack9(ItemStack stack, ItemStack itemStack) { + int intVal = itemStack.getMaxDamage(); + intVal -= itemStack.getItemDamage(); + int intVal2 = stack.getMaxDamage(); + intVal2 -= stack.getItemDamage(); + return Integer.compare(intVal, intVal2); +} + + @EventTarget + public void onMotionUpdate1(MotionUpdateEvent event) { + net.minecraft.client.Minecraft mcClient; + ChestStealer stealer = this; + BooleanProperty boolProp = this.csAura; + Boolean propFlag = boolProp.get(); + if (!propFlag) { + return; + } + + stealer = this; + + WorldClient world = stealer.mc.theWorld; + List itemList = world.obtainList2(); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + TileEntity tileEntity = (TileEntity)iter.next(); + TileEntity tileEntity2 = tileEntity; + if (!(tileEntity instanceof TileEntityChest)) { + continue; + } + + tileEntity2 = tileEntity; + + String textStr; + String textStr2 = tileEntity2.toString(); + textStr = textStr2.replace("net.minecraft.tileentity.TileEntityChest@", ""); + List itemList2 = this.stringList; + if (itemList2.contains(textStr)) { + continue; + } + + mcClient = this.mc; + + EntityPlayerSP player = this.mc.thePlayer; + double doubleVal = player.computeFloat4(tileEntity); + DoubleProperty doubleProp = this.auraRange; + Double propDouble = doubleProp.get(); + if (doubleVal > propDouble) { + continue; + } + + stealer = this; + + mcClient = this.mc; + + if (mcClient.currentScreen != null) { + continue; + } + + stealer = this; + + TimerUtil timerUtil = stealer.timer3; + boolean flag = timerUtil.delay(500L); + if (!flag) { + continue; + } + + flag = event.getState().equals(cc.novoline.events.type.State.PRE); + + if (flag) { + float[] floatArr = this.resolveFloatArray(tileEntity); + float floatVal = floatArr[0]; + event.setYaw(floatVal); + floatVal = floatArr[1]; + event.setPitch(floatVal); + continue; + } + + PlayerControllerMP controller = this.mc.playerController; + EntityPlayerSP player2 = this.mc.thePlayer; + WorldClient world2 = this.mc.theWorld; + ItemStack stack = this.mc.thePlayer.getHeldItem(); + BlockPos pos4 = tileEntity.getPos(); + BlockPos pos = tileEntity.getPos(); + EnumFacing facing = Block.resolveEnumFacing(pos); + BlockPos pos2 = tileEntity.getPos(); + BlockPos pos3 = tileEntity.getPos(); + EnumFacing facing2 = Block.resolveEnumFacing(pos3); + Vec3 vec = MathHelper.resolveInt3(pos2, facing2); + controller.evaluateCondition5(player2, world2, stack, pos4, facing, vec); + List itemList3 = this.stringList; + itemList3.add(textStr); + + TimerUtil timerUtil2 = this.timer3; + timerUtil2.reset(); + } +} + + private float evaluateFloat(ItemStack stack) { + int intVal = Enchantment.power.effectId; + int intVal2 = 1 + ChestStealerSupport.getEnchantmentLevel(intVal, stack); + intVal = Enchantment.flame.effectId; + intVal2 += ChestStealerSupport.getEnchantmentLevel(intVal, stack); + intVal = Enchantment.infinity.effectId; + return intVal2 + ChestStealerSupport.getEnchantmentLevel(intVal, stack); +} + + private Boolean supplyBoolean() { + Boolean propFlag = this.extraPacket.get(); + boolean flag = propFlag; + flag = !flag; + + return flag; +} + + public String resolveString(ToolType toolType) { + boolean flag = toolType.equals(ToolType.AXE); + if (flag) { + return "hatchet"; + } + + flag = toolType.equals(ToolType.PICKAXE); + + if (flag) { + return "pickaxe"; + } + + flag = toolType.equals(ToolType.SHOVEL); + + return flag ? "shovel" : ""; +} + + public List getStringList() { + return this.stringList; +} + + + private static int compareItemStack10(ItemStack stack, ItemStack itemStack) { + int intVal = itemStack.getMaxDamage(); + intVal -= itemStack.getItemDamage(); + int intVal2 = stack.getMaxDamage(); + intVal2 -= stack.getItemDamage(); + return Integer.compare(intVal, intVal2); +} + + private static int compareItemStack11(ItemStack stack, ItemStack itemStack) { + int intVal = itemStack.getMaxDamage(); + intVal -= itemStack.getItemDamage(); + int intVal2 = stack.getMaxDamage(); + intVal2 -= stack.getItemDamage(); + return Integer.compare(intVal, intVal2); +} + + private boolean invokeCallback5(ArmorPart armorPart, ItemStack stack) { + ItemStack stack2 = stack; + if (stack == null) { + return false; + } + + stack2 = stack; + + Item item = stack2.getItem(); + String textStr = item.getUnlocalizedName(); + String textStr2 = this.applyInt5(armorPart); + return textStr.contains(textStr2); +} + + private static boolean matchesItemStack2(ItemStack stack) { + ItemStack stack2 = stack; + if (stack == null) { + return false; + } + + stack2 = stack; + + return stack2.getItem() instanceof ItemIronAxe; +} + + private int compareItemStack12(ItemStack stack, ItemStack itemStack) { + float floatVal = this.applyInt5(itemStack); + float floatVal2 = this.applyInt5(stack); + return Float.compare(floatVal, floatVal2); +} + + private static int compareItemStack13(ItemStack stack, ItemStack itemStack) { + int intVal = itemStack.getMaxDamage(); + intVal -= itemStack.getItemDamage(); + int intVal2 = stack.getMaxDamage(); + intVal2 -= stack.getItemDamage(); + return Integer.compare(intVal, intVal2); +} + + private int compareItemStack14(ItemStack stack, ItemStack itemStack) { + float floatVal = this.applyInt5(itemStack); + float floatVal2 = this.applyInt5(stack); + return Float.compare(floatVal, floatVal2); +} + + private float applyInt5(@NonNull ItemStack stack) { + float floatVal = 0.0F; + Item item = stack.getItem(); + if (!(item instanceof ItemArmor)) { + return floatVal; + } + + item = stack.getItem(); + + ItemArmor armorItem = (ItemArmor)item; + double doubleVal = floatVal; + double doubleVal7 = armorItem.damageReduceAmount; + int intVal6 = 100 - armorItem.damageReduceAmount; + int intVal7 = Enchantment.protection.effectId; + floatVal = (float)(doubleVal + (doubleVal7 + intVal6 * ChestStealerSupport.getEnchantmentLevel(intVal7, stack) * 0.0075)); + double doubleVal2 = floatVal; + int intVal = Enchantment.blastProtection.effectId; + floatVal = (float)(doubleVal2 + ChestStealerSupport.getEnchantmentLevel(intVal, stack) / 100.0); + double doubleVal3 = floatVal; + int intVal2 = Enchantment.fireProtection.effectId; + floatVal = (float)(doubleVal3 + ChestStealerSupport.getEnchantmentLevel(intVal2, stack) / 100.0); + double doubleVal4 = floatVal; + int intVal3 = Enchantment.thorns.effectId; + floatVal = (float)(doubleVal4 + ChestStealerSupport.getEnchantmentLevel(intVal3, stack) / 100.0); + double doubleVal5 = floatVal; + int intVal4 = Enchantment.unbreaking.effectId; + floatVal = (float)(doubleVal5 + ChestStealerSupport.getEnchantmentLevel(intVal4, stack) / 50.0); + double doubleVal6 = floatVal; + int intVal5 = Enchantment.projectileProtection.effectId; + return (float)(doubleVal6 + ChestStealerSupport.getEnchantmentLevel(intVal5, stack) / 100.0); +} + + private static boolean matchesItemStack3(ItemStack stack) { + ItemStack stack2 = stack; + if (stack == null) { + return false; + } + + stack2 = stack; + + return stack2.getItem() instanceof ItemIronSword; +} + + private int computeItemStackArrayInt(ItemStack[] itemStackArray, ArmorPart armorPart) { + String textStr2 = getFlowMarker(); + int intVal = 0; + String textStr = textStr2; + + while (intVal < itemStackArray.length) { + label37: { + ItemStack stack = itemStackArray[intVal]; + if (textStr == null) { + if (stack == null) { + break label37; + } + + stack = itemStackArray[intVal]; + } + + Item item = stack.getItem(); + textStr2 = item.getUnlocalizedName(); + String textStr3 = this.applyInt5(armorPart); + if (textStr2.contains(textStr3)) { + return intVal; + } + } + + intVal++; + if (textStr != null) { + break; + } + } + + return -1; +} + + private static int compareItemStack15(ItemStack stack, ItemStack itemStack) { + int intVal = itemStack.getMaxDamage(); + intVal -= itemStack.getItemDamage(); + int intVal2 = stack.getMaxDamage(); + intVal2 -= stack.getItemDamage(); + return Integer.compare(intVal, intVal2); +} + + private static boolean matchesItemStack4(ItemStack stack) { + ItemStack stack2 = stack; + if (stack == null) { + return false; + } + + stack2 = stack; + + return stack2.getItem() instanceof ItemBow; +} + + private static int compareItemStack16(ItemStack stack, ItemStack itemStack) { + int intVal = itemStack.getMaxDamage(); + intVal -= itemStack.getItemDamage(); + int intVal2 = stack.getMaxDamage(); + intVal2 -= stack.getItemDamage(); + return Integer.compare(intVal, intVal2); +} + + private static boolean matchesItemStack5(ItemStack stack) { + ItemStack stack2 = stack; + if (stack == null) { + return false; + } + + stack2 = stack; + + return stack2.getItem() instanceof ItemIronShovel; +} + + public boolean isReadyState13() { + boolean enabled = this.isEnabled(); + if (!enabled) { + return false; + } + + BooleanProperty boolProp = this.noMove; + Boolean propFlag = boolProp.get(); + enabled = propFlag; + + if (!enabled) { + return false; + } + + enabled = this.mc.currentScreen instanceof GuiChest; + + return enabled; +} + + private int compareItemStack17(ItemStack stack, ItemStack itemStack) { + float floatVal = this.applyUpdate3(itemStack); + float floatVal2 = this.applyUpdate3(stack); + return Float.compare(floatVal, floatVal2); +} + + private float applyUpdate3(@NonNull ItemStack stack) { + String textStr3 = getFlowMarker(); + Item item = stack.getItem(); + String textStr = textStr3; + Item item2 = item; + if (textStr == null) { + if (!(item instanceof ItemImpl)) { + return 0.0F; + } + + item2 = item; + } + + float floatVal; + label64: { + String textStr2 = item2.getUnlocalizedName(); + ItemImpl itemImpl = (ItemImpl)item; + boolean flag = item instanceof ItemIronPickaxe; + if (textStr == null) { + if (flag) { + floatVal = itemImpl.getStrVsBlock(stack, Blocks.stone); + + textStr3 = textStr2.toLowerCase(); + if (!textStr3.contains("gold")) { + break label64; + } + + floatVal -= 6.0F; + break label64; + } + + flag = item instanceof ItemIronShovel; + } + + if (textStr == null) { + if (flag) { + floatVal = itemImpl.getStrVsBlock(stack, Blocks.dirt); + + textStr3 = textStr2.toLowerCase(); + if (!textStr3.contains("gold")) { + break label64; + } + + floatVal -= 6.0F; + break label64; + } + + flag = item instanceof ItemIronAxe; + } + + if (!flag) { + return 1.0F; + } + + floatVal = itemImpl.getStrVsBlock(stack, Blocks.log); + + textStr3 = textStr2.toLowerCase(); + if (textStr3.contains("gold")) { + floatVal -= 6.0F; + + } + } + + double doubleVal = floatVal; + int intVal = Enchantment.efficiency.effectId; + floatVal = (float)(doubleVal + ChestStealerSupport.getEnchantmentLevel(intVal, stack) * 0.0075); + double doubleVal2 = floatVal; + intVal = Enchantment.unbreaking.effectId; + return (float)(doubleVal2 + ChestStealerSupport.getEnchantmentLevel(intVal, stack) / 100.0); +} + + public static String getFlowMarker() { + return N; +} + + private static int compareItemStack18(ItemStack stack, ItemStack itemStack) { + int intVal = itemStack.getMaxDamage(); + intVal -= itemStack.getItemDamage(); + int intVal2 = stack.getMaxDamage(); + intVal2 -= stack.getItemDamage(); + return Integer.compare(intVal, intVal2); +} + + public ItemStack evaluateFloat(ItemStack[] itemStackArray) { + Object obj = this; + if (!this.matchesItemStackArray2(itemStackArray)) { + return null; + } + + Stream stream2 = Stream.of(itemStackArray); + Predicate predicate = ChestStealer::matchesItemStack4; + stream2 = stream2.filter(predicate); + Comparator comparator = ((java.util.Comparator) this::compareItemStack5); + stream2 = stream2.sorted(comparator); + Collector collector = Collectors.toList(); + List itemList = (java.util.List) stream2.collect(collector); + stream2 = itemList.stream(); + Optional optional = stream2.findFirst(); + obj = optional.get(); + + return (ItemStack)obj; +} + + public ItemStack resolveItemStack2(ItemStack[] itemStackArray) { + Object obj = this; + if (!this.applyUpdate3(itemStackArray)) { + return null; + } + + Stream stream2 = Stream.of(itemStackArray); + Predicate predicate = ChestStealer::matchesItemStack3; + stream2 = stream2.filter(predicate); + Comparator comparator = ((java.util.Comparator) ChestStealer::compareItemStack13); + stream2 = stream2.sorted(comparator); + Comparator comparator2 = ((java.util.Comparator) this::compareItemStack2); + stream2 = stream2.sorted(comparator2); + Collector collector = Collectors.toList(); + List itemList = (java.util.List) stream2.collect(collector); + stream2 = itemList.stream(); + Optional optional = stream2.findFirst(); + obj = optional.get(); + + return (ItemStack)obj; +} + + public boolean isReadyState14() { + boolean enabled = this.isEnabled(); + if (!enabled) { + return false; + } + + enabled = this.stateFlag2; + + if (!enabled) { + return false; + } + + BooleanProperty boolProp = this.silent; + Boolean propFlag = boolProp.get(); + enabled = propFlag; + + return enabled; +} + + @Override + public void onDisable() { + this.stateFlag = false; + this.stateFlag2 = false; + List itemList = this.integerList; + itemList.clear(); +} + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + String textStr; + label14: { + ChestStealer stealer = this; + BooleanProperty boolProp = this.extraPacket; + Boolean propFlag = boolProp.get(); + if (propFlag) { + textStr = "Extra"; + break label14; + } + + stealer = this; + + textStr = stealer.delay.toString(); + } + + this.handleString3(textStr); +} + + private boolean checkCondition(ItemStack stack, S30PacketWindowItems packet) { + cc.novoline.modules.player.ChestStealer stealer; + cc.novoline.modules.player.ChestStealer stealer2; + cc.novoline.modules.player.ChestStealer stealer3; + cc.novoline.modules.player.ChestStealer stealer4; + Item item = stack.getItem(); + String textStr2 = item.getUnlocalizedName(); + boolean flag = textStr2.contains("helmet"); + if (flag) { + ItemStack stack2 = stack; + if (!stack.equals(this.createItemStack(packet.getItemStacks(), ArmorPart.HELMET))) { + return false; + } + + stealer = this; + + stack2 = this.resolveItemStack(ArmorPart.HELMET); + + if (stack2 == null) { + return true; + } + + stealer = this; + + if (stealer.applyInt5(this.createItemStack(packet.getItemStacks(), ArmorPart.HELMET)) > this.applyInt5(this.resolveItemStack(ArmorPart.HELMET))) { + return true; + } + + return false; + } + + item = stack.getItem(); + String textStr3 = item.getUnlocalizedName(); + flag = textStr3.contains("chestplate"); + + if (flag) { + ItemStack stack3 = stack; + if (!stack.equals(this.createItemStack(packet.getItemStacks(), ArmorPart.CHESTPLATE))) { + return false; + } + + stealer2 = this; + + stack3 = this.resolveItemStack(ArmorPart.CHESTPLATE); + + if (stack3 == null) { + return true; + } + + stealer2 = this; + + if (stealer2.applyInt5(this.createItemStack(packet.getItemStacks(), ArmorPart.CHESTPLATE)) > this.applyInt5(this.resolveItemStack(ArmorPart.CHESTPLATE))) { + return true; + } + + return false; + } + + item = stack.getItem(); + String textStr4 = item.getUnlocalizedName(); + flag = textStr4.contains("boots"); + + if (flag) { + + ItemStack stack4 = stack; + + if (!stack.equals(this.createItemStack(packet.getItemStacks(), ArmorPart.BOOTS))) { + return false; + } + + stealer3 = this; + + stack4 = this.resolveItemStack(ArmorPart.BOOTS); + + + if (stack4 == null) { + return true; + } + + stealer3 = this; + + if (stealer3.applyInt5(this.createItemStack(packet.getItemStacks(), ArmorPart.BOOTS)) > this.applyInt5(this.resolveItemStack(ArmorPart.BOOTS))) { + return true; + } + + return false; + } + + item = stack.getItem(); + String textStr5 = item.getUnlocalizedName(); + flag = textStr5.contains("leggings"); + + + if (flag) { + + ItemStack stack5 = stack; + + if (!stack.equals(this.createItemStack(packet.getItemStacks(), ArmorPart.LEGGINS))) { + return false; + } + + stealer4 = this; + + stack5 = this.resolveItemStack(ArmorPart.LEGGINS); + + + if (stack5 == null) { + return true; + } + + stealer4 = this; + + if (stealer4.applyInt5(this.createItemStack(packet.getItemStacks(), ArmorPart.LEGGINS)) > this.applyInt5(this.resolveItemStack(ArmorPart.LEGGINS))) { + return true; + } + + return false; + } + + flag = true; + + + return flag; +} + + + private static int compareItemStack19(ItemStack stack, ItemStack itemStack) { + int intVal = itemStack.getMaxDamage(); + intVal -= itemStack.getItemDamage(); + int intVal2 = stack.getMaxDamage(); + intVal2 -= stack.getItemDamage(); + return Integer.compare(intVal, intVal2); +} + + private Boolean lambdaImpl$new$0() { + Boolean propFlag = this.extraPacket.get(); + boolean flag = propFlag; + flag = !flag; + + return flag; +} + + private int compareItemStack20(ItemStack stack, ItemStack itemStack) { + float floatVal = this.applyInt5(itemStack); + float floatVal2 = this.applyInt5(stack); + return Float.compare(floatVal, floatVal2); +} + + private boolean createItemStack(ItemStack stack, S30PacketWindowItems packet) { + cc.novoline.modules.player.ChestStealer stealer; + if (stack.getItem() instanceof ItemBow) { + ChestStealer stealer2; + ItemStack stack2 = stack; + if (!stack.equals(this.evaluateFloat(packet.getItemStacks()))) { + return false; + } + + stealer = this; + stealer2 = this; + + stack2 = this.evaluateFloat(this.playerContents()); + + if (stack2 == null) { + return true; + } + + stealer = this; + stealer2 = this; + + if (stealer.evaluateFloat(stealer2.evaluateFloat(packet.getItemStacks())) > this.evaluateFloat(this.evaluateFloat(this.playerContents()))) { + return true; + } + + return false; + } + + return true; +} + + private boolean matchesItemStack6(ItemStack stack, S30PacketWindowItems packet) { + cc.novoline.modules.player.ChestStealer stealer; + cc.novoline.modules.player.ChestStealer stealer2; + cc.novoline.modules.player.ChestStealer stealer3; + int intVal = (stack.getItem() instanceof ItemIronPickaxe ? 1 : 0); + if ((intVal != 0)) { + ChestStealer stealer4; + ItemStack stack2 = stack; + if (!stack.equals(this.createItemStack(packet.getItemStacks(), ToolType.PICKAXE))) { + return false; + } + + stealer = this; + stealer4 = this; + + stack2 = this.createItemStack(this.playerContents(), ToolType.PICKAXE); + + if (stack2 == null) { + return true; + } + + stealer = this; + stealer4 = this; + + float floatVal; + intVal = (floatVal = stealer.applyUpdate3(stealer4.createItemStack(packet.getItemStacks(), ToolType.PICKAXE)) - this.applyUpdate3(this.createItemStack(this.playerContents(), ToolType.PICKAXE))) == 0.0F + ? 0 + : (floatVal < 0.0F ? -1 : 1); + + if (intVal > 0) { + return true; + } + + return false; + } + + intVal = (stack.getItem() instanceof ItemIronAxe ? 1 : 0); + + if ((intVal != 0)) { + ChestStealer stealer5; + ItemStack stack3 = stack; + if (!stack.equals(this.createItemStack(packet.getItemStacks(), ToolType.AXE))) { + return false; + } + + stealer2 = this; + stealer5 = this; + + stack3 = this.createItemStack(this.playerContents(), ToolType.AXE); + + if (stack3 == null) { + return true; + } + + stealer2 = this; + stealer5 = this; + + if (stealer2.applyUpdate3(stealer5.createItemStack(packet.getItemStacks(), ToolType.AXE)) > this.applyUpdate3(this.createItemStack(this.playerContents(), ToolType.AXE))) { + return true; + } + + return false; + } + + intVal = (stack.getItem() instanceof ItemIronShovel ? 1 : 0); + + + if ((intVal != 0)) { + ChestStealer stealer6; + ItemStack stack4 = stack; + if (!stack.equals(this.createItemStack(packet.getItemStacks(), ToolType.SHOVEL))) { + return false; + } + + stealer3 = this; + stealer6 = this; + + stack4 = this.createItemStack(this.playerContents(), ToolType.SHOVEL); + + if (stack4 == null) { + return true; + } + + stealer3 = this; + stealer6 = this; + + float floatVal2; + intVal = (floatVal2 = stealer3.applyUpdate3(stealer6.createItemStack(packet.getItemStacks(), ToolType.SHOVEL)) - this.applyUpdate3(this.createItemStack(this.playerContents(), ToolType.SHOVEL))) == 0.0F + ? 0 + : (floatVal2 < 0.0F ? -1 : 1); + + if (intVal > 0) { + return true; + } + + return false; + } + + intVal = 1; + + + return ((intVal & 1) != 0); +} + + private boolean invokeCallback6(ArmorPart armorPart, ItemStack stack) { + ItemStack stack2 = stack; + if (stack == null) { + return false; + } + + stack2 = stack; + + Item item = stack2.getItem(); + String textStr = item.getUnlocalizedName(); + String textStr2 = this.applyInt5(armorPart); + return textStr.contains(textStr2); +} + + private boolean matchesCondition(ItemStack stack) { + boolean flag; + float floatVal; + net.minecraft.item.ItemStack stack2; + String textStr2 = getFlowMarker(); + ItemStack stack3 = null; + String textStr = textStr2; + float floatVal2 = -1.0F; + int intVal = 9; + + while (true) { + if (intVal < 45) { + label234: { + Container container = this.mc.thePlayer.inventoryContainer; + Slot slot = container.getSlot(intVal); + flag = slot.getHasStack(); + if (textStr != null) { + break; + } + + if (!flag) { + break label234; + } + + Container container2 = this.mc.thePlayer.inventoryContainer; + slot = container2.getSlot(intVal); + + ItemStack stack4 = slot.getStack(); + + label216: + if (stack4.getItem() instanceof ItemIronSword) { + label236: { + if (!(stack.getItem() instanceof ItemIronSword)) { + break label216; + } + + floatVal = floatVal2; + if (textStr != null) { + break label236; + } + + if (floatVal2 >= this.applyUpdate2(stack4)) { + break label216; + } + + floatVal = this.applyUpdate2(stack4); + } + + floatVal2 = floatVal; + stack3 = stack4; + } + } + + intVal++; + + continue; + } + + stack2 = stack3; + label201: + if (textStr == null) { + if (stack3 != null) { + stack2 = stack3; + + if (stack3.getItem() instanceof ItemIronSword) { + stack2 = stack; + if (textStr != null) { + break label201; + } + + if (stack.getItem() instanceof ItemIronSword) { + float floatVal3 = this.applyUpdate2(stack3); + float floatVal4 = this.applyUpdate2(stack); + float floatVal5; + int intVal2 = (floatVal5 = floatVal4 - floatVal3) == 0.0F ? 0 : (floatVal5 < 0.0F ? -1 : 1); + if (textStr != null) { + return ((intVal2 & 1) != 0); + } + + if (intVal2 > 0) { + return true; + } + } + } + } + + stack2 = stack; + } + + label238: { + if (textStr == null) { + if (stack2 == null) { + break label238; + } + + stack2 = stack; + } + + label239: { + Item item2 = stack2.getItem(); + textStr2 = item2.getUnlocalizedName(); + String textStr3 = "stick"; + flag = textStr2.contains(textStr3); + if (flag) { + break label239; + } + + Item item3 = stack.getItem(); + textStr2 = item3.getUnlocalizedName(); + textStr3 = "egg"; + flag = textStr2.contains(textStr3); + + label177: + if (textStr == null) { + if (flag) { + Item item4 = stack.getItem(); + textStr2 = item4.getUnlocalizedName(); + textStr3 = "leg"; + flag = textStr2.contains(textStr3); + if (textStr != null) { + break label177; + } + + if (!flag) { + break label239; + } + } + + Item item5 = stack.getItem(); + textStr2 = item5.getUnlocalizedName(); + textStr3 = "string"; + flag = textStr2.contains(textStr3); + } + + if (flag) { + break label239; + } + + Item item6 = stack.getItem(); + textStr2 = item6.getUnlocalizedName(); + textStr3 = "compass"; + flag = textStr2.contains(textStr3); + + if (flag) { + break label239; + } + + Item item7 = stack.getItem(); + textStr2 = item7.getUnlocalizedName(); + textStr3 = "feather"; + flag = textStr2.contains(textStr3); + + if (flag) { + break label239; + } + + Item item8 = stack.getItem(); + textStr2 = item8.getUnlocalizedName(); + textStr3 = "bucket"; + flag = textStr2.contains(textStr3); + + if (flag) { + break label239; + } + + Item item9 = stack.getItem(); + textStr2 = item9.getUnlocalizedName(); + textStr3 = "snow"; + flag = textStr2.contains(textStr3); + + if (flag) { + break label239; + } + + Item item10 = stack.getItem(); + textStr2 = item10.getUnlocalizedName(); + textStr3 = "fish"; + flag = textStr2.contains(textStr3); + + if (flag) { + break label239; + } + + Item item11 = stack.getItem(); + textStr2 = item11.getUnlocalizedName(); + textStr3 = "enchant"; + flag = textStr2.contains(textStr3); + + if (flag) { + break label239; + } + + Item item12 = stack.getItem(); + textStr2 = item12.getUnlocalizedName(); + textStr3 = "exp"; + flag = textStr2.contains(textStr3); + + if (flag) { + break label239; + } + + Item item13 = stack.getItem(); + textStr2 = item13.getUnlocalizedName(); + textStr3 = "shears"; + flag = textStr2.contains(textStr3); + + if (flag) { + break label239; + } + + Item item14 = stack.getItem(); + textStr2 = item14.getUnlocalizedName(); + textStr3 = "anvil"; + flag = textStr2.contains(textStr3); + + if (flag) { + break label239; + } + + Item item15 = stack.getItem(); + textStr2 = item15.getUnlocalizedName(); + textStr3 = "torch"; + flag = textStr2.contains(textStr3); + + if (flag) { + break label239; + } + + Item item16 = stack.getItem(); + textStr2 = item16.getUnlocalizedName(); + textStr3 = "seeds"; + flag = textStr2.contains(textStr3); + + if (flag) { + break label239; + } + + Item item17 = stack.getItem(); + textStr2 = item17.getUnlocalizedName(); + textStr3 = "leather"; + flag = textStr2.contains(textStr3); + + if (textStr == null) { + if (flag) { + break label239; + } + + flag = stack.getItem() instanceof ItemGlassBottle; + } + + if (flag) { + break label239; + } + + Item item18 = stack.getItem(); + textStr2 = item18.getUnlocalizedName(); + textStr3 = "piston"; + flag = textStr2.contains(textStr3); + + if (flag) { + break label239; + } + + Item item19 = stack.getItem(); + textStr2 = item19.getUnlocalizedName(); + textStr3 = "potion"; + flag = textStr2.contains(textStr3); + + if (textStr != null) { + break; + } + + if (!flag) { + break label238; + } + + flag = this.matchesItemStack7(stack); + if (textStr != null) { + break; + } + + if (!flag) { + break label238; + } + } + + flag = false; + break; + } + + flag = true; + break; + } + + return flag; +} + + public boolean matchesItemStackArray(ItemStack[] itemStackArray, ToolType toolType) { + int intVal = this.resolveHelper2(itemStackArray, toolType); + int intVal2 = intVal; + return intVal >= 0; +} + + public boolean matchesItemStackArray2(ItemStack[] itemStackArray) { + int intVal = this.applyInt5(itemStackArray); + int intVal2 = intVal; + return intVal >= 0; +} + + private boolean matchesItemStack7(ItemStack stack) { + ItemStack stack2 = stack; + if (stack == null) { + return false; + } + + stack2 = stack; + + boolean flag = stack2.getItem() instanceof ItemPotion; + + if (flag) { + ItemPotion potionItem = (ItemPotion)stack.getItem(); + boolean flag2 = ItemPotion.isSplash(stack.getItemDamage()); + + if (flag2) { + ModuleRegistry modEntry = ModuleRegistry.INVMANAGER; + InvManager invManager = modEntry.getModule(); + return invManager.matchesItemStack2(stack, potionItem); + } + } + + return false; +} + + private Boolean supplyBoolean3() { + Boolean propFlag = this.extraPacket.get(); + boolean flag = propFlag; + flag = !flag; + + return flag; +} + + public boolean shouldRotateCamera() { + boolean flag = this.mc.currentScreen instanceof GuiChest; + if (!flag) { + return false; + } + + flag = this.stateFlag2; + + if (!flag) { + return false; + } + + flag = this.isEnabled(); + + if (!flag) { + return false; + } + + BooleanProperty boolProp = this.rotateCamera; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + return flag; +} + + + @Override + public void onEnable() { + String textStr; + label14: { + ChestStealer stealer = this; + BooleanProperty boolProp = this.extraPacket; + Boolean propFlag = boolProp.get(); + if (propFlag) { + textStr = "Extra"; + break label14; + } + + stealer = this; + + textStr = stealer.delay.toString(); + } + + this.handleString3(textStr); +} + + @EventTarget + public void onLoadWorld(LoadWorldEvent event) { + Boolean propFlag = this.autoDisable.get(); + if (propFlag) { + this.popNotification(this.getDisplayName(), "Module was disabled due to world change", 3000, NotificationType.WARNING); + this.toggle(); + } +} + + @EventTarget + public void onMotionUpdate2(MotionUpdateEvent event) { + cc.novoline.modules.player.ChestStealer stealer; + cc.novoline.modules.player.ChestStealer stealer2; + boolean flag2 = event.getState().equals(cc.novoline.events.type.State.PRE); + if (!flag2) { + return; + } + + flag2 = this.stateFlag2; + + if (!flag2) { + return; + } + + BooleanProperty boolProp = this.extraPacket; + Boolean propFlag = boolProp.get(); + flag2 = propFlag; + + if (flag2) { + ChestStealer stealer3 = this; + List itemList = this.integerList; + if (!itemList.isEmpty()) { + List itemList2 = this.integerList; + Consumer consumer = (Integer intVal9) -> { this.mc.thePlayer.updateState2(this.stateTicks2, intVal9, false); }; + itemList2.forEach(consumer); + List itemList3 = this.integerList; + itemList3.clear(); + } + + EntityPlayerSP player2 = this.mc.thePlayer; + player2.closeScreen(); + stealer3 = this; + + stealer3.stateFlag2 = false; + return; + } + + List itemList4 = this.integerList; + flag2 = itemList4.isEmpty(); + + if (!flag2) { + TimerUtil timerUtil = this.timer2; + IntProperty intProp = this.startDelay; + Integer intVal = intProp.get(); + long longVal = intVal.intValue(); + int intVal2 = (timerUtil.delay(longVal) ? 1 : 0); + if (intVal2 == 0) { + return; + } + + TimerUtil timerUtil2 = this.timer4; + intProp = this.delay; + Integer intVal3 = intProp.get(); + long longVal2 = intVal3.intValue(); + intVal2 = (timerUtil2.delay(longVal2) ? 1 : 0); + + if (intVal2 == 0) { + return; + } + + ThreadLocalRandom threadLocalRandom = ThreadLocalRandom.current(); + List itemList5 = this.integerList; + int size2 = itemList5.size(); + intVal2 = threadLocalRandom.nextInt(size2); + + int intVal4; + label80: { + C0EPacketClickWindow clickWindowPacket; + label78: { + intVal4 = intVal2; + Container container = this.mc.thePlayer.openContainer; + short shortVal = container.executeStep(); + Container container2 = this.mc.thePlayer.openContainer; + List itemList6 = this.integerList; + Integer intVal5 = (Integer)itemList6.get(intVal4); + int intVal6 = intVal5; + EntityPlayerSP player4 = this.mc.thePlayer; + ItemStack stack = container2.slotClick(intVal6, 0, 1, player4); + int ticks = this.stateTicks2; + List itemList13 = this.integerList; + Integer intVal8 = (Integer)itemList13.get(intVal4); + clickWindowPacket = new C0EPacketClickWindow(ticks, intVal8, 0, 1, stack, shortVal); + boolean flag = ServerUtils.isHypixel(); + if (!flag) { + break label78; + } + + stealer = this; + + BooleanProperty boolProp2 = this.noMove; + Boolean propFlag2 = boolProp2.get(); + flag = propFlag2; + + if (!flag) { + List itemList7 = this.packetList; + itemList7.add(clickWindowPacket); + break label80; + } + } + + stealer = this; + + stealer.handlePacket(clickWindowPacket); + } + + List itemList8 = this.integerList; + List itemList9 = this.integerList; + Object obj = itemList9.get(intVal4); + itemList8.remove(obj); + TimerUtil timerUtil3 = this.timer4; + timerUtil3.reset(); + return; + } + + TimerUtil timerUtil4 = this.timer; + IntProperty intProp2 = this.closeDelay; + Integer intVal7 = intProp2.get(); + long longVal3 = intVal7.intValue(); + flag2 = timerUtil4.delay(longVal3); + + if (!flag2) { + return; + } + + stealer2 = this; + + List itemList10 = this.packetList; + flag2 = itemList10.isEmpty(); + + if (!flag2) { + List itemList11 = this.packetList; + Consumer> consumer2 = this::handlePacket; + itemList11.forEach(consumer2); + List itemList12 = this.packetList; + itemList12.clear(); + } + + EntityPlayerSP player3 = this.mc.thePlayer; + player3.closeScreen(); + stealer2 = this; + + stealer2.stateFlag2 = false; +} + +} diff --git a/src/main/java/cc/novoline/modules/player/ChestStealerDamageSourceHelper.java b/src/main/java/cc/novoline/modules/player/ChestStealerDamageSourceHelper.java new file mode 100644 index 0000000..b3974c0 --- /dev/null +++ b/src/main/java/cc/novoline/modules/player/ChestStealerDamageSourceHelper.java @@ -0,0 +1,22 @@ +package cc.novoline.modules.player; + + +import net.minecraft.util.ChestStealerHelper; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.util.DamageSource; + +public final class ChestStealerDamageSourceHelper implements IChestStealerAccess { + public DamageSource damageSource; + public int helperId; + + @Override + public void handleEnchantment(Enchantment enchantment, int value) { + this.helperId = this.helperId + enchantment.calcModifierDamage(value, this.damageSource); +} + + private ChestStealerDamageSourceHelper() {} + + public ChestStealerDamageSourceHelper(ChestStealerHelper chestStealerHelper) { + this(); +} +} diff --git a/src/main/java/cc/novoline/modules/player/ChestStealerEntityHelper.java b/src/main/java/cc/novoline/modules/player/ChestStealerEntityHelper.java new file mode 100644 index 0000000..8adbf29 --- /dev/null +++ b/src/main/java/cc/novoline/modules/player/ChestStealerEntityHelper.java @@ -0,0 +1,23 @@ +package cc.novoline.modules.player; + + +import net.minecraft.util.ChestStealerHelper; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; + +public final class ChestStealerEntityHelper implements IChestStealerAccess { + public Entity entity2; + public EntityLivingBase entityLivingBase; + + public ChestStealerEntityHelper(ChestStealerHelper chestStealerHelper) { + this(); +} + + @Override + public void handleEnchantment(Enchantment enchantment, int value) { + enchantment.onEntityDamaged(this.entityLivingBase, this.entity2, value); +} + + private ChestStealerEntityHelper() {} +} diff --git a/src/main/java/cc/novoline/modules/player/ChestStealerEntityLivingBaHelper.java b/src/main/java/cc/novoline/modules/player/ChestStealerEntityLivingBaHelper.java new file mode 100644 index 0000000..2ddee43 --- /dev/null +++ b/src/main/java/cc/novoline/modules/player/ChestStealerEntityLivingBaHelper.java @@ -0,0 +1,23 @@ +package cc.novoline.modules.player; + + +import net.minecraft.util.ChestStealerHelper; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; + +public final class ChestStealerEntityLivingBaHelper implements IChestStealerAccess { + public EntityLivingBase entityLivingBase; + public Entity entity2; + + @Override + public void handleEnchantment(Enchantment enchantment, int value) { + enchantment.onUserHurt(this.entityLivingBase, this.entity2, value); +} + + public ChestStealerEntityLivingBaHelper(ChestStealerHelper chestStealerHelper) { + this(); +} + + private ChestStealerEntityLivingBaHelper() {} +} diff --git a/src/main/java/cc/novoline/modules/player/ChestStealerEnumCreatureAtHelper.java b/src/main/java/cc/novoline/modules/player/ChestStealerEnumCreatureAtHelper.java new file mode 100644 index 0000000..22d6975 --- /dev/null +++ b/src/main/java/cc/novoline/modules/player/ChestStealerEnumCreatureAtHelper.java @@ -0,0 +1,22 @@ +package cc.novoline.modules.player; + + +import net.minecraft.util.ChestStealerHelper; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.EnumCreatureAttribute; + +public final class ChestStealerEnumCreatureAtHelper implements IChestStealerAccess { + public float floatField; + public EnumCreatureAttribute enumCreatureAttribute; + + public ChestStealerEnumCreatureAtHelper(ChestStealerHelper chestStealerHelper) { + this(); +} + + private ChestStealerEnumCreatureAtHelper() {} + + @Override + public void handleEnchantment(Enchantment enchantment, int value) { + this.floatField = this.floatField + enchantment.calcDamageByCreature(value, this.enumCreatureAttribute); +} +} diff --git a/src/main/java/cc/novoline/modules/player/ChestStealerSupport.java b/src/main/java/cc/novoline/modules/player/ChestStealerSupport.java new file mode 100644 index 0000000..7be3eb9 --- /dev/null +++ b/src/main/java/cc/novoline/modules/player/ChestStealerSupport.java @@ -0,0 +1,458 @@ +package cc.novoline.modules.player; + + +import net.minecraft.entity.projectile.EntityFishHookSupport; +import net.minecraft.item.ItemEnchantedBook; +import net.minecraft.util.WeightedRandomItemSupport; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.DamageSource; + +public class ChestStealerSupport { private static final Random random2 = new Random(); + private static final ChestStealerDamageSourceHelper chestStealerDamageSourceHelper = new ChestStealerDamageSourceHelper(null); + private static final ChestStealerEnumCreatureAtHelper chestStealerEnumCreatureAtHelper = new ChestStealerEnumCreatureAtHelper(null); + + private static final ChestStealerEntityLivingBaHelper chestStealerEntityLivingBaHelper = new ChestStealerEntityLivingBaHelper(null); + private static final ChestStealerEntityHelper chestStealerEntityHelperField = new ChestStealerEntityHelper(null); + + public static float computeFloat(ItemStack stack, EnumCreatureAttribute enumCreatureAttribute) { + chestStealerEnumCreatureAtHelper.floatField = 0.0F; + chestStealerEnumCreatureAtHelper.enumCreatureAttribute = enumCreatureAttribute; + applyChestStealerAccess(chestStealerEnumCreatureAtHelper, stack); + return chestStealerEnumCreatureAtHelper.floatField; +} + + public static int computeIntFromEntityLivingBase(EntityLivingBase living) { + return evaluateInt3(Enchantment.looting.effectId, living.getHeldItem()); +} + + public static int evaluateInt(Entity entity) { + return computeIntInt(Enchantment.depthStrider.effectId, entity.getInventory()); +} + + private static void applyChestStealerAccess(IChestStealerAccess chestStealerAccess, ItemStack stack) { + if (stack != null) { + NBTTagList nbtList = stack.getEnchantmentTagList(); + if (nbtList != null) { + int intVal = 0; + + while (true) { + if (intVal >= nbtList.getInt2()) { + break; + } + + NBTTagCompound nbtTag = nbtList.getCompoundTagAt(intVal); + short shortVal = nbtTag.getShort("id"); + nbtTag = nbtList.getCompoundTagAt(intVal); + short shortVal2 = nbtTag.getShort("lvl"); + if (Enchantment.getEnchantmentById(shortVal) != null) { + chestStealerAccess.handleEnchantment(Enchantment.getEnchantmentById(shortVal), shortVal2); + } + + intVal++; + } + } + } +} + + public static int computeIntInt(int value, ItemStack[] itemStackArray) { + if (itemStackArray == null) { + return 0; + } + + int intVal = 0; + + for (ItemStack stack : itemStackArray) { + int intVal2 = evaluateInt3(value, stack); + if (intVal2 > intVal) { + intVal = intVal2; + } + } + + return intVal; +} + + public static int evaluateInt2(EntityLivingBase living) { + return evaluateInt3(Enchantment.fortune.effectId, living.getHeldItem()); +} + + public static int evaluateInt2(ItemStack stack) { + return evaluateInt3(Enchantment.efficiency.effectId, stack); +} + + public static int evaluateInt(EntityLivingBase living) { + return evaluateInt3(Enchantment.fireAspect.effectId, living.getHeldItem()); +} + + public static int computeIntFromEntityLivingBase2(EntityLivingBase living) { + return evaluateInt3(Enchantment.lure.effectId, living.getHeldItem()); +} + + public static int computeItemStackArrayInt(ItemStack[] itemStackArray, DamageSource damageSource) { + chestStealerDamageSourceHelper.helperId = 0; + chestStealerDamageSourceHelper.damageSource = damageSource; + applyChestStealerAccess2(chestStealerDamageSourceHelper, itemStackArray); + if (chestStealerDamageSourceHelper.helperId > 25) { + chestStealerDamageSourceHelper.helperId = 25; + } else if (chestStealerDamageSourceHelper.helperId < 0) { + chestStealerDamageSourceHelper.helperId = 0; + } + + int intVal = chestStealerDamageSourceHelper.helperId + 1 >> 1; + Random random = random2; + int intVal2 = (chestStealerDamageSourceHelper.helperId >> 1) + 1; + return intVal + random.nextInt(intVal2); +} + + public static Map evaluateInt(ItemStack stack) { + LinkedHashMap linkedHashMap = Maps.newLinkedHashMap(); + NBTTagList nbtList; + if (stack.getItem() == Items.enchanted_book) { + nbtList = Items.enchanted_book.getEnchant(stack); + } else { + nbtList = stack.getEnchantmentTagList(); + } + + NBTTagList nbtList2 = nbtList; + if (nbtList2 != null) { + int intVal = 0; + + while (true) { + if (intVal >= nbtList2.getInt2()) { + break; + } + + NBTTagCompound nbtTag = nbtList2.getCompoundTagAt(intVal); + short shortVal = nbtTag.getShort("id"); + NBTTagCompound nbtTag2 = nbtList2.getCompoundTagAt(intVal); + short shortVal2 = nbtTag2.getShort("lvl"); + Integer intVal2 = Integer.valueOf(shortVal); + Integer intVal3 = Integer.valueOf(shortVal2); + linkedHashMap.put(intVal2, intVal3); + intVal++; + } + } + + return linkedHashMap; +} + + public static Map resolveMap(int value, ItemStack stack) { + Item item = stack.getItem(); + HashMap hashMap = null; + int intVal = stack.getItem() == Items.book ? 1 : 0; + + for (Enchantment enchantment : Enchantment.enchantmentArray) { + if (enchantment != null && (enchantment.type.canEnchantItem(item) || intVal != 0)) { + for (int index = enchantment.getMinLevel(); index <= enchantment.getMaxLevel(); index++) { + if (value >= enchantment.resolveInt2(index) && value <= enchantment.resolveInt(index)) { + if (hashMap == null) { + hashMap = Maps.newHashMap(); + } + + Integer intVal2 = enchantment.effectId; + WeightedRandomItemSupport weightedRandomItemSupport = new WeightedRandomItemSupport(enchantment, index); + hashMap.put(intVal2, weightedRandomItemSupport); + } + } + } + } + + return hashMap; +} + + public static int computeIntFromEntityLivingBase3(EntityLivingBase living) { + return evaluateInt3(Enchantment.efficiency.effectId, living.getHeldItem()); +} + + public static int computeIntFromEntityLivingBase4(EntityLivingBase living) { + return evaluateInt3(Enchantment.luckOfTheSea.effectId, living.getHeldItem()); +} + + public static ItemStack resolveItemStack(Random random, ItemStack stack, int value) { + List itemList = resolveList(random, stack, value); + int intVal = stack.getItem() == Items.book ? 1 : 0; + if (intVal != 0) { + stack.setItem(Items.enchanted_book); + } + + if (itemList != null) { + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + WeightedRandomItemSupport weightedRandomItemSupport = (WeightedRandomItemSupport)iter.next(); + if (intVal != 0) { + Items.enchanted_book.addEnchantment(stack, weightedRandomItemSupport); + } else { + Enchantment enchantment = weightedRandomItemSupport.enchantmentobj; + int intVal2 = weightedRandomItemSupport.enchantmentLevel; + stack.addEnchantment(enchantment, intVal2); + } + } + } + + return stack; +} + + public static int evaluateInt3(int value, ItemStack stack) { + if (stack != null) { + NBTTagList nbtList = stack.getEnchantmentTagList(); + if (nbtList != null) { + int intVal = 0; + + while (true) { + if (intVal >= nbtList.getInt2()) { + break; + } + + NBTTagCompound nbtTag = nbtList.getCompoundTagAt(intVal); + short shortVal = nbtTag.getShort("id"); + nbtTag = nbtList.getCompoundTagAt(intVal); + short shortVal2 = nbtTag.getShort("lvl"); + if (shortVal == value) { + return shortVal2; + } + + intVal++; + } + } + } + + return 0; +} + + public static void evaluateInt3(EntityLivingBase living, Entity entity) { + chestStealerEntityLivingBaHelper.entity2 = entity; + chestStealerEntityLivingBaHelper.entityLivingBase = living; + if (living != null) { + applyChestStealerAccess2(chestStealerEntityLivingBaHelper, living.getInventory()); + } + + if (entity instanceof EntityPlayer) { + ChestStealerEntityLivingBaHelper val = chestStealerEntityLivingBaHelper; + applyChestStealerAccess(val, living.getHeldItem()); + } +} + + private static void applyChestStealerAccess2(IChestStealerAccess chestStealerAccess, ItemStack[] itemStackArray) { + for (ItemStack stack : itemStackArray) { + applyChestStealerAccess(chestStealerAccess, stack); + } +} + + public static ItemStack resolveItemStack2(Enchantment enchantment, EntityLivingBase living) { + for (ItemStack stack : living.getInventory()) { + if (stack != null && evaluateInt3(enchantment.effectId, stack) > 0) { + return stack; + } + } + + return null; +} + + public static int computeIntFromRandom(Random random, int value, int index, ItemStack stack) { + Item item = stack.getItem(); + int intVal = item.getItemEnchantability(); + if (intVal <= 0) { + return 0; + } + + if (index > 15) { + index = 15; + } + + int intVal3 = random.nextInt(8) + 1 + (index >> 1); + int intVal4 = index + 1; + int intVal2 = intVal3 + random.nextInt(intVal4); + if (value == 0) { + intVal3 = intVal2 / 3; + intVal3 = Math.max(intVal3, 1); + } else if (value == 1) { + intVal3 = intVal2 * 2 / 3 + 1; + } else { + int intVal5 = index * 2; + intVal3 = Math.max(intVal2, intVal5); + } + + return intVal3; +} + + public static void applyMap(Map map, ItemStack stack) { + NBTTagList nBTTagList = new NBTTagList(); + Set itemSet = map.keySet(); + Iterator iter = itemSet.iterator(); + + while (true) { + if (!iter.hasNext()) { + if (nBTTagList.getInt2() > 0) { + if (stack.getItem() != Items.enchanted_book) { + stack.setTagInfo("ench", nBTTagList); + } + } else { + if (stack.hasTagCompound()) { + NBTTagCompound nbtTag = stack.getTagCompound(); + nbtTag.removeTag("ench"); + } + } + + return; + } + + Integer intVal = (Integer)iter.next(); + int intVal2 = intVal; + Enchantment enchantment = Enchantment.getEnchantmentById(intVal2); + if (enchantment != null) { + NBTTagCompound nbtTag2 = new NBTTagCompound(); + short shortVal = (short)intVal2; + nbtTag2.setShort("id", shortVal); + Integer intVal4 = intVal2; + Integer intVal3 = (Integer)map.get(intVal4); + shortVal = (short)intVal3.intValue(); + nbtTag2.setShort("lvl", shortVal); + nBTTagList.appendTag(nbtTag2); + if (stack.getItem() == Items.enchanted_book) { + ItemEnchantedBook itemEnchantedBook = Items.enchanted_book; + Integer intVal5 = intVal2; + Integer intVal6 = (Integer)map.get(intVal5); + itemEnchantedBook.addEnchantment(stack, new WeightedRandomItemSupport(enchantment, intVal6)); + } + } + } +} + + public static int computeIntFromEntityLivingBase5(EntityLivingBase living) { + return evaluateInt3(Enchantment.knockback.effectId, living.getHeldItem()); +} + + public static boolean checkEntityLivingBase(EntityLivingBase living) { + return evaluateInt3(Enchantment.silkTouch.effectId, living.getHeldItem()) > 0; +} + + public static boolean isValidEntity(EntityLivingBase living) { + return computeIntInt(Enchantment.aquaAffinity.effectId, living.getInventory()) > 0; +} + + public static List resolveList(Random random, ItemStack stack, int value) { + Item item = stack.getItem(); + int intVal = item.getItemEnchantability(); + if (intVal <= 0) { + return null; + } + + intVal /= 2; + int intVal6 = (intVal >> 1) + 1; + int intVal7 = 1 + random.nextInt(intVal6); + intVal6 = (intVal >> 1) + 1; + intVal = intVal7 + random.nextInt(intVal6); + int intVal2 = intVal + value; + float floatVal = random.nextFloat(); + float floatVal2 = (floatVal + random.nextFloat() - 1.0F) * 0.15F; + int intVal3 = (int)(intVal2 * (1.0F + floatVal2) + 0.5F); + if (intVal3 < 1) { + intVal3 = 1; + } + + ArrayList itemList = null; + Map itemMap = resolveMap(intVal3, stack); + if (itemMap != null) { + if (!itemMap.isEmpty()) { + WeightedRandomItemSupport weightedRandomItemSupport = (WeightedRandomItemSupport)EntityFishHookSupport.resolveItem2(random, itemMap.values()); + if (weightedRandomItemSupport != null) { + itemList = Lists.newArrayList(); + itemList.add(weightedRandomItemSupport); + int intVal4 = intVal3; + + while (true) { + if (random.nextInt(50) > intVal4) { + break; + } + + Set itemSet = itemMap.keySet(); + Iterator iter = itemSet.iterator(); + + while (true) { + if (!iter.hasNext()) { + if (!itemMap.isEmpty()) { + WeightedRandomItemSupport weightedRandomItemSupport2 = (WeightedRandomItemSupport)EntityFishHookSupport.resolveItem2(random, itemMap.values()); + itemList.add(weightedRandomItemSupport2); + } + + intVal4 >>= 1; + break; + } + + Integer intVal5 = (Integer)iter.next(); + byte byteVal = 1; + Iterator iter2 = itemList.iterator(); + + while (true) { + if (!iter2.hasNext()) { + break; + } + + WeightedRandomItemSupport weightedRandomItemSupport3 = (WeightedRandomItemSupport)iter2.next(); + Enchantment enchantment = weightedRandomItemSupport3.enchantmentobj; + if (!enchantment.canApplyTogether(Enchantment.getEnchantmentById(intVal5))) { + byteVal = 0; + break; + } + } + + if (byteVal == 0) { + iter.remove(); + } + } + } + } + } + } + + return itemList; +} + + public static void applyEntityLivingBase(EntityLivingBase living, Entity entity) { + chestStealerEntityHelperField.entityLivingBase = living; + chestStealerEntityHelperField.entity2 = entity; + if (living != null) { + applyChestStealerAccess2(chestStealerEntityHelperField, living.getInventory()); + } + + if (living instanceof EntityPlayer) { + ChestStealerEntityHelper chestStealerEntityHelper = chestStealerEntityHelperField; + applyChestStealerAccess(chestStealerEntityHelper, living.getHeldItem()); + } +} + + public static int evaluateInt2(Entity entity) { + return computeIntInt(Enchantment.respiration.effectId, entity.getInventory()); +} + + public static int getEnchantmentLevel(int enchID, net.minecraft.item.ItemStack stack) { return evaluateInt3(enchID, stack); } + public static int getMaxEnchantmentLevel(int enchID, net.minecraft.item.ItemStack[] stacks) { return computeIntInt(enchID, stacks); } + public static int getEfficiencyModifier(net.minecraft.item.ItemStack stack) { return evaluateInt2(stack); } + public static boolean getAquaAffinityModifier(net.minecraft.entity.EntityLivingBase entity) { return isValidEntity(entity); } + public static float getModifierForCreature(net.minecraft.item.ItemStack stack, net.minecraft.entity.EnumCreatureAttribute creatureAtr) { return computeFloat(stack, creatureAtr); } + public static int getEnchantmentModifierDamage(net.minecraft.item.ItemStack[] stacks, net.minecraft.util.DamageSource source) { return computeItemStackArrayInt(stacks, source); } + public static void setEnchantments(java.util.Map enchMap, net.minecraft.item.ItemStack stack) { applyMap(enchMap, stack); } +} diff --git a/src/main/java/cc/novoline/modules/player/FastUse.java b/src/main/java/cc/novoline/modules/player/FastUse.java new file mode 100644 index 0000000..3d805e2 --- /dev/null +++ b/src/main/java/cc/novoline/modules/player/FastUse.java @@ -0,0 +1,79 @@ +package cc.novoline.modules.player; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C04PacketPlayerPosition; +import net.minecraft.network.play.client.C06PacketPlayerPosLook; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemPotion; +import net.minecraft.item.ItemStack; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class FastUse extends AbstractModule { + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + this.handleString3("NCP"); +} + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + if (event.getState() == State.PRE) { + double posX2; + double posY2; + double posZ2; + float yaw; + float pitch; + boolean onGround2; + FastUse fastUse; + posX2 = this.mc.thePlayer.posX; + posY2 = this.mc.thePlayer.posY; + posZ2 = this.mc.thePlayer.posZ; + yaw = this.mc.thePlayer.rotationYaw; + pitch = this.mc.thePlayer.rotationPitch; + onGround2 = this.mc.thePlayer.onGround; + boolean flag = this.mc.thePlayer.isConditionMet78(); + if (!flag) { + return; + } + + fastUse = this; + + EntityPlayerSP player = this.mc.thePlayer; + ItemStack stack = player.getHeldItem(); + flag = stack.getItem() instanceof ItemPotion; + + if (!flag) { + fastUse = this; + + EntityPlayerSP player2 = this.mc.thePlayer; + ItemStack stack2 = player2.getHeldItem(); + if (!(stack2.getItem() instanceof ItemFood)) { + return; + } + } + + this.sendPacketNoEvent(new C04PacketPlayerPosition(posX2, posY2, posZ2, onGround2)); + this.sendPacketNoEvent(new C06PacketPlayerPosLook(posX2, posY2, posZ2, yaw, pitch, onGround2)); + this.sendPacketNoEvent(new C04PacketPlayerPosition(posX2, posY2, posZ2, onGround2)); + fastUse = this; + + fastUse.applyInt5(new C06PacketPlayerPosLook(posX2, posY2, posZ2, yaw, pitch, onGround2)); + } +} + + @Override + public void onEnable() { + this.handleString3("NCP"); +} + + public FastUse(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); +} +} diff --git a/src/main/java/cc/novoline/modules/player/Freecam.java b/src/main/java/cc/novoline/modules/player/Freecam.java new file mode 100644 index 0000000..80c749a --- /dev/null +++ b/src/main/java/cc/novoline/modules/player/Freecam.java @@ -0,0 +1,156 @@ +package cc.novoline.modules.player; + +import cc.novoline.events.events.PushBlockEvent; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.CollideWithBlockEvent; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.MoveEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.FloatProperty; +import cc.novoline.modules.exploits.Blink; +import net.minecraft.client.entity.AbstractClientPlayerOnLivingUpdateHelper; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class Freecam extends AbstractModule { + private AbstractClientPlayerOnLivingUpdateHelper abstractClientPlayerOnLivingUpdateHelperField; + public static boolean stateFlag; + @Property("freecam-speed") + private final FloatProperty freecamSpeed; + + + @EventTarget + public void onPacket(PacketEvent event) { + PacketEvent packetEvent; + boolean flag = event.getState().equals(State.OUTGOING); + if (!flag) { + return; + } + + packetEvent = event; + + flag = event.getPacket() instanceof C03PacketPlayer; + + if (!flag) { + return; + } + + packetEvent = event; + + packetEvent.setCancelled(true); +} + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + if (event.getState().equals(cc.novoline.events.type.State.PRE)) { + this.mc.thePlayer.noClip = true; + } +} + + + @Override + public void onEnable() { + Minecraft mcClient = this.mc; + if (this.mc.thePlayer == null) { + return; + } + + this.applyInt5(Blink.class); + stateFlag = true; + WorldClient world = this.mc.theWorld; + EntityPlayerSP player = this.mc.thePlayer; + this.abstractClientPlayerOnLivingUpdateHelperField = new AbstractClientPlayerOnLivingUpdateHelper(world, player.getGameProfile()); + this.abstractClientPlayerOnLivingUpdateHelperField.inventory = this.mc.thePlayer.inventory; + this.abstractClientPlayerOnLivingUpdateHelperField.inventoryContainer = this.mc.thePlayer.inventoryContainer; + this.abstractClientPlayerOnLivingUpdateHelperField.setPositionAndRotation(this.mc.thePlayer.posX, this.mc.thePlayer.posY, this.mc.thePlayer.posZ, this.mc.thePlayer.rotationYaw, this.mc.thePlayer.rotationPitch); + this.abstractClientPlayerOnLivingUpdateHelperField.rotationYawHead = this.mc.thePlayer.rotationYawHead; + AbstractClientPlayerOnLivingUpdateHelper val = this.abstractClientPlayerOnLivingUpdateHelperField; + EntityPlayerSP player2 = this.mc.thePlayer; + val.handleUUID(player2.getUUID()); + mcClient = this.mc; + + WorldClient world2 = mcClient.theWorld; + int intVal = this.abstractClientPlayerOnLivingUpdateHelperField.getEntityId(); + world2.addEntityToWorld(intVal, this.abstractClientPlayerOnLivingUpdateHelperField); +} + + + public Freecam(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + this.freecamSpeed = FloatProperty.of(4.0F).minimum(0.5F).maximum(5.0F); + SettingManager.register(new Setting("FC_SPEED", "Speed", SettingType.SLIDER, this, this.freecamSpeed, 0.5)); +} + + @EventTarget + public void handlePushBlockEvent(PushBlockEvent event) { + event.setCancelled(true); +} + + + @EventTarget + public void onCollideWithBlock(CollideWithBlockEvent event) {} + + @EventTarget + public void onMove(MoveEvent event) { + float floatVal; + label17: { + Float propFloat = this.freecamSpeed.get(); + floatVal = propFloat; + EntityPlayerSP player = this.mc.thePlayer; + boolean flag = player.getMovementInput().isJump(); + if (flag) { + event.setCachedValue32(this.mc.thePlayer.motionY = floatVal); + break label17; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + flag = player2.getMovementInput().isSneak(); + + if (flag) { + event.setCachedValue32(this.mc.thePlayer.motionY = -floatVal); + } + } + + event.setMoveSpeed(floatVal); +} + + + @Override + public void onDisable() { + Freecam freecam = this; + if (this.abstractClientPlayerOnLivingUpdateHelperField != null) { + EntityPlayerSP player = this.mc.thePlayer; + double posX2 = this.abstractClientPlayerOnLivingUpdateHelperField.posX; + double posY2 = this.abstractClientPlayerOnLivingUpdateHelperField.posY; + double posZ2 = this.abstractClientPlayerOnLivingUpdateHelperField.posZ; + float yaw = this.abstractClientPlayerOnLivingUpdateHelperField.rotationYaw; + float pitch = this.abstractClientPlayerOnLivingUpdateHelperField.rotationPitch; + player.setPositionAndRotation(posX2, posY2, posZ2, yaw, pitch); + WorldClient world = this.mc.theWorld; + int intVal = this.abstractClientPlayerOnLivingUpdateHelperField.getEntityId(); + world.applyFlag(intVal); + } + + freecam = this; + + freecam.mc.thePlayer.noClip = false; + stateFlag = false; +} + + public AbstractClientPlayerOnLivingUpdateHelper obtainAbstractModule() { + return this.abstractClientPlayerOnLivingUpdateHelperField; +} + +} diff --git a/src/main/java/cc/novoline/modules/player/GameSpeed.java b/src/main/java/cc/novoline/modules/player/GameSpeed.java new file mode 100644 index 0000000..883c219 --- /dev/null +++ b/src/main/java/cc/novoline/modules/player/GameSpeed.java @@ -0,0 +1,237 @@ +package cc.novoline.modules.player; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.PlayerUpdateEvent; +import cc.novoline.events.events.SettingEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.FloatProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.exploits.Disabler; +import cc.novoline.modules.ModuleRegistry; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.server.S08PacketPlayerPosLook; +import net.minecraft.client.MinecraftHelper; +import net.minecraft.util.BlockPos; + +public class GameSpeed extends AbstractModule { + private int stateTicks; + private TimerUtil timer2; + @Property("mode") + private StringProperty mode; + @Property("timer-boost") + private final FloatProperty timerBoost; + @Property("lag-check") + private final BooleanProperty lagCheck; + @Property("ticks") + private IntProperty ticks; + private BlockPos targetPos; + + @Override + public void onEnable() { + this.handleString3(this.mode.get()); + this.stateTicks = 0; +} + + public StringProperty getMode() { + return this.mode; +} + + public StringProperty getStringProperty3() { + return this.getMode(); +} + + public GameSpeed(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + StringProperty strProp = StringProperty.of("Balance"); + String[] stringArr = new String[]{"Basic", "Balance"}; + this.mode = strProp.acceptableValues(stringArr); + this.timerBoost = FloatProperty.of(2.0F).minimum(0.5F).maximum(2.0F); + this.lagCheck = BooleanProperty.of(true); + this.ticks = IntProperty.of(30).minimum(15).maximum(150); + this.timer2 = new TimerUtil(); + Setting setting = new Setting("GS_MODE", "Mode", SettingType.COMBOBOX, this, this.mode); + SettingManager.register(setting); + setting = new Setting("GS_TICKS", "Ticks", SettingType.SLIDER, this, this.ticks, 15.0, () -> this.mode.equals("Balance")); + SettingManager.register(setting); + setting = new Setting("GS_TIMER_BOOST", "Timer Speed", SettingType.SLIDER, this, this.timerBoost, 0.05F, () -> this.mode.equals("Basic")); + SettingManager.register(setting); + setting = new Setting("GS_LAG_BACK_CHECK", "Lagback check", SettingType.CHECKBOX, this, this.lagCheck); + SettingManager.register(setting); +} + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + this.handleString3(this.mode.get()); +} + + + public void handleSettingEvent(SettingEvent event) { + label56: { + SettingEvent settingEvent = event; + + if (event == null) { + break label56; + } + + settingEvent = event; + + + boolean flag = settingEvent.getSettingName().equals("GS_MODE"); + + if (flag) { + break label56; + } + + flag = event.getSettingName().equals("DISABLER_PING_SPOOF_TOGGLE"); + + + if (!flag) { + return; + } + } + + boolean enabled2; + label39: { + label57: { + ModuleRegistry modEntry = ModuleRegistry.DISABLER; + Disabler disabler = modEntry.getModule(); + enabled2 = disabler.isEnabled(); + + if (!enabled2) { + break label57; + } + + enabled2 = disabler.checkState4(); + + + if (enabled2) { + enabled2 = true; + break label39; + } + } + + enabled2 = false; + } + + boolean flag2 = enabled2; + StringProperty strProp = this.mode; + boolean flag3 = strProp.equals("Balance"); + + if (!flag3) { + return; + } + + flag3 = flag2; + + + if (!flag3) { + this.popNotification(this.getDisplayName(), "You need to enabled Disabler and turn on Ping Spoof option in it to use BALANCE mode", 4500, NotificationType.WARNING); + StringProperty strProp2 = this.mode; + strProp2.set("Basic"); + } +} + + + @EventTarget + public void onPlayerUpdate(PlayerUpdateEvent event) { + cc.novoline.modules.player.GameSpeed gameSpeed; + int intVal4 = (this.isEnabled(ModuleRegistry.SPEED, ModuleRegistry.LONGJUMP, ModuleRegistry.SCAFFOLD, ModuleRegistry.FLY) ? 1 : 0); + if (intVal4 != 0) { + return; + } + + StringProperty strProp = this.mode; + intVal4 = (strProp.equals("Basic") ? 1 : 0); + + if (intVal4 != 0) { + MinecraftHelper minecraftHelper = this.mc.timer; + Float propFloat = this.timerBoost.get(); + minecraftHelper.timerSpeed = propFloat; + return; + } + + StringProperty strProp2 = this.mode; + intVal4 = (strProp2.equals("Balance") ? 1 : 0); + + if (intVal4 == 0) { + return; + } + + this.stateTicks++; + intVal4 = this.stateTicks; + + IntProperty intProp = this.ticks; + Integer intVal = intProp.get(); + int intVal2 = intVal / 15 + 1; + if (intVal4 < intVal2) { + this.mc.timer.timerSpeed = 0.1F; + return; + } + + gameSpeed = this; + + intVal4 = this.stateTicks; + intProp = this.ticks; + Integer intVal3 = intProp.get(); + intVal2 = intVal3; + + if (intVal4 > intVal2) { + this.stateTicks = 0; + return; + } + + gameSpeed = this; + + gameSpeed.mc.timer.timerSpeed = 2.0F; +} + + + @EventTarget + public void onPacket(PacketEvent event) { + cc.novoline.modules.player.GameSpeed gameSpeed; + boolean flag = event.getState().equals(State.INCOMING); + if (!flag) { + return; + } + + flag = event.getPacket() instanceof S08PacketPlayerPosLook; + + if (!flag) { + return; + } + + gameSpeed = this; + + BooleanProperty boolProp = this.lagCheck; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + return; + } + + gameSpeed = this; + + gameSpeed.applyInt5(this.getClass()); +} + + + @Override + public void onDisable() { + this.mc.timer.timerSpeed = 1.0F; +} + +} diff --git a/src/main/java/cc/novoline/modules/player/IChestStealerAccess.java b/src/main/java/cc/novoline/modules/player/IChestStealerAccess.java new file mode 100644 index 0000000..bbd8fb0 --- /dev/null +++ b/src/main/java/cc/novoline/modules/player/IChestStealerAccess.java @@ -0,0 +1,7 @@ +package cc.novoline.modules.player; + +import net.minecraft.enchantment.Enchantment; + +public interface IChestStealerAccess { + void handleEnchantment(Enchantment enchantment, int value); +} diff --git a/src/main/java/cc/novoline/modules/player/InvManager.java b/src/main/java/cc/novoline/modules/player/InvManager.java new file mode 100644 index 0000000..f7cecfa --- /dev/null +++ b/src/main/java/cc/novoline/modules/player/InvManager.java @@ -0,0 +1,4249 @@ +package cc.novoline.modules.player; + +import cc.novoline.gui.screen.config.GuiConfig; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.gui.screen.whitelist.GuiItemWhitelist; +import cc.novoline.utils.HypixelLobbyType; +import cc.novoline.utils.ServerUtils; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.LoadWorldEvent; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.SettingEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.exploits.Disabler; +import cc.novoline.modules.ModuleRegistry; +import java.awt.Color; +import java.util.Iterator; +import java.util.List; +import net.minecraft.item.ItemRose; +import net.minecraft.item.ItemIronSword; +import net.minecraft.item.ItemIronAxe; +import net.minecraft.item.ItemImpl; +import net.minecraft.item.ItemIronShovel; +import net.minecraft.item.ItemGlassBottle; +import net.minecraft.item.ItemIronPickaxe; +import net.minecraft.item.ItemGoldenApple; +import net.minecraft.item.ItemWoodenHoe; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.client.renderer.InventoryEffectRendererSupport; + +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.Slot; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemBow; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemPotion; +import net.minecraft.item.ItemSkull; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.EnumChatFormatting; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class InvManager extends AbstractModule { + @Property("blocks") + private final IntProperty blocks; + @Property("pickaxe-slot") + private final IntProperty pickaxeSlot; + @Property("keep-items") + private final ListProperty keepItems; + private final TimerUtil timer; + @Property("head-slot") + private final IntProperty headSlot; + @Property("gapple-slot") + private final IntProperty gappleSlot; + @Property("custom-sort-ids") + private ListProperty customSortIds; + @Property("shovel-slot") + private final IntProperty shovelSlot; + @Property("axe-slot") + private final IntProperty axeSlot; + @Property("auto-disable") + private final BooleanProperty autoDisable; + @Property("open-inventory") + private final BooleanProperty openInventory; + @Property("arrows") + private final IntProperty arrows; + @Property("bow-slot") + private final IntProperty bowSlot; + @Property("weapon-slot") + private final IntProperty weaponSlot; + @Property("delay") + private final IntProperty delay; + @Property("no-move") + private final BooleanProperty noMove; + @Property("sort-mode") + private final StringProperty sortMode; + @Property("inventory-cleaner") + private final BooleanProperty inventoryCleaner; + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + Object obj; + cc.novoline.modules.player.InvManager invManager; + String textStr = ChestStealer.getFlowMarker(); + int intVal6 = (event.getState().equals(State.PRE) ? 1 : 0); + if ((intVal6 == 0)) { + return; + } + + HypixelLobbyType lobbyType = HypixelLobbyType.PRE; + intVal6 = (ServerUtils.serverIs(lobbyType) ? 1 : 0); + + if ((intVal6 != 0)) { + return; + } + + HypixelLobbyType lobbyType2 = HypixelLobbyType.LOBBY; + intVal6 = (ServerUtils.serverIs(lobbyType2) ? 1 : 0); + + if ((intVal6 != 0)) { + return; + } + + BooleanProperty boolProp = this.noMove; + Boolean propFlag = boolProp.get(); + intVal6 = (propFlag ? 1 : 0); + + label475: { + { + if ((intVal6 != 0)) { + EntityPlayerSP player2 = this.mc.thePlayer; + intVal6 = (player2.isMoving() ? 1 : 0); + + if ((intVal6 != 0)) { + return; + } + } + + invManager = this; + + BooleanProperty boolProp2 = this.openInventory; + Boolean propFlag2 = boolProp2.get(); + intVal6 = (propFlag2 ? 1 : 0); + + if ((intVal6 != 0)) { + if (!(this.mc.currentScreen instanceof InventoryEffectRendererSupport)) { + return; + } + break label475; + } + + invManager = this; + } + + obj = invManager.mc.currentScreen; + + if (invManager.mc.currentScreen != null) { + intVal6 = (this.mc.currentScreen instanceof InventoryEffectRendererSupport ? 1 : 0); + + if (intVal6 == 0) { + intVal6 = (this.mc.currentScreen instanceof GuiChat ? 1 : 0); + + if (intVal6 == 0) { + return; + } + } + } + } + + IntProperty intProp = this.weaponSlot; + obj = intProp.get(); + + Integer intVal = (Integer)obj; + intVal6 = intVal - 1; + + int intVal7 = intVal6; + IntProperty intProp2 = this.pickaxeSlot; + Integer intVal2 = intProp2.get(); + int intVal8 = intVal2 - 1; + IntProperty intProp3 = this.bowSlot; + intVal2 = intProp3.get(); + int intVal9 = intVal2 - 1; + IntProperty intProp4 = this.shovelSlot; + intVal2 = intProp4.get(); + int intVal10 = intVal2 - 1; + IntProperty intProp5 = this.axeSlot; + intVal2 = intProp5.get(); + int intVal11 = intVal2 - 1; + IntProperty intProp6 = this.headSlot; + intVal2 = intProp6.get(); + int intVal12 = intVal2 - 1; + IntProperty intProp7 = this.gappleSlot; + intVal2 = intProp7.get(); + int intVal13 = intVal2 - 1; + ListProperty listProp = this.keepItems; + boolean flag = listProp.contains("Pickaxe"); + ListProperty listProp2 = this.keepItems; + boolean flag2 = listProp2.contains("Shovel"); + ListProperty listProp3 = this.keepItems; + boolean flag3 = listProp3.contains("Axe"); + ListProperty listProp4 = this.keepItems; + boolean flag4 = listProp4.contains("Sword"); + ListProperty listProp5 = this.keepItems; + boolean flag5 = listProp5.contains("Bow"); + ListProperty listProp6 = this.keepItems; + boolean flag6 = listProp6.contains("Head"); + ListProperty listProp7 = this.keepItems; + String textStr2 = "Golden Apple"; + boolean flag7 = listProp7.contains(textStr2); + ModuleRegistry modEntry = ModuleRegistry.AUTOARMOR; + AutoArmor autoArmor = modEntry.getModule(); + IntProperty intProp8 = this.delay; + intVal2 = intProp8.get(); + int intVal3 = intVal2 * 50; + int intVal4 = autoArmor.getIntValue2() * 50; + int intVal5 = 9; + + while (true) { + if (intVal5 < 45) { + EntityPlayerSP player3 = this.mc.thePlayer; + Slot slot = player3.getSlotFromPlayerContainer(intVal5); + ItemStack stack = slot.getStack(); + + + label175: + if (stack != null) { + String displayName = stack.getDisplayName(); + textStr2 = "\u00a77(Right Click)"; + boolean flag8 = displayName.contains(textStr2); + if (flag8) { + break label175; + } + + TimerUtil timerUtil = this.timer; + long longVal = intVal3; + flag8 = timerUtil.hasReached(longVal); + + + if (!flag8) { + break label175; + } + + flag8 = this.isValidStack3(stack); + + + if (flag8) { + flag8 = flag4; + + if (flag4) { + flag8 = this.resolveFlagArray(intVal7)[0]; + + if (flag8) { + EntityPlayerSP player4 = this.mc.thePlayer; + player4.swapHotbar(intVal5, intVal7); + TimerUtil timerUtil2 = this.timer; + timerUtil2.reset(); + break label175; + } + } + } + + flag8 = this.checkItemStack(stack); + + if (flag8) { + flag8 = flag; + + if (flag) { + flag8 = this.resolveFlagArray(intVal8)[2]; + + if (flag8) { + EntityPlayerSP player5 = this.mc.thePlayer; + player5.swapHotbar(intVal5, intVal8); + TimerUtil timerUtil3 = this.timer; + timerUtil3.reset(); + break label175; + } + } + } + + flag8 = this.isValidStack6(stack); + + if (flag8) { + flag8 = flag3; + + if (flag3) { + flag8 = this.resolveFlagArray(intVal11)[1]; + + if (flag8) { + EntityPlayerSP player6 = this.mc.thePlayer; + player6.swapHotbar(intVal5, intVal11); + TimerUtil timerUtil4 = this.timer; + timerUtil4.reset(); + break label175; + } + } + } + + flag8 = this.isValidStack2(stack); + + if (flag8) { + flag8 = flag5; + + if (flag5) { + flag8 = this.resolveFlagArray(intVal9)[5]; + + if (flag8) { + EntityPlayerSP player7 = this.mc.thePlayer; + player7.swapHotbar(intVal5, intVal9); + TimerUtil timerUtil5 = this.timer; + timerUtil5.reset(); + break label175; + } + } + } + + flag8 = this.matchesItemStack(stack); + + if (flag8) { + flag8 = flag6; + + if (flag6) { + flag8 = this.resolveFlagArray(intVal12)[4]; + + if (flag8) { + EntityPlayerSP player8 = this.mc.thePlayer; + player8.swapHotbar(intVal5, intVal12); + TimerUtil timerUtil6 = this.timer; + timerUtil6.reset(); + break label175; + } + } + } + + flag8 = this.isValidStack5(stack); + + if (flag8) { + flag8 = flag2; + + if (flag2) { + flag8 = this.resolveFlagArray(intVal10)[3]; + + if (flag8) { + EntityPlayerSP player9 = this.mc.thePlayer; + player9.swapHotbar(intVal5, intVal10); + TimerUtil timerUtil7 = this.timer; + timerUtil7.reset(); + break label175; + } + } + } + + flag8 = this.isValidStack(stack); + + + if (!flag8) { + break label175; + } + + flag8 = flag7; + + + + if (!flag8) { + break label175; + } + + flag8 = this.resolveFlagArray(intVal13)[6]; + + + if (flag8) { + EntityPlayerSP player10 = this.mc.thePlayer; + player10.swapHotbar(intVal5, intVal13); + TimerUtil timerUtil9 = this.timer; + timerUtil9.reset(); + } + } + + intVal5++; + if (textStr == null) { + continue; + } + + intVal5 = 9; + if (intVal5 >= 45) { + break; + } + + + } else { + intVal5 = 9; + if (intVal5 >= 45) { + break; + } + } + + while (true) { + EntityPlayerSP player15 = this.mc.thePlayer; + Slot slot2 = player15.getSlotFromPlayerContainer(intVal5); + if (!slot2.getHasStack()) { + if (textStr == null) { + if (++intVal5 >= 45) { + return; + } + continue; + } + + EntityPlayerSP player16 = this.mc.thePlayer; + slot2 = player16.getSlotFromPlayerContainer(intVal5); + } else { + EntityPlayerSP player17 = this.mc.thePlayer; + slot2 = player17.getSlotFromPlayerContainer(intVal5); + } + + ItemStack stack2 = slot2.getStack(); + + BooleanProperty boolProp3 = this.inventoryCleaner; + Boolean propFlag3 = boolProp3.get(); + if (propFlag3) { + if (stack2 != null) { + boolean flag12 = this.checkItemStack2(stack2); + + if (flag12) { + TimerUtil timerUtil17 = this.timer; + long longVal5 = intVal3; + boolean flag13 = timerUtil17.delay(longVal5); + + if (flag13) { + TimerUtil timerUtil18 = autoArmor.getXHC(); + + long longVal6 = intVal4; + if (timerUtil18.delay(longVal6)) { + EntityPlayerSP player18 = this.mc.thePlayer; + player18.dropSlot(intVal5); + TimerUtil timerUtil19 = this.timer; + timerUtil19.reset(); + } + + } + + + if (++intVal5 >= 45) { + return; + } + } else if (textStr != null || ++intVal5 >= 45) { + return; + } + + } else if (textStr != null || ++intVal5 >= 45) { + return; + } + } else if (textStr != null || ++intVal5 >= 45) { + return; + } + + } + } +} + + + private int getIntValue6() { + int slot2; + int intVal = 0; + int intVal2 = 0; + + while (true) { + if (intVal2 < 45) { + label46: { + EntityPlayerSP player = this.mc.thePlayer; + Slot slot = player.getSlotFromPlayerContainer(intVal2); + slot2 = (slot.getHasStack() ? 1 : 0); + + if (slot2 == 0) { + break label46; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + slot = player2.getSlotFromPlayerContainer(intVal2); + + ItemStack stack = slot.getStack(); + + label30: + if (stack.getItem() instanceof ItemIronPickaxe) { + int intVal3 = (this.checkItemStack(stack) ? 1 : 0); + if (intVal3 == 0) { + break label30; + } + + intVal3 = intVal + stack.stackSize; + + intVal = intVal3; + } + } + + intVal2++; + + continue; + } + + slot2 = intVal; + break; + } + + return slot2; +} + + private boolean isValidStack(@NonNull ItemStack stack) { + return stack.getItem() instanceof ItemGoldenApple; +} + + private boolean[] resolveFlagArray(int value) { + boolean flag; + boolean[] boolArr; + boolArr = new boolean[7]; + EntityPlayerSP player = this.mc.thePlayer; + int intVal7 = value + 36; + Slot slot = player.getSlotFromPlayerContainer(intVal7); + flag = slot.getHasStack(); + label101: { + if (flag) { + EntityPlayerSP player2 = this.mc.thePlayer; + int intVal8 = value + 36; + Slot slot2 = player2.getSlotFromPlayerContainer(intVal8); + flag = this.isValidStack3(slot2.getStack()); + + if (flag) { + flag = false; + break label101; + } + } + + flag = true; + } + + boolArr[0] = flag; + EntityPlayerSP player3 = this.mc.thePlayer; + intVal7 = value + 36; + Slot slot3 = player3.getSlotFromPlayerContainer(intVal7); + flag = slot3.getHasStack(); + label93: { + if (flag) { + EntityPlayerSP player4 = this.mc.thePlayer; + int intVal = value + 36; + Slot slot4 = player4.getSlotFromPlayerContainer(intVal); + flag = this.isValidStack6(slot4.getStack()); + + if (flag) { + flag = false; + break label93; + } + } + + flag = true; + } + + boolArr[1] = flag; + EntityPlayerSP player5 = this.mc.thePlayer; + intVal7 = value + 36; + Slot slot5 = player5.getSlotFromPlayerContainer(intVal7); + flag = slot5.getHasStack(); + label85: { + if (flag) { + EntityPlayerSP player6 = this.mc.thePlayer; + int intVal2 = value + 36; + Slot slot6 = player6.getSlotFromPlayerContainer(intVal2); + flag = this.checkItemStack(slot6.getStack()); + + if (flag) { + flag = false; + break label85; + } + } + + flag = true; + } + + boolArr[2] = flag; + EntityPlayerSP player7 = this.mc.thePlayer; + intVal7 = value + 36; + Slot slot7 = player7.getSlotFromPlayerContainer(intVal7); + flag = slot7.getHasStack(); + label77: { + if (flag) { + EntityPlayerSP player8 = this.mc.thePlayer; + int intVal3 = value + 36; + Slot slot8 = player8.getSlotFromPlayerContainer(intVal3); + flag = this.isValidStack5(slot8.getStack()); + + if (flag) { + flag = false; + break label77; + } + } + + flag = true; + } + + boolArr[3] = flag; + EntityPlayerSP player9 = this.mc.thePlayer; + intVal7 = value + 36; + Slot slot9 = player9.getSlotFromPlayerContainer(intVal7); + flag = slot9.getHasStack(); + label69: { + if (flag) { + EntityPlayerSP player10 = this.mc.thePlayer; + int intVal4 = value + 36; + Slot slot10 = player10.getSlotFromPlayerContainer(intVal4); + flag = this.matchesItemStack(slot10.getStack()); + + if (flag) { + flag = false; + break label69; + } + } + + flag = true; + } + + boolArr[4] = flag; + EntityPlayerSP player11 = this.mc.thePlayer; + intVal7 = value + 36; + Slot slot11 = player11.getSlotFromPlayerContainer(intVal7); + flag = slot11.getHasStack(); + label61: { + if (flag) { + EntityPlayerSP player12 = this.mc.thePlayer; + int intVal5 = value + 36; + Slot slot12 = player12.getSlotFromPlayerContainer(intVal5); + flag = this.isValidStack2(slot12.getStack()); + + if (flag) { + flag = false; + break label61; + } + } + + flag = true; + } + + boolArr[5] = flag; + EntityPlayerSP player13 = this.mc.thePlayer; + intVal7 = value + 36; + Slot slot13 = player13.getSlotFromPlayerContainer(intVal7); + flag = slot13.getHasStack(); + label53: { + if (flag) { + EntityPlayerSP player14 = this.mc.thePlayer; + int intVal6 = value + 36; + Slot slot14 = player14.getSlotFromPlayerContainer(intVal6); + flag = this.isValidStack(slot14.getStack()); + + if (flag) { + flag = false; + break label53; + } + } + + flag = true; + } + + boolArr[6] = flag; + return boolArr; +} + + + public IntProperty getBlocks() { + return this.blocks; +} + + public IntProperty getIntProperty() { + return this.getBlocks(); +} + + public IntProperty getAxeSlot() { + return this.axeSlot; +} + + public IntProperty getIntProperty2() { + return this.getAxeSlot(); +} + + public void handleSettingEvent(SettingEvent event) { + label27: { + SettingEvent settingEvent = event; + if (event == null) { + break label27; + } + + settingEvent = event; + + boolean flag = settingEvent.getCachedText2().equals("IM_NO_MOVE"); + if (flag) { + break label27; + } + + flag = event.getSettingName().equals("DISABLER_CLICK_BYPASS_ENABLED"); + + if (!flag) { + return; + } + } + + this.performStep17(); +} + + private int getIntValue7() { + int slot2; + int intVal = 0; + int intVal2 = 0; + + while (true) { + if (intVal2 < 45) { + label38: { + EntityPlayerSP player = this.mc.thePlayer; + Slot slot = player.getSlotFromPlayerContainer(intVal2); + slot2 = (slot.getHasStack() ? 1 : 0); + + if (slot2 == 0) { + break label38; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + slot = player2.getSlotFromPlayerContainer(intVal2); + + ItemStack stack = slot.getStack(); + + if (stack.getItem() == Items.arrow) { + intVal += stack.stackSize; + } + } + + intVal2++; + + continue; + } + + slot2 = intVal; + break; + } + + return slot2; +} + + private int getIntValue8() { + int slot2; + int intVal = 0; + int intVal2 = 0; + + while (true) { + if (intVal2 < 45) { + label46: { + EntityPlayerSP player = this.mc.thePlayer; + Slot slot = player.getSlotFromPlayerContainer(intVal2); + slot2 = (slot.getHasStack() ? 1 : 0); + + if (slot2 == 0) { + break label46; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + slot = player2.getSlotFromPlayerContainer(intVal2); + + ItemStack stack = slot.getStack(); + + label30: + if (stack.getItem() instanceof ItemIronAxe) { + int intVal3 = (this.isValidStack6(stack) ? 1 : 0); + if (intVal3 == 0) { + break label30; + } + + intVal3 = intVal + stack.stackSize; + + intVal = intVal3; + } + } + + intVal2++; + + continue; + } + + slot2 = intVal; + break; + } + + return slot2; +} + + private boolean isValidStack2(@NonNull ItemStack stack) { + int slot3; + Item item = stack.getItem(); + boolean flag = item instanceof ItemBow; + if (flag) { + float floatVal = this.getItemScore(stack); + ItemStack stack2 = null; + int intVal = 9; + + while (true) { + if (intVal < 45) { + EntityPlayerSP player = this.mc.thePlayer; + Slot slot = player.getSlotFromPlayerContainer(intVal); + slot3 = (slot.getHasStack() ? 1 : 0); + + label55: { + if (slot3 == 0) { + break label55; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + Slot slot2 = player2.getSlotFromPlayerContainer(intVal); + stack2 = slot2.getStack(); + + if (this.getItemScore(stack2) > floatVal) { + boolean flag2 = stack2.getItem() instanceof ItemBow; + + if (flag2) { + return false; + } + } + } + + intVal++; + + continue; + } + + float floatVal2; + slot3 = (floatVal2 = this.getItemScore(stack) - this.getItemScore(stack2)) == 0.0F ? 0 : (floatVal2 < 0.0F ? -1 : 1); + break; + } + + if (slot3 > 0) { + return true; + } + + slot3 = stack.getItemDamage(); + + slot3 = slot3 <= stack2.getItemDamage() ? 1 : 0; + + return ((slot3 & 1) != 0); + } + + flag = false; + + return flag; +} + + public ListProperty getCustomSortIds() { + return this.customSortIds; +} + + public ListProperty getListPropertyB() { + return this.getCustomSortIds(); +} + + private float getItemScore(ItemStack stack) { + int intVal = Enchantment.power.effectId; + int intVal2 = 1 + ChestStealerSupport.getEnchantmentLevel(intVal, stack); + intVal = Enchantment.flame.effectId; + intVal2 += ChestStealerSupport.getEnchantmentLevel(intVal, stack); + intVal = Enchantment.infinity.effectId; + return intVal2 + ChestStealerSupport.getEnchantmentLevel(intVal, stack); +} + + public IntProperty getGappleSlot() { + return this.gappleSlot; +} + + public IntProperty getIntProperty3() { + return this.getGappleSlot(); +} + + private int computeIntValue() { + int slot2; + int intVal = 0; + int intVal2 = 0; + + while (true) { + if (intVal2 < 45) { + label38: { + EntityPlayerSP player = this.mc.thePlayer; + Slot slot = player.getSlotFromPlayerContainer(intVal2); + slot2 = (slot.getHasStack() ? 1 : 0); + + if (slot2 == 0) { + break label38; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + slot = player2.getSlotFromPlayerContainer(intVal2); + + ItemStack stack = slot.getStack(); + + if (stack.getItem() == Items.coal) { + intVal += stack.stackSize; + } + } + + intVal2++; + + continue; + } + + slot2 = intVal; + break; + } + + return slot2; +} + + public IntProperty getPickaxeSlot() { + return this.pickaxeSlot; +} + + public IntProperty getIntPropertyJ() { + return this.getPickaxeSlot(); +} + + private boolean isValidStack3(ItemStack stack) { + int slot3; + Item item = stack.getItem(); + boolean flag = item instanceof ItemIronSword; + if (flag) { + float floatVal = this.computeFloatFromItemStack(stack); + ItemStack stack2 = null; + int intVal = 9; + + while (true) { + if (intVal < 45) { + EntityPlayerSP player = this.mc.thePlayer; + Slot slot = player.getSlotFromPlayerContainer(intVal); + slot3 = (slot.getHasStack() ? 1 : 0); + + label55: { + if (slot3 == 0) { + break label55; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + Slot slot2 = player2.getSlotFromPlayerContainer(intVal); + stack2 = slot2.getStack(); + + if (this.computeFloatFromItemStack(stack2) > floatVal) { + boolean flag2 = stack2.getItem() instanceof ItemIronSword; + + if (flag2) { + return false; + } + } + } + + intVal++; + + continue; + } + + float floatVal2; + slot3 = (floatVal2 = this.computeFloatFromItemStack(stack) - this.computeFloatFromItemStack(stack2)) == 0.0F ? 0 : (floatVal2 < 0.0F ? -1 : 1); + break; + } + + if (slot3 > 0) { + return true; + } + + slot3 = stack.getItemDamage(); + + slot3 = slot3 <= stack2.getItemDamage() ? 1 : 0; + + return ((slot3 & 1) != 0); + } + + flag = false; + + return flag; +} + + private int getIntValue3() { + int slot2; + int intVal = 0; + int intVal2 = 0; + + while (true) { + if (intVal2 < 45) { + label46: { + EntityPlayerSP player = this.mc.thePlayer; + Slot slot = player.getSlotFromPlayerContainer(intVal2); + slot2 = (slot.getHasStack() ? 1 : 0); + + if (slot2 == 0) { + break label46; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + slot = player2.getSlotFromPlayerContainer(intVal2); + + ItemStack stack = slot.getStack(); + + label30: + if (stack.getItem() instanceof ItemIronSword) { + int intVal3 = (this.isValidStack3(stack) ? 1 : 0); + if (intVal3 == 0) { + break label30; + } + + intVal3 = intVal + stack.stackSize; + + intVal = intVal3; + } + } + + intVal2++; + + continue; + } + + slot2 = intVal; + break; + } + + return slot2; +} + + public BooleanProperty getInventoryCleaner() { + return this.inventoryCleaner; +} + + public BooleanProperty getBooleanPropertyValue() { + return this.getInventoryCleaner(); +} + + private boolean matchesItemStack(@NonNull ItemStack stack) { + String textStr = ChestStealer.getFlowMarker(); + boolean flag = stack.getItem() instanceof ItemSkull; + if (!flag) { + return false; + } + + String displayName = stack.getDisplayName(); + flag = displayName.contains("Head"); + + if (!flag) { + return false; + } + + String displayName2 = stack.getDisplayName(); + flag = displayName2.equalsIgnoreCase("Wither Skeleton Skull"); + + if (flag) { + return false; + } + + String displayName3 = stack.getDisplayName(); + flag = displayName3.equalsIgnoreCase("Zombie Head"); + + if (flag) { + return false; + } + + String displayName4 = stack.getDisplayName(); + flag = displayName4.equalsIgnoreCase("Creeper Head"); + + if (flag) { + return false; + } + + String displayName5 = stack.getDisplayName(); + flag = displayName5.equalsIgnoreCase("Skeleton Skull"); + + return textStr != null ? flag : !flag; +} + + public IntProperty getWeaponSlot() { + return this.weaponSlot; +} + + public IntProperty getIntPropertyR() { + return this.getWeaponSlot(); +} + + private boolean isValidStack4(ItemStack stack) { + ItemStack stack2 = stack; + if (stack == null) { + return false; + } + + stack2 = stack; + + boolean flag = stack2.getItem() instanceof ItemPotion; + + if (flag) { + ItemPotion potionItem = (ItemPotion)stack.getItem(); + if (potionItem.getEffects(stack) != null) { + boolean flag2 = this.matchesItemStack2(stack, potionItem); + + if (!flag2) { + return false; + } + } + + return true; + } else { + return false; + } +} + + public BooleanProperty getOpenInventory() { + return this.openInventory; +} + + public BooleanProperty getBooleanPropertyL() { + return this.getOpenInventory(); +} + + public ListProperty getKeepItems() { + return this.keepItems; +} + + public ListProperty getListPropertyF() { + return this.getKeepItems(); +} + + private void handleString(String text) { + Minecraft mcClient = this.mc; + mcClient.displayGuiScreen(new GuiConfig()); +} + + public IntProperty getHeadSlot() { + return this.headSlot; +} + + public IntProperty getIntProperty4() { + return this.getHeadSlot(); +} + + + private boolean checkItemStack(ItemStack stack) { + int slot3; + Item item = stack.getItem(); + boolean flag = item instanceof ItemIronPickaxe; + if (flag) { + float floatVal = this.getItemScore2(stack); + ItemStack stack2 = null; + int intVal = 9; + + while (true) { + if (intVal < 45) { + EntityPlayerSP player = this.mc.thePlayer; + Slot slot = player.getSlotFromPlayerContainer(intVal); + slot3 = (slot.getHasStack() ? 1 : 0); + + label55: { + if (slot3 == 0) { + break label55; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + Slot slot2 = player2.getSlotFromPlayerContainer(intVal); + stack2 = slot2.getStack(); + + if (this.getItemScore2(stack2) > floatVal) { + boolean flag2 = stack2.getItem() instanceof ItemIronPickaxe; + + if (flag2) { + return false; + } + } + } + + intVal++; + + continue; + } + + float floatVal2; + slot3 = (floatVal2 = this.getItemScore2(stack) - this.getItemScore2(stack2)) == 0.0F ? 0 : (floatVal2 < 0.0F ? -1 : 1); + break; + } + + if (slot3 > 0) { + return true; + } + + slot3 = stack.getItemDamage(); + + slot3 = slot3 <= stack2.getItemDamage() ? 1 : 0; + + return ((slot3 & 1) != 0); + } + + flag = false; + + return flag; +} + + @Override + public void onDisable() { + this.timer.reset(); +} + + @Override + public void onEnable() {} + + + private int computeIntValue3() { + int slot2; + int intVal = 0; + int intVal2 = 0; + + while (true) { + if (intVal2 < 45) { + label46: { + EntityPlayerSP player = this.mc.thePlayer; + Slot slot = player.getSlotFromPlayerContainer(intVal2); + slot2 = (slot.getHasStack() ? 1 : 0); + + if (slot2 == 0) { + break label46; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + slot = player2.getSlotFromPlayerContainer(intVal2); + + ItemStack stack = slot.getStack(); + + label30: + if (stack.getItem() instanceof ItemIronShovel) { + int intVal3 = (this.isValidStack5(stack) ? 1 : 0); + if (intVal3 == 0) { + break label30; + } + + intVal3 = intVal + stack.stackSize; + + intVal = intVal3; + } + } + + intVal2++; + + continue; + } + + slot2 = intVal; + break; + } + + return slot2; +} + + public boolean matchesItemStack2(ItemStack stack, ItemPotion itemPotion) { + boolean flag; + List itemList = itemPotion.getEffects(stack); + Iterator iter = itemList.iterator(); + + while (true) { + if (iter.hasNext()) { + PotionEffect potionEffect = (PotionEffect)iter.next(); + int intVal = potionEffect.getPotionID(); + Potion[] potionArr = Potion.potionTypes; + Potion potion = potionArr[potionEffect.getPotionID()]; + flag = potion.isBadEffect2(); + + if (flag) { + return true; + } + + continue; + } + + flag = false; + break; + } + + return flag; +} + + private float computeFloatFromItemStack(@NonNull ItemStack stack) { + float floatVal; + label17: { + floatVal = 0.0F; + Item item = stack.getItem(); + boolean flag = item instanceof ItemImpl; + if (flag) { + floatVal += ((ItemImpl)item).getDamageVsEntity3(); + break label17; + } + + flag = item instanceof ItemIronSword; + + if (flag) { + floatVal += ((ItemIronSword)item).getAttackDamage(); + } + } + + float floatVal2 = ChestStealerSupport.getEnchantmentLevel(Enchantment.sharpness.effectId, stack) * 1.25F; + int intVal = Enchantment.fireAspect.effectId; + return floatVal + (floatVal2 + ChestStealerSupport.getEnchantmentLevel(intVal, stack) * 0.3F); +} + + private boolean checkItemStack2(ItemStack stack) { + boolean flag; + int intVal; + int intVal2; + int intVal3; + int intVal4; + int intVal5; + int intVal6; + cc.novoline.modules.AbstractModule mod; + boolean flag2; + int intVal7; + net.minecraft.item.Item item2; + int intVal8; + String textStr42 = ChestStealer.getFlowMarker(); + Item item3 = stack.getItem(); + String textStr = textStr42; + String displayName = stack.getDisplayName(); + int intVal9 = Item.getIdFromItem(item3); + int intVal10 = intVal9; + if (textStr == null) { + if (intVal9 != 58) { + textStr42 = displayName.toLowerCase(); + StringBuilder sb = new StringBuilder(); + EnumChatFormatting enumChatFormatting = EnumChatFormatting.OBFUSCATED; + sb = sb.append(enumChatFormatting); + String textStr2 = sb.append("||").toString(); + boolean flag3 = textStr42.contains(textStr2); + if (textStr != null) { + return flag3; + } + + if (!flag3) { + sb = new StringBuilder(); + Color awtColor = new Color(0, 255, 0, 255); + sb = sb.append(awtColor).append("Game Menu "); + enumChatFormatting = EnumChatFormatting.GRAY; + sb = sb.append(enumChatFormatting); + String textStr3 = sb.append("(Right Click)").toString(); + boolean flag4 = displayName.contains(textStr3); + if (textStr != null) { + return flag4; + } + + if (!flag4) { + sb = new StringBuilder(); + enumChatFormatting = EnumChatFormatting.AQUA; + sb = sb.append(enumChatFormatting).append(""); + enumChatFormatting = EnumChatFormatting.BOLD; + sb = sb.append(enumChatFormatting).append("Spectator Settings "); + enumChatFormatting = EnumChatFormatting.GRAY; + sb = sb.append(enumChatFormatting); + String textStr4 = sb.append("(Right Click)").toString(); + boolean flag5 = displayName.equalsIgnoreCase(textStr4); + if (textStr != null) { + return flag5; + } + + if (!flag5) { + sb = new StringBuilder(); + enumChatFormatting = EnumChatFormatting.AQUA; + sb = sb.append(enumChatFormatting).append(""); + enumChatFormatting = EnumChatFormatting.BOLD; + sb = sb.append(enumChatFormatting).append("Play Again "); + enumChatFormatting = EnumChatFormatting.GRAY; + sb = sb.append(enumChatFormatting); + String textStr5 = sb.append("(Right Click)").toString(); + boolean flag6 = displayName.equalsIgnoreCase(textStr5); + if (textStr != null) { + return flag6; + } + + if (!flag6) { + sb = new StringBuilder(); + enumChatFormatting = EnumChatFormatting.GREEN; + sb = sb.append(enumChatFormatting).append(""); + enumChatFormatting = EnumChatFormatting.BOLD; + sb = sb.append(enumChatFormatting).append("Teleporter "); + enumChatFormatting = EnumChatFormatting.GRAY; + sb = sb.append(enumChatFormatting); + String textStr6 = sb.append("(Right Click)").toString(); + boolean flag7 = displayName.equalsIgnoreCase(textStr6); + if (textStr != null) { + return flag7; + } + + if (!flag7) { + sb = new StringBuilder(); + enumChatFormatting = EnumChatFormatting.GREEN; + sb = sb.append(enumChatFormatting).append("SkyWars Challenges "); + enumChatFormatting = EnumChatFormatting.GRAY; + sb = sb.append(enumChatFormatting); + String textStr7 = sb.append("(Right Click)").toString(); + boolean flag8 = displayName.equalsIgnoreCase(textStr7); + if (textStr != null) { + return flag8; + } + + if (!flag8) { + sb = new StringBuilder(); + enumChatFormatting = EnumChatFormatting.GREEN; + sb = sb.append(enumChatFormatting).append("Collectibles "); + enumChatFormatting = EnumChatFormatting.GRAY; + sb = sb.append(enumChatFormatting); + String textStr8 = sb.append("(Right Click)").toString(); + boolean flag9 = displayName.equalsIgnoreCase(textStr8); + if (textStr != null) { + return flag9; + } + + if (!flag9) { + sb = new StringBuilder(); + enumChatFormatting = EnumChatFormatting.GREEN; + sb = sb.append(enumChatFormatting).append("Kit Selector "); + enumChatFormatting = EnumChatFormatting.GRAY; + sb = sb.append(enumChatFormatting); + String textStr9 = sb.append("(Right Click)").toString(); + boolean flag10 = displayName.equalsIgnoreCase(textStr9); + if (textStr != null) { + return flag10; + } + + if (!flag10) { + sb = new StringBuilder(); + enumChatFormatting = EnumChatFormatting.GREEN; + sb = sb.append(enumChatFormatting).append("Kill Effect Selector "); + enumChatFormatting = EnumChatFormatting.GRAY; + sb = sb.append(enumChatFormatting); + String textStr10 = sb.append("(Right Click)").toString(); + boolean flag11 = displayName.equalsIgnoreCase(textStr10); + if (textStr != null) { + return flag11; + } + + if (!flag11) { + sb = new StringBuilder(); + enumChatFormatting = EnumChatFormatting.WHITE; + sb = sb.append(enumChatFormatting).append("Players: "); + enumChatFormatting = EnumChatFormatting.RED; + sb = sb.append(enumChatFormatting).append("Hidden "); + enumChatFormatting = EnumChatFormatting.GRAY; + sb = sb.append(enumChatFormatting); + String textStr11 = sb.append("(Right Click)").toString(); + boolean flag12 = displayName.equalsIgnoreCase(textStr11); + if (textStr != null) { + return flag12; + } + + if (!flag12) { + sb = new StringBuilder(); + enumChatFormatting = EnumChatFormatting.GREEN; + sb = sb.append(enumChatFormatting).append("Shop "); + enumChatFormatting = EnumChatFormatting.GRAY; + sb = sb.append(enumChatFormatting); + String textStr12 = sb.append("(Right Click)").toString(); + boolean flag13 = displayName.equalsIgnoreCase(textStr12); + if (textStr != null) { + return flag13; + } + + if (!flag13) { + sb = new StringBuilder(); + enumChatFormatting = EnumChatFormatting.WHITE; + sb = sb.append(enumChatFormatting).append("Players: "); + enumChatFormatting = EnumChatFormatting.RED; + sb = sb.append(enumChatFormatting).append("Visible "); + enumChatFormatting = EnumChatFormatting.GRAY; + sb = sb.append(enumChatFormatting); + String textStr13 = sb.append("(Right Click)").toString(); + boolean flag14 = displayName.equalsIgnoreCase(textStr13); + if (textStr != null) { + return flag14; + } + + if (!flag14) { + sb = new StringBuilder(); + enumChatFormatting = EnumChatFormatting.GOLD; + sb = sb.append(enumChatFormatting); + String textStr14 = sb.append("Excalibur").toString(); + boolean flag15 = displayName.equalsIgnoreCase(textStr14); + if (textStr != null) { + return flag15; + } + + if (!flag15) { + boolean flag16 = displayName.equalsIgnoreCase("aDragon Sword"); + if (textStr != null) { + return flag16; + } + + if (!flag16) { + sb = new StringBuilder(); + enumChatFormatting = EnumChatFormatting.GREEN; + sb = sb.append(enumChatFormatting); + String textStr15 = sb.append("Cornucopia").toString(); + boolean flag17 = displayName.equalsIgnoreCase(textStr15); + if (textStr != null) { + return flag17; + } + + if (!flag17) { + sb = new StringBuilder(); + enumChatFormatting = EnumChatFormatting.RED; + sb = sb.append(enumChatFormatting); + String textStr16 = sb.append("Bloodlust").toString(); + boolean flag18 = displayName.equalsIgnoreCase(textStr16); + if (textStr != null) { + return flag18; + } + + if (!flag18) { + sb = new StringBuilder(); + enumChatFormatting = EnumChatFormatting.RED; + sb = sb.append(enumChatFormatting); + String textStr17 = sb.append("Artemis' Bow").toString(); + boolean flag19 = displayName.equalsIgnoreCase(textStr17); + if (textStr != null) { + return flag19; + } + + if (!flag19) { + sb = new StringBuilder(); + enumChatFormatting = EnumChatFormatting.GREEN; + sb = sb.append(enumChatFormatting); + String textStr18 = sb.append("Miner's Blessing").toString(); + boolean flag20 = displayName.equalsIgnoreCase(textStr18); + if (textStr != null) { + return flag20; + } + + if (!flag20) { + sb = new StringBuilder(); + enumChatFormatting = EnumChatFormatting.GOLD; + sb = sb.append(enumChatFormatting); + String textStr19 = sb.append("Axe of Perun").toString(); + boolean flag21 = displayName.equalsIgnoreCase(textStr19); + if (textStr != null) { + return flag21; + } + + if (!flag21) { + sb = new StringBuilder(); + enumChatFormatting = EnumChatFormatting.GOLD; + sb = sb.append(enumChatFormatting); + String textStr20 = sb.append("Cornucopia").toString(); + boolean flag22 = displayName.equalsIgnoreCase(textStr20); + if (textStr != null) { + return flag22; + } + + if (!flag22) { + if (textStr != null) { + return ((intVal9 & 1) != 0); + } + + if (intVal9 != 116) { + if (textStr != null) { + return ((intVal9 & 1) != 0); + } + + if (intVal9 != 145) { + boolean flag23 = displayName.equalsIgnoreCase("\u00a7aAnd\u00faril"); + if (textStr != null) { + return flag23; + } + + if (!flag23) { + if (textStr != null) { + return ((intVal9 & 1) != 0); + } + + if (intVal9 != 259) { + if (textStr != null) { + return ((intVal9 & 1) != 0); + } + + label1278: + if (intVal9 != 46) { + int intVal11 = intVal9; + if (intVal9 == 165) { + break label1278; + } + + ListProperty listProp = this.keepItems; + intVal11 = (listProp.contains("Pickaxe") ? 1 : 0); + + int intVal12; + byte byteVal; + byte byteVal2; + byte byteVal3; + byte byteVal4; + int intVal13; + int intVal14; + int intVal15; + int intVal16; + int intVal17; + label1362: { + byte byteVal5; + label1363: { + intVal12 = intVal11; + ListProperty listProp2 = this.keepItems; + byteVal5 = (byte)(listProp2.contains("Shovel") ? 1 : 0); + ListProperty listProp3 = this.keepItems; + byteVal = (byte)(listProp3.contains("Axe") ? 1 : 0); + ListProperty listProp4 = this.keepItems; + byteVal2 = (byte)(listProp4.contains("Sword") ? 1 : 0); + ListProperty listProp5 = this.keepItems; + byteVal3 = (byte)(listProp5.contains("Bow") ? 1 : 0); + ListProperty listProp6 = this.keepItems; + byteVal4 = (byte)(listProp6.contains("Head") ? 1 : 0); + IntProperty intProp = this.weaponSlot; + Integer intVal18 = intProp.get(); + intVal13 = intVal18 - 1; + IntProperty intProp2 = this.pickaxeSlot; + Integer intVal19 = intProp2.get(); + intVal14 = intVal19 - 1; + IntProperty intProp3 = this.bowSlot; + Integer intVal20 = intProp3.get(); + intVal15 = intVal20 - 1; + IntProperty intProp4 = this.shovelSlot; + Integer intVal21 = intProp4.get(); + int intVal22 = intVal21 - 1; + IntProperty intProp5 = this.axeSlot; + Integer intVal23 = intProp5.get(); + intVal16 = intVal23 - 1; + IntProperty intProp6 = this.headSlot; + Integer intVal24 = intProp6.get(); + intVal17 = intVal24 - 1; + intVal = (this.isValidStack5(stack) ? 1 : 0); + if (textStr == null) { + if (intVal != 0) { + intVal2 = this.computeIntValue3(); + + if (intVal2 < 2) { + break label1363; + } + } + + intVal = (stack.getItem() instanceof ItemIronShovel ? 1 : 0); + } + + if (intVal == 0) { + break label1362; + } + + InventoryPlayer inventory2 = this.mc.thePlayer.inventory; + if (stack != inventory2.getStackInSlot(intVal22)) { + break label1362; + } + } + + intVal2 = byteVal5; + + if (textStr != null) { + return ((intVal2 & 1) != 0); + } + + if (intVal2 != 0) { + return false; + } + } + + intVal = (this.isValidStack2(stack) ? 1 : 0); + + label1364: { + label1365: { + if (textStr == null) { + if (intVal != 0) { + intVal3 = this.computeIntValue5(); + + if (intVal3 < 2) { + break label1365; + } + } + + intVal = (stack.getItem() instanceof ItemBow ? 1 : 0); + } + + if (intVal == 0) { + break label1364; + } + + InventoryPlayer inventory3 = this.mc.thePlayer.inventory; + if (stack != inventory3.getStackInSlot(intVal15)) { + break label1364; + } + } + + intVal3 = byteVal3; + + if (textStr != null) { + return ((intVal3 & 1) != 0); + } + + if (intVal3 != 0) { + return false; + } + } + + intVal = (this.matchesItemStack(stack) ? 1 : 0); + + label1366: { + label1367: { + if (textStr == null) { + if (intVal != 0) { + intVal4 = this.getIntValue9(); + + if (intVal4 < 2) { + break label1367; + } + } + + intVal = (stack.getItem() instanceof ItemSkull ? 1 : 0); + } + + if (intVal == 0) { + break label1366; + } + + InventoryPlayer inventory4 = this.mc.thePlayer.inventory; + if (stack != inventory4.getStackInSlot(intVal17)) { + break label1366; + } + } + + intVal4 = byteVal4; + + if (textStr != null) { + return ((intVal4 & 1) != 0); + } + + if (intVal4 != 0) { + return false; + } + } + + intVal = (this.isValidStack6(stack) ? 1 : 0); + + label1368: { + label1369: { + if (textStr == null) { + if (intVal != 0) { + intVal5 = this.getIntValue8(); + + if (intVal5 < 2) { + break label1369; + } + } + + intVal = (stack.getItem() instanceof ItemIronAxe ? 1 : 0); + } + + if (intVal == 0) { + break label1368; + } + + InventoryPlayer inventory5 = this.mc.thePlayer.inventory; + if (stack != inventory5.getStackInSlot(intVal16)) { + break label1368; + } + } + + intVal5 = byteVal; + + if (textStr != null) { + return ((intVal5 & 1) != 0); + } + + if (intVal5 != 0) { + return false; + } + } + + intVal = (this.checkItemStack(stack) ? 1 : 0); + + label1370: { + label1371: { + if (textStr == null) { + if (intVal != 0) { + intVal6 = this.getIntValue6(); + + if (intVal6 < 2) { + break label1371; + } + } + + intVal = (stack.getItem() instanceof ItemIronPickaxe ? 1 : 0); + } + + if (intVal == 0) { + break label1370; + } + + InventoryPlayer inventory6 = this.mc.thePlayer.inventory; + if (stack != inventory6.getStackInSlot(intVal14)) { + break label1370; + } + } + + intVal6 = intVal12; + + if (textStr != null) { + return ((intVal6 & 1) != 0); + } + + if (intVal6 != 0) { + return false; + } + } + + intVal = (this.isValidStack3(stack) ? 1 : 0); + + label1372: { + label1373: { + if (textStr == null) { + if (intVal != 0) { + intVal = this.getIntValue3(); + + if (intVal < 2) { + break label1373; + } + } + + intVal = (stack.getItem() instanceof ItemIronSword ? 1 : 0); + } + + if (intVal == 0) { + break label1372; + } + + InventoryPlayer inventory7 = this.mc.thePlayer.inventory; + if (stack != inventory7.getStackInSlot(intVal13)) { + break label1372; + } + } + + intVal = byteVal2; + + if (intVal != 0) { + return false; + } + } + + intVal = (item3 instanceof ItemArmor ? 1 : 0); + + if (intVal != 0) { + ModuleRegistry modEntry = ModuleRegistry.AUTOARMOR; + AutoArmor autoArmor = modEntry.getModule(); + int intVal39 = 1; + + while (intVal39 < 5) { + mod = this; + + label1376: { + EntityPlayerSP player = this.mc.thePlayer; + int intVal25 = 4 + intVal39; + Slot slot = player.getSlotFromPlayerContainer(intVal25); + flag2 = slot.getHasStack(); + label1092: + if (textStr == null) { + if (flag2) { + EntityPlayerSP player2 = this.mc.thePlayer; + int intVal26 = 4 + intVal39; + Slot slot2 = player2.getSlotFromPlayerContainer(intVal26); + ItemStack stack2 = slot2.getStack(); + flag2 = autoArmor.matchesItemStack(stack2, intVal39); + if (textStr != null) { + break label1092; + } + + if (flag2) { + break label1376; + } + } + + flag2 = autoArmor.matchesItemStack(stack, intVal39); + } + + if (flag2) { + return false; + } + } + + intVal39++; + if (textStr != null) { + break; + } + } + } + + ModuleRegistry modEntry2 = ModuleRegistry.SCAFFOLD; + mod = modEntry2.getModule(); + + label1071: { + label1377: { + Scaffold scaffold = (Scaffold)mod; + StringProperty strProp = this.sortMode; + intVal7 = (strProp.equals("Default") ? 1 : 0); + if (intVal7 == 0) { + break label1377; + } + + List itemList = scaffold.getBlockList(); + Block block = Block.getBlockFromItem(item3); + intVal7 = (itemList.contains(block) ? 1 : 0); + + if (intVal7 != 0) { + intVal7 = 1; + break label1071; + } + } + + intVal7 = 0; + } + + label1612: { + int intVal27 = intVal7; + boolean flag24 = item3 instanceof ItemBlock; + if (textStr == null) { + if (flag24) { + int intVal28 = this.computeIntValue4(); + if (textStr != null) { + return ((intVal28 & 1) != 0); + } + + IntProperty intProp7 = this.blocks; + Integer intVal29 = intProp7.get(); + if (intVal28 > intVal29) { + return true; + } + + if (textStr != null) { + return ((intVal27 & 1) != 0); + } + + if (intVal27 != 0) { + return true; + } + } + + flag24 = item3 instanceof ItemPotion; + } + + if (textStr == null) { + if (flag24) { + boolean flag25 = this.isValidStack4(stack); + if (textStr != null) { + return flag25; + } + + if (flag25) { + return true; + } + } + + flag24 = item3 instanceof ItemFood; + } + + label1040: + if (textStr == null) { + label1038: { + if (flag24) { + flag24 = item3 instanceof ItemGoldenApple; + if (textStr != null) { + break label1040; + } + + if (!flag24) { + item2 = item3; + + if (item3 != Items.bread) { + item2 = item3; + + if (item3 != Items.pumpkin_pie) { + item2 = item3; + + if (item3 != Items.baked_potato) { + item2 = item3; + + if (item3 != Items.cooked_chicken) { + item2 = item3; + + if (item3 != Items.carrot) { + item2 = item3; + + if (item3 != Items.apple) { + item2 = item3; + + if (item3 != Items.beef) { + item2 = item3; + + if (item3 != Items.cooked_beef) { + item2 = item3; + + if (item3 != Items.porkchop) { + item2 = item3; + + if (item3 != Items.cooked_porkchop) { + item2 = item3; + + if (item3 != Items.mushroom_stew) { + item2 = item3; + + if (item3 != Items.cooked_fish) { + item2 = item3; + if (textStr != null) { + break label1038; + } + + if (item3 != Items.melon) { + return true; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + + item2 = item3; + } + + flag24 = item2 instanceof ItemWoodenHoe; + } + + if (!flag24) { + boolean flag26 = item3 instanceof ItemImpl; + + if (!flag26) { + boolean flag27 = item3 instanceof ItemIronSword; + + if (!flag27) { + flag = item3 instanceof ItemArmor; + + if (!flag) { + StringProperty strProp2 = this.sortMode; + flag = strProp2.equals("Default"); + break label1612; + } + } + } + } + + return true; + } + + if (flag) { + String textStr21 = item3.getUnlocalizedName(); + boolean flag28 = textStr21.contains("stick"); + if (textStr == null) { + if (!flag28) { + boolean flag29 = textStr21.contains("egg"); + + label964: + if (!flag29) { + intVal8 = this.getIntX(); + byte byteVal6 = 64; + if (intVal8 > 64 && item3 == Items.iron_ingot) { + break label964; + } + + intVal8 = this.computeIntValue(); + + byteVal6 = 64; + + if (intVal8 > byteVal6 && item3 == Items.coal) { + break label964; + } + + intVal8 = (textStr21.contains("string") ? 1 : 0); + + if (textStr != null) { + return ((intVal8 & 1) != 0); + } + + if (intVal8 == 0) { + boolean flag30 = textStr21.contains("flint"); + + if (!flag30) { + boolean flag31 = textStr21.contains("compass"); + + if (!flag31) { + boolean flag32 = textStr21.contains("dyePowder"); + + if (!flag32) { + boolean flag33 = textStr21.contains("feather"); + + label941: + if (!flag33) { + boolean flag34 = textStr21.contains("chest"); + if (flag34) { + textStr42 = displayName.toLowerCase(); + String textStr22 = "collect"; + byte byteVal7 = (byte)(textStr42.contains( + textStr22 + ) ? 1 : 0); + if (textStr != null) { + return ((byteVal7 & 1) != 0); + } + + if (byteVal7 == 0) { + break label941; + } + } + + flag34 = textStr21.contains("snow"); + + if (!flag34) { + boolean flag35 = textStr21.contains("torch"); + + if (!flag35) { + String textStr23 = "seeds"; + boolean flag36 = textStr21.contains( + textStr23 + ); + + if (!flag36) { + String textStr24 = "leather"; + boolean flag37 = textStr21.contains( + textStr24 + ); + + if (!flag37) { + String textStr25 = "reeds"; + boolean flag38 = textStr21.contains( + textStr25 + ); + + if (!flag38) { + String textStr26 = "record"; + boolean flag39 = textStr21.contains( + textStr26 + ); + + if (!flag39) { + String textStr27 = "snowball"; + boolean flag40 = textStr21.contains( + textStr27 + ); + + if (!flag40) { + boolean flag41 = item3 instanceof ItemGlassBottle; + + if (!flag41) { + boolean flag42 = item3 instanceof ItemRose; + + if (!flag42) { + if (textStr + != null) { + return ((intVal9 & 1) != 0); + } + + if (intVal9 != 113 + ) + { + if (textStr + != null) { + return ((intVal9 & 1) != 0); + } + + label912: + if (intVal9 + != 106) { + int intVal30 = intVal9; + short shortVal = 325; + if (intVal9 + == 325 + ) + { + ListProperty listProp7 = this.keepItems; + String textStr28 = "Buckets"; + byte byteVal8 = (byte)(listProp7.contains( + textStr28 + ) ? 1 : 0); + if (textStr + != null + ) + { + return ((byteVal8 & 1) != 0); + } + + if (byteVal8 + == 0 + ) + { + break label912; + } + + EntityPlayerSP player3 = this.mc + .thePlayer; + int intVal31 = player3.resolveInt( + 325 + ); + if (textStr + != null + ) + { + return ((intVal31 & 1) != 0); + } + + if (intVal31 + > 1 + ) + { + break label912; + } + } + + intVal30 = intVal9; + shortVal = 326; + + if (intVal30 + == shortVal + ) + { + ListProperty listProp8 = this.keepItems; + String textStr29 = "Buckets"; + byte byteVal9 = (byte)(listProp8.contains( + textStr29 + ) ? 1 : 0); + if (textStr + != null + ) + { + return ((byteVal9 & 1) != 0); + } + + if (byteVal9 + == 0 + ) + { + break label912; + } + + EntityPlayerSP player4 = this.mc + .thePlayer; + int intVal32 = player4.resolveInt( + 326 + ); + if (textStr + != null + ) + { + return ((intVal32 & 1) != 0); + } + + if (intVal32 + > 1 + ) + { + break label912; + } + } + + intVal30 = intVal9; + shortVal = 327; + + if (intVal30 + == shortVal + ) + { + ListProperty listProp9 = this.keepItems; + String textStr30 = "Buckets"; + byte byteVal10 = (byte)(listProp9.contains( + textStr30 + ) ? 1 : 0); + if (textStr + != null + ) + { + return ((byteVal10 & 1) != 0); + } + + if (byteVal10 + == 0 + ) + { + break label912; + } + + EntityPlayerSP player5 = this.mc + .thePlayer; + int intVal33 = player5.resolveInt( + 327 + ); + if (textStr + != null + ) + { + return ((intVal33 & 1) != 0); + } + + if (intVal33 + > 1 + ) + { + break label912; + } + } + + intVal30 = intVal9; + shortVal = 335; + + if (textStr + == null + ) + { + if (intVal30 + == shortVal + ) + { + ListProperty listProp10 = this.keepItems; + String textStr31 = "Buckets"; + byte byteVal11 = (byte)(listProp10.contains( + textStr31 + ) ? 1 : 0); + if (textStr + != null + ) + { + return ((byteVal11 & 1) != 0); + } + + if (byteVal11 + == 0 + ) + { + break label912; + } + + EntityPlayerSP player6 = this.mc + .thePlayer; + int intVal34 = player6.resolveInt( + 335 + ); + if (textStr + != null + ) + { + return ((intVal34 & 1) != 0); + } + + if (intVal34 + > 1 + ) + { + break label912; + } + } + + intVal30 = intVal9; + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + shortVal = 111; + } + + if (intVal30 + != shortVal + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 85 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 188 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 189 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 190 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 191 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 401 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 192 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 81 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 32 + ) + { + String textStr32 = "gravel"; + boolean flag43 = textStr21.contains( + textStr32 + ); + + if (!flag43 + ) + { + String textStr33 = "flower"; + boolean flag44 = textStr21.contains( + textStr33 + ); + + if (!flag44 + ) + { + String textStr34 = "tallgrass"; + boolean flag45 = textStr21.contains( + textStr34 + ); + + if (!flag45 + ) + { + boolean flag46 = item3 instanceof ItemBow; + + label845: + if (!flag46 + ) + { + if (item3 + == Items.arrow + ) + { + int intVal35 = this.getIntValue7(); + ListProperty listProp11 = this.keepItems; + String textStr35 = "Bow"; + int intVal36 = (listProp11.contains( + textStr35 + ) ? 1 : 0); + if (intVal36 + != 0 + ) + { + IntProperty intProp8 = this.arrows; + Integer intVal37 = intProp8.get(); + intVal36 = intVal37; + } else { + intVal36 = 0; + } + + if (intVal35 + > intVal36 + ) + { + break label845; + } + } + + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 175 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 340 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 339 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 160 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 101 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 102 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 321 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 323 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 389 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 416 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 171 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 139 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 23 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 25 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 69 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 70 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 72 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 77 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 96 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 107 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 123 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 131 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 143 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 147 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 148 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 151 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 154 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 158 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 167 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 403 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 183 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 184 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 185 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 186 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 187 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 331 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 356 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 404 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 27 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 28 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 66 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 76 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 157 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 328 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 342 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 343 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 398 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 407 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 408 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 138 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 352 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 385 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 386 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 395 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 402 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 418 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 419 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 281 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 289 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 337 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 336 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 348 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 353 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 369 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 372 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 405 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 406 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 409 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 410 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 415 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 370 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 376 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 377 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 378 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 379 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 380 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 382 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 414 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 346 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 347 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 420 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 397 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 421 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 341 + ) + { + String textStr36 = "sapling"; + boolean flag47 = textStr21.contains( + textStr36 + ); + + if (!flag47 + ) + { + String textStr37 = "stairs"; + boolean flag48 = textStr21.contains( + textStr37 + ); + + if (!flag48 + ) + { + String textStr38 = "door"; + boolean flag49 = textStr21.contains( + textStr38 + ); + + if (!flag49 + ) + { + String textStr39 = "monster_egg"; + boolean flag50 = textStr21.contains( + textStr39 + ); + + label664: + if (!flag50 + ) + { + String textStr40 = "sand"; + byte byteVal12 = (byte)(textStr21.contains( + textStr40 + ) ? 1 : 0); + if (byteVal12 + != 0 + ) + { + if (textStr + != null + ) + { + return ((intVal9 & 1) != 0); + } + + if (intVal9 + != 24 + ) + { + break label664; + } + } + + String textStr41 = "piston"; + byteVal12 = (byte)(textStr21.contains( + textStr41 + ) ? 1 : 0); + + if (textStr + != null + ) + { + return ((byteVal12 & 1) != 0); + } + + if (byteVal12 + == 0 + ) + { + return false; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + + flag28 = true; + } + + return flag28; + } + + ListProperty listProp12 = this.customSortIds; + Integer intVal38 = intVal9; + flag = listProp12.contains(intVal38); + + flag = !flag; + + return flag; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + + intVal10 = 0; + } + + return ((intVal10 & 1) != 0); +} + + public BooleanProperty getNoMove() { + return this.noMove; +} + + public BooleanProperty getBooleanPropertyValue2() { + return this.getNoMove(); +} + + private int getIntValue9() { + int slot2; + int intVal = 0; + int intVal2 = 0; + + while (true) { + if (intVal2 < 45) { + label46: { + EntityPlayerSP player = this.mc.thePlayer; + Slot slot = player.getSlotFromPlayerContainer(intVal2); + slot2 = (slot.getHasStack() ? 1 : 0); + + if (slot2 == 0) { + break label46; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + slot = player2.getSlotFromPlayerContainer(intVal2); + + ItemStack stack = slot.getStack(); + + label30: + if (stack.getItem() instanceof ItemSkull) { + int intVal3 = (this.isValidStack5(stack) ? 1 : 0); + if (intVal3 == 0) { + break label30; + } + + intVal3 = intVal + stack.stackSize; + + intVal = intVal3; + } + } + + intVal2++; + + continue; + } + + slot2 = intVal; + break; + } + + return slot2; +} + + public IntProperty getShovelSlot() { + return this.shovelSlot; +} + + public IntProperty getIntPropertyK() { + return this.getShovelSlot(); +} + + private void performStep17() { + Disabler disabler; + boolean enabled2; + disabler = ModuleRegistry.DISABLER.getModule(); + enabled2 = disabler.isEnabled(); + + if (enabled2) { + enabled2 = disabler.isFlagK(); + + if (enabled2) { + return; + } + } + + BooleanProperty boolProp = this.noMove; + Boolean propFlag = boolProp.get(); + enabled2 = propFlag; + + + if (enabled2) { + return; + } + + enabled2 = disabler.isEnabled(); + + + label20: { + if (!enabled2) { + this.popNotification(this.getDisplayName(), "No Moving keept enabled for your safety, enable Disabler module to bypass inventory moving click", 5000, NotificationType.WARNING); + break label20; + } + + this.popNotification(this.getDisplayName(), "No Moving keept enabled for your safety, enable Inventory Click Bypass feature in Disabler to bypass inventory move click", 5000, NotificationType.WARNING); + } + + BooleanProperty boolProp2 = this.noMove; + Boolean flag = true; + boolProp2.set(flag); +} + + public InvManager(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.timer = new TimerUtil(); + this.inventoryCleaner = BooleanProperty.of(true); + this.openInventory = BooleanProperty.of(false); + this.noMove = BooleanProperty.of(false); + IntProperty intProp = IntProperty.of(1); + Integer intVal = 1; + IntProperty intProp2 = intProp.minimum(intVal); + this.delay = intProp2.maximum(10); + IntProperty intProp3 = IntProperty.of(128); + IntProperty intProp4 = intProp3.minimum(64); + this.arrows = intProp4.maximum(512); + IntProperty intProp5 = IntProperty.of(128); + IntProperty intProp6 = intProp5.minimum(0); + this.blocks = intProp6.maximum(512); + IntProperty intProp7 = IntProperty.of(7); + IntProperty intProp8 = intProp7.minimum(1); + this.pickaxeSlot = intProp8.maximum(9); + IntProperty intProp9 = IntProperty.of(8); + IntProperty intProp10 = intProp9.minimum(1); + this.axeSlot = intProp10.maximum(9); + IntProperty intProp11 = IntProperty.of(9); + IntProperty intProp12 = intProp11.minimum(1); + this.shovelSlot = intProp12.maximum(9); + IntProperty intProp13 = IntProperty.of(1); + IntProperty intProp14 = intProp13.minimum(1); + this.weaponSlot = intProp14.maximum(9); + IntProperty intProp15 = IntProperty.of(2); + IntProperty intProp16 = intProp15.minimum(1); + this.bowSlot = intProp16.maximum(9); + IntProperty intProp17 = IntProperty.of(3); + IntProperty intProp18 = intProp17.minimum(1); + this.headSlot = intProp18.maximum(9); + IntProperty intProp19 = IntProperty.of(4); + IntProperty intProperty = intProp19.minimum(1); + this.gappleSlot = intProperty.maximum(9); + this.autoDisable = BooleanProperty.of(true); + ListProperty listProp = ListProperty.of("Sword", "Bow"); + String[] stringArr = new String[]{"Sword", "Bow", "Pickaxe", "Axe", "Shovel", "Golden Apple", "Head", "Buckets"}; + this.keepItems = listProp.acceptableValues((Object[])stringArr); + StringProperty strProp = StringProperty.of("Default"); + String[] stringArr2 = new String[]{"Custom", "Default"}; + this.sortMode = strProp.acceptableValues(stringArr2); + Integer[] integerArr = new Integer[0]; + this.customSortIds = ListProperty.of(integerArr); + Setting setting = new Setting("IM_SORT_MODE", "Sort Mode", SettingType.COMBOBOX, this, this.sortMode); + SettingManager.register(setting); + Setting setting2 = new Setting("IM_CLEANER", "Cleaner", SettingType.CHECKBOX, this, this.inventoryCleaner); + SettingManager.register(setting2); + Setting setting3 = new Setting("IM_OPEN_INV", "Open Inventory", SettingType.CHECKBOX, this, this.openInventory); + SettingManager.register(setting3); + Setting setting4 = new Setting("IM_NO_MOVE", "No Moving", SettingType.CHECKBOX, this, this.noMove); + SettingManager.register(setting4); + Setting setting5 = new Setting("IM_DELAY", "Delay", SettingType.SLIDER, this, this.delay, 1.0); + SettingManager.register(setting5); + setting5 = new Setting("IM_BLOCKS", "Blocks", SettingType.SLIDER, this, this.blocks, 64.0, this.inventoryCleaner::get); + SettingManager.register(setting5); + setting5 = new Setting("IM_ARROWS", "Arrows", SettingType.SLIDER, this, this.arrows, 64.0, this::lambdaImpl$new$0); + SettingManager.register(setting5); + setting5 = new Setting("IM_KEEP_ITEMS", "Keep Items", SettingType.SELECTBOX, this, this.keepItems); + SettingManager.register(setting5); + setting5 = new Setting("IM_SLOT_CHANGE", "Preferred slots", SettingType.BUTTON, this, this::handleString); + SettingManager.register(setting5); + setting5 = new Setting("IM_WHITELIST", "Item management", SettingType.BUTTON, this, this::handleString2, () -> this.sortMode.equals("Custom")); + SettingManager.register(setting5); + setting5 = new Setting("IM_AUTO_DISABLE", "Auto Disable", SettingType.CHECKBOX, this, this.autoDisable); + SettingManager.register(setting5); +} + + private int computeIntValue4() { + int slot2; + int intVal = 0; + int intVal2 = 0; + + while (true) { + if (intVal2 < 45) { + label46: { + EntityPlayerSP player = this.mc.thePlayer; + Slot slot = player.getSlotFromPlayerContainer(intVal2); + slot2 = (slot.getHasStack() ? 1 : 0); + + if (slot2 == 0) { + break label46; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + slot = player2.getSlotFromPlayerContainer(intVal2); + + ItemStack stack = slot.getStack(); + Item item = stack.getItem(); + ModuleRegistry modEntry = ModuleRegistry.SCAFFOLD; + Scaffold scaffold = modEntry.getModule(); + + label30: + if (stack.getItem() instanceof ItemBlock) { + List itemList = scaffold.getBlockList(); + Block block = ((ItemBlock)item).getBlock(); + int intVal3 = (itemList.contains(block) ? 1 : 0); + if (intVal3 != 0) { + break label30; + } + + intVal3 = intVal + stack.stackSize; + + intVal = intVal3; + } + } + + intVal2++; + + continue; + } + + slot2 = intVal; + break; + } + + return slot2; +} + + private float getItemScore2(@NonNull ItemStack stack) { + String textStr3 = ChestStealer.getFlowMarker(); + Item item = stack.getItem(); + String textStr = textStr3; + Item item2 = item; + if (textStr == null) { + if (!(item instanceof ItemImpl)) { + return 0.0F; + } + + item2 = item; + } + + float floatVal; + label64: { + String textStr2 = item2.getUnlocalizedName(); + ItemImpl itemImpl = (ItemImpl)item; + boolean flag = item instanceof ItemIronPickaxe; + if (textStr == null) { + if (flag) { + floatVal = itemImpl.getStrVsBlock(stack, Blocks.stone); + + textStr3 = textStr2.toLowerCase(); + if (!textStr3.contains("gold")) { + break label64; + } + + floatVal -= 5.0F; + break label64; + } + + flag = item instanceof ItemIronShovel; + } + + if (textStr == null) { + if (flag) { + floatVal = itemImpl.getStrVsBlock(stack, Blocks.dirt); + + textStr3 = textStr2.toLowerCase(); + if (!textStr3.contains("gold")) { + break label64; + } + + floatVal -= 5.0F; + break label64; + } + + flag = item instanceof ItemIronAxe; + } + + if (!flag) { + return 1.0F; + } + + floatVal = itemImpl.getStrVsBlock(stack, Blocks.log); + + textStr3 = textStr2.toLowerCase(); + if (textStr3.contains("gold")) { + floatVal -= 5.0F; + + } + } + + double doubleVal = floatVal; + int intVal = Enchantment.efficiency.effectId; + floatVal = (float)(doubleVal + ChestStealerSupport.getEnchantmentLevel(intVal, stack) * 0.0075); + double doubleVal2 = floatVal; + intVal = Enchantment.unbreaking.effectId; + return (float)(doubleVal2 + ChestStealerSupport.getEnchantmentLevel(intVal, stack) * 0.01); +} + + private boolean isValidStack5(@NonNull ItemStack stack) { + int slot3; + Item item = stack.getItem(); + boolean flag = item instanceof ItemIronShovel; + if (flag) { + float floatVal = this.getItemScore2(stack); + ItemStack stack2 = null; + int intVal = 9; + + while (true) { + if (intVal < 45) { + EntityPlayerSP player = this.mc.thePlayer; + Slot slot = player.getSlotFromPlayerContainer(intVal); + slot3 = (slot.getHasStack() ? 1 : 0); + + label55: { + if (slot3 == 0) { + break label55; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + Slot slot2 = player2.getSlotFromPlayerContainer(intVal); + stack2 = slot2.getStack(); + + if (this.getItemScore2(stack2) > floatVal) { + boolean flag2 = stack2.getItem() instanceof ItemIronShovel; + + if (flag2) { + return false; + } + } + } + + intVal++; + + continue; + } + + float floatVal2; + slot3 = (floatVal2 = this.getItemScore2(stack) - this.getItemScore2(stack2)) == 0.0F ? 0 : (floatVal2 < 0.0F ? -1 : 1); + break; + } + + if (slot3 > 0) { + return true; + } + + slot3 = stack.getItemDamage(); + + slot3 = slot3 <= stack2.getItemDamage() ? 1 : 0; + + return ((slot3 & 1) != 0); + } + + flag = false; + + return flag; +} + + @EventTarget + public void onLoadWorld(LoadWorldEvent event) { + Boolean propFlag = this.autoDisable.get(); + if (propFlag) { + this.popNotification(this.getDisplayName(), "Module was disabled due to world change", 3000, NotificationType.WARNING); + this.toggle(); + } +} + + public IntProperty getDelay() { + return this.delay; +} + + public IntProperty getIntPropertyValue() { + return this.getDelay(); +} + + private boolean isValidStack6(@NonNull ItemStack stack) { + int slot3; + Item item = stack.getItem(); + boolean flag = item instanceof ItemIronAxe; + if (flag) { + float floatVal = this.getItemScore2(stack); + ItemStack stack2 = null; + int intVal = 9; + + while (true) { + if (intVal < 45) { + EntityPlayerSP player = this.mc.thePlayer; + Slot slot = player.getSlotFromPlayerContainer(intVal); + slot3 = (slot.getHasStack() ? 1 : 0); + + label55: { + if (slot3 == 0) { + break label55; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + Slot slot2 = player2.getSlotFromPlayerContainer(intVal); + stack2 = slot2.getStack(); + + if (this.getItemScore2(stack2) > floatVal) { + boolean flag2 = stack2.getItem() instanceof ItemIronAxe; + + if (flag2) { + return false; + } + } + } + + intVal++; + + continue; + } + + float floatVal2; + slot3 = (floatVal2 = this.getItemScore2(stack) - this.getItemScore2(stack2)) == 0.0F ? 0 : (floatVal2 < 0.0F ? -1 : 1); + break; + } + + if (slot3 > 0) { + return true; + } + + slot3 = stack.getItemDamage(); + + slot3 = slot3 <= stack2.getItemDamage() ? 1 : 0; + + return ((slot3 & 1) != 0); + } + + flag = false; + + return flag; +} + + private int getIntX() { + int slot2; + int intVal = 0; + int intVal2 = 0; + + while (true) { + if (intVal2 < 45) { + label38: { + EntityPlayerSP player = this.mc.thePlayer; + Slot slot = player.getSlotFromPlayerContainer(intVal2); + slot2 = (slot.getHasStack() ? 1 : 0); + + if (slot2 == 0) { + break label38; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + slot = player2.getSlotFromPlayerContainer(intVal2); + + ItemStack stack = slot.getStack(); + + if (stack.getItem() == Items.iron_ingot) { + intVal += stack.stackSize; + } + } + + intVal2++; + + continue; + } + + slot2 = intVal; + break; + } + + return slot2; +} + + public IntProperty getBowSlot() { + return this.bowSlot; +} + + public IntProperty getIntProperty5() { + return this.getBowSlot(); +} + + private Boolean lambdaImpl$new$0() { + boolean flag; + label21: { + label23: { + ListProperty listProp = this.keepItems; + flag = listProp.contains("Bow"); + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.inventoryCleaner; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private void handleString2(String text) { + Minecraft mcClient = this.mc; + mcClient.displayGuiScreen(new GuiItemWhitelist()); +} + + private int computeIntValue5() { + int slot2; + int intVal = 0; + int intVal2 = 0; + + while (true) { + if (intVal2 < 45) { + label46: { + EntityPlayerSP player = this.mc.thePlayer; + Slot slot = player.getSlotFromPlayerContainer(intVal2); + slot2 = (slot.getHasStack() ? 1 : 0); + + if (slot2 == 0) { + break label46; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + slot = player2.getSlotFromPlayerContainer(intVal2); + + ItemStack stack = slot.getStack(); + + label30: + if (stack.getItem() instanceof ItemBow) { + int intVal3 = (this.isValidStack2(stack) ? 1 : 0); + if (intVal3 == 0) { + break label30; + } + + intVal3 = intVal + stack.stackSize; + + intVal = intVal3; + } + } + + intVal2++; + + continue; + } + + slot2 = intVal; + break; + } + + return slot2; +} + +} diff --git a/src/main/java/cc/novoline/modules/player/NoRotate.java b/src/main/java/cc/novoline/modules/player/NoRotate.java new file mode 100644 index 0000000..a29b386 --- /dev/null +++ b/src/main/java/cc/novoline/modules/player/NoRotate.java @@ -0,0 +1,13 @@ +package cc.novoline.modules.player; + +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.ModuleManager; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class NoRotate extends AbstractModule { + + public NoRotate(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); +} +} diff --git a/src/main/java/cc/novoline/modules/player/Respawn.java b/src/main/java/cc/novoline/modules/player/Respawn.java new file mode 100644 index 0000000..2502860 --- /dev/null +++ b/src/main/java/cc/novoline/modules/player/Respawn.java @@ -0,0 +1,45 @@ +package cc.novoline.modules.player; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.misc.UhcCrafts; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.GuiGameOver; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class Respawn extends AbstractModule { + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + Minecraft mcClient; + + boolean flag = event.getState().equals(State.PRE); + + if (!flag) { + return; + } + + mcClient = this.mc; + + flag = this.mc.currentScreen instanceof GuiGameOver; + + + if (!flag) { + return; + } + + mcClient = this.mc; + + EntityPlayerSP player = mcClient.thePlayer; + player.respawnPlayer(); +} + + public Respawn(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); +} +} diff --git a/src/main/java/cc/novoline/modules/player/Scaffold.java b/src/main/java/cc/novoline/modules/player/Scaffold.java new file mode 100644 index 0000000..799e1d5 --- /dev/null +++ b/src/main/java/cc/novoline/modules/player/Scaffold.java @@ -0,0 +1,2364 @@ +package cc.novoline.modules.player; + +import cc.novoline.events.events.FallDistanceEvent; +import cc.novoline.events.events.JumpEvent; +import cc.novoline.events.events.MoveInputEvent; +import cc.novoline.events.events.RightClickEvent; +import cc.novoline.gui.screen.config.GuiConfig; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.modules.configurations.util.RotationVector; +import cc.novoline.modules.configurations.util.ScaffoldBlockData; +import cc.novoline.utils.ServerUtils; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.anim.SmoothAnimation; +import cc.novoline.utils.helper.BlockPlaceRayResult; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.render.RotationAngleUtil; + +import cc.novoline.events.EventManager; +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.MoveEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.PlayerUpdateEvent; +import cc.novoline.events.events.SettingEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.exploits.Disabler; +import cc.novoline.modules.move.Fly; +import cc.novoline.modules.move.LongJump; +import cc.novoline.modules.move.Speed; +import cc.novoline.modules.visual.HUD; +import cc.novoline.modules.ModuleRegistry; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.ThreadLocalRandom; +import java.util.function.Consumer; +import net.minecraft.block.BlockSnowLayer; +import net.minecraft.network.play.server.S29PacketSoundEffect; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.minecraft.util.MovementInput; +import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.util.MathHelper; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; + +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.network.play.client.C0APacketAnimation; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.network.Packet; +import net.minecraft.network.play.client.C0BPacketEntityAction$Action; +import net.minecraft.potion.Potion; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.Vec3; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.jetbrains.annotations.NotNull; + +public class Scaffold extends AbstractModule { + @Property("item-spoof") + private BooleanProperty itemSpoof; + private SmoothAnimation smoothAnim; + @Property("slot") + private IntProperty slot; + private double cachedValue; + @Property("icon") + private BooleanProperty icon; + private boolean flagValue; + @Property("roundness") + private DoubleProperty roundness; + private TimerUtil timerUtilField; + @Property("swapper") + private BooleanProperty swapper; + private float floatValue; + @Property("spoof-mode") + private StringProperty spoofMode; + @Property("block-indicator") + private BooleanProperty blockIndicator; + private boolean stateFlag; + private float floatValueField; + private BlockPlaceRayResult blockPlaceRayResultField; + private float floatValueField2; + private ScaffoldBlockData scaffoldBlockDataField; + @Property("towermove-mode") + private StringProperty towermoveMode; + @Property("no-sprint") + private BooleanProperty noSprint; + @Property("max-angle") + private IntProperty maxAngle; + private int intValueField; + private List packetList; + @Property("place-method") + private StringProperty placeMethod; + private int stateTicks; + private float cachedAngle; + @Property("background") + private BooleanProperty background; + @Property("item-swing") + private BooleanProperty itemSwing; + private float cachedAngle2; + @Property("sprint-mode") + private StringProperty sprintMode; + private static int[] intArray2; + private float cachedAngle3; + private float cachedAngle4; + @Property("smoothness") + private IntProperty smoothness; + @Property("rotations-method") + private StringProperty rotationsMethod; + @Property("speed-amplifier-hypixel") + private DoubleProperty speedAmplifierHypixel; + private RotationVector rotationVectorField; + @Property("swapper-delay") + private IntProperty swapperDelay; + private BlockPos targetPos; + private int stateTicks2; + private static final long XOR_KEY = 109401761302129L; + private double cachedValue2; + private List blockList; + private float X; + @Property("tower-mode") + private StringProperty towerMode; + private float floatValueField3; + @Property("alpha") + private IntProperty alpha; + @Property("speed-amplifier") + private DoubleProperty speedAmplifier; + + private void updateHelper2() { + List itemList = this.packetList; + Consumer> consumer = this::handlePacket; + itemList.forEach(consumer); + itemList = this.packetList; + itemList.clear(); +} + + public static SmoothAnimation resolveSmoothAnimation(Scaffold scaffold) { + return scaffold.smoothAnim; +} + + public boolean isFlagW() { + boolean flag = this.sprintMode.equals("Hypixel"); + if (!flag) { + return false; + } + + flag = this.isReadyState15(); + + if (!flag) { + return false; + } + + flag = this.mc.thePlayer.onGround; + + return flag; +} + + public float getFloatValue2() { + return this.floatValue; +} + + @EventTarget + public void onMove(MoveEvent event) { + cc.novoline.modules.player.Scaffold scaffold; + boolean flag3 = this.isReadyState15(); + if (flag3) { + StringProperty strProp = this.sprintMode; + boolean flag = strProp.equals("Hypixel"); + if (flag) { + if (this.mc.thePlayer.onGround) { + EntityPlayerSP player2 = this.mc.thePlayer; + Double speed = this.speedAmplifierHypixel.get(); + double speed2 = speed / 10.0; + event.applyDouble(player2.applyArmorCalculations(true, speed2) * 0.972); + return; + } + + EntityPlayerSP player3 = this.mc.thePlayer; + event.applyDouble(player3.resolveDouble(false) * 0.95); + return; + } + + StringProperty strProp2 = this.sprintMode; + flag = strProp2.equals("Vanilla"); + + if (flag) { + EntityPlayerSP player4 = this.mc.thePlayer; + DoubleProperty doubleProp = this.speedAmplifier; + Double propDouble = doubleProp.get(); + double doubleVal2 = propDouble / 10.0; + event.applyDouble(player4.applyArmorCalculations(true, doubleVal2) * 0.98); + return; + } + + StringProperty strProp3 = this.sprintMode; + flag = strProp3.equals("None"); + + if (!flag) { + return; + } + + EntityPlayerSP player5 = this.mc.thePlayer; + double doubleVal = player5.resolveDouble(false); + event.applyDouble(doubleVal * (ServerUtils.isHypixel() ? 0.95 : 0.98)); + return; + } + + flag3 = this.checkState16(); + + if (flag3) { + label187: { + label152: { + + StringProperty strProp4 = this.towermoveMode; + String textStr = "Vanilla"; + boolean flag2 = strProp4.equals(textStr); + if (flag2) { + this.handleMoveEvent(event); + break label187; + } + + scaffold = this; + + StringProperty strProp5 = this.towermoveMode; + textStr = "Basic"; + flag2 = strProp5.equals(textStr); + + if (!flag2) { + StringProperty strProp6 = this.towermoveMode; + textStr = "Slow"; + flag3 = strProp6.equals(textStr); + + if (!flag3) { + break label152; + } + } + + scaffold = this; + + scaffold.applyInt5(event); + + break label187; + + } + + StringProperty strProp7 = this.towerMode; + flag3 = strProp7.equals("None"); + + if (flag3) { + flag3 = this.mc.thePlayer.onGround; + + if (this.mc.thePlayer.onGround) { + event.setCachedValue32(this.mc.thePlayer.motionY = 0.42F); + } + } + } + + StringProperty strProp8 = this.towermoveMode; + flag3 = strProp8.equals("Slow"); + + if (flag3) { + EntityPlayerSP player6 = this.mc.thePlayer; + event.applyDouble(player6.resolveDouble(false) * (this.mc.thePlayer.onGround ? 0.95 : 0.725)); + return; + } + + StringProperty strProp9 = this.sprintMode; + flag3 = strProp9.equals("Hypixel"); + + if (flag3) { + EntityPlayerSP player7 = this.mc.thePlayer; + event.applyDouble(player7.resolveDouble(false) * (this.mc.thePlayer.onGround ? 0.95 : 0.9)); + return; + } + + StringProperty strProp10 = this.sprintMode; + flag3 = strProp10.equals("Vanilla"); + + if (!flag3) { + return; + } + + BooleanProperty boolProp = this.noSprint; + Boolean propFlag = boolProp.get(); + flag3 = propFlag; + + if (flag3) { + EntityPlayerSP player8 = this.mc.thePlayer; + event.applyDouble(player8.resolveDouble(false) * 0.98); + return; + } + + EntityPlayerSP player9 = this.mc.thePlayer; + DoubleProperty doubleProp2 = this.speedAmplifier; + Double propDouble2 = doubleProp2.get(); + double doubleVal3 = propDouble2 / 10.0; + event.applyDouble(player9.applyArmorCalculations(true, doubleVal3) * 0.98); + return; + } + + flag3 = this.checkState17(); + + if (!flag3) { + return; + } + + StringProperty strProp11 = this.towerMode; + flag3 = strProp11.equals("Vanilla"); + + label190: { + if (flag3) { + this.handleMoveEvent(event); + break label190; + } + + StringProperty strProp12 = this.towerMode; + flag3 = strProp12.equals("Basic"); + + if (flag3) { + this.applyInt5(event); + break label190; + } + + StringProperty strProp13 = this.towerMode; + flag3 = strProp13.equals("None"); + + + if (!flag3) { + break label190; + } + + flag3 = this.mc.thePlayer.onGround; + + + if (flag3) { + event.setCachedValue32(this.mc.thePlayer.motionY = 0.42F); + } + } + + event.setMoveSpeed(0.0); +} + + @EventTarget + public void handleJumpEvent(JumpEvent event) { + event.setCancelled(true); +} + + public static IntProperty resolveIntProperty(Scaffold scaffold) { + return scaffold.alpha; +} + + public static Minecraft resolveMinecraft31(Scaffold scaffold) { + return scaffold.mc; +} + + private boolean checkState16() { + boolean flag = this.mc.thePlayer.isMoving(); + if (!flag) { + return false; + } + + EntityPlayerSP player = this.mc.thePlayer; + flag = player.getMovementInput().evaluateCondition2(); + + return flag; +} + + + public static int[] getIntArrayValue() { + return intArray2; +} + + @EventTarget + public void handleRightClickEvent(RightClickEvent event) { + event.setCancelled(true); +} + + private void lambdaImpl$new$0(String text) { + Minecraft mcClient = this.mc; + mcClient.displayGuiScreen(new GuiConfig()); +} + + private Boolean supplyBoolean() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.blockIndicator.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.background; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + public Scaffold(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + IntProperty intProp = IntProperty.of(5); + Integer intVal = 1; + IntProperty intProp2 = intProp.minimum(intVal); + this.slot = intProp2.maximum(9); + StringProperty strProp = StringProperty.of("Pre"); + String[] stringArr = new String[]{"Pre", "Post"}; + this.placeMethod = strProp.acceptableValues(stringArr); + StringProperty strProp2 = StringProperty.of("Backward"); + String[] stringArr2 = new String[]{"Backward", "Basic"}; + this.rotationsMethod = strProp2.acceptableValues(stringArr2); + StringProperty strProp3 = StringProperty.of("Hypixel"); + String[] stringArr3 = new String[]{"None", "Hypixel", "Vanilla"}; + this.sprintMode = strProp3.acceptableValues(stringArr3); + StringProperty strProp4 = StringProperty.of("Vanilla"); + String[] stringArr4 = new String[]{"None", "Slow", "Basic", "Vanilla"}; + this.towermoveMode = strProp4.acceptableValues(stringArr4); + this.noSprint = BooleanProperty.of(false); + StringProperty strProp5 = StringProperty.of("None"); + String[] stringArr5 = new String[]{"None", "Basic", "Vanilla"}; + this.towerMode = strProp5.acceptableValues(stringArr5); + this.swapper = BooleanProperty.of(true); + IntProperty intProp3 = IntProperty.of(300); + IntProperty intProp4 = intProp3.minimum(50); + this.swapperDelay = intProp4.maximum(500); + this.itemSpoof = BooleanProperty.of(true); + this.itemSwing = BooleanProperty.of(false); + this.blockIndicator = BooleanProperty.of(true); + this.icon = BooleanProperty.of(true); + this.background = BooleanProperty.of(true); + IntProperty intProp5 = IntProperty.of(120); + IntProperty intProp6 = intProp5.minimum(100); + this.alpha = intProp6.maximum(255); + this.roundness = DoubleProperty.of(12.0).minimum(0.0).maximum(24.0); + IntProperty intProp7 = IntProperty.of(8); + IntProperty intProp8 = intProp7.minimum(0); + this.smoothness = intProp8.maximum(16); + StringProperty strProp6 = StringProperty.of("Fake"); + String[] stringArr6 = new String[]{"Basic", "Fake"}; + this.spoofMode = strProp6.acceptableValues(stringArr6); + this.speedAmplifier = DoubleProperty.of(1.4).minimum(0.0).maximum(2.0); + this.speedAmplifierHypixel = DoubleProperty.of(0.3).minimum(0.0).maximum(1.0); + IntProperty intProp9 = IntProperty.of(45); + IntProperty intProp10 = intProp9.minimum(30); + this.maxAngle = intProp10.maximum(90); + Block[] blockArr = new Block[]{ + Blocks.air, + Blocks.water, + Blocks.flowing_water, + Blocks.lava, + Blocks.wooden_slab, + Blocks.wooden_slab, + Blocks.chest, + Blocks.flowing_lava, + Blocks.enchanting_table, + Blocks.carpet, + Blocks.glass_pane, + Blocks.skull, + Blocks.stained_glass_pane, + Blocks.iron_bars, + Blocks.snow_layer, + Blocks.ice, + Blocks.packed_ice, + Blocks.coal_ore, + Blocks.diamond_ore, + Blocks.emerald_ore, + Blocks.chest, + Blocks.trapped_chest, + Blocks.torch, + Blocks.anvil, + Blocks.trapped_chest, + Blocks.noteblock, + Blocks.jukebox, + Blocks.gold_ore, + Blocks.iron_ore, + Blocks.lapis_ore, + Blocks.lit_redstone_ore, + Blocks.quartz_ore, + Blocks.redstone_ore, + Blocks.wooden_pressure_plate, + Blocks.stone_pressure_plate, + Blocks.trapped_chest, + Blocks.light_weighted_pressure_plate, + Blocks.heavy_weighted_pressure_plate, + Blocks.stone_button, + Blocks.wooden_button, + Blocks.lever, + Blocks.tallgrass, + Blocks.tripwire, + Blocks.tripwire_hook, + Blocks.rail, + Blocks.waterlily, + Blocks.red_flower, + Blocks.red_mushroom, + Blocks.brown_mushroom, + Blocks.vine, + Blocks.trapdoor, + Blocks.yellow_flower, + Blocks.ladder, + Blocks.furnace, + Blocks.sand, + Blocks.cactus, + Blocks.dispenser, + Blocks.noteblock, + Blocks.dropper, + Blocks.crafting_table, + Blocks.pumpkin, + Blocks.sapling, + Blocks.cobblestone_wall, + Blocks.fence, + Blocks.activator_rail, + Blocks.detector_rail, + Blocks.golden_rail, + Blocks.redstone_torch, + Blocks.acacia_stairs, + Blocks.birch_stairs, + Blocks.brick_stairs, + Blocks.dark_oak_stairs, + Blocks.jungle_stairs, + Blocks.nether_brick_stairs, + Blocks.oak_stairs, + Blocks.quartz_stairs, + Blocks.red_sandstone_stairs, + Blocks.sandstone_stairs, + Blocks.spruce_stairs, + Blocks.stone_brick_stairs, + Blocks.stone_stairs, + Blocks.wooden_slab, + Blocks.double_wooden_slab, + Blocks.stone_slab, + Blocks.double_stone_slab, + Blocks.stone_slab2, + Blocks.double_stone_slab2, + Blocks.web, + Blocks.gravel, + Blocks.daylight_detector_inverted, + Blocks.daylight_detector, + Blocks.soul_sand, + Blocks.piston, + Blocks.piston_extension, + Blocks.piston_head, + Blocks.sticky_piston, + Blocks.iron_trapdoor, + Blocks.ender_chest, + Blocks.end_portal, + Blocks.end_portal_frame, + Blocks.standing_banner, + Blocks.wall_banner, + Blocks.deadbush, + Blocks.slime_block, + Blocks.acacia_fence_gate, + Blocks.birch_fence_gate, + Blocks.dark_oak_fence_gate, + Blocks.jungle_fence_gate, + Blocks.spruce_fence_gate, + Blocks.fence_gate, + Blocks.double_plant + }; + this.blockList = Arrays.asList(blockArr); + this.scaffoldBlockDataField = new ScaffoldBlockData(this); + this.smoothAnim = new SmoothAnimation(); + this.packetList = new ArrayList<>(); + this.timerUtilField = new TimerUtil(); + ThreadLocalRandom threadLocalRandom = ThreadLocalRandom.current(); + this.cachedValue2 = threadLocalRandom.nextDouble(0.9, 0.95); + Setting setting = new Setting("SF_BLOCK_SLOT", "Block Slot", SettingType.BUTTON, this, this::lambdaImpl$new$0); + SettingManager.register(setting); + Setting setting2 = new Setting("SF_PLACE_METHOD", "Place Method", SettingType.COMBOBOX, this, this.placeMethod); + SettingManager.register(setting2); + Setting setting3 = new Setting("SF_ROTATIONS_METHOD", "Rotations Method", SettingType.COMBOBOX, this, this.rotationsMethod); + SettingManager.register(setting3); + Setting setting4 = new Setting("SF_MAX_ANGLE", "Max Angle", SettingType.SLIDER, this, this.maxAngle, 15.0); + SettingManager.register(setting4); + Setting setting5 = new Setting("SF_FEATURES_SECTION", "FEATURES", SettingType.SEPARATOR, this); + SettingManager.register(setting5); + Setting setting6 = new Setting("SF_ITEM_SPOOF", "Item Spoof", SettingType.CHECKBOX, this, this.itemSpoof); + SettingManager.register(setting6); + Setting setting7 = new Setting("SF_ITEM_SPOOF_MODE", "Spoof Mode", SettingType.COMBOBOX, this, this.spoofMode, this.itemSpoof::get); + SettingManager.register(setting7); + Setting setting8 = new Setting("SF_ITEM_SWING", "Item Swing", SettingType.CHECKBOX, this, this.itemSwing); + SettingManager.register(setting8); + Setting setting9 = new Setting("SF_SWAPPER", "Swapper", SettingType.CHECKBOX, this, this.swapper); + SettingManager.register(setting9); + Setting setting10 = new Setting("SF_BLOCK_INDICATOR", "Block Indicator", SettingType.CHECKBOX, this, this.blockIndicator); + SettingManager.register(setting10); + Setting setting11 = new Setting("SF_SWAPPER_SECTION", "SWAPPER", SettingType.SEPARATOR, this, this.swapper::get); + SettingManager.register(setting11); + Setting setting12 = new Setting("SF_SWAPPER_DELAY", "Delay", SettingType.SLIDER, this, this.swapperDelay, 50.0, this.swapper::get); + SettingManager.register(setting12); + Setting setting13 = new Setting("SF_BLOCK_INDICATOR_SECTION", "BLOCK INDICATOR", SettingType.SEPARATOR, this, this.blockIndicator::get); + SettingManager.register(setting13); + Setting setting14 = new Setting("SF_BLOCK_INDICATOR_ICON", "Icon", SettingType.CHECKBOX, this, this.icon, this.blockIndicator::get); + SettingManager.register(setting14); + Setting setting15 = new Setting("SF_BLOCK_INDICATOR_BACKGROUND", "Background", SettingType.CHECKBOX, this, this.background, this.blockIndicator::get); + SettingManager.register(setting15); + Setting setting16 = new Setting("SF_BLOCK_INDICATOR_ALPHA", "Alpha", SettingType.SLIDER, this, this.alpha, 5.0, this::supplyBoolean3); + SettingManager.register(setting16); + Setting setting17 = new Setting("SF_BLOCK_INDICATOR_ROUNDNESS", "Roundess", SettingType.SLIDER, this, this.roundness, 1.0, this::supplyBoolean); + SettingManager.register(setting17); + Setting setting18 = new Setting("SF_BLOCK_INDICATOR_SMOOTHNESS", "Smoothness", SettingType.SLIDER, this, this.smoothness, 1.0, this::supplyBoolean2); + SettingManager.register(setting18); + Setting setting19 = new Setting("SF_MOVING_SECTION", "MOVING", SettingType.SEPARATOR, this); + SettingManager.register(setting19); + Setting setting20 = new Setting("SF_SPRINT_METHOD", "Sprint Mode", SettingType.COMBOBOX, this, this.sprintMode); + SettingManager.register(setting20); + Setting setting21 = new Setting("SF_SPRINT_SPEED_AMPLIFIER", "Speed Potion Amplifier", SettingType.SLIDER, this, this.speedAmplifier, 0.1, () -> this.sprintMode.equals("Vanilla")); + SettingManager.register(setting21); + Setting setting22 = new Setting("SF_SPRINT_SPEED_AMPLIFIER_HYPIXEL", "Speed Potion Amplifier", SettingType.SLIDER, this, this.speedAmplifierHypixel, 0.1, () -> this.sprintMode.equals("Hypixel")); + SettingManager.register(setting22); + Setting setting23 = new Setting("SF_TOWERMOVE_SECTION", "TOWERMOVE", SettingType.SEPARATOR, this); + SettingManager.register(setting23); + Setting setting24 = new Setting("SF_TOWERMOVE_METHOD", "Mode", SettingType.COMBOBOX, this, this.towermoveMode); + SettingManager.register(setting24); + Setting setting25 = new Setting("SF_TOWERMOVE_NO_SPRINT", "No Sprint", SettingType.CHECKBOX, this, this.noSprint, () -> this.sprintMode.equals("Vanilla")); + SettingManager.register(setting25); + Setting setting26 = new Setting("SF_TOWER_SECTION", "TOWER", SettingType.SEPARATOR, this); + SettingManager.register(setting26); + Setting setting27 = new Setting("SF_TOWER_METHOD", "Mode", SettingType.COMBOBOX, this, this.towerMode); + SettingManager.register(setting27); +} + + @EventTarget + public void onPlayerUpdate(PlayerUpdateEvent event) { + if (this.getIntValue10() == 0) { + this.popNotification(this.getDisplayName(), "Out of Blocks", 2000, NotificationType.WARNING); + this.toggle(); + } +} + + private boolean isFlagP() { + double motionX = this.mc.thePlayer.motionX; + double motionY = this.mc.thePlayer.motionY; + double motionZ = this.mc.thePlayer.motionZ; + double origX = motionX; + double origZ = motionZ; + WorldClient world = this.mc.theWorld; + EntityPlayerSP player = this.mc.thePlayer; + net.minecraft.util.AxisAlignedBB boundingBox = player.getAxisAlignedBB(); + double step = 0.05; + + while (motionX != 0.0) { + EntityPlayerSP currentPlayer = this.mc.thePlayer; + net.minecraft.util.AxisAlignedBB offsetBox = boundingBox.offset(motionX, -1.0, 0.0); + List colliding = world.getCollidingBoundingBoxes(currentPlayer, offsetBox); + if (!colliding.isEmpty()) { + break; + } + if (motionX < step && motionX >= -step) { + return this.mc.thePlayer.onGround; + } + if (motionX > 0.0) { + motionX -= step; + } else { + motionX += step; + } + origX = motionX; + } + + while (motionZ != 0.0) { + EntityPlayerSP currentPlayer = this.mc.thePlayer; + net.minecraft.util.AxisAlignedBB offsetBox = boundingBox.offset(0.0, -1.0, motionZ); + List colliding = world.getCollidingBoundingBoxes(currentPlayer, offsetBox); + if (!colliding.isEmpty()) { + break; + } + if (motionZ < step && motionZ >= -step) { + return this.mc.thePlayer.onGround; + } + if (motionZ > 0.0) { + motionZ -= step; + } else { + motionZ += step; + } + origZ = motionZ; + } + + while (motionX != 0.0 && motionZ != 0.0) { + EntityPlayerSP currentPlayer = this.mc.thePlayer; + net.minecraft.util.AxisAlignedBB offsetBox = boundingBox.offset(motionX, -1.0, motionZ); + List colliding = world.getCollidingBoundingBoxes(currentPlayer, offsetBox); + if (!colliding.isEmpty()) { + break; + } + if (motionX < step && motionX >= -step) { + return this.mc.thePlayer.onGround; + } + if (motionX > 0.0) { + motionX -= step; + } else { + motionX += step; + } + origX = motionX; + if (motionZ < step && motionZ >= -step) { + return this.mc.thePlayer.onGround; + } + if (motionZ > 0.0) { + motionZ -= step; + } else { + motionZ += step; + } + origZ = motionZ; + } + + return false; +} + + private Boolean supplyBoolean2() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.blockIndicator.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.background; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private int computeIntValue(int value) { + int intVal; + int intVal2 = -1; + int intVal3 = 0; + + while (true) { + List itemList2 = this.mc.thePlayer.inventoryContainer.inventorySlots; + if (intVal3 < itemList2.size()) { + intVal = intVal3; + + if (intVal3 == value) { + List itemList = this.mc.thePlayer.inventoryContainer.inventorySlots; + Slot slot2 = (Slot)itemList.get(intVal3); + ItemStack stack = slot2.getStack(); + + if (stack != null) { + intVal2 = stack.stackSize; + } + } + + intVal3++; + + continue; + } + + intVal = intVal2; + break; + } + + return intVal; +} + + public float getCachedAngle2() { + return this.cachedAngle2; +} + + @EventTarget(1) + public void onMotionUpdate(MotionUpdateEvent event) { + int intVal; + boolean flag; + boolean flag2; + net.minecraft.client.entity.EntityPlayerSP player; + float floatVal; + int intVal2; + net.minecraft.client.entity.EntityPlayerSP player2; + cc.novoline.events.type.State state; + int[] intArr; + Scaffold scaffold; + + intArr = getIntArrayValue(); + label319: + if (event.getState() == State.PRE) { + + label315: { + + label313: { + + label310: { + + boolean flag5 = this.mc.thePlayer.stateFlag; + + if (this.mc.thePlayer.stateFlag) { + this.sendPacket(new C0BPacketEntityAction(this.mc.thePlayer, C0BPacketEntityAction$Action.STOP_SPRINTING)); + this.mc.thePlayer.stateFlag = false; + } + + scaffold = this; + + flag5 = this.mc.thePlayer.onGround; + + + if (!flag5) { + flag = this.checkState16(); + + if (flag) { + break label310; + } + } + + scaffold = this; + + EntityPlayerSP player3 = this.mc.thePlayer; + scaffold.cachedAngle = player3.getFloat2(); + } + + scaffold = this; + + flag = this.checkState16(); + + if (!flag) { + flag2 = this.checkState17(); + + if (!flag2) { + break label313; + } + } + + scaffold = this; + + double posY2 = this.mc.thePlayer.posY; + scaffold.cachedValue = MathHelper.floor_double(posY2); + + break label315; + + } + + scaffold = this; + + flag2 = this.isReadyState15(); + + if (flag2) { + player = this.mc.thePlayer; + + if (this.mc.thePlayer.onGround) { + double posY3 = this.mc.thePlayer.posY; + this.cachedValue = MathHelper.floor_double(posY3); + } + } + } + + scaffold = this; + + player = scaffold.mc.thePlayer; + + BlockPlaceRayResult placeTarget; + label275: { + label274: { + double posX2 = player.posX; + double doubleVal = this.cachedValue - 1.0; + double posZ2 = this.mc.thePlayer.posZ; + WorldClient world = this.mc.theWorld; + IBlockState blockState = world.getBlockState(new BlockPos(posX2, doubleVal, posZ2)); + boolean flag3 = this.matchesBlock(blockState.getBlock()); + this.targetPos = new BlockPos(flag3 ? posX2 : this.computeDoubleArrayValue(doubleVal)[0], doubleVal, flag3 ? posZ2 : this.computeDoubleArrayValue(doubleVal)[1]); + WorldClient world2 = this.mc.theWorld; + BlockPos pos = this.targetPos; + IBlockState blockState2 = world2.getBlockState(pos); + Block block = blockState2.getBlock(); + Material material = block.getMaterial(); + boolean flag4 = material.isLiquid(); + + if (flag4) { + break label274; + } + + Material material2 = block.getMaterial(); + flag4 = material2.isReplaceable(); + + + if (flag4) { + placeTarget = BlockPlaceRayResult.findSimplePlaceTarget(this.targetPos); + break label275; + } + } + + placeTarget = null; + } + + label331: { + int intVal13; + + label332: { + this.blockPlaceRayResultField = placeTarget; + IntProperty intProp = this.slot; + Integer intVal3 = intProp.get(); + intVal13 = intVal3 - 1; + InventoryPlayer inventory2 = this.mc.thePlayer.inventory; + ItemStack stack = inventory2.getStackInSlot(intVal13); + if (stack != null) { + intVal = (this.matchesItem(stack.getItem()) ? 1 : 0); + + if (intVal != 0) { + break label332; + } + } + + label256: { + ModuleRegistry modEntry = ModuleRegistry.DISABLER; + Disabler disabler = modEntry.getModule(); + EntityPlayerSP player4 = this.mc.thePlayer; + int intVal4 = this.getIntValue11(); + player4.applyArmorCalculations(intVal4, intVal13); + Disabler disabler2 = disabler; + + if (!disabler.matchesFlag(true)) { + break label256; + } + + disabler2 = disabler; + + + disabler2.performStep12(); + } + + + break label331; + + } + + BooleanProperty boolProp = this.swapper; + Boolean propFlag = boolProp.get(); + intVal = (propFlag ? 1 : 0); + + if (intVal != 0) { + TimerUtil timerUtil = this.timerUtilField; + IntProperty intProp2 = this.swapperDelay; + Integer intVal5 = intProp2.get(); + long longVal = intVal5.intValue(); + intVal = (timerUtil.delay(longVal) ? 1 : 0); + + if (intVal != 0) { + IntProperty intProp3 = this.slot; + Integer intVal6 = intProp3.get(); + int intVal7 = this.computeIntValue(35 + intVal6); + int intVal8 = this.computeIntValue(this.getIntValue11()); + intVal = intVal8; + + if (intVal8 > intVal7) { + EntityPlayerSP player5 = this.mc.thePlayer; + int intVal9 = this.getIntValue11(); + player5.applyArmorCalculations(intVal9, intVal13); + TimerUtil timerUtil2 = this.timerUtilField; + timerUtil2.reset(); + } + } + } + } + + scaffold = this; + + BooleanProperty boolProp2 = this.itemSpoof; + Boolean propFlag2 = boolProp2.get(); + intVal = (propFlag2 ? 1 : 0); + + if (intVal == 0) { + InventoryPlayer inventory3 = this.mc.thePlayer.inventory; + IntProperty intProp4 = this.slot; + Integer intVal10 = intProp4.get(); + inventory3.currentItem = intVal10 - 1; + } + + this.X = this.floatValue; + this.floatValueField = this.cachedAngle2; + scaffold = this; + + + label232: + if (scaffold.blockPlaceRayResultField != null) { + float[] floatArr = this.buildFloatArray(this.blockPlaceRayResultField.getTargetPos(), this.blockPlaceRayResultField.getFacing()); + this.floatValueField2 = floatArr[0]; + Scaffold scaffold2 = this; + + StringProperty strProp = this.rotationsMethod; + if (strProp.equals("Basic")) { + this.cachedAngle4 = floatArr[1]; + + break label232; + + } + + scaffold2 = this; + + + label224: { + Scaffold scaffold3 = this; + + if (this.blockPlaceRayResultField.getFacing() == EnumFacing.UP) { + floatVal = this.cachedAngle3; + break label224; + } + + scaffold3 = this; + + + floatVal = scaffold3.floatValueField3; + } + + scaffold2.cachedAngle4 = floatVal; + } + + scaffold = this; + + + label216: { + StringProperty strProp2 = scaffold.rotationsMethod; + if (strProp2.equals("Basic")) { + float floatVal2 = this.floatValue = this.rotationVectorField.evaluateFloat(this.floatValueField2, this.maxAngle); + event.applyUpdate2(floatVal2); + float floatVal3 = this.cachedAngle2 = this.cachedAngle4; + event.setPitch(floatVal3); + + break label216; + + } + + RotationVector rotationVector = this.rotationVectorField; + EntityPlayerSP player6 = this.mc.thePlayer; + float floatVal4 = this.floatValue = rotationVector.evaluateFloat(player6.getMoveDirection(-180.0F), this.maxAngle); + event.applyUpdate2(floatVal4); + float floatVal5 = this.cachedAngle2 = this.cachedAngle4; + event.setPitch(floatVal5); + } + + label335: { + intVal2 = (this.checkState16() ? 1 : 0); + + if ((intVal2 == 0)) { + intVal2 = (this.checkState17() ? 1 : 0); + + if ((intVal2 == 0)) { + break label335; + } + } + + this.mc.thePlayer.cameraPitch = 0.0F; + this.mc.thePlayer.cameraYaw = 0.0F; + this.flagValue = true; + if (event.getY() % 1.0 == 0.0) { + intVal2 = (event.isOnGround() ? 1 : 0); + + if ((intVal2 == 0)) { + event.setOnGround(true); + } + } + } + + intVal2 = (this.isFlagW() ? 1 : 0); + + + if ((intVal2 != 0)) { + + int intVal11 = (this.flagValue ? 1 : 0); + + if (this.flagValue) { + this.mc.thePlayer.motionY = 0.42F; + this.flagValue = false; + } + + player2 = this.mc.thePlayer; + + intVal11 = this.mc.thePlayer.intState8 % 2; + + + if (intVal11 == 0) { + this.updateHelper2(); + + break label319; + + } + + player2 = this.mc.thePlayer; + + label184: { + double doubleVal2 = player2.getDouble8(); + EntityPlayerSP player7 = this.mc.thePlayer; + double doubleVal3 = player7.resolveDouble(false); + ThreadLocalRandom threadLocalRandom = ThreadLocalRandom.current(); + double doubleVal4 = doubleVal3 * threadLocalRandom.nextDouble(0.9, 0.95); + double doubleVal5 = doubleVal2; + if (intArr == null) { + if (!(doubleVal2 > doubleVal4)) { + break label184; + } + + EntityPlayerSP player8 = this.mc.thePlayer; + double doubleVal6 = player8.getFloat2(); + double angleRad = Math.toRadians(doubleVal6); + doubleVal5 = -MathHelper.sin(angleRad); + } + + double doubleVal7 = doubleVal5; + EntityPlayerSP player9 = this.mc.thePlayer; + double doubleVal8 = player9.getFloat2(); + double angleRad2 = Math.toRadians(doubleVal8); + double doubleVal9 = MathHelper.resolveFloat5(angleRad2); + double doubleVal10 = doubleVal2 - doubleVal4; + double doubleVal11 = event.getX() - doubleVal7 * doubleVal10; + event.setCachedValue3(doubleVal11); + double doubleVal12 = event.getZ() - doubleVal9 * doubleVal10; + event.applyUpdate2(doubleVal12); + } + + + break label319; + + } + + scaffold = this; + + List itemList = this.packetList; + intVal2 = (itemList.isEmpty() ? 1 : 0); + + + if ((intVal2 == 0)) { + this.updateHelper2(); + } + } + + scaffold = this; + + if (scaffold.blockPlaceRayResultField != null) { + State state2; + label166: { + label165: { + state = event.getState(); + Scaffold scaffold4 = this; + + StringProperty strProp3 = this.placeMethod; + if (strProp3.equals("Post")) { + break label165; + } + + scaffold4 = this; + + + if (scaffold4.blockPlaceRayResultField.getEnumFacing() != EnumFacing.UP) { + state2 = State.PRE; + break label166; + } + } + + state2 = State.POST; + } + + if (state == state2) { + scaffold = this; + + if (this.checkState17()) { + scaffold = this; + + StringProperty strProp4 = this.towerMode; + String textStr = "None"; + label152: + if (strProp4.equals(textStr)) { + double doubleVal13; + int intVal12 = (doubleVal13 = event.getY() % 1.0 - 0.24) == 0.0 ? 0 : (doubleVal13 < 0.0 ? -1 : 1); + + if (intVal12 > 0) { + break label152; + } + + scaffold = this; + + EntityPlayerSP player10 = this.mc.thePlayer; + Potion potion = Potion.jump; + intVal12 = (player10.isPotionActive(potion) ? 1 : 0); + + + if (intVal12 == 0) { + return; + } + } + } + + scaffold = this; + + scaffold.handleBlockPos(this.blockPlaceRayResultField.getTargetPos(), this.blockPlaceRayResultField.getFacing()); + } + } +} + + @EventTarget + public void handleFallDistanceEvent(FallDistanceEvent event) { + if (this.mc.thePlayer.isMovingKeyDown()) { + } +} + + @Override + public void onDisable() { + int intVal; + AbstractModule mod; + this.flagValue = false; + List itemList = this.packetList; + boolean empty = itemList.isEmpty(); + if (!empty) { + this.updateHelper2(); + } + + mod = this; + + empty = this.stateFlag; + + if (empty) { + label58: { + BooleanProperty boolProp = this.itemSpoof; + Boolean propFlag = boolProp.get(); + intVal = (propFlag ? 1 : 0); + if (intVal != 0) { + StringProperty strProp = this.spoofMode; + intVal = (strProp.equals("Fake") ? 1 : 0); + + if (intVal == 0) { + break label58; + } + + this.sendPacketNoEvent(new C09PacketHeldItemChange(this.mc.thePlayer.inventory.currentItem)); + break label58; + } + + intVal = this.stateTicks; + + if (intVal != this.mc.thePlayer.inventory.currentItem) { + this.mc.thePlayer.inventory.currentItem = this.stateTicks; + } + } + + mod = this; + + BooleanProperty boolProp2 = this.blockIndicator; + Boolean propFlag2 = boolProp2.get(); + intVal = (propFlag2 ? 1 : 0); + + if (intVal != 0) { + this.smoothAnim.reset(); + } + } + + ModuleRegistry modEntry = ModuleRegistry.HUD; + mod = modEntry.getModule(); + + HUD hudMod = (HUD)mod; + hudMod.applyInt5(0.0); +} + + private float[] resolveFloatArray(Vec3 vec) { + double posX2 = vec.getX() - this.mc.thePlayer.posX; + double posZ2 = vec.getZ() - this.mc.thePlayer.posZ; + double doubleVal = vec.getY(); + double posY2 = this.mc.thePlayer.posY; + EntityPlayerSP player = this.mc.thePlayer; + double doubleVal2 = posY2 + player.getEyeHeight() - doubleVal; + posY2 = posX2 * posX2 + posZ2 * posZ2; + double dist = MathHelper.sqrt_double(posY2); + float floatVal = (float)(Math.atan2(posZ2, posX2) * 180.0 / Math.PI) - 90.0F; + float floatVal2 = (float)(Math.atan2(doubleVal2, dist) * 180.0 / Math.PI); + float floatVal3; + int intVal = (floatVal3 = floatVal - 0.0F) == 0.0F ? 0 : (floatVal3 < 0.0F ? -1 : 1); + if (intVal < 0) { + floatVal += 360.0F; + } + + intVal = 2; + + float[] floatArr = new float[intVal]; + floatArr[0] = floatVal; + floatArr[1] = floatVal2; + return floatArr; +} + + @EventTarget + public void onPacket(PacketEvent event) { + PacketEvent packetEvent = event; + if (event.getState() == cc.novoline.events.State.OUTGOING) { + boolean flag = event.getPacket() instanceof C07PacketPlayerDigging; + if (flag) { + C07PacketPlayerDigging playerDiggingPacket = (C07PacketPlayerDigging)event.getPacket(); + if (playerDiggingPacket.getStatus2() == net.minecraft.network.play.client.C07PacketPlayerDigging$Action.RELEASE_USE_ITEM) { + event.setCancelled(true); + } + + return; + } + + flag = event.getPacket() instanceof C09PacketHeldItemChange; + + if (!flag) { + return; + } + + BooleanProperty boolProp = this.itemSpoof; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + return; + } + + event.setCancelled(true); + return; + } + + packetEvent = event; + + Packet packet = packetEvent.getPacket(); + if (!(packet instanceof S29PacketSoundEffect)) { + return; + } + + packet = event.getPacket(); + + S29PacketSoundEffect soundEffectPacket = (S29PacketSoundEffect)packet; + String textStr = soundEffectPacket.getSoundName(); + if (textStr.startsWith("dig.")) { + event.setCancelled(true); + } +} + + public List getBlockList() { + return this.blockList; +} + + public static Minecraft resolveMinecraft32(Scaffold scaffold) { + return scaffold.mc; +} + + public float getFloatValue3() { + return this.floatValueField; +} + + private void applyInt5(MoveEvent event) { + int intVal = (this.mc.thePlayer.onGround ? 1 : 0); + if (this.mc.thePlayer.onGround) { + event.setCachedValue32(this.mc.thePlayer.motionY = 0.42F); + return; + } + + intVal = this.mc.thePlayer.offGroundTicks; + + if (intVal == 3) { + event.setCachedValue32(this.mc.thePlayer.motionY = -0.0785); + } +} + + public static IntProperty resolveIntProperty3(Scaffold scaffold) { + return scaffold.slot; +} + + + public int computeIntValue2() { + net.minecraft.entity.player.InventoryPlayer inventory2; + int intVal = 0; + + while (true) { + if (intVal < 9) { + inventory2 = this.mc.thePlayer.inventory; + + label47: { + ItemStack stack = inventory2.getStackInSlot(intVal); + if (stack == null) { + break label47; + } + + InventoryPlayer inventory3 = this.mc.thePlayer.inventory; + stack = inventory3.getStackInSlot(intVal); + + if (stack.stackSize == 0) { + break label47; + } + + InventoryPlayer inventory4 = this.mc.thePlayer.inventory; + stack = inventory4.getStackInSlot(intVal); + + Item item = stack.getItem(); + + if (this.matchesItem(item)) { + return intVal; + } + } + + intVal++; + + continue; + } + + inventory2 = this.mc.thePlayer.inventory; + break; + } + + return inventory2.currentItem; +} + + @Override + public void onEnable() { + this.handleString3(this.sprintMode.equals("Hypixel") ? "Hypixel" : ""); + Object obj = this.scaffoldBlockDataField; + EventManager.unregister(obj); + EntityPlayerSP player = this.mc.thePlayer; + this.cachedAngle = player.getFloat2(); + int intVal = this.getIntValue10(); + if (intVal == 0) { + this.stateFlag = false; + return; + } + + this.handleClassArray(Speed.class, LongJump.class, Fly.class); + float yaw = this.mc.thePlayer.rotationYaw; + this.rotationVectorField = new RotationVector(MathHelper.resolveFloat5(yaw)); + this.stateFlag = true; + BooleanProperty boolProp = this.blockIndicator; + Boolean propFlag = boolProp.get(); + intVal = (propFlag ? 1 : 0); + + if (intVal != 0) { + ScaffoldBlockData scaffoldBlockData = this.scaffoldBlockDataField; + EventManager.register(scaffoldBlockData); + this.smoothAnim.applyDouble(0.02); + } + + double posY2 = this.mc.thePlayer.posY; + this.cachedValue = MathHelper.floor_double(posY2); + ThreadLocalRandom threadLocalRandom = ThreadLocalRandom.current(); + this.floatValueField3 = (float)threadLocalRandom.nextDouble(74.0, 78.0); + ThreadLocalRandom threadLocalRandom2 = ThreadLocalRandom.current(); + this.cachedAngle3 = (float)threadLocalRandom2.nextDouble(88.0, 90.0); + this.floatValue = this.mc.thePlayer.rotationYaw; + this.X = this.mc.thePlayer.prevRotationYaw; + this.cachedAngle2 = this.mc.thePlayer.rotationPitch; + this.floatValueField = this.mc.thePlayer.prevRotationPitch; + obj = this; + + BooleanProperty boolProp2 = this.itemSpoof; + Boolean propFlag2 = boolProp2.get(); + intVal = (propFlag2 ? 1 : 0); + + if (intVal != 0) { + Scaffold scaffold = this; + StringProperty strProp = this.spoofMode; + if (!strProp.equals("Fake")) { + return; + } + + scaffold = this; + + IntProperty intProp = this.slot; + Integer intVal2 = intProp.get(); + scaffold.applyInt5(new C09PacketHeldItemChange(intVal2 - 1)); + return; + } + + obj = this; + + ((Scaffold)obj).stateTicks = this.mc.thePlayer.inventory.currentItem; +} + + static { + applyInt5((int[])null); + } + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + this.handleString3(this.sprintMode.equals("Hypixel") ? "Hypixel" : ""); +} + + + public int getIntValue10() { + int slot3; + int intVal = 0; + int intVal2 = 0; + + while (true) { + if (intVal2 < 45) { + label38: { + Container container = this.mc.thePlayer.inventoryContainer; + Slot slot2 = container.getSlot(intVal2); + slot3 = (slot2.getHasStack() ? 1 : 0); + + if (slot3 == 0) { + break label38; + } + + Container container2 = this.mc.thePlayer.inventoryContainer; + slot2 = container2.getSlot(intVal2); + + ItemStack stack = slot2.getStack(); + + if (this.matchesItem(stack.getItem())) { + intVal += stack.stackSize; + } + } + + intVal2++; + + continue; + } + + slot3 = intVal; + break; + } + + return slot3; +} + + private boolean matchesItem(Item item) { + boolean flag2 = item instanceof ItemBlock; + if (flag2) { + ItemBlock blockItem = (ItemBlock)item; + Block block = blockItem.getBlock(); + List itemList = this.blockList; + boolean flag = itemList.contains(block); + flag = !flag; + + return flag; + } + + return false; +} + + private int getIntValue11() { + int intVal = this.computeIntValue(this.getIntValue13()); + if (intVal > this.computeIntValue(this.computeIntValue3())) { + return this.getIntValue13(); + } + + intVal = this.computeIntValue3(); + + return intVal; +} + + public static IntProperty applyInt5(Scaffold scaffold) { + return scaffold.smoothness; +} + + public float getFloatValue4() { + return this.X; +} + + private void handleBlockPos(BlockPos pos, EnumFacing facing) { + int intVal; + ItemStack stack2; + double doubleVal; + double doubleVal2; + double doubleVal3; + float[] floatArr; + label43: { + Scaffold scaffold; + int slot2 = this.mc.thePlayer.inventory.currentItem; + Integer slot3 = this.slot.get(); + intVal = slot3 - 1; + InventoryPlayer inventory2 = this.mc.thePlayer.inventory; + stack2 = inventory2.getStackInSlot(intVal); + doubleVal = pos.getX(); + doubleVal2 = pos.getY(); + doubleVal3 = pos.getZ(); + floatArr = RotationAngleUtil.evaluateFloat(pos, facing); + StringProperty strProp = this.spoofMode; + boolean flag = strProp.equals("Basic"); + if (flag) { + this.sendPacketNoEvent(new C09PacketHeldItemChange(intVal)); + } + + scaffold = this; + + flag = this.isFlagW(); + + if (flag) { + List itemList = this.packetList; + C08PacketPlayerBlockPlacement playerBlockPlacementPacket = new C08PacketPlayerBlockPlacement(pos, facing.getIndex2(), stack2, floatArr[0], floatArr[1], floatArr[2]); + itemList.add(playerBlockPlacementPacket); + List itemList2 = this.packetList; + C0APacketAnimation animationPacket = new C0APacketAnimation(); + itemList2.add(animationPacket); + break label43; + } + + this.sendPacket(new C08PacketPlayerBlockPlacement(pos, facing.getIndex2(), stack2, floatArr[0], floatArr[1], floatArr[2])); + scaffold = this; + + scaffold.handlePacket(new C0APacketAnimation()); + } + + Scaffold scaffold2; + + StringProperty strProp2 = this.spoofMode; + boolean flag2 = strProp2.equals("Basic"); + if (flag2) { + this.sendPacketNoEvent(new C09PacketHeldItemChange(this.mc.thePlayer.inventory.currentItem)); + } + + stack2.onItemUse(this.mc.thePlayer, this.mc.theWorld, pos, facing, floatArr[0], floatArr[1], floatArr[2]); + scaffold2 = this; + + BooleanProperty boolProp = this.itemSwing; + Boolean propFlag = boolProp.get(); + flag2 = propFlag; + + if (flag2) { + EntityPlayerSP player = this.mc.thePlayer; + player.executeAction2(); + } + + scaffold2 = this; + + InventoryPlayer inventory3 = scaffold2.mc.thePlayer.inventory; + ItemStack stack = inventory3.getStackInSlot(intVal); + Block block = ((ItemBlock)stack.getItem()).getBlock(); + WorldClient world = this.mc.theWorld; + String textStr = block.stepSound.getPlaceSound(); + world.playSound(doubleVal, doubleVal2, doubleVal3, textStr, 1.0F, 0.8F, false); +} + + private float[] buildFloatArray(BlockPos pos, EnumFacing facing) { + double posX2 = pos.getX() + 0.5 - this.mc.thePlayer.posX; + double doubleVal4 = posX2 + facing.computeInt3() / 2.0; + double posZ2 = pos.getZ() + 0.5 - this.mc.thePlayer.posZ; + double doubleVal = posZ2 + facing.getFrontOffsetZ() / 2.0; + double doubleVal2 = pos.getY() + 0.5; + posZ2 = this.mc.thePlayer.posY; + EntityPlayerSP player = this.mc.thePlayer; + double doubleVal3 = posZ2 + player.getEyeHeight() - doubleVal2; + posZ2 = doubleVal4 * doubleVal4 + doubleVal * doubleVal; + double dist = MathHelper.sqrt_double(posZ2); + float floatVal = (float)(Math.atan2(doubleVal, doubleVal4) * 180.0 / Math.PI) - 90.0F; + float floatVal2 = (float)(Math.atan2(doubleVal3, dist) * 180.0 / Math.PI); + float floatVal3; + int intVal = (floatVal3 = floatVal - 0.0F) == 0.0F ? 0 : (floatVal3 < 0.0F ? -1 : 1); + if (intVal < 0) { + floatVal += 360.0F; + } + + intVal = 2; + + float[] floatArr = new float[intVal]; + floatArr[0] = floatVal; + floatArr[1] = floatVal2; + return floatArr; +} + + @EventTarget + public void handleMoveInputEvent(MoveInputEvent event) { + event.setStateFlag(false); +} + + private boolean isStateReady2() { + byte byteVal = 36; + + Container container = this.mc.thePlayer.inventoryContainer; + Slot slot2 = container.getSlot(byteVal); + ItemStack stack = slot2.getStack(); + ItemStack stack2 = stack; + if (stack == null) { + return false; + } + + stack2 = stack; + + Item item = stack2.getItem(); + if (item == null) { + return false; + } + + item = stack.getItem(); + + boolean flag = item instanceof ItemBlock; + if (!flag) { + return false; + } + + flag = this.matchesItem(stack.getItem()); + + return flag; +} + + public void handleSettingEvent(SettingEvent event) { + boolean enabled; + boolean flag; + cc.novoline.modules.configurations.property.object.StringProperty strProp; + SettingEvent settingEvent; + + label225: { + label226: { + settingEvent = event; + + if (event == null) { + break label226; + } + + settingEvent = event; + + + if (!settingEvent.getCachedText2().equals("SF_ROTATIONS_METHOD")) { + break label225; + } + } + + StringProperty strProp2 = this.rotationsMethod; + String textStr10 = "Basic"; + + if (!strProp2.equals(textStr10)) { + break label225; + } + + textStr10 = this.getDisplayName(); + StringBuilder sb = new StringBuilder(); + sb = sb.append("Rotations Method was set to BACKWARD due to unstable "); + StringProperty strProp3 = this.rotationsMethod; + String propStr = strProp3.get(); + propStr = propStr.toUpperCase(); + sb = sb.append(propStr); + this.popNotification(textStr10, sb.append(" bypass").toString(), 3500, NotificationType.WARNING); + strProp2 = this.rotationsMethod; + textStr10 = "Backward"; + + + strProp2.set(textStr10); + } + + settingEvent = event; + + label227: { + label228: { + + if (settingEvent == null) { + break label228; + } + + settingEvent = event; + + + if (!settingEvent.getCachedText2().equals("SF_PLACE_METHOD")) { + break label227; + } + } + + StringProperty strProp4 = this.placeMethod; + String textStr = "Pre"; + + if (strProp4.equals(textStr)) { + break label227; + } + + textStr = this.getDisplayName(); + StringBuilder sb2 = new StringBuilder(); + String textStr2 = "Place Method was set to PRE due to unstable "; + sb2 = sb2.append(textStr2); + StringProperty strProp5 = this.placeMethod; + textStr2 = strProp5.get(); + textStr2 = textStr2.toUpperCase(); + sb2 = sb2.append(textStr2); + textStr2 = " bypass"; + this.popNotification(textStr, sb2.append(textStr2).toString(), 3500, NotificationType.WARNING); + strProp4 = this.placeMethod; + textStr = "Pre"; + + + strProp4.set(textStr); + } + + settingEvent = event; + + label229: { + label230: { + + if (settingEvent == null) { + break label230; + } + + settingEvent = event; + + + if (!settingEvent.getCachedText2().equals("SF_TOWERMOVE_METHOD")) { + break label229; + } + } + + StringProperty strProp6 = this.towermoveMode; + String textStr3 = "Vanilla"; + + if (!strProp6.equals(textStr3)) { + break label229; + } + + textStr3 = this.getDisplayName(); + StringBuilder sb3 = new StringBuilder(); + String textStr4 = "TowerMove Mode was set to BASIC due to unstable "; + sb3 = sb3.append(textStr4); + StringProperty strProp7 = this.towermoveMode; + textStr4 = strProp7.get(); + textStr4 = textStr4.toUpperCase(); + sb3 = sb3.append(textStr4); + textStr4 = " bypass"; + this.popNotification(textStr3, sb3.append(textStr4).toString(), 3500, NotificationType.WARNING); + strProp6 = this.towermoveMode; + textStr3 = "Basic"; + + + strProp6.set(textStr3); + } + + settingEvent = event; + + label231: { + label232: { + + if (settingEvent == null) { + break label232; + } + + settingEvent = event; + + + if (!settingEvent.getCachedText2().equals("SF_SWAPPER")) { + break label231; + } + } + + Disabler disabler; + ModuleRegistry modEntry = ModuleRegistry.DISABLER; + disabler = modEntry.getModule(); + enabled = disabler.isEnabled(); + + if (enabled) { + enabled = disabler.isFlagK(); + + if (enabled) { + break label231; + } + } + + BooleanProperty boolProp = this.swapper; + Boolean propFlag = boolProp.get(); + enabled = propFlag; + + + if (!enabled) { + break label231; + } + + enabled = disabler.isEnabled(); + + + label143: { + if (enabled) { + this.popNotification(this.getDisplayName(), "You need to enable Inventory Click Bypass feature in Disabler module to bypass Swapper", 5000, NotificationType.WARNING); + + break label143; + + } + + this.popNotification(this.getDisplayName(), "You need to enable Disabler module to bypass Swapper", 3500, NotificationType.WARNING); + } + + BooleanProperty boolProp2 = this.swapper; + Boolean flag2 = false; + boolProp2.set(flag2); + } + + settingEvent = event; + + label233: { + label234: { + + if (settingEvent == null) { + break label234; + } + + settingEvent = event; + + + if (!settingEvent.getCachedText2().equals("SF_SPRINT_METHOD")) { + break label233; + } + } + + StringProperty strProp8 = this.sprintMode; + String textStr5 = "Vanilla"; + + if (!strProp8.equals(textStr5)) { + break label233; + } + + this.popNotification(this.getDisplayName(), "Sprint Mode was set to HYPIXEL due to unstable VANILLA bypass", 3500, NotificationType.WARNING); + strProp8 = this.sprintMode; + textStr5 = "Hypixel"; + + + strProp8.set(textStr5); + } + + settingEvent = event; + + label235: { + label236: { + + if (settingEvent == null) { + break label236; + } + + settingEvent = event; + + + if (!settingEvent.getCachedText2().equals("SF_ITEM_SPOOF_MODE")) { + break label235; + } + } + + StringProperty strProp9 = this.spoofMode; + String textStr6 = "Basic"; + + if (!strProp9.equals(textStr6)) { + break label235; + } + + textStr6 = this.getDisplayName(); + StringBuilder sb4 = new StringBuilder(); + String textStr7 = "Spoof Mode was set to FAKE due to unstable "; + sb4 = sb4.append(textStr7); + StringProperty strProp10 = this.spoofMode; + textStr7 = strProp10.get(); + textStr7 = textStr7.toUpperCase(); + sb4 = sb4.append(textStr7); + textStr7 = " bypass"; + this.popNotification(textStr6, sb4.append(textStr7).toString(), 3500, NotificationType.WARNING); + strProp9 = this.spoofMode; + textStr6 = "Fake"; + + + strProp9.set(textStr6); + } + + settingEvent = event; + + String textStr8; + + label239: { + + if (settingEvent == null) { + break label239; + } + + settingEvent = event; + + + flag = settingEvent.getCachedText2().equals("SF_TOWER_METHOD"); + + if (!flag) { + return; + } + } + + strProp = this.towerMode; + textStr8 = "None"; + + flag = strProp.equals(textStr8); + + if (flag) { + return; + } + + textStr8 = this.getDisplayName(); + StringBuilder sb5 = new StringBuilder(); + String textStr9 = "Tower Mode was set to NONE due to unstable "; + sb5 = sb5.append(textStr9); + StringProperty strProp11 = this.towerMode; + textStr9 = strProp11.get(); + textStr9 = textStr9.toUpperCase(); + sb5 = sb5.append(textStr9); + textStr9 = " bypass"; + this.popNotification(textStr8, sb5.append(textStr9).toString(), 3500, NotificationType.WARNING); + strProp = this.towerMode; + textStr8 = "None"; + + strProp.set(textStr8); +} + + private int computeIntValue3() { + int slot3; + int intVal = -1; + int intVal2 = 0; + int intVal3 = this.getIntValue10(); + if (intVal3 == 0) { + return -1; + } + + intVal3 = 9; + + int intVal4 = intVal3; + + while (true) { + if (intVal4 < 36) { + Container container = this.mc.thePlayer.inventoryContainer; + Slot slot2 = container.getSlot(intVal4); + + slot3 = (slot2.getHasStack() ? 1 : 0); + + if (slot3 != 0) { + ItemStack stack = slot2.getStack(); + Item item = stack.getItem(); + ItemStack stack2 = slot2.getStack(); + + label47: + if (item instanceof ItemBlock) { + int intVal5 = (this.matchesItem(item) ? 1 : 0); + if (intVal5 == 0) { + break label47; + } + + intVal5 = stack2.stackSize; + + if (intVal5 <= intVal2) { + break label47; + } + + intVal2 = stack2.stackSize; + intVal5 = intVal4; + + intVal = intVal5; + } + } + + intVal4++; + + + continue; + } + + slot3 = intVal; + break; + } + + return slot3; +} + + private int getIntValue12() { + int slot3; + int intVal = 0; + int intVal2 = 36; + + while (true) { + if (intVal2 < 45) { + label38: { + Container container = this.mc.thePlayer.inventoryContainer; + Slot slot2 = container.getSlot(intVal2); + slot3 = (slot2.getHasStack() ? 1 : 0); + + if (slot3 == 0) { + break label38; + } + + Container container2 = this.mc.thePlayer.inventoryContainer; + slot2 = container2.getSlot(intVal2); + + ItemStack stack = slot2.getStack(); + + if (this.matchesItem(stack.getItem())) { + intVal += stack.stackSize; + } + } + + intVal2++; + + continue; + } + + slot3 = intVal; + break; + } + + return slot3; +} + + private void handleInt(int value) { + List itemList = this.packetList; + this.handlePacket((Packet)itemList.get(value)); + List itemList2 = this.packetList; + itemList2.remove(value); +} + + public IntProperty getSlot() { + return this.slot; +} + + public IntProperty getIntPropertyI() { + return this.getSlot(); +} + + private void handleMoveEvent(MoveEvent event) { + int intVal; + EntityPlayerSP player = this.mc.thePlayer; + intVal = (player.matchesDouble(0.76) ? 1 : 0); + if (intVal != 0) { + EntityPlayerSP player2 = this.mc.thePlayer; + intVal = (player2.matchesDouble(0.75) ? 1 : 0); + + if (intVal == 0) { + if (this.mc.thePlayer.motionY > 0.23) { + if (this.mc.thePlayer.motionY < 0.25) { + EntityPlayerSP player3 = this.mc.thePlayer; + double posY2 = this.mc.thePlayer.posY; + event.setCachedValue32(player3.motionY = Math.round(posY2) - this.mc.thePlayer.posY); + } + } + } + } + + EntityPlayerSP player4 = this.mc.thePlayer; + intVal = (player4.matchesDouble(1.0E-4) ? 1 : 0); + + if (intVal != 0) { + event.setCachedValue32(this.mc.thePlayer.motionY = 0.42F); + } +} + + public static void applyInt5(int[] intArray) { + intArray2 = intArray; +} + + public double[] computeDoubleArrayValue(double value) { + int intVal; + BlockPos pos = new BlockPos(this.mc.thePlayer.posX, value, this.mc.thePlayer.posZ); + IBlockState blockState = this.mc.theWorld.getBlockState(pos); + Block block = blockState.getBlock(); + EntityPlayerSP player = this.mc.thePlayer; + MovementInput movementInput = player.getMovementInput(); + float floatVal = movementInput.getMoveForward(); + float floatVal2 = movementInput.getMoveStrafe(); + float yaw = this.mc.thePlayer.rotationYaw; + double doubleVal = -999.0; + double doubleVal8 = -999.0; + double doubleVal2 = 0.0; + double doubleVal3 = this.checkState16() ? 0.4 : 0.0; + + while (true) { + label39: + if (!this.matchesBlock(block)) { + doubleVal = this.mc.thePlayer.posX; + doubleVal8 = this.mc.thePlayer.posZ; + if (++doubleVal2 > doubleVal3) { + doubleVal2 = doubleVal3; + } + + double doubleVal4 = floatVal * 0.45; + double doubleVal9 = yaw + 90.0F; + doubleVal9 = Math.toRadians(doubleVal9); + double doubleVal5 = doubleVal4 * MathHelper.resolveFloat5(doubleVal9); + doubleVal9 = floatVal2 * 0.45; + double doubleVal10 = yaw + 90.0F; + doubleVal10 = Math.toRadians(doubleVal10); + doubleVal += (doubleVal5 + doubleVal9 * MathHelper.sin(doubleVal10)) * doubleVal2; + double doubleVal6 = floatVal * 0.45; + doubleVal9 = yaw + 90.0F; + doubleVal9 = Math.toRadians(doubleVal9); + double doubleVal7 = doubleVal6 * MathHelper.sin(doubleVal9); + doubleVal9 = floatVal2 * 0.45; + doubleVal10 = yaw + 90.0F; + doubleVal10 = Math.toRadians(doubleVal10); + doubleVal8 += (doubleVal7 - doubleVal9 * MathHelper.resolveFloat5(doubleVal10)) * doubleVal2; + + if (doubleVal2 == doubleVal3) { + break label39; + } + + pos = new BlockPos(doubleVal, value, doubleVal8); + WorldClient world = this.mc.theWorld; + IBlockState blockState2 = world.getBlockState(pos); + block = blockState2.getBlock(); + + continue; + } + + intVal = 2; + break; + } + + double[] doubleArr = new double[intVal]; + doubleArr[0] = doubleVal; + doubleArr[1] = doubleVal8; + return doubleArr; +} + + private boolean checkState17() { + boolean flag = this.mc.thePlayer.isMoving(); + if (flag) { + return false; + } + + EntityPlayerSP player = this.mc.thePlayer; + flag = player.getMovementInput().evaluateCondition2(); + + return flag; +} + + public static DoubleProperty resolveDoubleProperty(Scaffold scaffold) { + return scaffold.roundness; +} + + private int getIntValue13() { + int slot3; + int intVal = -1; + int intVal2 = 0; + int intVal3 = this.getIntValue10(); + if (intVal3 == 0) { + return -1; + } + + intVal3 = 36; + + int intVal4 = intVal3; + + while (true) { + if (intVal4 < 45) { + Container container = this.mc.thePlayer.inventoryContainer; + Slot slot2 = container.getSlot(intVal4); + + slot3 = (slot2.getHasStack() ? 1 : 0); + + if (slot3 != 0) { + ItemStack stack = slot2.getStack(); + Item item = stack.getItem(); + ItemStack stack2 = slot2.getStack(); + + label47: + if (item instanceof ItemBlock) { + int intVal5 = (this.matchesItem(item) ? 1 : 0); + if (intVal5 == 0) { + break label47; + } + + intVal5 = stack2.stackSize; + + if (intVal5 <= intVal2) { + break label47; + } + + intVal2 = stack2.stackSize; + intVal5 = intVal4; + + intVal = intVal5; + } + } + + intVal4++; + + + continue; + } + + slot3 = intVal; + break; + } + + return slot3; +} + + private boolean isReadyState15() { + int[] intArr = getIntArrayValue(); + boolean flag = this.mc.thePlayer.isMoving(); + if (!flag) { + return false; + } + + EntityPlayerSP player = this.mc.thePlayer; + flag = player.getMovementInput().evaluateCondition2(); + + return intArr != null ? flag : !flag; +} + + public boolean matchesBlock(@NotNull Block block) { + Material material = block.getMaterial(); + boolean flag = material.isReplaceable(); + if (flag) { + boolean flag2 = block instanceof BlockSnowLayer; + if (flag2) { + if (block.getBlockBoundsMaxY() > 0.125) { + return false; + } + } + + flag2 = true; + + return flag2; + } + + flag = false; + + return flag; +} + + private Boolean supplyBoolean3() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.blockIndicator.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.background; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + + public cc.novoline.modules.configurations.property.object.BooleanProperty getIcon() { return this.icon; } + public cc.novoline.utils.anim.SmoothAnimation getSmoothAnim() { return this.smoothAnim; } + public cc.novoline.modules.configurations.property.object.IntProperty getAlpha() { return this.alpha; } + public cc.novoline.modules.configurations.property.object.IntProperty getSmoothness() { return this.smoothness; } + public cc.novoline.modules.configurations.property.object.BooleanProperty getBackground() { return this.background; } + public cc.novoline.modules.configurations.property.object.DoubleProperty getRoundness() { return this.roundness; } +} diff --git a/src/main/java/cc/novoline/modules/player/SpeedMine.java b/src/main/java/cc/novoline/modules/player/SpeedMine.java new file mode 100644 index 0000000..15fe51e --- /dev/null +++ b/src/main/java/cc/novoline/modules/player/SpeedMine.java @@ -0,0 +1,176 @@ +package cc.novoline.modules.player; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.FloatProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.ModuleManager; +import net.minecraft.block.material.Material; +import net.minecraft.client.entity.EntityPlayerSP; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class SpeedMine extends AbstractModule { + @Property("no-hit-delay") + private BooleanProperty noHitDelay; + @Property("multiplier") + private FloatProperty multiplier; + @Property("no-fatigue") + private ListProperty noFatigue; + @Property("no-progress-reset") + private BooleanProperty noProgressReset; + + + public boolean isReadyState16() { + boolean enabled = this.isEnabled(); + if (!enabled) { + return false; + } + + ListProperty listProp = this.noFatigue; + enabled = listProp.contains("Water"); + + return enabled; +} + + public boolean checkState18() { + boolean flag = this.checkState20(); + if (flag) { + + if (!this.mc.thePlayer.onGround) { + return true; + } + } + + flag = this.isReadyState16(); + + if (!flag) { + return false; + } + + EntityPlayerSP player = this.mc.thePlayer; + Material material = Material.water; + flag = player.isInsideOfMaterial(material); + + return flag; +} + + public boolean checkState19() { + boolean enabled = this.isEnabled(); + if (!enabled) { + return false; + } + + BooleanProperty boolProp = this.noHitDelay; + Boolean propFlag = boolProp.get(); + enabled = propFlag; + + return enabled; +} + + public boolean isReadyState17() { + boolean enabled = this.isEnabled(); + if (!enabled) { + return false; + } + + ListProperty listProp = this.noFatigue; + enabled = listProp.contains("Effect"); + + return enabled; +} + + public boolean checkState20() { + boolean enabled = this.isEnabled(); + if (!enabled) { + return false; + } + + ListProperty listProp = this.noFatigue; + enabled = listProp.contains("Air"); + + return enabled; +} + + + public float getFloatValue5() { + Object obj = this; + if (!this.isEnabled()) { + return 1.0F; + } + + obj = this.multiplier.get(); + + return (Float)obj; +} + + public boolean isReadyState18() { + boolean enabled = this.isEnabled(); + if (!enabled) { + return false; + } + + BooleanProperty boolProp = this.noProgressReset; + Boolean propFlag = boolProp.get(); + enabled = propFlag; + + return enabled; +} + + + public SpeedMine(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.multiplier = FloatProperty.of(1.0F).minimum(1.0F).maximum(1.4F); + this.noHitDelay = BooleanProperty.of(true); + this.noProgressReset = BooleanProperty.of(true); + ListProperty listProp = ListProperty.of("Effect"); + String[] stringArr = new String[]{"Air", "Water", "Effect"}; + this.noFatigue = listProp.acceptableValues((Object[])stringArr); + Setting setting = new Setting("SM_MULTIPLIER", "Multiplier", SettingType.SLIDER, this, this.multiplier, 0.05); + SettingManager.register(setting); + setting = new Setting("SM_FEATURES", "Features", SettingType.SEPARATOR, this); + SettingManager.register(setting); + setting = new Setting("SM_NO_HIT_DELAY", "No Hit Delay", SettingType.CHECKBOX, this, this.noHitDelay); + SettingManager.register(setting); + setting = new Setting("SM_NO_PROGRESS_RESET", "No Progress Reset", SettingType.CHECKBOX, this, this.noProgressReset); + SettingManager.register(setting); + setting = new Setting("SM_NO_FATIGUE", "No Fatigue", SettingType.SELECTBOX, this, this.noFatigue); + SettingManager.register(setting); +} + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + if (event.getState() == State.PRE) { + SpeedMine speedMine = this; + if (!this.checkState18()) { + return; + } + + speedMine = this; + + float floatVal = speedMine.mc.playerController.floatState2; + float floatVal2 = this.mc.playerController.floatState; + if (floatVal <= 0.0F) { + return; + } + + float floatVal3 = floatVal + floatVal2; + + if (floatVal3 >= 1.0) { + event.setOnGround(true); + floatVal = 0.0F; + float floatVal4 = 0.0F; + } + } +} + + +} diff --git a/src/main/java/cc/novoline/modules/visual/Animations.java b/src/main/java/cc/novoline/modules/visual/Animations.java new file mode 100644 index 0000000..f10bc07 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/Animations.java @@ -0,0 +1,198 @@ +package cc.novoline.modules.visual; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.combat.KillAura; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.FloatProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.ModuleRegistry; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class Animations extends AbstractModule { + @Property("hit") + private final StringProperty hit; + @Property("downscale-factor") + private final DoubleProperty downscaleFactor; + @Property("slowdown") + private final IntProperty slowdown; + private float cachedAngle; + @Property("block-height") + private final FloatProperty blockHeight; + @Property("hit-height") + private final FloatProperty hitHeight; + @Property("type") + private final StringProperty type; + @Property("rotating") + private final BooleanProperty rotating; + + public boolean isReadyState19() { + Boolean propFlag = this.rotating.get(); + return propFlag; +} + + public DoubleProperty getDownscaleFactor() { + return this.downscaleFactor; +} + + public DoubleProperty getDoublePropertyValue() { + return this.getDownscaleFactor(); +} + + + public StringProperty getHit() { + return this.hit; +} + + public StringProperty getStringPropertyF() { + return this.getHit(); +} + + public IntProperty getSlowdown() { + return this.slowdown; +} + + public IntProperty getIntPropertyC() { + return this.getSlowdown(); +} + + @EventTarget + public void onRender2D(Render2DEvent event) { + Object obj; + float floatVal; + label50: { + KillAura killAura = ModuleRegistry.KILLAURA.getModule(); + obj = this.mc.thePlayer; + + if (!((net.minecraft.client.entity.EntityPlayerSP) obj).isConditionMet79()) { + obj = killAura; + + if (!killAura.isReadyState3()) { + EntityPlayerSP player = this.mc.thePlayer; + Object obj2 = player.getHeldItem(); + + if (obj2 == null) { + floatVal = 0.0F; + break label50; + } + + obj2 = this.hitHeight.get(); + + + Float floatVal2 = (Float)obj2; + floatVal = floatVal2; + break label50; + } + } + + obj = this.blockHeight.get(); + + Float floatVal3 = (Float)obj; + floatVal = floatVal3; + } + + Animations animations; + + float floatVal4 = 20.0F - floatVal; + Minecraft mcClient = this.mc; + float floatVal5 = 2000 / mcClient.getDebugFPS(); + if (this.cachedAngle > floatVal4) { + this.cachedAngle--; + return; + } + + animations = this; + + if (this.cachedAngle >= floatVal4) { + return; + } + + animations = this; + + animations.cachedAngle++; +} + + + @Override + public void onEnable() { + this.handleString3(this.type.get()); +} + + public float getFloatValue6() { + return this.cachedAngle; +} + + public StringProperty getType() { + return this.type; +} + + public StringProperty getStringProperty4() { + return this.getType(); +} + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + this.handleString3(this.type.get()); +} + + + public Animations(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + StringProperty strProp = StringProperty.of("Swank"); + String[] stringArr = new String[]{ + "Swank", + "Swing", + "Swang", + "Swong", + "Swaing", + "Punch", + "Stella", + "Styles", + "Slide", + "Interia", + "Ethereal", + "1.7", + "Sigma", + "Exhibition", + "Smooth", + "Spinning" + }; + this.type = strProp.acceptableValues(stringArr); + StringProperty strProp2 = StringProperty.of("Vanilla"); + stringArr = new String[]{"Vanilla", "Smooth"}; + this.hit = strProp2.acceptableValues(stringArr); + this.slowdown = IntProperty.of(0).minimum(-4).maximum(6); + this.downscaleFactor = DoubleProperty.of(0.3).minimum(0.0).maximum(0.5); + this.hitHeight = FloatProperty.of(10.0F).minimum(-10.0F).maximum(30.0F); + this.blockHeight = FloatProperty.of(10.0F).minimum(0.0F).maximum(60.0F); + this.rotating = BooleanProperty.of(false); + Setting setting = new Setting("BLOCK_ANIMATION", "Block Animation", SettingType.COMBOBOX, this, this.type); + SettingManager.register(setting); + setting = new Setting("HIT_ANIM_MODE", "Hit Animation", SettingType.COMBOBOX, this, this.hit); + SettingManager.register(setting); + setting = new Setting("SWING_SLOW", "Slowdown", SettingType.SLIDER, this, this.slowdown, 1.0); + SettingManager.register(setting); + setting = new Setting("SCALE_FACTOR", "Downscale Factor", SettingType.SLIDER, this, this.downscaleFactor, 0.1); + SettingManager.register(setting); + setting = new Setting("BLOCK_HEIGHT", "Block Height", SettingType.SLIDER, this, this.blockHeight, 1.0); + SettingManager.register(setting); + setting = new Setting("HIT_HEIGHT", "Hit Height", SettingType.SLIDER, this, this.hitHeight, 1.0); + SettingManager.register(setting); + setting = new Setting("BLOCK_ROTATING", "Rotating", SettingType.CHECKBOX, this, this.rotating); + SettingManager.register(setting); +} + +} diff --git a/src/main/java/cc/novoline/modules/visual/Arrows.java b/src/main/java/cc/novoline/modules/visual/Arrows.java new file mode 100644 index 0000000..0415887 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/Arrows.java @@ -0,0 +1,650 @@ +package cc.novoline.modules.visual; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.modules.PlayerRelationType; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.HypixelLobbyType; +import cc.novoline.utils.MovementUtils; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.ServerUtils; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.render.ColorPaletteUtil; +import cc.novoline.utils.render.RotationAngleUtil; + +import cc.novoline.Novoline; +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import java.awt.Color; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import net.minecraft.entity.EntityCreatureSupport; +import cc.novoline.modules.ModuleManager; +import net.minecraft.util.MathHelper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.Entity; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.monster.EntitySlime; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IChatComponent; +import net.minecraft.util.Vec3; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.lwjgl.opengl.GL11; + +public final class Arrows extends AbstractModule { + @Property("radius") + private final IntProperty radius; + @Property("targets") + private final ListProperty targets; + private static double X; + private static double doubleValueField; + + static { + X = 0.03; + doubleValueField = 5.0; + } + private static final float CONST_FLOAT = 360.0F; + private static final int CONST_INT = 90; + private static final float CONST_FLOAT_2 = 255.0F; + private boolean stateFlag; + @Property("alpha-type") + private final StringProperty alphaType; + @Property("alpha") + private final IntProperty alpha; + @Property("only_invisible") + private final BooleanProperty only_invisible; + @Property("color") + private final ColorProperty color; + @Property("color-type") + private final StringProperty colorType; + @Property("rainbow-type") + private final StringProperty rainbowType; + @Property("targets-only") + private final BooleanProperty targetsOnly; + private int stateTicks; + @Property("filters") + private final ListProperty filters; + + + public Arrows(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + this.only_invisible = BooleanProperty.of(true); + IntProperty intProp = IntProperty.of(150); + Integer intVal2 = 55; + IntProperty intProp2 = intProp.minimum(intVal2); + this.radius = intProp2.maximum(165); + Integer intVal = -16776961; + this.color = ColorProperty.e(intVal); + ListProperty listProp = ListProperty.of("Players"); + String[] stringArr = new String[]{"Players", "Animals", "Mobs"}; + this.targets = listProp.acceptableValues((Object[])stringArr); + ListProperty listProp2 = ListProperty.of("Teams"); + String[] stringArr2 = new String[]{"Teams"}; + this.filters = listProp2.acceptableValues((Object[])stringArr2); + this.targetsOnly = BooleanProperty.of(false); + StringProperty strProp = StringProperty.of("Static"); + String[] stringArr3 = new String[]{"Static", "Team", "Client"}; + this.colorType = strProp.acceptableValues(stringArr3); + StringProperty strProp2 = StringProperty.of("Static"); + String[] stringArr4 = new String[]{"Static", "Cycle"}; + this.rainbowType = strProp2.acceptableValues(stringArr4); + StringProperty strProp3 = StringProperty.of("Distance"); + String[] stringArr5 = new String[]{"Distance", "Pulse", "Static"}; + this.alphaType = strProp3.acceptableValues(stringArr5); + IntProperty intProp3 = IntProperty.of(255); + IntProperty intProp4 = intProp3.minimum(0); + this.alpha = intProp4.maximum(255); + this.stateTicks = 1; + Setting setting = new Setting("ARROWS_ONLY_VISIBLES", "Not in FOV only", SettingType.CHECKBOX, this, this.only_invisible); + SettingManager.register(setting); + setting = new Setting("ARROWS_TARGETS_ONLY", "Targets Only", SettingType.CHECKBOX, this, this.targetsOnly); + SettingManager.register(setting); + setting = new Setting("ARROWS_RADIUS", "Radius", SettingType.SLIDER, this, this.radius, 5.0); + SettingManager.register(setting); + setting = new Setting("ARROWS_TARGETS", "Targets", SettingType.SELECTBOX, this, this.targets); + SettingManager.register(setting); + setting = new Setting("ARROWS_FILTER", "Filters", SettingType.SELECTBOX, this, this.filters, this::lambdaImpl$new$0); + SettingManager.register(setting); + setting = new Setting("ARROWS_COLORTYPE", "Color Type", SettingType.COMBOBOX, this, this.colorType); + SettingManager.register(setting); + setting = new Setting("ARROWS_RAINBOWTYPE", "Color State", SettingType.COMBOBOX, this, this.rainbowType, () -> this.colorType.equals("Client")); + SettingManager.register(setting); + setting = new Setting("ARROWS_COLOR", "Color", SettingType.COLOR_PICKER, this, this.color, null); + SettingManager.register(setting); + setting = new Setting("ARROWS_ALPHA", "Alpha Type", SettingType.COMBOBOX, this, this.alphaType); + SettingManager.register(setting); + setting = new Setting("ARROWS_ALPHA_SLIDER", "Alpha", SettingType.SLIDER, this, this.alpha, 5.0, () -> this.alphaType.equals("Static")); + SettingManager.register(setting); +} + + private Boolean lambdaImpl$new$0() { + ListProperty listProp = this.targets; + return listProp.contains("Players"); +} + + + private static double invokeCallback(float value, Entity entity) { + double posX2 = ((RotationAngleUtil.evaluateFloat(entity.posX, entity.posZ) + 360.0F) % 360.0F - value + 360.0F) % 360.0F - 90.0F; + return Math.toRadians(posX2); +} + + @EventTarget + public void onRender2D(Render2DEvent event) { + boolean flag; + int intVal; + int intVal2; + java.awt.Color awtColor; + cc.novoline.modules.visual.Arrows arrows; + cc.novoline.modules.visual.Arrows arrows2; + boolean flag4 = HUD.H(); + Minecraft mcClient = this.mc; + boolean flag2 = flag4; + EntityPlayerSP player = mcClient.thePlayer; + float yaw = player.rotationYaw; + Integer intVal3 = this.radius.get(); + X = 0.03 * (135.0 / intVal3.doubleValue()); + ScaledResolution scaledRes = event.getResolution(); + double scaledWidthD = scaledRes.getScaledWidthGui(); + double scaledHeightD = scaledRes.getScaledHeightGui(); + double doubleVal = scaledWidthD / 2.0; + double doubleVal2 = scaledHeightD / 2.0; + BooleanProperty boolProp = this.only_invisible; + Boolean propFlag = boolProp.get(); + boolean flag3 = propFlag; + IntProperty intProp = this.radius; + Integer intVal4 = intProp.get(); + int intVal5 = intVal4; + ColorProperty colorProp = this.color; + long longVal = 0L; + WorldClient world = mcClient.theWorld; + List itemList = world.getLoadedEntityList(); + Stream stream2 = itemList.stream(); + Comparator comparator = Comparator.comparingDouble(((java.util.function.ToDoubleFunction) ((value0) -> cc.novoline.modules.visual.Arrows.invokeCallback(yaw, value0)))); + Stream stream3 = stream2.sorted(comparator); + Collector collector = Collectors.toList(); + List itemList2 = (java.util.List) stream3.collect(collector); + Iterator iter = itemList2.iterator(); + + label215: { + + while (true) { + if (iter.hasNext()) { + Entity entity = (Entity)iter.next(); + flag = this.matchesEntity(entity); + + if (!flag) { + continue; + } + + flag = RenderUtils.computeIntArray(entity); + + if (flag) { + flag = flag3; + + if (flag3) { + continue; + } + } + + BooleanProperty boolProp2 = this.targetsOnly; + propFlag = boolProp2.get(); + flag = propFlag; + + label200: { + if (!flag) { + break label200; + } + + Novoline novolineInst = this.novoline; + flag = novolineInst.getPlayerManager().hasType(entity.getName(), PlayerRelationType.TARGET); + + if (!flag) { + continue; + } + } + + double dist; + float floatVal3; + dist = entity.getDistanceToEntity(player); + RenderUtils.renderVisual3(); + GL11.glPushMatrix(); + MovementUtils.applyGuiScale(true); + GL11.glLineWidth(2.0F); + floatVal3 = 0.0F; + StringProperty strProp = this.alphaType; + String propStr = strProp.get(); + byte byteVal = -1; + intVal = propStr.hashCode(); + + switch (intVal) { + case -1808614770: + intVal = (propStr.equals("Static") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 0; + if (flag2) { + break; + } + case 353103893: + intVal = (propStr.equals("Distance") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 1; + if (flag2) { + break; + } + case 77474681: + intVal = (propStr.equals("Pulse") ? 1 : 0); + + if (intVal != 0) { + byteVal = 2; + } + } + + intVal = byteVal; + + + label174: { + label173: { + label172: { + switch (intVal) { + case 0: + IntProperty intProp2 = this.alpha; + Integer intVal6 = intProp2.get(); + intVal = intVal6; + break; + case 1: + break label172; + case 2: + break label173; + default: + break label174; + } + + floatVal3 = intVal / 255.0F; + + break label174; + + } + + float colorF = colorProp.getAlpha() / 255.0F * (float)dist * 3.0F; + floatVal3 = 1.0F - MathHelper.clamp_float(colorF, 0.0F, 255.0F) / 255.0F; + + break label174; + + } + + floatVal3 = this.stateTicks / 255.0F; + } + + label226: { + awtColor = new Color(102, 201, 255, 255); + intVal2 = (entity instanceof EntityPlayer ? 1 : 0); + + if (intVal2 != 0) { + Novoline novolineInst2 = this.novoline; + intVal2 = (novolineInst2.getPlayerManager().hasType(entity.getName(), PlayerRelationType.TARGET) ? 1 : 0); + + if (intVal2 != 0) { + awtColor = this.colorField2; + break label226; + } + } + + intVal2 = (entity instanceof EntityPlayer ? 1 : 0); + + if (intVal2 != 0) { + Novoline novolineInst3 = this.novoline; + intVal2 = (novolineInst3.getPlayerManager().hasType(entity.getName(), PlayerRelationType.FRIEND) ? 1 : 0); + + if (intVal2 != 0) { + awtColor = this.colorField; + break label226; + } + } + + StringProperty strProp2 = this.colorType; + intVal2 = (strProp2.equals("Static") ? 1 : 0); + + if (intVal2 != 0) { + awtColor = colorProp.getAwtColor(); + break label226; + } + + StringProperty strProp3 = this.colorType; + intVal2 = (strProp3.equals("Client") ? 1 : 0); + + + if (intVal2 != 0) { + StringProperty strProp4 = this.rainbowType; + long longVal2 = strProp4.equals("Static") ? 0L : longVal; + int color2 = ColorTheme.getHudColor(longVal2); + awtColor = new Color(ColorTheme.reAlpha(color2, 255)); + break label226; + } + + intVal2 = (entity instanceof EntityPlayer ? 1 : 0); + + + if (intVal2 != 0) { + StringProperty strProp5 = this.colorType; + intVal2 = (strProp5.equals("Team") ? 1 : 0); + + if (intVal2 != 0) { + awtColor = ColorPaletteUtil.checkNetworkPlayerInfo(entity); + } + } + } + + intVal2 = awtColor.getRGB() >> 16 & 0xFF; + + float colorF2 = intVal2 / 255.0F; + float greenF = (awtColor.getRGB() >> 8 & 0xFF) / 255.0F; + float colorF3 = (awtColor.getRGB() & 0xFF) / 255.0F; + GL11.glColor4f(colorF2, greenF, colorF3, floatVal3); + GL11.glEnable(2881); + GL11.glBegin(5); + float floatVal = ( + RotationAngleUtil.evaluateFloat( + entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * this.mc.timer.elapsedPartialTicks, + entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * this.mc.timer.elapsedPartialTicks + ) + + 360.0F + ) + % 360.0F; + float floatVal2 = (floatVal - yaw + 360.0F) % 360.0F - 90.0F; + double doubleVal3 = floatVal2; + double angleRad = Math.toRadians(doubleVal3); + double doubleVal4 = doubleVal + MathHelper.cos(angleRad) * intVal5; + GL11.glVertex2d(doubleVal4, doubleVal2 + MathHelper.sin(angleRad) * intVal5); + double doubleVal5 = angleRad + X; + double doubleVal6 = doubleVal + MathHelper.cos(doubleVal5) * (intVal5 - doubleValueField); + double doubleVal7 = angleRad + X; + GL11.glVertex2d(doubleVal6, doubleVal2 + MathHelper.sin(doubleVal7) * (intVal5 - doubleValueField)); + double doubleVal8 = angleRad - X; + double doubleVal9 = doubleVal + MathHelper.cos(doubleVal8) * (intVal5 - doubleValueField); + double doubleVal10 = angleRad - X; + GL11.glVertex2d(doubleVal9, doubleVal2 + MathHelper.sin(doubleVal10) * (intVal5 - doubleValueField)); + double doubleVal11 = doubleVal + MathHelper.cos(angleRad) * intVal5; + GL11.glVertex2d(doubleVal11, doubleVal2 + MathHelper.sin(angleRad) * intVal5); + GL11.glEnd(); + GL11.glDisable(2881); + GL11.glPopMatrix(); + RenderUtils.stop2D(); + longVal -= 240L; + continue; + } + + arrows = this; + + flag = this.stateFlag; + break; + } + + if (!flag) { + arrows = this; + + if (this.stateTicks < 255) { + this.stateTicks++; + break label215; + } + } + + arrows = this; + + arrows.stateFlag = true; + } + + arrows2 = this; + + if (this.stateFlag) { + arrows2 = this; + + if (this.stateTicks > 0) { + this.stateTicks--; + return; + } + } + + arrows2 = this; + + arrows2.stateFlag = false; +} + + public boolean matchesEntity(Entity entity) { + boolean flag; + boolean flag2; + if (entity.isConditionMet16()) { + EntityPlayerSP player = this.mc.thePlayer; + if (player.getHealth() > 0.0F) { + Novoline novolineInst = this.novoline; + byte byteVal = (byte)(novolineInst.getPlayerManager().hasType(entity.getName(), PlayerRelationType.FRIEND) ? 1 : 0); + + label134: + if (byteVal == 0) { + flag = entity instanceof EntityMob; + if (!flag) { + flag = entity instanceof EntitySlime; + + label165: + if (!flag) { + boolean flag4 = entity instanceof EntityCreatureSupport; + if (flag4) { + break label165; + } + + flag4 = entity instanceof EntityAnimal; + + label150: + if (!flag4) { + boolean flag5 = entity instanceof EntityVillager; + if (flag5) { + break label150; + } + + flag5 = entity instanceof EntityPlayer; + + if (flag5) { + ListProperty listProp = this.targets; + if (listProp.contains("Players") && entity != this.mc.thePlayer) { + ListProperty listProp2 = this.filters; + flag2 = listProp2.contains("Teams"); + + if (flag2) { + flag2 = ColorPaletteUtil.checkICommandSender(entity); + + if (flag2) { + return false; + } + } + + flag2 = entity.isConditionMet23(); + + if (flag2) { + ListProperty listProp3 = this.targets; + flag2 = listProp3.contains("Invisibles"); + + if (!flag2) { + return false; + } + } + + flag2 = this.matchesCommandSender((ICommandSender)entity); + + if (!flag2) { + return true; + } + } + + return false; + } + break label134; + } + + ListProperty listProp4 = this.targets; + flag4 = listProp4.contains("Animals"); + + + if (!flag4) { + return false; + } + + flag4 = entity.isConditionMet23(); + + + if (!flag4) { + return true; + } + + ListProperty listProp5 = this.targets; + boolean flag6 = listProp5.contains("Invisibles"); + + if (flag6) { + return true; + } + + return false; + } + } + + ListProperty listProp6 = this.targets; + flag = listProp6.contains("Mobs"); + + + if (!flag) { + return false; + } + + flag = entity.isConditionMet23(); + + + if (!flag) { + return true; + } + + ListProperty listProp7 = this.targets; + boolean flag7 = listProp7.contains("Invisibles"); + + if (flag7) { + return true; + } + + return false; + } + } + } + + return false; +} + + private boolean matchesCommandSender(ICommandSender sender) { + boolean flag6 = HUD.H(); + IChatComponent chatComp = sender.getDisplayName(); + boolean flag = flag6; + String msgText = chatComp.getFormattedText(); + String textStr = chatComp.getUnformattedText(); + int len2 = msgText.length() - 2; + String textStr2 = msgText.substring(0, len2); + boolean flag2 = textStr2.contains("\u00a7"); + flag2 = !flag2; + + boolean flag3 = flag2; + int len = msgText.length() - 2; + String textStr3 = msgText.substring(len); + boolean flag4 = textStr3.contains("\u00a7"); + boolean flag5 = ServerUtils.isHypixel(); + if (!flag5) { + return false; + } + + HypixelLobbyType lobbyType = HypixelLobbyType.BW; + flag5 = ServerUtils.serverIs(lobbyType); + + if (!flag5) { + return false; + } + + flag5 = flag3; + + if (!flag5) { + return false; + } + + flag5 = flag4; + + return !flag ? flag5 : flag5; +} + + + private Vec3 resolveVec32(float value, float amount) { + double doubleVal = -amount; + doubleVal = Math.toRadians(doubleVal) - (float) Math.PI; + float floatVal = MathHelper.cos(doubleVal); + doubleVal = -amount; + doubleVal = Math.toRadians(doubleVal) - (float) Math.PI; + float floatVal2 = MathHelper.sin(doubleVal); + doubleVal = -value; + doubleVal = Math.toRadians(doubleVal); + float floatVal3 = -MathHelper.cos(doubleVal); + doubleVal = -value; + doubleVal = Math.toRadians(doubleVal); + float floatVal4 = MathHelper.sin(doubleVal); + return new Vec3(floatVal2 * floatVal3, floatVal4, floatVal * floatVal3); +} + + private static boolean matchesEntityPlayer(EntityPlayer player) { + ItemStack[] stackArr = player.inventory.armorInventory; + ItemStack stack = stackArr[0]; + + if (stack != null) { + return true; + } + + stack = stackArr[1]; + + + + if (stack != null) { + return true; + } + + stack = stackArr[2]; + + + + if (stack != null) { + return true; + } + + stack = stackArr[3]; + + + return stack != null; +} + +} diff --git a/src/main/java/cc/novoline/modules/visual/Atomsphere.java b/src/main/java/cc/novoline/modules/visual/Atomsphere.java new file mode 100644 index 0000000..90c5650 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/Atomsphere.java @@ -0,0 +1,269 @@ +package cc.novoline.modules.visual; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.server.S03PacketTimeUpdate; +import net.minecraft.network.play.server.S2BPacketChangeGameState; +import net.minecraft.client.multiplayer.WorldClient; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class Atomsphere extends AbstractModule { + @Property("time") + private final DoubleProperty time; + @Property("weather-mode") + private final StringProperty weatherMode; + @Property("cycle-speed") + private final IntProperty cycleSpeed; + private long lastTimestamp; + @Property("weather-control") + private final BooleanProperty weatherControl; + @Property("time-mode") + private final StringProperty timeMode; + + @EventTarget + public void onPacket(PacketEvent event) { + cc.novoline.events.events.PacketEvent packetEvent; + int intVal = (event.getState().equals(State.INCOMING) ? 1 : 0); + if (intVal == 0) { + return; + } + + BooleanProperty boolProp = this.weatherControl; + Boolean propFlag = boolProp.get(); + intVal = (propFlag ? 1 : 0); + + if (intVal != 0) { + intVal = (event.getPacket() instanceof S2BPacketChangeGameState ? 1 : 0); + + label57: + if (intVal != 0) { + label73: { + S2BPacketChangeGameState changeGameStatePacket = (S2BPacketChangeGameState)event.getPacket(); + intVal = changeGameStatePacket.getGameState(); + byte byteVal = 1; + if (intVal == 1) { + break label73; + } + + intVal = changeGameStatePacket.getGameState(); + + if (intVal == 2) { + break label73; + } + + intVal = changeGameStatePacket.getGameState(); + + if (intVal == 7) { + break label73; + } + + intVal = changeGameStatePacket.getGameState(); + + if (intVal != 8) { + break label57; + } + } + + event.setCancelled(true); + } + } + + packetEvent = event; + + intVal = (event.getPacket() instanceof S03PacketTimeUpdate ? 1 : 0); + + if (intVal == 0) { + return; + } + + packetEvent = event; + + packetEvent.setCancelled(true); +} + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + int intVal; + cc.novoline.modules.visual.Atomsphere atomsphere; + boolean flag = HUD.H(); + Object obj = this.mc.theWorld; + if (this.mc.theWorld == null) { + return; + } + + BooleanProperty boolProp = this.weatherControl; + obj = boolProp.get(); + + boolean flag2 = ((Boolean) obj); + if (flag2) { + StringProperty strProp = this.weatherMode; + String propStr = strProp.get(); + byte byteVal = -1; + intVal = propStr.hashCode(); + + switch (intVal) { + case 756396958: + intVal = (propStr.equals("Snowfall") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 0; + if (flag) { + break; + } + case 2539444: + intVal = (propStr.equals("Rain") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 1; + if (flag) { + break; + } + case 1986044198: + intVal = (propStr.equals("Snowstorm") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 2; + if (flag) { + break; + } + case 329757892: + intVal = (propStr.equals("Thunder") ? 1 : 0); + + if (intVal != 0) { + byteVal = 3; + } + } + + intVal = byteVal; + + + switch (intVal) { + case 0: + case 1: + WorldClient world = this.mc.theWorld; + world.setSpawnPoint(1.0F); + WorldClient world2 = this.mc.theWorld; + world2.applyFloat(0.0F); + if (flag) { + break; + } + case 2: + case 3: + WorldClient world3 = this.mc.theWorld; + world3.setSpawnPoint(1.0F); + WorldClient world4 = this.mc.theWorld; + world4.applyFloat(1.0F); + if (flag) { + break; + } + default: + WorldClient world5 = this.mc.theWorld; + world5.setSpawnPoint(0.0F); + WorldClient world6 = this.mc.theWorld; + world6.applyFloat(0.0F); + } + } + + atomsphere = this; + + StringProperty strProp2 = this.timeMode; + flag2 = strProp2.equals("Static"); + + if (!flag2) { + return; + } + + atomsphere = this; + + WorldClient world7 = atomsphere.mc.theWorld; + DoubleProperty doubleProp = this.time; + Double propDouble = doubleProp.get(); + long longVal = propDouble.longValue() * 1000L; + world7.setWorldTime(longVal); +} + + + public StringProperty getWeatherMode() { + return this.weatherMode; +} + + public StringProperty getStringProperty5() { + return this.getWeatherMode(); +} + + + @EventTarget + public void onRender2D(Render2DEvent event) { + Atomsphere atomsphere; + + StringProperty strProp = this.timeMode; + if (!(strProp.equals("Cycle"))) { + return; + } + + long timeMs = this.lastTimestamp; + Integer intVal = this.cycleSpeed.get(); + this.lastTimestamp = timeMs + intVal.intValue(); + WorldClient world = this.mc.theWorld; + long timeMs2 = this.lastTimestamp; + world.setWorldTime(timeMs2); + atomsphere = this; + + if (this.lastTimestamp - 24000L <= 0L) { + return; + } + + atomsphere = this; + + atomsphere.lastTimestamp = 0L; +} + + + public Atomsphere(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + StringProperty strProp = StringProperty.of("Static"); + String[] stringArr = new String[]{"Static", "Cycle"}; + this.timeMode = strProp.acceptableValues(stringArr); + this.time = DoubleProperty.of(12.0).minimum(1.0).maximum(24.0); + this.cycleSpeed = IntProperty.of(5).minimum(1).maximum(20); + StringProperty strProp2 = StringProperty.of("Clean"); + stringArr = new String[]{"Clean", "Rain", "Thunder", "Snowfall", "Snowstorm"}; + this.weatherMode = strProp2.acceptableValues(stringArr); + this.weatherControl = BooleanProperty.of(false); + Setting setting = new Setting("WORLD_TIME_MODE", "Time Mode", SettingType.COMBOBOX, this, this.timeMode); + SettingManager.register(setting); + setting = new Setting("WORLD_TIME", "Hour", SettingType.SLIDER, this, this.time, 0.5, () -> this.timeMode.equals("Static")); + SettingManager.register(setting); + setting = new Setting("WORLD_CYCLE_SPEED", "Cycle Speed", SettingType.SLIDER, this, this.cycleSpeed, 1.0, () -> this.timeMode.equals("Cycle")); + SettingManager.register(setting); + setting = new Setting("WEATHER_CONTROL", "Weather control", SettingType.CHECKBOX, this, this.weatherControl); + SettingManager.register(setting); + setting = new Setting("WEATHER_MODE", "Weather", SettingType.COMBOBOX, this, this.weatherMode, this.weatherControl::get); + SettingManager.register(setting); +} + +} diff --git a/src/main/java/cc/novoline/modules/visual/BlockOutline.java b/src/main/java/cc/novoline/modules/visual/BlockOutline.java new file mode 100644 index 0000000..776bfd4 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/BlockOutline.java @@ -0,0 +1,313 @@ +package cc.novoline.modules.visual; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.RenderUtils; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.render.RotationAngleUtil; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render3DEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import java.awt.Color; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.multiplayer.PlayerControllerMP; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.util.MovingObjectPosition$MovingObjectType; +import org.lwjgl.opengl.GL11; + +public class BlockOutline extends AbstractModule { + @Property("color-mode") + private final StringProperty colorMode; + @Property("color") + private final ColorProperty color; + @Property("vector") + private final BooleanProperty vector; + private static final long XOR_KEY = 10667490695418L; + @Property("mode") + private StringProperty mode; + + @EventTarget + public void onRender3D(Render3DEvent event) { + MovingObjectPosition rayTrace = this.getMovingObjectPosition(); + + if (rayTrace == null) { + return; + } + + rayTrace = this.getMovingObjectPosition(); + + + + if (rayTrace == null) { + return; + } + + rayTrace = this.getMovingObjectPosition(); + + + + if (rayTrace.typeOfHit != MovingObjectPosition$MovingObjectType.BLOCK) { + return; + } + + rayTrace = this.getMovingObjectPosition(); + + + BlockPos pos = rayTrace.getBlockPos(); + StringProperty strProp = this.mode; + int intVal = (strProp.equals("Chams") ? 1 : 0); + if (intVal != 0) { + this.renderBlockPos(pos); + return; + } + + RenderUtils.renderVisual10(); + Color awtColor = this.getColorB(); + int color2 = awtColor.getRGB(); + RenderUtils.glColor(color2); + intVal = pos.getX(); + + double doubleVal = intVal; + Minecraft mcClient = this.mc; + double doubleVal2 = doubleVal - mcClient.getRenderManager().renderPosX; + double doubleVal3 = pos.getY(); + Minecraft mcClient2 = this.mc; + double doubleVal7 = doubleVal3 - mcClient2.getRenderManager().renderPosY; + double doubleVal4 = pos.getZ(); + Minecraft mcClient3 = this.mc; + double doubleVal8 = doubleVal4 - mcClient3.getRenderManager().renderPosZ; + WorldClient world = this.mc.theWorld; + IBlockState blockState = world.getBlockState(pos); + Block block = blockState.getBlock(); + double doubleVal5 = block.getBlockBoundsMaxY(); + WorldClient world2 = this.mc.theWorld; + IBlockState blockState2 = world2.getBlockState(pos); + Block block2 = blockState2.getBlock(); + double doubleVal6 = doubleVal5 - block2.getBlockBoundsMinY(); + GL11.glLineWidth(1.0F); + GL11.glBegin(3); + GL11.glVertex3d(doubleVal2, doubleVal7, doubleVal8); + GL11.glVertex3d(doubleVal2, doubleVal7 + doubleVal6, doubleVal8); + GL11.glEnd(); + GL11.glBegin(3); + GL11.glVertex3d(doubleVal2 + 1.0, doubleVal7, doubleVal8); + GL11.glVertex3d(doubleVal2 + 1.0, doubleVal7 + doubleVal6, doubleVal8); + GL11.glEnd(); + GL11.glBegin(3); + GL11.glVertex3d(doubleVal2 + 1.0, doubleVal7, doubleVal8 + 1.0); + GL11.glVertex3d(doubleVal2 + 1.0, doubleVal7 + doubleVal6, doubleVal8 + 1.0); + GL11.glEnd(); + GL11.glBegin(3); + GL11.glVertex3d(doubleVal2, doubleVal7, doubleVal8 + 1.0); + GL11.glVertex3d(doubleVal2, doubleVal7 + doubleVal6, doubleVal8 + 1.0); + GL11.glEnd(); + GL11.glBegin(3); + GL11.glVertex3d(doubleVal2, doubleVal7, doubleVal8); + GL11.glVertex3d(doubleVal2 + 1.0, doubleVal7, doubleVal8); + GL11.glEnd(); + GL11.glBegin(3); + GL11.glVertex3d(doubleVal2, doubleVal7 + doubleVal6, doubleVal8); + GL11.glVertex3d(doubleVal2 + 1.0, doubleVal7 + doubleVal6, doubleVal8); + GL11.glEnd(); + GL11.glBegin(3); + GL11.glVertex3d(doubleVal2, doubleVal7, doubleVal8); + GL11.glVertex3d(doubleVal2, doubleVal7, doubleVal8 + 1.0); + GL11.glEnd(); + GL11.glBegin(3); + GL11.glVertex3d(doubleVal2, doubleVal7 + doubleVal6, doubleVal8); + GL11.glVertex3d(doubleVal2, doubleVal7 + doubleVal6, doubleVal8 + 1.0); + GL11.glEnd(); + GL11.glBegin(3); + GL11.glVertex3d(doubleVal2 + 1.0, doubleVal7, doubleVal8 + 1.0); + GL11.glVertex3d(doubleVal2 + 1.0, doubleVal7, doubleVal8 + 1.0); + GL11.glEnd(); + GL11.glBegin(3); + GL11.glVertex3d(doubleVal2 + 1.0, doubleVal7 + doubleVal6, doubleVal8 + 1.0); + GL11.glVertex3d(doubleVal2 + 1.0, doubleVal7 + doubleVal6, doubleVal8 + 1.0); + GL11.glEnd(); + GL11.glBegin(3); + GL11.glVertex3d(doubleVal2 + 1.0, doubleVal7, doubleVal8 + 1.0); + GL11.glVertex3d(doubleVal2 + 1.0, doubleVal7, doubleVal8); + GL11.glEnd(); + GL11.glBegin(3); + GL11.glVertex3d(doubleVal2 + 1.0, doubleVal7 + doubleVal6, doubleVal8 + 1.0); + GL11.glVertex3d(doubleVal2 + 1.0, doubleVal7 + doubleVal6, doubleVal8); + GL11.glEnd(); + GL11.glBegin(3); + GL11.glVertex3d(doubleVal2, doubleVal7, doubleVal8 + 1.0); + GL11.glVertex3d(doubleVal2 + 1.0, doubleVal7, doubleVal8 + 1.0); + GL11.glEnd(); + GL11.glBegin(3); + GL11.glVertex3d(doubleVal2, doubleVal7 + doubleVal6, doubleVal8 + 1.0); + GL11.glVertex3d(doubleVal2 + 1.0, doubleVal7 + doubleVal6, doubleVal8 + 1.0); + GL11.glEnd(); + RenderUtils.renderVisual9(); +} + + private Color getColorB() { + BlockOutline blockOutline = this; + + StringProperty strProp = this.colorMode; + if (!strProp.equals("Custom")) { + return new Color(ColorTheme.getHudColor(0L)); + } + + blockOutline = this; + + + ColorProperty colorProp = blockOutline.color; + return colorProp.getAwtColor(); +} + + + public MovingObjectPosition getMovingObjectPosition() { + float floatVal; + label14: { + float floatVal2 = this.mc.thePlayer.getCollisionBorderSize(); + BlockOutline blockOutline = this; + BooleanProperty boolProp = this.vector; + Boolean propFlag = boolProp.get(); + if (propFlag) { + floatVal = 250.0F; + break label14; + } + + blockOutline = this; + + PlayerControllerMP controller = blockOutline.mc.playerController; + floatVal = controller.getBlockReachDistance(); + } + + float floatVal3 = floatVal; + Vec3 vec = RotationAngleUtil.getEyesPos(); + Vec3 vec2 = RotationAngleUtil.getVectorForRotation(this.mc.thePlayer.rotationPitch, this.mc.thePlayer.rotationYaw); + double posX = vec2.xCoord * floatVal3; + double posY = vec2.yCoord * floatVal3; + double posZ = vec2.zCoord * floatVal3; + Vec3 vec3 = vec.addVector(posX, posY, posZ); + WorldClient world = this.mc.theWorld; + return world.rayTraceBlocks(vec, vec3, false, false, false); +} + + + private void renderBlockPos(BlockPos pos) { + RenderUtils.renderVisual10(); + Color awtColor = this.getColorB(); + int intVal = awtColor.getRed(); + Color awtColor2 = this.getColorB(); + int intVal2 = awtColor2.getGreen(); + Color awtColor3 = this.getColorB(); + RenderUtils.glColor(new Color(intVal, intVal2, awtColor3.getBlue(), 100)); + double doubleVal = pos.getX(); + Minecraft mcClient = this.mc; + double doubleVal2 = doubleVal - mcClient.getRenderManager().renderPosX; + double doubleVal3 = pos.getY(); + mcClient = this.mc; + double doubleVal12 = doubleVal3 - mcClient.getRenderManager().renderPosY; + double doubleVal4 = pos.getZ(); + mcClient = this.mc; + double doubleVal5 = doubleVal4 - mcClient.getRenderManager().renderPosZ; + WorldClient world = this.mc.theWorld; + IBlockState blockState = world.getBlockState(pos); + Block block = blockState.getBlock(); + double doubleVal6 = block.getBlockBoundsMaxY(); + WorldClient world2 = this.mc.theWorld; + IBlockState blockState2 = world2.getBlockState(pos); + Block block2 = blockState2.getBlock(); + double doubleVal7 = doubleVal6 - block2.getBlockBoundsMinY(); + WorldClient world3 = this.mc.theWorld; + IBlockState blockState3 = world3.getBlockState(pos); + Block block3 = blockState3.getBlock(); + double doubleVal8 = block3.getBlockBoundsMinX(); + WorldClient world4 = this.mc.theWorld; + IBlockState blockState4 = world4.getBlockState(pos); + Block block4 = blockState4.getBlock(); + double doubleVal9 = block4.getBlockBoundsMaxX(); + WorldClient world5 = this.mc.theWorld; + IBlockState blockState5 = world5.getBlockState(pos); + Block block5 = blockState5.getBlock(); + double doubleVal10 = block5.getBlockBoundsMinZ(); + WorldClient world6 = this.mc.theWorld; + IBlockState blockState6 = world6.getBlockState(pos); + Block block6 = blockState6.getBlock(); + double doubleVal11 = block6.getBlockBoundsMaxZ(); + GL11.glLineWidth(1.0F); + GL11.glPolygonMode(1032, 6914); + GL11.glBegin(7); + GL11.glVertex3d(doubleVal2 + doubleVal8, doubleVal12 + doubleVal7, doubleVal5 + doubleVal10); + GL11.glVertex3d(doubleVal2 + doubleVal8, doubleVal12 + doubleVal7, doubleVal5 + doubleVal11); + GL11.glVertex3d(doubleVal2 + doubleVal9, doubleVal12 + doubleVal7, doubleVal5 + doubleVal11); + GL11.glVertex3d(doubleVal2 + doubleVal9, doubleVal12 + doubleVal7, doubleVal5 + doubleVal10); + GL11.glEnd(); + GL11.glBegin(7); + GL11.glVertex3d(doubleVal2 + doubleVal9, doubleVal12 + doubleVal7, doubleVal5 + doubleVal10); + GL11.glVertex3d(doubleVal2 + doubleVal9, doubleVal12 + doubleVal7, doubleVal5 + doubleVal11); + GL11.glVertex3d(doubleVal2 + doubleVal9, doubleVal12, doubleVal5 + doubleVal11); + GL11.glVertex3d(doubleVal2 + doubleVal9, doubleVal12, doubleVal5 + doubleVal10); + GL11.glEnd(); + GL11.glBegin(7); + GL11.glVertex3d(doubleVal2 + doubleVal8, doubleVal12 + doubleVal7, doubleVal5 + doubleVal10); + GL11.glVertex3d(doubleVal2 + doubleVal9, doubleVal12 + doubleVal7, doubleVal5 + doubleVal10); + GL11.glVertex3d(doubleVal2 + doubleVal9, doubleVal12, doubleVal5 + doubleVal10); + GL11.glVertex3d(doubleVal2 + doubleVal8, doubleVal12, doubleVal5 + doubleVal10); + GL11.glEnd(); + GL11.glBegin(7); + GL11.glVertex3d(doubleVal2 + doubleVal8, doubleVal12 + doubleVal7, doubleVal5 + doubleVal11); + GL11.glVertex3d(doubleVal2 + doubleVal8, doubleVal12 + doubleVal7, doubleVal5 + doubleVal10); + GL11.glVertex3d(doubleVal2 + doubleVal8, doubleVal12, doubleVal5 + doubleVal10); + GL11.glVertex3d(doubleVal2 + doubleVal8, doubleVal12, doubleVal5 + doubleVal11); + GL11.glEnd(); + GL11.glBegin(7); + GL11.glVertex3d(doubleVal2 + doubleVal9, doubleVal12 + doubleVal7, doubleVal5 + doubleVal11); + GL11.glVertex3d(doubleVal2 + doubleVal8, doubleVal12 + doubleVal7, doubleVal5 + doubleVal11); + GL11.glVertex3d(doubleVal2 + doubleVal8, doubleVal12, doubleVal5 + doubleVal11); + GL11.glVertex3d(doubleVal2 + doubleVal9, doubleVal12, doubleVal5 + doubleVal11); + GL11.glEnd(); + GL11.glBegin(7); + GL11.glVertex3d(doubleVal2 + doubleVal9, doubleVal12, doubleVal5 + doubleVal11); + GL11.glVertex3d(doubleVal2 + doubleVal8, doubleVal12, doubleVal5 + doubleVal11); + GL11.glVertex3d(doubleVal2 + doubleVal8, doubleVal12, doubleVal5 + doubleVal10); + GL11.glVertex3d(doubleVal2 + doubleVal9, doubleVal12, doubleVal5 + doubleVal10); + GL11.glEnd(); + RenderUtils.renderVisual9(); +} + + public BlockOutline(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + StringProperty strProp = StringProperty.of("Client"); + String[] stringArr = new String[]{"Client", "Custom"}; + this.colorMode = strProp.acceptableValues(stringArr); + Color awtColor = new Color(200, 200, 200); + int color2 = awtColor.getRGB(); + Integer intVal = color2; + this.color = ColorProperty.e(intVal); + StringProperty strProp2 = StringProperty.of("Outline"); + stringArr = new String[]{"Chams", "Outline"}; + this.mode = strProp2.acceptableValues(stringArr); + this.vector = BooleanProperty.of(false); + Setting setting = new Setting("BO_COLOR_MODE", "Color Mode", SettingType.COMBOBOX, this, this.colorMode); + SettingManager.register(setting); + setting = new Setting("BO_COLOR", "Color", SettingType.COLOR_PICKER, this, this.color, null, () -> this.colorMode.equals("Custom")); + SettingManager.register(setting); + setting = new Setting("BO_MODE", "Mode", SettingType.COMBOBOX, this, this.mode); + SettingManager.register(setting); + setting = new Setting("BO_VECTOR", "Infinite", SettingType.CHECKBOX, this, this.vector); + SettingManager.register(setting); +} + + +} diff --git a/src/main/java/cc/novoline/modules/visual/BreadCrumbs.java b/src/main/java/cc/novoline/modules/visual/BreadCrumbs.java new file mode 100644 index 0000000..ca1371d --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/BreadCrumbs.java @@ -0,0 +1,140 @@ +package cc.novoline.modules.visual; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.render.BreadcrumbPoint; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render3DEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import java.awt.Color; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.lwjgl.opengl.GL11; + +public class BreadCrumbs extends AbstractModule { + @Property("color") + private final ColorProperty color; + @Property("color-mode") + private final StringProperty colorMode; + private List breadcrumbPointList; + + public BreadCrumbs(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + this.breadcrumbPointList = new CopyOnWriteArrayList<>(); + StringProperty strProp = StringProperty.of("Client"); + String[] stringArr = new String[]{"Client", "Custom"}; + this.colorMode = strProp.acceptableValues(stringArr); + Color awtColor = new Color(200, 200, 200); + int color2 = awtColor.getRGB(); + Integer intVal = color2; + this.color = ColorProperty.e(intVal); + Setting setting = new Setting("BC_COLOR_MODE", "Color Mode", SettingType.COMBOBOX, this, this.colorMode); + SettingManager.register(setting); + setting = new Setting("BC_COLOR", "Color", SettingType.COLOR_PICKER, this, this.color, null, () -> this.colorMode.equals("Custom")); + SettingManager.register(setting); +} + + + public int computeIntInt(int value, int index) { + double doubleVal2 = System.currentTimeMillis() - (long)value * index; + double doubleVal = Math.ceil(doubleVal2) / 11.0; + doubleVal %= 360.0; + float floatVal = (float)(doubleVal / 360.0); + Color awtColor = Color.getHSBColor(floatVal, 1.0F, 0.7F); + int intVal = awtColor.getRed(); + int intVal2 = awtColor.getGreen(); + Color awtColor2 = new Color(intVal, intVal2, awtColor.getBlue()); + return awtColor2.getRGB(); +} + + @EventTarget + public void onRender3D(Render3DEvent event) { + int intVal; + EntityPlayerSP player = this.mc.thePlayer; + if (player.isMoving()) { + List itemList = this.breadcrumbPointList; + double doubleVal = this.mc.getRenderManager().renderPosX; + double doubleVal6 = this.mc.getRenderManager().renderPosY + 0.1; + Minecraft mcClient = this.mc; + itemList.add(new BreadcrumbPoint(doubleVal, doubleVal6, mcClient.getRenderManager().renderPosZ)); + } + + long longVal = 0L; + GL11.glPushMatrix(); + GL11.glDisable(3553); + GL11.glLineWidth(2.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(2881); + GL11.glEnable(2848); + GL11.glBegin(3); + List itemList2 = this.breadcrumbPointList; + Iterator iter = itemList2.iterator(); + + while (true) { + if (iter.hasNext()) { + BreadcrumbPoint breadcrumbPoint = (BreadcrumbPoint)iter.next(); + int intVal2 = breadcrumbPoint.getStateTicks() + 1; + breadcrumbPoint.setStateTicks(intVal2); + intVal = breadcrumbPoint.getStateTicks(); + + if (intVal > 250) { + List itemList3 = this.breadcrumbPointList; + itemList3.remove(breadcrumbPoint); + } + + Color awtColor = this.resolveColor(longVal); + intVal = awtColor.getRGB(); + + RenderUtils.glColor(intVal); + double doubleVal2 = breadcrumbPoint.getCachedValue(); + Minecraft mcClient2 = this.mc; + double doubleVal3 = doubleVal2 - mcClient2.getRenderManager().renderPosX; + double doubleVal4 = breadcrumbPoint.getCachedValue2(); + Minecraft mcClient3 = this.mc; + double doubleVal7 = doubleVal4 - mcClient3.getRenderManager().renderPosY; + double doubleVal5 = breadcrumbPoint.getCachedValue3(); + Minecraft mcClient4 = this.mc; + GL11.glVertex3d(doubleVal3, doubleVal7, doubleVal5 - mcClient4.getRenderManager().renderPosZ); + longVal -= 40L; + continue; + } + + GL11.glEnd(); + GL11.glEnable(3553); + GL11.glDisable(2848); + intVal = 2881; + break; + } + + GL11.glDisable(intVal); + GL11.glPopMatrix(); +} + + + private Color resolveColor(long time) { + BreadCrumbs breadCrumbs = this; + StringProperty strProp = this.colorMode; + if (!strProp.equals("Custom")) { + return new Color(ColorTheme.getHudColor(time)); + } + + breadCrumbs = this; + + ColorProperty colorProp = breadCrumbs.color; + return colorProp.getAwtColor(); +} + +} diff --git a/src/main/java/cc/novoline/modules/visual/Brightness.java b/src/main/java/cc/novoline/modules/visual/Brightness.java new file mode 100644 index 0000000..7888129 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/Brightness.java @@ -0,0 +1,56 @@ +package cc.novoline.modules.visual; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.ModuleManager; + +public final class Brightness extends AbstractModule { + @Property("mode") + private final StringProperty mode; + + public boolean evaluateFlag6(String text) { + boolean flag = HUD.H(); + boolean enabled = this.isEnabled(); + if (!enabled) { + return false; + } + + StringProperty strProp = this.mode; + enabled = strProp.equals(text); + + return !flag ? enabled : enabled; +} + + public StringProperty getMode() { + return this.mode; +} + + public StringProperty getStringProperty6() { + return this.getMode(); +} + + + public Brightness(ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + StringProperty strProp = StringProperty.of("Gamma"); + String[] stringArr = new String[]{"Gamma", "Effect"}; + this.mode = strProp.acceptableValues(stringArr); + SettingManager.register(new Setting("BN_MODE", "Mode", SettingType.COMBOBOX, this, this.mode)); +} + + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + this.handleString3(this.mode.get()); +} + + +} diff --git a/src/main/java/cc/novoline/modules/visual/Camera.java b/src/main/java/cc/novoline/modules/visual/Camera.java new file mode 100644 index 0000000..e34f7d8 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/Camera.java @@ -0,0 +1,162 @@ +package cc.novoline.modules.visual; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.ModuleManager; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.lwjgl.input.Mouse; + +public class Camera extends AbstractModule { + @Property("view-clip") + BooleanProperty viewClip; + @Property("no-hurt-cam") + BooleanProperty noHurtCam; + @Property("rotate-camera") + private BooleanProperty rotateCamera; + private boolean stateFlag; + @Property("camera-button") + private StringProperty cameraButton; + @Property("mc-lock") + BooleanProperty mcLock; + @Property("smooth-zoom") + private BooleanProperty smoothZoom; + @Property("amount") + private final IntProperty amount; + + + public BooleanProperty getRotateCamera() { + return this.rotateCamera; +} + + public BooleanProperty getBooleanProperty() { + return this.getRotateCamera(); +} + + public BooleanProperty getNoHurtCam() { + return this.noHurtCam; +} + + public BooleanProperty getBooleanPropertyB() { + return this.getNoHurtCam(); +} + + public Camera(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + this.mcLock = BooleanProperty.of(true); + this.viewClip = BooleanProperty.of(true); + this.noHurtCam = BooleanProperty.of(true); + IntProperty intProp = IntProperty.of(1); + Integer intVal = 1; + IntProperty intProp2 = intProp.minimum(intVal); + this.amount = intProp2.maximum(10); + this.smoothZoom = BooleanProperty.of(false); + StringProperty strProp = StringProperty.of("MButton"); + String[] stringArr = new String[]{"MButton", "RButton", "XButton1", "XButton2"}; + this.cameraButton = strProp.acceptableValues(stringArr); + this.rotateCamera = BooleanProperty.of(false); + Setting setting = new Setting("CAMERA_SMOOTH_ZOOM", "Smooth Zoom", SettingType.CHECKBOX, this, this.smoothZoom); + SettingManager.register(setting); + setting = new Setting("CAMERA_VC", "View Clip", SettingType.CHECKBOX, this, this.viewClip); + SettingManager.register(setting); + setting = new Setting("CAMERA_NHC", "No Hurt Cam", SettingType.CHECKBOX, this, this.noHurtCam); + SettingManager.register(setting); + setting = new Setting("CAMERA_LOCK", "Camera Lock", SettingType.CHECKBOX, this, this.mcLock); + SettingManager.register(setting); + setting = new Setting("CAMERA_LOCK_BUTTON", "Lock Button", SettingType.COMBOBOX, this, this.cameraButton, this.mcLock::get); + SettingManager.register(setting); + setting = new Setting("CAMERA_ROTATE", "Rotate Camera", SettingType.CHECKBOX, this, this.rotateCamera, this.mcLock::get); + SettingManager.register(setting); +} + + + public boolean isReadyState20() { + boolean flag = HUD.Q(); + int intVal = (this.isEnabled() ? 1 : 0); + if ((intVal == 0)) { + return false; + } + + BooleanProperty boolProp = this.mcLock; + Boolean propFlag = boolProp.get(); + intVal = (propFlag ? 1 : 0); + + if ((intVal == 0)) { + return false; + } + + intVal = this.getIntValue14(); + intVal = (Mouse.isButtonDown(intVal) ? 1 : 0); + + return (((flag ? intVal : intVal) & 1) != 0); +} + + + private int getIntValue14() { + StringProperty strProp = this.cameraButton; + byte byteVal = (byte)(strProp.equals("XButton2") ? 1 : 0); + if (byteVal != 0) { + return 4; + } + + strProp = this.cameraButton; + byteVal = (byte)(strProp.equals("XButton1") ? 1 : 0); + + if (byteVal != 0) { + return 3; + } + + strProp = this.cameraButton; + byteVal = (byte)(strProp.equals("RButton") ? 1 : 0); + + + if (byteVal != 0) { + return 1; + } + + byteVal = 2; + + + return byteVal; +} + + public BooleanProperty getViewClip() { + return this.viewClip; +} + + public BooleanProperty getBooleanProperty2() { + return this.getViewClip(); +} + + + public BooleanProperty getSmoothZoom() { + return this.smoothZoom; +} + + public BooleanProperty getBooleanPropertyE() { + return this.getSmoothZoom(); +} + + + public boolean checkState21() { + boolean flag = HUD.Q(); + boolean enabled = this.isEnabled(); + if (!enabled) { + return false; + } + + BooleanProperty boolProp = this.smoothZoom; + Boolean propFlag = boolProp.get(); + enabled = propFlag; + + return flag ? enabled : enabled; +} + +} diff --git a/src/main/java/cc/novoline/modules/visual/Chams.java b/src/main/java/cc/novoline/modules/visual/Chams.java new file mode 100644 index 0000000..7cf23ec --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/Chams.java @@ -0,0 +1,610 @@ +package cc.novoline.modules.visual; + +import cc.novoline.events.events.RenderEntityEvent; +import cc.novoline.events.type.RenderEntityState; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.modules.PlayerRelationType; +import cc.novoline.utils.EntityFakePlayer; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.render.GlowOutlineFramebuffer; + +import cc.novoline.Novoline; +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.FloatProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import java.util.List; +import java.util.function.Predicate; +import java.util.stream.Stream; +import net.minecraft.entity.EntityCreatureSupport; +import cc.novoline.modules.ModuleManager; +import net.minecraft.util.MathHelper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.entity.Entity; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.monster.EntitySlime; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.lwjgl.opengl.GL11; + +public final class Chams extends AbstractModule { + @Property("mode") + private StringProperty mode; + @Property("chams-visible") + private ColorProperty chamsVisible; + @Property("chams-hand") + private ColorProperty chamsHand; + @Property("shader-color") + private ColorProperty shaderColor; + @Property("visible-alpha") + private FloatProperty visibleAlpha; + private boolean stateFlag; + @Property("chams-onlyTargets") + private BooleanProperty chamsOnlyTargets; + @Property("pulse-speed") + private FloatProperty pulseSpeed; + @Property("chams-material") + private BooleanProperty chamsMaterial; + private static boolean stateFlag2; + @Property("targets") + private ListProperty targets; + @Property("colored") + private BooleanProperty colored; + GlowOutlineFramebuffer glowOutlineFramebuffer; + @Property("pulse") + private BooleanProperty pulse; + @Property("hand") + private BooleanProperty hand; + @Property("rainbow") + private BooleanProperty rainbow; + private static float X; + @Property("chams-hidden") + private ColorProperty chamsHidden; + + public ColorProperty getChamsHidden() { + return this.chamsHidden; +} + + public ColorProperty getColorPropertyK() { + return this.getChamsHidden(); +} + + public float getFloatValue7() { + Object obj = this.pulse.get(); + + if (((Boolean) obj)) { + return X; + } + + obj = this.visibleAlpha.get(); + + + Float floatVal = (Float)obj; + return floatVal; +} + + + private Boolean supplyBoolean() { + boolean flag; + label35: { + label37: { + Boolean propFlag = this.rainbow.get(); + flag = propFlag; + if (!flag) { + StringProperty strProp = this.mode; + flag = strProp.equals("Basic"); + + if (flag) { + break label37; + } + } + + StringProperty strProp2 = this.mode; + flag = strProp2.equals("Texture"); + + label38: { + if (!flag) { + break label38; + } + + BooleanProperty boolProp = this.colored; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + break label37; + } + } + + flag = false; + break label35; + } + + flag = true; + } + + return flag; +} + + public StringProperty getMode() { + return this.mode; +} + + public StringProperty getStringPropertyJ() { + return this.getMode(); +} + + @Override + public void onEnable() { + stateFlag2 = true; + X = 0.0F; + this.stateFlag = false; +} + + public boolean isReadyState21() { + boolean flag = HUD.H(); + boolean flag2 = this.mode.equals("Texture"); + if (!flag2) { + return false; + } + + BooleanProperty boolProp = this.colored; + Boolean propFlag = boolProp.get(); + flag2 = propFlag; + + return !flag ? flag2 : flag2; +} + + public BooleanProperty getHand() { + return this.hand; +} + + public BooleanProperty getBooleanProperty3() { + return this.getHand(); +} + + + private Boolean supplyBoolean2() { + boolean flag; + label29: { + label31: { + Boolean propFlag = this.rainbow.get(); + flag = propFlag; + if (flag) { + break label31; + } + + StringProperty strProp = this.mode; + flag = strProp.equals("Basic"); + + if (!flag) { + break label31; + } + + BooleanProperty boolProp = this.hand; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label29; + } + } + + flag = false; + } + + return flag; +} + + public ColorProperty getChamsHand() { + return this.chamsHand; +} + + public ColorProperty getColorPropertyF() { + return this.getChamsHand(); +} + + public boolean applyInt5(Entity entity) { + Object obj; + boolean flag = HUD.H(); + boolean flag5 = entity instanceof EntityFakePlayer; + if (flag5) { + return false; + } + + flag5 = this.matchesEntity(entity); + + if (!flag5) { + return false; + } + + flag5 = entity.isConditionMet16(); + + if (!flag5) { + return false; + } + + obj = entity; + + flag5 = entity.isConditionMet23(); + + if (flag5) { + return false; + } + + obj = entity; + + if (obj == Minecraft.getMinecraft().thePlayer) { + return false; + } + + BooleanProperty boolProp = this.chamsOnlyTargets; + obj = boolProp.get(); + + Boolean flag2 = (Boolean)obj; + boolean flag3 = flag2; + + if (!flag3) { + return true; + } + + Novoline novolineInst = Novoline.getInstance(); + boolean flag4 = novolineInst.getPlayerManager().hasType(entity.getName(), PlayerRelationType.TARGET); + return !flag ? flag4 : flag4; +} + + @Override + public void onDisable() { + stateFlag2 = false; +} + + public BooleanProperty getRainbow() { + return this.rainbow; +} + + public BooleanProperty getBooleanPropertyValue3() { + return this.getRainbow(); +} + + private Boolean supplyBoolean3() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.pulse.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + StringProperty strProp = this.mode; + flag = strProp.equals("Basic"); + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + int intVal; + float floatVal7 = X; + Float propFloat5 = this.visibleAlpha.get(); + float floatVal8 = propFloat5; + X = MathHelper.clamp_float(floatVal7, 0.0F, floatVal8); + intVal = (this.stateFlag ? 1 : 0); + + if (!this.stateFlag) { + float floatVal = X; + Float propFloat = this.visibleAlpha.get(); + if (floatVal < propFloat) { + float floatVal2 = X; + propFloat = this.pulseSpeed.get(); + float floatVal3 = floatVal2 + propFloat; + Float propFloat6 = this.visibleAlpha.get(); + float floatVal9 = propFloat6; + X = MathHelper.clamp_float(floatVal3, 0.0F, floatVal9); + return; + } + } + + intVal = (this.stateFlag ? 1 : 0); + + if (intVal == 0) { + float floatVal4 = X; + Float propFloat2 = this.visibleAlpha.get(); + if (floatVal4 == propFloat2) { + this.stateFlag = true; + return; + } + } + + intVal = (this.stateFlag ? 1 : 0); + + if (intVal != 0) { + if (X > 0.0F) { + float floatVal5 = X; + Float propFloat3 = this.pulseSpeed.get(); + float floatVal6 = floatVal5 - propFloat3; + Float propFloat4 = this.visibleAlpha.get(); + float floatVal10 = propFloat4; + X = MathHelper.clamp_float(floatVal6, 0.0F, floatVal10); + return; + } + } + + intVal = (this.stateFlag ? 1 : 0); + + if (intVal == 0) { + return; + } + + if (X == 0.0F) { + this.stateFlag = false; + } +} + + public Chams(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + StringProperty strProp = StringProperty.of("Basic"); + String[] stringArr = new String[]{"Basic", "Shader", "Texture"}; + this.mode = strProp.acceptableValues(stringArr); + Integer intVal = -7697665; + this.chamsVisible = ColorProperty.e(intVal); + Integer intVal2 = -7697665; + this.chamsHidden = ColorProperty.e(intVal2); + Integer intVal3 = -7697665; + this.chamsHand = ColorProperty.e(intVal3); + Integer intVal4 = -7697665; + this.shaderColor = ColorProperty.e(intVal4); + this.visibleAlpha = FloatProperty.of(255.0F).minimum(50.0F).maximum(255.0F); + this.pulseSpeed = FloatProperty.of(10.0F).minimum(5.0F).maximum(20.0F); + this.rainbow = BooleanProperty.of(false); + this.pulse = BooleanProperty.of(false); + this.hand = BooleanProperty.of(false); + ListProperty listProp = ListProperty.of("Players"); + stringArr = new String[]{"Players", "Animals", "Mobs", "Passives"}; + this.targets = listProp.acceptableValues((Object[])stringArr); + this.chamsOnlyTargets = BooleanProperty.of(false); + this.chamsMaterial = BooleanProperty.of(false); + this.colored = BooleanProperty.of(false); + this.stateFlag = false; + this.glowOutlineFramebuffer = new GlowOutlineFramebuffer(); + Setting setting = new Setting("CTARGETS", "Targets", SettingType.SELECTBOX, this, this.targets); + SettingManager.register(setting); + setting = new Setting("CHAMS_MODE", "Mode", SettingType.COMBOBOX, this, this.mode); + SettingManager.register(setting); + setting = new Setting("CHAMS_SHADER_COLOR", "Shader Color", SettingType.COLOR_PICKER, this, this.shaderColor, null, () -> this.mode.equals("Shader")); + SettingManager.register(setting); + setting = new Setting("VISIBLE_CHAMS", "Visible", SettingType.COLOR_PICKER, this, this.chamsVisible, null, this::supplyBoolean4); + SettingManager.register(setting); + setting = new Setting("HIDDEN_CHAMS", "Hidden", SettingType.COLOR_PICKER, this, this.chamsHidden, null, this::supplyBoolean); + SettingManager.register(setting); + setting = new Setting("VAlpha", "Alpha", SettingType.SLIDER, this, this.visibleAlpha, 5.0, () -> this.mode.equals("Basic")); + SettingManager.register(setting); + setting = new Setting("CHAMS_MT", "Material", SettingType.CHECKBOX, this, this.chamsMaterial, () -> this.mode.equals("Basic")); + SettingManager.register(setting); + setting = new Setting("ChamsRainbow", "Rainbow", SettingType.CHECKBOX, this, this.rainbow, () -> this.mode.equals("Basic")); + SettingManager.register(setting); + setting = new Setting("PULSE", "Pulse", SettingType.CHECKBOX, this, this.pulse, () -> this.mode.equals("Basic")); + SettingManager.register(setting); + setting = new Setting("HAND", "Hand", SettingType.CHECKBOX, this, this.hand, () -> this.mode.equals("Basic")); + SettingManager.register(setting); + setting = new Setting("HAND_CHAMS", "Hand color", SettingType.COLOR_PICKER, this, this.chamsHand, null, this::supplyBoolean2); + SettingManager.register(setting); + setting = new Setting("PS", "Pulse speed", SettingType.SLIDER, this, this.pulseSpeed, 1.0, this::supplyBoolean3); + SettingManager.register(setting); + setting = new Setting("CHAMS_TEXTURE_COLORED", "Colored", SettingType.CHECKBOX, this, this.colored, () -> this.mode.equals("Texture")); + SettingManager.register(setting); + setting = new Setting("ONLYTARGETS", "Targets Only", SettingType.CHECKBOX, this, this.chamsOnlyTargets); + SettingManager.register(setting); +} + + @EventTarget + public void handleRenderEntityEvent(RenderEntityEvent event) { + boolean flag = this.mode.equals("Texture"); + if (!flag) { + return; + } + + BooleanProperty boolProp = this.colored; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + return; + } + + flag = this.applyInt5(event.getEntityB()); + + if (flag) { + if (event.getRenderEntityState() == RenderEntityState.PRE) { + GL11.glEnable(32823); + GL11.glPolygonOffset(1.0F, -1100000.0F); + return; + } + + GL11.glDisable(32823); + GL11.glPolygonOffset(1.0F, 1100000.0F); + } +} + + + public BooleanProperty getChamsMaterial() { + return this.chamsMaterial; +} + + public BooleanProperty getBooleanProperty4() { + return this.getChamsMaterial(); +} + + public ColorProperty getShaderColor() { + return this.shaderColor; +} + + public ColorProperty getColorPropertyB() { + return this.getShaderColor(); +} + + @EventTarget + public void onRender2D(Render2DEvent event) { + Chams chams; + boolean flag = this.mode.equals("Shader"); + if (!flag) { + return; + } + + chams = this; + + WorldClient world = this.mc.theWorld; + List itemList = world.getLoadedEntityList(); + Stream stream2 = itemList.stream(); + Predicate predicate = this::applyInt5; + flag = stream2.anyMatch(predicate); + + if (!flag) { + return; + } + + chams = this; + + chams.glowOutlineFramebuffer.evaluateInt(this, event); +} + + public ListProperty getTargets() { + return this.targets; +} + + public ListProperty getListProperty() { + return this.getTargets(); +} + + private boolean matchesEntity(Entity entity) { + boolean flag = HUD.Q(); + ListProperty listProp = this.targets; + boolean flag2 = listProp.contains("Players"); + if (flag2) { + boolean flag3 = entity instanceof EntityPlayer; + + if (flag3) { + return true; + } + } + + listProp = this.targets; + flag2 = listProp.contains("Mobs"); + + if (flag2) { + boolean flag4 = entity instanceof EntityMob; + + if (flag4) { + return true; + } + + boolean flag5 = entity instanceof EntitySlime; + + if (flag5) { + return true; + } + } + + listProp = this.targets; + flag2 = listProp.contains("Passives"); + + if (flag2) { + boolean flag6 = entity instanceof EntityVillager; + + if (flag6) { + return true; + } + + boolean flag7 = entity instanceof EntityCreatureSupport; + + if (flag7) { + return true; + } + } + + listProp = this.targets; + flag2 = listProp.contains("Animals"); + + + if (!flag2) { + return false; + } + + flag2 = entity instanceof EntityAnimal; + + + return flag ? flag2 : flag2; +} + + public ColorProperty getChamsVisible() { + return this.chamsVisible; +} + + public ColorProperty getColorPropertyE() { + return this.getChamsVisible(); +} + + private Boolean supplyBoolean4() { + boolean flag; + label35: { + label37: { + Boolean propFlag = this.rainbow.get(); + flag = propFlag; + if (!flag) { + StringProperty strProp = this.mode; + flag = strProp.equals("Basic"); + + if (flag) { + break label37; + } + } + + StringProperty strProp2 = this.mode; + flag = strProp2.equals("Texture"); + + label38: { + if (!flag) { + break label38; + } + + BooleanProperty boolProp = this.colored; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + break label37; + } + } + + flag = false; + break label35; + } + + flag = true; + } + + return flag; +} + +} diff --git a/src/main/java/cc/novoline/modules/visual/ChestESP.java b/src/main/java/cc/novoline/modules/visual/ChestESP.java new file mode 100644 index 0000000..eeee585 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/ChestESP.java @@ -0,0 +1,718 @@ +package cc.novoline.modules.visual; + + +import org.lwjgl.util.glu.GLU; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.MovementUtils; +import cc.novoline.utils.RenderUtils; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.events.events.Render3DEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import java.awt.Color; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.function.Predicate; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import javax.vecmath.Vector3d; +import javax.vecmath.Vector4d; +import cc.novoline.modules.ModuleManager; +import net.minecraft.tileentity.TileEntityEnderChest; + +import cc.novoline.utils.RenderUtilsSupport; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.shader.Framebuffer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.EXTFramebufferObject; +import org.lwjgl.opengl.GL11; + +public final class ChestESP extends AbstractModule { + @Property("color-box") + private final StringProperty colorBox; + @Property("color-ender") + private final ColorProperty colorEnder; + private final FloatBuffer floatBufferField; + @Property("bordered") + private final BooleanProperty bordered; + @Property("color-visible") + private final ColorProperty colorVisible; + private final FloatBuffer floatBufferField2; + private final FloatBuffer floatBufferField3; + private int stateTicks; + @Property("color") + private final ColorProperty color; + private final IntBuffer intBufferField; + @Property("color-hidden") + private final ColorProperty colorHidden; + @Property("mode") + private final StringProperty mode; + + private @NonNull AxisAlignedBB resolveAxisAlignedBB3(double x, double y, double z) { + RenderManager renderMgr = this.mc.getRenderManager(); + return new AxisAlignedBB(x + 0.05F - renderMgr.renderPosX, y - renderMgr.renderPosY, z + 0.05F - renderMgr.renderPosZ, x + 1.95F - renderMgr.renderPosX, y + 0.9F - renderMgr.renderPosY, z + 0.95F - renderMgr.renderPosZ); +} + + public void performStep18() { + this.performStep22(); + GL11.glPushAttrib(1048575); + GL11.glDisable(3008); + GL11.glDisable(3553); + GL11.glDisable(2896); + GL11.glEnable(3042); + GL11.glBlendFunc(770, 771); + GL11.glLineWidth(3.0F); + GL11.glEnable(2848); + GL11.glEnable(2960); + GL11.glClear(1024); + GL11.glClearStencil(15); + GL11.glStencilFunc(512, 1, 15); + GL11.glStencilOp(7681, 7681, 7681); + GL11.glPolygonMode(1032, 6913); +} + + public ColorProperty getColorHidden() { + return this.colorHidden; +} + + public ColorProperty getColorProperty() { + return this.getColorHidden(); +} + + public ColorProperty getColorVisible() { + return this.colorVisible; +} + + public ColorProperty getColorProperty2() { + return this.getColorVisible(); +} + + public void renderVisual() { + GL11.glPolygonOffset(1.0F, 2000000.0F); + GL11.glDisable(10754); + GL11.glEnable(2929); + GL11.glDepthMask(true); + GL11.glDisable(2960); + GL11.glDisable(2848); + GL11.glHint(3154, 4352); + GL11.glEnable(3042); + GL11.glEnable(2896); + GL11.glEnable(3553); + GL11.glEnable(3008); + GL11.glPopAttrib(); +} + + private Boolean supplyBoolean() { + boolean flag; + label29: { + label28: { + label31: { + StringProperty strProp = this.mode; + flag = strProp.equals("Chams"); + if (flag) { + break label31; + } + + StringProperty strProp2 = this.mode; + flag = strProp2.equals("2D"); + + if (!flag) { + break label28; + } + + StringProperty strProp3 = this.colorBox; + flag = strProp3.equals("Static"); + + if (flag) { + break label28; + } + } + + flag = false; + break label29; + } + + flag = true; + } + + return flag; +} + + + @EventTarget + public void onRender2D(Render2DEvent event) { + StringProperty strProp = this.mode; + String textStr = "2D"; + if (strProp.equals(textStr)) { + long longVal = 0L; + List itemList = this.getList(); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + Object obj = iter.next(); + + TileEntity tileEntity; + Vector4d vector4d; + label70: + while (true) { + tileEntity = (TileEntity)obj; + BlockPos pos = tileEntity.getPos(); + double doubleVal14 = pos.getX() + 0.1; + double doubleVal15 = pos.getY(); + double doubleVal16 = pos.getZ() + 0.1; + double doubleVal17 = pos.getX() + 0.9; + double doubleVal18 = pos.getY() + 0.8; + AxisAlignedBB boundingBox = new AxisAlignedBB(doubleVal14, doubleVal15, doubleVal16, doubleVal17, doubleVal18, pos.getZ() + 0.9); + Vector3d[] vector3dArr = new Vector3d[]{ + new Vector3d(boundingBox.minX, boundingBox.minY, boundingBox.minZ), + new Vector3d(boundingBox.minX, boundingBox.maxY, boundingBox.minZ), + new Vector3d(boundingBox.maxX, boundingBox.minY, boundingBox.minZ), + new Vector3d(boundingBox.maxX, boundingBox.maxY, boundingBox.minZ), + new Vector3d(boundingBox.minX, boundingBox.minY, boundingBox.maxZ), + new Vector3d(boundingBox.minX, boundingBox.maxY, boundingBox.maxZ), + new Vector3d(boundingBox.maxX, boundingBox.minY, boundingBox.maxZ), + new Vector3d(boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ) + }; + List itemList2 = Arrays.asList(vector3dArr); + this.mc.entityRenderer.renderStep(event.getPartialTicks(), 0); + vector4d = null; + Iterator iter2 = itemList2.iterator(); + + while (true) { + if (!iter2.hasNext()) { + break label70; + } + + Vector3d vector3d = (Vector3d)iter2.next(); + ScaledResolution scaledRes = event.getResolution(); + doubleVal14 = vector3d.x; + Minecraft mcClient = this.mc; + doubleVal14 -= mcClient.getRenderManager().viewerPosX; + doubleVal15 = vector3d.y; + Minecraft mcClient2 = this.mc; + doubleVal15 -= mcClient2.getRenderManager().viewerPosY; + doubleVal16 = vector3d.z; + Minecraft mcClient3 = this.mc; + vector3d = this.applyUpdate5(scaledRes, doubleVal14, doubleVal15, doubleVal16 - mcClient3.getRenderManager().viewerPosZ); + obj = vector3d; + + label101: { + + if (vector3d == null) { + break label101; + } + + obj = vector3d; + + + if (((Vector3d)obj).z < 0.0) { + break label101; + } + + if (vector3d.z < 1.0) { + Vector4d vector4d2 = vector4d; + if (vector4d == null) { + vector4d = new Vector4d(vector3d.x, vector3d.y, vector3d.z, 0.0); + } + + double doubleVal = vector3d.x; + doubleVal14 = vector4d.x; + vector4d.x = Math.min(doubleVal, doubleVal14); + double doubleVal2 = vector3d.y; + doubleVal14 = vector4d.y; + vector4d.y = Math.min(doubleVal2, doubleVal14); + double doubleVal3 = vector3d.x; + doubleVal14 = vector4d.z; + vector4d.z = Math.max(doubleVal3, doubleVal14); + vector4d2 = vector4d; + + double doubleVal4 = vector3d.y; + doubleVal14 = vector4d.w; + vector4d2.w = Math.max(doubleVal4, doubleVal14); + } + } + + } + } + + this.mc.entityRenderer.renderStep7(); + Vector4d vector4d3 = vector4d; + + if (vector4d == null) { + continue; + } + + vector4d3 = vector4d; + + + double doubleVal5 = vector4d3.x; + double doubleVal6 = vector4d.y; + double doubleVal7 = vector4d.z; + double doubleVal8 = vector4d.w; + strProp = this.mode; + textStr = "2D"; + boolean flag2 = strProp.equals(textStr); + + if (!flag2) { + continue; + } + + flag2 = true; + + + double doubleVal9; + label103: { + doubleVal9 = MovementUtils.applyGuiScale(flag2); + double doubleVal10 = doubleVal5 * (1.0 / doubleVal9); + double doubleVal11 = doubleVal6 * (1.0 / doubleVal9); + double doubleVal12 = doubleVal7 * (1.0 / doubleVal9); + double doubleVal13 = doubleVal8 * (1.0 / doubleVal9); + strProp = this.colorBox; + textStr = "Client"; + boolean flag3 = strProp.equals(textStr); + + if (flag3) { + float floatVal = (float)doubleVal10; + float floatVal4 = (float)doubleVal11; + float floatVal5 = (float)doubleVal12; + float floatVal6 = (float)doubleVal13; + Color awtColor = new Color(ColorTheme.getHudColor(longVal)); + BooleanProperty boolProp = this.bordered; + Boolean propFlag = boolProp.get(); + boolean flag = propFlag; + RenderUtils.drawElement(floatVal, floatVal4, floatVal5, floatVal6, awtColor, flag); + longVal -= 240L; + break label103; + } + + flag3 = tileEntity instanceof TileEntityEnderChest; + + + if (flag3) { + float floatVal2 = (float)doubleVal10; + float floatVal7 = (float)doubleVal11; + float floatVal8 = (float)doubleVal12; + float floatVal9 = (float)doubleVal13; + ColorProperty colorProp = this.colorEnder; + Color awtColor2 = colorProp.getAwtColor(); + BooleanProperty boolProp2 = this.bordered; + Boolean propFlag2 = boolProp2.get(); + boolean flag4 = propFlag2; + RenderUtils.drawElement(floatVal2, floatVal7, floatVal8, floatVal9, awtColor2, flag4); + break label103; + } + + float floatVal3 = (float)doubleVal10; + float floatVal10 = (float)doubleVal11; + float floatVal11 = (float)doubleVal12; + float floatVal12 = (float)doubleVal13; + ColorProperty colorProp2 = this.color; + Color awtColor3 = colorProp2.getAwtColor(); + BooleanProperty boolProp3 = this.bordered; + Boolean propFlag3 = boolProp3.get(); + boolean flag5 = propFlag3; + RenderUtils.drawElement(floatVal3, floatVal10, floatVal11, floatVal12, awtColor3, flag5); + } + + GL11.glScaled(1.0 / doubleVal9, 1.0 / doubleVal9, 1.0 / doubleVal9); + } + } +} + + public void renderVisual2() { + GL11.glStencilFunc(512, 0, 15); + GL11.glStencilOp(7681, 7681, 7681); + GL11.glPolygonMode(1032, 6914); +} + + private Vector3d applyUpdate5(ScaledResolution scaledResolution, double value, double amount, double offset) { + GL11.glGetFloat(2982, this.floatBufferField2); + GL11.glGetFloat(2983, this.floatBufferField3); + GL11.glGetInteger(2978, this.intBufferField); + if (GLU.gluProject((float)value, (float)amount, (float)offset, this.floatBufferField2, this.floatBufferField3, this.intBufferField, this.floatBufferField)) { + float floatVal = this.floatBufferField.get(0); + double doubleVal = floatVal / scaledResolution.getScaleFactor(); + float floatVal2 = Display.getHeight(); + FloatBuffer floatBuffer = this.floatBufferField; + floatVal2 -= floatBuffer.get(1); + double doubleVal2 = floatVal2 / scaledResolution.getScaleFactor(); + floatBuffer = this.floatBufferField; + return new Vector3d(doubleVal, doubleVal2, floatBuffer.get(2)); + } else { + return null; + } +} + + private List getList() { + List itemList = this.mc.theWorld.obtainList2(); + Stream stream2 = itemList.stream(); + Predicate predicate = ChestESP::matchesTileEntity; + Stream stream3 = stream2.filter(predicate); + Collector collector = Collectors.toList(); + return (java.util.List) stream3.collect(collector); +} + + private static boolean matchesTileEntity(TileEntity tileEntity) { + boolean flag = tileEntity instanceof TileEntityChest; + + if (!flag) { + flag = tileEntity instanceof TileEntityEnderChest; + + if (!flag) { + return false; + } + } + + flag = true; + + + return flag; +} + + public void performStep19() { + GL11.glStencilFunc(514, 1, 15); + GL11.glStencilOp(7680, 7680, 7680); + GL11.glPolygonMode(1032, 6913); +} + + + public void applyUpdate2(int value) { + this.handleInt(value); + GL11.glDepthMask(false); + GL11.glDisable(2929); + GL11.glEnable(10754); + GL11.glPolygonOffset(1.0F, -2000000.0F); + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.intState19, 240.0F, 240.0F); +} + + public void performStep20() { + GL11.glStencilFunc(512, 0, 15); + GL11.glStencilOp(7681, 7681, 7681); + GL11.glPolygonMode(1032, 6914); +} + + public ColorProperty getColor() { + return this.color; +} + + public ColorProperty getColorPropertyC() { + return this.getColor(); +} + + private @NonNull AxisAlignedBB resolveAxisAlignedBB(double x, double y, double z) { + RenderManager renderMgr = this.mc.getRenderManager(); + return new AxisAlignedBB( + x + 0.05F - renderMgr.renderPosX, y - renderMgr.renderPosY, z + 0.05F - renderMgr.renderPosZ - 1.0, x + 0.95F - renderMgr.renderPosX, y + 0.9F - renderMgr.renderPosY, z + 0.95F - renderMgr.renderPosZ + ); +} + + public void handleInt(int value) { + float alphaF = (value >> 24 & 0xFF) / 255.0F; + float redF = (value >> 16 & 0xFF) / 255.0F; + float greenF = (value >> 8 & 0xFF) / 255.0F; + float colorF = (value & 0xFF) / 255.0F; + float floatVal = alphaF; + float floatVal2 = 0.0F; + if (alphaF == 0.0F) { + alphaF = 1.0F; + } + + floatVal = redF; + floatVal2 = greenF; + + GL11.glColor4f(floatVal, floatVal2, colorF, alphaF); +} + + public void performStep21() { + GL11.glStencilFunc(514, 1, 15); + GL11.glStencilOp(7680, 7680, 7680); + GL11.glPolygonMode(1032, 6913); +} + + public int applyUpdate5(float value, float amount, float factor, float angle) { + return ((int)(angle * 255.0F) & 0xFF) << 24 | ((int)(value * 255.0F) & 0xFF) << 16 | ((int)(amount * 255.0F) & 0xFF) << 8 | (int)(factor * 255.0F) & 0xFF; +} + + public ColorProperty getColorEnder() { + return this.colorEnder; +} + + public ColorProperty getColorPropertyValue() { + return this.getColorEnder(); +} + + public void handleFramebuffer(Framebuffer framebuffer) { + EXTFramebufferObject.glDeleteRenderbuffersEXT(framebuffer.depthBuffer); + int intVal = EXTFramebufferObject.glGenRenderbuffersEXT(); + EXTFramebufferObject.glBindRenderbufferEXT(36161, intVal); + int intVal2 = Minecraft.getMinecraft().displayWidth; + EXTFramebufferObject.glRenderbufferStorageEXT(36161, 34041, intVal2, Minecraft.getMinecraft().displayHeight); + EXTFramebufferObject.glFramebufferRenderbufferEXT(36160, 36128, 36161, intVal); + EXTFramebufferObject.glFramebufferRenderbufferEXT(36160, 36096, 36161, intVal); +} + + private Boolean supplyBoolean2() { + boolean flag; + label29: { + label28: { + label31: { + StringProperty strProp = this.mode; + flag = strProp.equals("Chams"); + if (flag) { + break label31; + } + + StringProperty strProp2 = this.mode; + flag = strProp2.equals("2D"); + + if (!flag) { + break label28; + } + + StringProperty strProp3 = this.colorBox; + flag = strProp3.equals("Static"); + + if (flag) { + break label28; + } + } + + flag = false; + break label29; + } + + flag = true; + } + + return flag; +} + + private @NonNull AxisAlignedBB resolveAxisAlignedBB2(double x, double y, double z) { + RenderManager renderMgr = this.mc.getRenderManager(); + return new AxisAlignedBB(x + 0.05F - renderMgr.renderPosX, y - renderMgr.renderPosY, z + 0.05F - renderMgr.renderPosZ, x + 0.95F - renderMgr.renderPosX, y + 0.9F - renderMgr.renderPosY, z + 0.95F - renderMgr.renderPosZ); +} + + @EventTarget + public void onRender3D(Render3DEvent event) { + ChestESP chestESP = this; + + StringProperty strProp = this.mode; + if (!strProp.equals("Filled")) { + return; + } + + chestESP = this; + + + List itemList = chestESP.getList(); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + TileEntity tileEntity = (TileEntity)iter.next(); + if (!tileEntity.isInvalid()) { + WorldClient world = this.mc.theWorld; + BlockPos pos = tileEntity.getPos(); + if (world.getBlockState(pos) != null) { + if (tileEntity instanceof TileEntityEnderChest) { + this.renderTileEntity(tileEntity, this.colorEnder.getAwtColor()); + continue; + } + + ColorProperty colorProp = this.color; + this.renderTileEntity(tileEntity, colorProp.getAwtColor()); + } + } + } +} + + public void performStep22() { + Framebuffer fbo = Minecraft.getMinecraft().getFramebuffer(); + Framebuffer fbo2 = fbo; + + if (fbo == null) { + return; + } + + fbo2 = fbo; + + + if (fbo2.depthBuffer <= -1) { + return; + } + + this.handleFramebuffer(fbo); + fbo2 = fbo; + + fbo2.depthBuffer = -1; +} + + public float[] resolveFloatArray(Color color2) { + float[] floatArr = new float[4]; + floatArr[0] = color2.getRed(); + floatArr[1] = color2.getGreen(); + floatArr[2] = color2.getBlue(); + floatArr[3] = 200.0F; + return floatArr; +} + + + private void renderTileEntity(@NonNull TileEntity tileEntity, Color color2) { + AxisAlignedBB boundingBox; + label35: { + BlockPos pos = tileEntity.getPos(); + double doubleVal = pos.getX(); + pos = tileEntity.getPos(); + double doubleVal2 = pos.getY(); + pos = tileEntity.getPos(); + double doubleVal3 = pos.getZ(); + boundingBox = null; + WorldClient world = this.mc.theWorld; + BlockPos pos2 = new BlockPos(doubleVal, doubleVal2, doubleVal3); + IBlockState blockState = world.getBlockState(pos2); + Block block = blockState.getBlock(); + WorldClient world2 = this.mc.theWorld; + pos2 = new BlockPos(doubleVal + 1.0, doubleVal2, doubleVal3); + IBlockState blockState2 = world2.getBlockState(pos2); + Block block2 = blockState2.getBlock(); + WorldClient world3 = this.mc.theWorld; + pos2 = new BlockPos(doubleVal - 1.0, doubleVal2, doubleVal3); + IBlockState blockState3 = world3.getBlockState(pos2); + Block block3 = blockState3.getBlock(); + WorldClient world4 = this.mc.theWorld; + pos2 = new BlockPos(doubleVal, doubleVal2, doubleVal3 + 1.0); + IBlockState blockState4 = world4.getBlockState(pos2); + Block block4 = blockState4.getBlock(); + WorldClient world5 = this.mc.theWorld; + pos = new BlockPos(doubleVal, doubleVal2, doubleVal3 - 1.0); + IBlockState blockState5 = world5.getBlockState(pos); + Block block5 = blockState5.getBlock(); + Block block6 = block2; + Block block7 = block; + if (block2 == block) { + boundingBox = this.resolveAxisAlignedBB3(doubleVal, doubleVal2, doubleVal3); + break label35; + } + + block6 = block5; + block7 = block; + + if (block6 == block7) { + boundingBox = this.resolveAxisAlignedBB(doubleVal, doubleVal2, doubleVal3); + break label35; + } + + block6 = block3; + block7 = block; + + if (block6 == block7) { + break label35; + } + + block6 = block4; + block7 = block; + + if (block6 != block7) { + boundingBox = this.resolveAxisAlignedBB2(doubleVal, doubleVal2, doubleVal3); + } + } + + GlStateManager.disableAlpha(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 771); + GlStateManager.disableTexture2D(); + GlStateManager.disableDepth(); + GL11.glEnable(2848); + float[] floatArr = this.resolveFloatArray(color2); + int intVal = this.applyUpdate5(floatArr[0] / 255.0F, floatArr[1] / 255.0F, floatArr[2] / 255.0F, 0.2F); + RenderUtilsSupport.renderAxisAlignedBB(boundingBox, 1.0F, intVal); + GL11.glDisable(2848); + GlStateManager.enableDepth(); + GlStateManager.enableTexture2D(); + GlStateManager.enableBlend(); + GlStateManager.enableAlpha(); +} + + public StringProperty getMode() { + return this.mode; +} + + public StringProperty getStringPropertyO() { + return this.getMode(); +} + + public ChestESP(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + Integer intVal = -65339; + this.color = ColorProperty.e(intVal); + Integer intVal2 = -65339; + this.colorEnder = ColorProperty.e(intVal2); + StringProperty strProp = StringProperty.of("Outline"); + String[] stringArr = new String[]{"Outline", "Filled", "Chams", "2D"}; + this.mode = strProp.acceptableValues(stringArr); + Color awtColor = new Color(255, 101, 101); + int color2 = awtColor.getRGB(); + Integer intVal3 = color2; + this.colorVisible = ColorProperty.e(intVal3); + Color awtColor2 = new Color(165, 163, 165); + int color3 = awtColor2.getRGB(); + Integer intVal4 = color3; + this.colorHidden = ColorProperty.e(intVal4); + StringProperty strProp2 = StringProperty.of("Client"); + stringArr = new String[]{"Static", "Client"}; + this.colorBox = strProp2.acceptableValues(stringArr); + this.bordered = ChestESPSupport.booleanTrue(); + this.intBufferField = GLAllocation.createDirectIntBuffer(16); + this.floatBufferField2 = GLAllocation.createDirectFloatBuffer(16); + this.floatBufferField3 = GLAllocation.createDirectFloatBuffer(16); + this.floatBufferField = GLAllocation.createDirectFloatBuffer(4); + Setting setting = new Setting("CHESTESP_MODE", "Mode", SettingType.COMBOBOX, this, this.mode); + SettingManager.register(setting); + setting = new Setting("CHESTESP_BOX_COLOR_MODE", "Color Mode", SettingType.COMBOBOX, this, this.colorBox, () -> this.mode.equals("2D")); + SettingManager.register(setting); + setting = new Setting("CHESTESP_COLOR", "Chest", SettingType.COLOR_PICKER, this, this.color, null, this::supplyBoolean2); + SettingManager.register(setting); + setting = new Setting("CHESTESP_COLOR_ENDER", "Ender Chest", SettingType.COLOR_PICKER, this, this.colorEnder, null, this::supplyBoolean); + SettingManager.register(setting); + setting = new Setting("CHESTESP_BOX_BORDERED", "Bordered", SettingType.CHECKBOX, this, this.bordered, () -> this.mode.equals("2D")); + SettingManager.register(setting); + setting = new Setting("CHESTESP_COLOR", "Chams Visible", SettingType.COLOR_PICKER, this, this.colorVisible, null, () -> this.mode.equals("Chams")); + SettingManager.register(setting); + setting = new Setting("CHESTESP_COLOR", "Chams Hidden", SettingType.COLOR_PICKER, this, this.colorHidden, null, () -> this.mode.equals("Chams")); + SettingManager.register(setting); +} + +} diff --git a/src/main/java/cc/novoline/modules/visual/ChestESPSupport.java b/src/main/java/cc/novoline/modules/visual/ChestESPSupport.java new file mode 100644 index 0000000..3014de0 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/ChestESPSupport.java @@ -0,0 +1,163 @@ +package cc.novoline.modules.visual; + + +import cc.novoline.modules.configurations.holder.SavingModuleHolderSupport; +import cc.novoline.modules.binds.ModuleKeybind; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.FloatProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.KeyBindProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.LongProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import java.util.Collection; +import java.util.List; +import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public final class ChestESPSupport { + @NotNull + public static LongProperty getLongProperty() { + return LongProperty.getLongPropertyA(); +} + + @NotNull + public static StringProperty getStringProperty() { + return StringProperty.of(); +} + + @NotNull + public static BooleanProperty getBooleanProperty() { + return BooleanProperty.alwaysTrue(); +} + + @NotNull + public static ListProperty resolveListProperty(@NotNull List list) { + return ListProperty.b(list); +} + + @SafeVarargs + @NotNull + public static ListProperty createListProperty(@NotNull Subtype... subtypeArray) { + return ListProperty.a((Subtype[])subtypeArray); +} + + @NotNull + public static StringProperty createListProperty(@Nullable String text) { + return StringProperty.of(text); +} + + @NotNull + public static ListProperty resolveListProperty3(@Nullable Subtype subtype, @Nullable Subtype subtypeIn, @Nullable Subtype subtype2) { + return ListProperty.of((Subtype)subtype, (Subtype)subtypeIn, (Subtype)subtype2); +} + + @NotNull + public static FloatProperty createListProperty(@Nullable Float param) { + return FloatProperty.of(param); +} + + @NotNull + public static FloatProperty getFloatProperty() { + return FloatProperty.getFloatPropertyB(); +} + + @NotNull + public static LongProperty createListProperty(@Nullable Long param) { + return LongProperty.f(param); +} + + @NotNull + public static ListProperty createListProperty(@Nullable Subtype subtype) { + return ListProperty.of((Subtype)subtype); +} + + @NotNull + public static IntProperty getIntProperty() { + return IntProperty.getIntPropertyA(); +} + + @NotNull + public static DoubleProperty getDoubleProperty() { + return DoubleProperty.getDoublePropertyC(); +} + + @NotNull + public static BooleanProperty getBooleanProperty2() { + return BooleanProperty.alwaysFalse(); +} + + @NotNull + public static ListProperty resolveListProperty5(@NotNull Collection collection) { + return ListProperty.a(collection); +} + + @NotNull + public static BooleanProperty getBooleanProperty3() { + return BooleanProperty.of(true); +} + + @Contract(value = "_ -> new", pure = true) + @NotNull + public static KeyBindProperty createListProperty(@NotNull ModuleKeybind moduleKeybind) { + SavingModuleHolderSupport.notNull(moduleKeybind, "Key binding"); + return new KeyBindProperty(moduleKeybind); +} + + @NotNull + public static IntProperty resolveIntProperty(@Nullable Integer integer) { + return IntProperty.of(integer); +} + + @NotNull + public static BooleanProperty createListProperty(@Nullable Boolean param) { + return BooleanProperty.of(param); +} + + @NotNull + public static ColorProperty createListProperty(@Nullable Integer integer) { + return ColorProperty.e(integer); +} + + @NotNull + public static BooleanProperty getBooleanProperty4() { + return BooleanProperty.of(false); +} + + @NotNull + public static DoubleProperty createListProperty(@Nullable Double param) { + return DoubleProperty.of(param); +} + + @NotNull + public static ListProperty resolveListProperty6(@Nullable Subtype subtype, @Nullable Subtype subtypeIn) { + return ListProperty.of((Subtype)subtype, (Subtype)subtypeIn); +} + + @NotNull public static BooleanProperty of(@Nullable Boolean value) { return createListProperty(value); } + @NotNull public static FloatProperty of(@Nullable Float value) { return createListProperty(value); } + @NotNull public static DoubleProperty of(@Nullable Double value) { return createListProperty(value); } + @NotNull public static LongProperty of(@Nullable Long value) { return createListProperty(value); } + @NotNull public static StringProperty of(@Nullable String value) { return createListProperty(value); } + @NotNull public static ColorProperty of(@Nullable Integer color) { return createListProperty(color); } + @NotNull public static KeyBindProperty of(@NotNull ModuleKeybind keybind) { return createListProperty(keybind); } + @NotNull public static ListProperty of(@NotNull List list) { return resolveListProperty(list); } + @NotNull public static ListProperty of(@NotNull Collection collection) { return resolveListProperty5(collection); } + @SafeVarargs @NotNull public static ListProperty of(@NotNull Subtype... values) { return createListProperty(values); } + @NotNull public static ListProperty of(@Nullable Subtype v1) { return createListProperty(v1); } + @NotNull public static ListProperty of(@Nullable Subtype v1, @Nullable Subtype v2) { return resolveListProperty6(v1, v2); } + @NotNull public static ListProperty of(@Nullable Subtype v1, @Nullable Subtype v2, @Nullable Subtype v3) { return resolveListProperty3(v1, v2, v3); } + @NotNull public static IntProperty createInt(@Nullable Integer value) { return resolveIntProperty(value); } + @NotNull public static IntProperty createInt() { return getIntProperty(); } + @NotNull public static FloatProperty createFloat() { return getFloatProperty(); } + @NotNull public static DoubleProperty createDouble() { return getDoubleProperty(); } + @NotNull public static LongProperty createLong() { return getLongProperty(); } + @NotNull public static StringProperty createString() { return getStringProperty(); } + @NotNull public static BooleanProperty booleanTrue() { return getBooleanProperty3(); } + @NotNull public static BooleanProperty booleanFalse() { return getBooleanProperty4(); } + @NotNull public static BooleanProperty immutableTrue() { return getBooleanProperty(); } + @NotNull public static BooleanProperty immutableFalse() { return getBooleanProperty2(); } +} diff --git a/src/main/java/cc/novoline/modules/visual/ClickGui.java b/src/main/java/cc/novoline/modules/visual/ClickGui.java new file mode 100644 index 0000000..f6659f0 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/ClickGui.java @@ -0,0 +1,2062 @@ +package cc.novoline.modules.visual; + +import cc.novoline.events.events.BindKeyEvent; +import cc.novoline.events.events.DisconnectEvent; +import cc.novoline.gui.screen.ClickGUI; +import cc.novoline.gui.screen.click.ConfigScriptTab; +import cc.novoline.gui.screen.click.Tab; +import cc.novoline.gui.screen.font.GuiFontSelector; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.irc.NovolineWebSocket; +import cc.novoline.irc.packet.UsernameCloudPacket; +import cc.novoline.modules.PlayerRelationType; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.HypixelChatChannel; +import cc.novoline.utils.HypixelLobbyType; +import cc.novoline.utils.ListAction; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.ServerUtils; +import cc.novoline.utils.StringScrambler; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.notifications.Notification; +import cc.novoline.utils.notifications.NotificationManager; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.tasks.TaskManager; +import cc.novoline.utils.tasks.TaskStage; +import cc.novoline.utils.tasks.impl.ClickGuiSupport; +import cc.novoline.utils.tasks.impl.ClickGuiTask; + +import cc.novoline.Initializer; +import cc.novoline.Novoline; +import cc.novoline.events.EventManager; +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.LoadWorldEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.PlayerUpdateEvent; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.events.events.SettingEvent; +import cc.novoline.events.events.ShaderEvent; +import cc.novoline.events.events.SpawnCheckEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.combat.AutoClicker; +import cc.novoline.modules.combat.Criticals; +import cc.novoline.modules.combat.KillAura; +import cc.novoline.modules.combat.Velocity; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.exploits.Blink; +import cc.novoline.modules.exploits.Disabler; +import cc.novoline.modules.exploits.NoFall; +import cc.novoline.modules.move.NoSlowDown; +import cc.novoline.modules.move.Speed; +import cc.novoline.modules.move.Step; +import cc.novoline.modules.move.TargetStrafe; +import cc.novoline.modules.move.WaterWalk; +import cc.novoline.modules.player.AutoArmor; +import cc.novoline.modules.player.ChestStealer; +import cc.novoline.modules.player.GameSpeed; +import cc.novoline.modules.player.InvManager; +import cc.novoline.modules.player.Scaffold; +import cc.novoline.modules.ModuleRegistry; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Toolkit; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ForkJoinPool; +import java.util.concurrent.ThreadLocalRandom; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.client.renderer.InventoryEffectRendererSupport; +import net.minecraft.network.play.server.S3DPacketDisplayScoreboard; +import cc.novoline.utils.fonts.holders.FontFamilySF_BOLD; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraft.network.play.server.S03PacketTimeUpdate; + +import net.minecraft.network.play.server.S45PacketTitle; +import net.minecraft.network.play.server.S00PacketKeepAlive; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.network.PacketGameProfileHelper; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.network.play.server.S12PacketEntityVelocity; +import cc.novoline.utils.fonts.api.FontFamily; +import net.minecraft.network.play.server.S2DPacketOpenWindow; +import net.minecraft.network.play.server.S01PacketJoinGame; +import net.minecraft.network.play.server.S2EPacketCloseWindow; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemEditableBook; +import net.minecraft.item.ItemStack; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S2FPacketSetSlot; +import net.minecraft.network.play.server.S45PacketTitle$Type; +import net.minecraft.util.IChatComponent; +import org.apache.commons.io.IOUtils; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.json.JSONObject; +import org.lwjgl.LWJGLException; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.DisplayMode; + +public final class ClickGui extends AbstractModule { + private TimerUtil timer; + private int stateTicks; + @Property("dropdown-transparecny") + private IntProperty dropdownTransparecny; + private TimerUtil timer2; + private static String[] stringArray; + @Property("razer_fanboy") + private final BooleanProperty razer_fanboy; + private int stateTicks2; + @Property("open-animation") + private StringProperty openAnimation; + private int stateTicks3; + @Property("crystal-gui-width") + private DoubleProperty crystalGuiWidth; + private int stateTicks4; + private TimerUtil timer3; + @Property("dpi-scale-crystal") + private final DoubleProperty dpiScaleCrystal; + private Initializer initializerField; + private int stateTicks5; + private HypixelLobbyType hypixelLobbyTypeField; + private HypixelChatChannel hypixelChatChannelField; + @Property("color-crystal") + private final ColorProperty colorCrystal; + private TimerUtil timer4; + @Property("close_previous") + private final BooleanProperty close_previous; + private TimerUtil timer5; + private int stateTicks6; + @Property("crystal-gui-pos-x") + private IntProperty crystalGuiPosX; + private double cachedValue; + private double cachedValue2; + @Property("crystal-gui-pos-y") + private IntProperty crystalGuiPosY; + private Dimension dimensionField; + private String cachedText; + private boolean stateFlag; + private int stateTicks7; + @Property("shadow-effect-crystal") + private BooleanProperty shadowEffectCrystal; + private int stateTicks8; + @Property("dpi_scale") + private final DoubleProperty dpi_scale; + @Property("crystal-gui-height") + private DoubleProperty crystalGuiHeight; + @Property("crystal-gui-current-tab") + private StringProperty crystalGuiCurrentTab; + @Property("blur") + private final BooleanProperty blur; + private int stateTicks9; + private HypixelLobbyType hypixelLobbyTypeField2; + private ArrayList arrayListField; + private int stateTicks10; + private TimerUtil timer6; + @Property("dsv") + private final BooleanProperty dsv; + @Property("mode") + private final StringProperty mode; + private long lastTimestamp; + private int intValue; + private long lastTimestamp2; + private boolean flagValue; + private int stateTicks11; + private String cachedText2; + @Property("dropdown-design") + private StringProperty dropdownDesign; + private String cachedText3; + + public double getCachedValue() { + return this.cachedValue; +} + + public IntProperty getCrystalGuiPosX() { + return this.crystalGuiPosX; +} + + public IntProperty getIntPropertyValue2() { + return this.getCrystalGuiPosX(); +} + + public double getDoubleValue() { + Integer intVal = this.dropdownTransparecny.get(); + return 1.0 - 0.01 * (intVal / 2); +} + + + public BooleanProperty getBlur() { + return this.blur; +} + + public BooleanProperty getBooleanPropertyValue4() { + return this.getBlur(); +} + + @EventTarget + public void onPacket3(PacketEvent event) { + PacketEvent packetEvent = event; + if (event.getState() != State.INCOMING) { + return; + } + + packetEvent = event; + + if (packetEvent.getPacket() instanceof PacketGameProfileHelper) { + Novoline novolineInst = this.novoline; + if (novolineInst.getWebSocket() != null) { + PacketGameProfileHelper gameProfileHelperPacket = (PacketGameProfileHelper)event.getPacket(); + Novoline novolineInst2 = this.novoline; + NovolineWebSocket novolineWebSocket = novolineInst2.getWebSocket(); + novolineWebSocket.applyUpdate(new UsernameCloudPacket(gameProfileHelperPacket.obtainGameProfile().getName())); + } + } +} + + public BooleanProperty getRazer_fanboy() { + return this.razer_fanboy; +} + + public BooleanProperty getBooleanProperty() { + return this.getRazer_fanboy(); +} + + @EventTarget + public void onSpawnCheck(SpawnCheckEvent event) { + boolean flag = HUD.Q(); + SpawnCheckEvent spawnCheckEvent = event; + + if (event.getListAction() != ListAction.ADD) { + return; + } + + spawnCheckEvent = event; + + + Entity entity = spawnCheckEvent.getTrackedEntity3(); + if (!flag) { + if (!(entity instanceof EntityPlayer)) { + return; + } + + entity = event.getTrackedEntity3(); + } + + EntityPlayer player = (EntityPlayer)entity; + ClickGui clickGuiMod = this; + + Novoline novolineInst = this.novoline; + if (!novolineInst.getPlayerManager().hasType(player.getName(), PlayerRelationType.TARGET)) { + return; + } + + clickGuiMod = this; + + + StringBuilder sb = new StringBuilder(); + sb = sb.append("Target detected "); + String nameStr = player.getName(); + clickGuiMod.popNotification(sb.append(nameStr).toString(), 3000, NotificationType.WARNING); +} + + @EventTarget + public void onPacket2(PacketEvent event) { + cc.novoline.modules.visual.ClickGui clickGuiMod; + boolean flag = event.getState().equals(State.INCOMING); + + if (!flag) { + return; + } + + flag = event.getPacket() instanceof S00PacketKeepAlive; + + + + if (flag) { + label86: { + S00PacketKeepAlive keepAlivePacket = (S00PacketKeepAlive)event.getPacket(); + int intVal = keepAlivePacket.computeInt() % 4; + + if (intVal != 0) { + break label86; + } + + intVal = (ServerUtils.isHypixel() ? 1 : 0); + + + if (intVal == 0) { + break label86; + } + + clickGuiMod = this; + + String textStr = this.cachedText2; + intVal = (textStr.isEmpty() ? 1 : 0); + + if (intVal != 0) { + break label86; + } + + clickGuiMod = this; + + CompletableFuture completableFuture = CompletableFuture.supplyAsync(clickGuiMod::supplyJSONObject, ForkJoinPool.commonPool()); + completableFuture.whenCompleteAsync(((java.util.function.BiConsumer) this::invokeCallback)); + } + + return; + } + + flag = event.getPacket() instanceof S03PacketTimeUpdate; + + + if (!flag) { + return; + } + + ArrayList itemList = this.arrayListField; + long timeMs = this.timer3.getElapsedMS(); + long longVal6 = Math.max(1000L, timeMs); + Long longVal = longVal6; + itemList.add(longVal); + + long longVal2 = 0L; + ArrayList itemList2 = this.arrayListField; + + if (itemList2.size() > 5) { + ArrayList itemList3 = this.arrayListField; + itemList3.remove(0); + } + + itemList2 = this.arrayListField; + + + Iterator iter = itemList2.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + Long longVal3 = (Long)iter.next(); + long longVal4 = longVal3; + longVal2 += longVal4; + + } + + ArrayList itemList4 = this.arrayListField; + long longVal5 = longVal2 / itemList4.size(); + this.cachedValue2 = 20.0 / longVal5 * 1000.0; + TimerUtil timerUtil = this.timer3; + timerUtil.reset(); +} + + public HypixelChatChannel getHypixelChatChannel() { + return this.hypixelChatChannelField; +} + + public long getLongValue() { + return this.lastTimestamp2; +} + + public static void executeClickGui(ClickGui clickGui, Packet packet) { + clickGui.applyInt5(packet); +} + + public DoubleProperty getDpi_scale() { + return this.dpi_scale; +} + + public DoubleProperty getDoublePropertyW() { + return this.getDpi_scale(); +} + + @Override + public void onEnable() { + Minecraft mcClient = this.mc; + ClickGUI clickGuiScreen = this.novoline.getClickGUI(); + mcClient.displayGuiScreen(clickGuiScreen); + this.toggle(); +} + + public ColorProperty getColorCrystal() { + return this.colorCrystal; +} + + public ColorProperty getColorProperty() { + return this.getColorCrystal(); +} + + public void handleHypixelLobbyType(HypixelLobbyType hypixelLobbyType) { + this.hypixelLobbyTypeField = hypixelLobbyType; +} + + public Integer getIntegerValue() { + return this.stateTicks4; +} + + @EventTarget + public void handleBindKeyEvent(BindKeyEvent event) { + EntityPlayerSP player = this.mc.thePlayer; + StringBuilder sb = new StringBuilder(); + sb = sb.append(".bind "); + String nameStr = event.getAbstractModule().getName(); + sb = sb.append(nameStr).append(" "); + nameStr = event.getCachedText(); + String textStr = sb.append(nameStr).toString(); + player.sendChatMessage(textStr); +} + + public int getIntValue15() { + return ColorTheme.WHITE.getRGB(); +} + + @EventTarget + public void handleDisconnectEvent(DisconnectEvent event) { + this.mc.timer.timerSpeed = 1.0F; + NetHandlerPlayClient netHandler = this.mc.getNetHandler(); + Collection collection = netHandler.getPlayerInfoMap(); + collection.clear(); + this.hypixelLobbyTypeField2 = HypixelLobbyType.NONE; + this.hypixelLobbyTypeField = HypixelLobbyType.NONE; + ModuleRegistry modEntry = ModuleRegistry.CHESTSTEALER; + ChestStealer stealer = modEntry.getModule(); + List itemList = stealer.getStringList(); + itemList.clear(); + Novoline novolineInst = this.novoline; + TaskManager taskManager = novolineInst.getTaskManager(); + List itemList2 = taskManager.getFutureTaskList(); + itemList2.clear(); + this.cachedText2 = ""; + this.stateTicks9 = 0; + this.stateTicks = 0; + this.stateTicks8 = 0; + this.stateTicks10 = 0; + this.stateTicks7 = 0; + this.stateTicks3 = 0; + this.stateTicks11 = 0; + this.stateTicks4 = 0; +} + + public ClickGui(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.hypixelLobbyTypeField2 = HypixelLobbyType.NONE; + this.hypixelLobbyTypeField = HypixelLobbyType.NONE; + this.hypixelChatChannelField = HypixelChatChannel.ALL; + this.timer = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.cachedValue = 1.0; + this.initializerField = Initializer.d(); + this.cachedText = this.initializerField.b; + this.stateTicks6 = this.initializerField.n; + ThreadLocalRandom threadLocalRandom = ThreadLocalRandom.current(); + this.stateTicks5 = threadLocalRandom.nextInt(10, 25); + this.cachedText2 = ""; + this.dimensionField = Toolkit.getDefaultToolkit().getScreenSize(); + this.intValue = (int)(this.dimensionField.getWidth() / 2.0); + this.stateTicks2 = (int)(this.dimensionField.getHeight() / 2.0); + this.blur = BooleanProperty.of(false); + this.close_previous = BooleanProperty.of(false); + StringProperty strProp = StringProperty.of("Dropdown"); + String[] stringArr = new String[]{"Compact", "Dropdown", "Crystal", "Windows"}; + this.mode = strProp.acceptableValues(stringArr); + this.razer_fanboy = BooleanProperty.of(false); + this.dsv = BooleanProperty.of(false); + this.dpi_scale = DoubleProperty.of(1.0).minimum(0.5).maximum(3.0); + this.dpiScaleCrystal = DoubleProperty.of(1.0).minimum(0.6).maximum(1.0); + Color awtColor = new Color(150, 100, 255); + int color = awtColor.getRGB(); + Integer intVal = color; + this.colorCrystal = ColorProperty.e(intVal); + this.shadowEffectCrystal = BooleanProperty.of(false); + IntProperty intProp2 = IntProperty.of(100).minimum(1); + int intVal2 = this.intValue; + Integer intVal3 = intVal2; + this.crystalGuiPosX = intProp2.maximum(intVal3); + int ticks = this.stateTicks2 / 4; + Integer intVal4 = ticks; + IntProperty intProp4 = IntProperty.of(intVal4).minimum(1); + int ticks2 = this.stateTicks2; + Integer intVal5 = ticks2; + this.crystalGuiPosY = intProp4.maximum(intVal5); + DoubleProperty doubleProp6 = DoubleProperty.of(560.0).minimum(560.0); + double doubleVal = this.intValue; + Double doubleVal2 = doubleVal; + this.crystalGuiWidth = doubleProp6.maximum(doubleVal2); + DoubleProperty doubleProp8 = DoubleProperty.of(330.0).minimum(330.0); + double doubleVal3 = this.stateTicks2; + Double doubleVal4 = doubleVal3; + this.crystalGuiHeight = doubleProp8.maximum(doubleVal4); + this.crystalGuiCurrentTab = StringProperty.of("Combat"); + StringProperty strProp2 = StringProperty.of("Bouncing"); + stringArr = new String[]{"None", "Linear", "Bouncing"}; + this.openAnimation = strProp2.acceptableValues(stringArr); + StringProperty strProp3 = StringProperty.of("Old"); + stringArr = new String[]{"Old", "Basic"}; + this.dropdownDesign = strProp3.acceptableValues(stringArr); + this.dropdownTransparecny = IntProperty.of(40).minimum(0).maximum(100); + this.timer4 = new TimerUtil(); + this.timer6 = new TimerUtil(); + this.arrayListField = new ArrayList<>(); + this.timer3 = new TimerUtil(); + this.cachedValue2 = 20.0; + this.timer5 = new TimerUtil(); + this.mode.set("Dropdown"); + Setting setting = new Setting("CG_DROPDOWN_DESIGN", "Design", SettingType.COMBOBOX, this, this.dropdownDesign, () -> this.mode.equals("Dropdown")); + SettingManager.register(setting); + Setting setting2 = new Setting("CG_OPEN_ANIMATION", "Animation", SettingType.COMBOBOX, this, this.openAnimation, () -> this.mode.equals("Dropdown")); + SettingManager.register(setting2); + Setting setting3 = new Setting("CG_BLUR", "Blur", SettingType.CHECKBOX, this, this.blur, () -> this.mode.equals("Dropdown")); + SettingManager.register(setting3); + Setting setting4 = new Setting("CG_CP", "Close Previous", SettingType.CHECKBOX, this, this.close_previous, () -> this.mode.equals("Dropdown")); + SettingManager.register(setting4); + Setting setting5 = new Setting("CG_RFM", "Full Outline", SettingType.CHECKBOX, this, this.razer_fanboy, () -> this.mode.equals("Compact")); + SettingManager.register(setting5); + Setting setting6 = new Setting("CG_DSV", "Display Slider Values", SettingType.CHECKBOX, this, this.dsv, () -> this.mode.equals("Compact")); + SettingManager.register(setting6); + Setting setting7 = new Setting("CG_CRYSTAL_COLOR", "Accent Color", SettingType.COLOR_PICKER, this, this.colorCrystal, null, () -> this.mode.equals("Crystal")); + SettingManager.register(setting7); + Setting setting8 = new Setting("CG_DPI_SCALE_CRYSTAL", "DPI Scale", SettingType.SLIDER, this, this.dpiScaleCrystal, 0.05, () -> this.mode.equals("Crystal")); + SettingManager.register(setting8); + Setting setting9 = new Setting("CG_DROPDOWN_TRANSPARENCY", "Transparency", SettingType.SLIDER, this, this.dropdownTransparecny, 2.0, "%", this::supplyBoolean2); + SettingManager.register(setting9); + Setting setting10 = new Setting("CG_DPI_SCALE", "DPI Scale", SettingType.SLIDER, this, this.dpi_scale, 0.05, this::supplyBoolean); + SettingManager.register(setting10); + Setting setting11 = new Setting("CG_CRYSTAL_SHADOWS", "Glow Effects", SettingType.CHECKBOX, this, this.shadowEffectCrystal, () -> this.mode.equals("Crystal")); + SettingManager.register(setting11); + Setting setting12 = new Setting("CG_RESTORE_LAYOUT", "Restore Layout", SettingType.BUTTON, this, this::handleString, () -> this.mode.equals("Dropdown")); + SettingManager.register(setting12); +} + + + @EventTarget + public void onPlayerUpdate(PlayerUpdateEvent event) { + int intVal = 0; + + while (intVal < 9) { + label35: { + InventoryPlayer inventory2 = this.mc.thePlayer.inventory; + ItemStack stack = inventory2.getStackInSlot(intVal); + if (stack == null) { + break label35; + } + + InventoryPlayer inventory3 = this.mc.thePlayer.inventory; + stack = inventory3.getStackInSlot(intVal); + + if (stack.stackSize == 0) { + InventoryPlayer inventory4 = this.mc.thePlayer.inventory; + inventory4.resolveItemStack2(intVal); + } + } + + intVal++; + + } +} + + public void setCachedText3(String text) { + this.cachedText3 = text; +} + + @EventTarget + public void onSetting(SettingEvent event) { + boolean flag; + int intVal; + String textStr = event.getSettingName(); + boolean flag2 = HUD.H(); + byte byteVal = -1; + flag = flag2; + intVal = textStr.hashCode(); + + switch (intVal) { + case -2103527946: + intVal = (textStr.equals("CG_STYLE") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 0; + if (flag) { + break; + } + case -1102214930: + intVal = (textStr.equals("AC_MAX_CPS") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 1; + if (flag) { + break; + } + case -882416932: + intVal = (textStr.equals("AC_MIN_CPS") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 2; + if (flag) { + break; + } + case 1093374647: + intVal = (textStr.equals("HUD_FONT") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 3; + if (flag) { + break; + } + case 1146741435: + intVal = (textStr.equals("SPEED_MODE") ? 1 : 0); + + if (intVal != 0) { + byteVal = 4; + } + } + + intVal = byteVal; + + switch (intVal) { + case 0: + Minecraft mcClient = this.mc; + ClickGUI clickGuiScreen = this.novoline.getClickGUI(); + mcClient.displayGuiScreen(clickGuiScreen); + if (flag) { + break; + } + case 1: + case 2: + ModuleRegistry modEntry = ModuleRegistry.AUTOCLICKER; + AutoClicker autoClicker = modEntry.getModule(); + IntProperty intProp = autoClicker.getIntProperty(); + Integer intVal2 = intProp.get(); + intVal = intVal2; + IntProperty intProp2 = autoClicker.getIntPropertyB(); + Integer intVal3 = intProp2.get(); + int intVal4 = intVal3; + if (flag) { + if (intVal < intVal4) { + IntProperty intProp3 = autoClicker.getIntPropertyB(); + intProp2 = autoClicker.getIntProperty(); + Number number = intProp2.get(); + ((cc.novoline.modules.configurations.property.AbstractNumberProperty) intProp3).set(number); + } + + IntProperty intProp4 = autoClicker.getIntPropertyB(); + Integer intVal5 = intProp4.get(); + intVal = intVal5; + + intProp2 = autoClicker.getIntProperty(); + Integer intVal6 = intProp2.get(); + intVal4 = intVal6; + } + + if (intVal <= intVal4) { + break; + } + + IntProperty intProp5 = autoClicker.getIntProperty(); + intProp2 = autoClicker.getIntPropertyB(); + Number number2 = intProp2.get(); + ((cc.novoline.modules.configurations.property.AbstractNumberProperty) intProp5).set(number2); + if (flag) { + break; + } + case 3: + ModuleRegistry modEntry2 = ModuleRegistry.HUD; + HUD hudMod = modEntry2.getModule(); + StringProperty strProp = hudMod.getStringPropertyS(); + String textStr2 = "Custom"; + if (strProp.equals(textStr2)) { + HUD hudMod2 = hudMod; + if (hudMod.getFontFamilyField9() != null) { + break; + } + + this.applyUpdate5(hudMod.getDisplayName(), "You either need to set the font through .font command or through the font repository", 3500, NotificationType.WARNING); + Minecraft mcClient2 = this.mc; + GuiFontSelector guiFontSelector = new GuiFontSelector(); + mcClient2.displayGuiScreen(guiFontSelector); + hudMod2 = hudMod; + + StringProperty strProp2 = hudMod2.getStringPropertyS(); + textStr2 = this.cachedText3; + strProp2.set(textStr2); + break; + } + + StringProperty strProp3 = hudMod.getStringPropertyS(); + this.cachedText3 = strProp3.get(); + + if (flag) { + break; + } + case 4: + StringProperty strProp4 = event.getStringProperty(); + intVal = (strProp4.equals("Motion") ? 1 : 0); + + if (intVal != 0) { + this.applyUpdate5("Speed", "MOTION Mode does not work with Target Strafe", 3000, NotificationType.WARNING); + } + } + + intVal = (ServerUtils.isHypixel() ? 1 : 0); + + if (intVal != 0) { + ModuleRegistry modEntry3 = ModuleRegistry.INVMANAGER; + InvManager invManager = modEntry3.getModule(); + invManager.handleSettingEvent(event); + ModuleRegistry modEntry4 = ModuleRegistry.AUTOARMOR; + AutoArmor autoArmor = modEntry4.getModule(); + autoArmor.handleSettingEvent(event); + ModuleRegistry modEntry5 = ModuleRegistry.SCAFFOLD; + Scaffold scaffold = modEntry5.getModule(); + scaffold.handleSettingEvent(event); + ModuleRegistry modEntry6 = ModuleRegistry.SPEED; + Speed speedMod = modEntry6.getModule(); + speedMod.handleSettingEvent(event); + ModuleRegistry modEntry7 = ModuleRegistry.NOSLOWDOWN; + NoSlowDown noSlowDown = modEntry7.getModule(); + noSlowDown.handleSettingEvent(event); + ModuleRegistry modEntry8 = ModuleRegistry.KILLAURA; + KillAura killAura = modEntry8.getModule(); + killAura.handleSettingEvent(event); + ModuleRegistry modEntry9 = ModuleRegistry.NOFALL; + NoFall noFall = modEntry9.getModule(); + noFall.handleSettingEvent(event); + ModuleRegistry modEntry10 = ModuleRegistry.CRITICALS; + Criticals criticals = modEntry10.getModule(); + criticals.handleSettingEvent(event); + ModuleRegistry modEntry11 = ModuleRegistry.STEP; + Step step = modEntry11.getModule(); + step.handleSettingEvent(event); + ModuleRegistry modEntry12 = ModuleRegistry.DISABLER; + Disabler disabler = modEntry12.getModule(); + disabler.handleSettingEvent(event); + ModuleRegistry modEntry13 = ModuleRegistry.VELOCITY; + Velocity velocity = modEntry13.getModule(); + velocity.handleSettingEvent(event); + ModuleRegistry modEntry14 = ModuleRegistry.TARGETSTRAFE; + TargetStrafe targetStrafe = modEntry14.getModule(); + targetStrafe.handleSettingEvent(event); + ModuleRegistry modEntry15 = ModuleRegistry.WATERWALK; + WaterWalk waterWalk = modEntry15.getModule(); + waterWalk.handleSettingEvent(event); + ModuleRegistry modEntry16 = ModuleRegistry.GAMESPEED; + GameSpeed gameSpeed = modEntry16.getModule(); + gameSpeed.handleSettingEvent(event); + ModuleRegistry modEntry17 = ModuleRegistry.BLINK; + Blink blink = modEntry17.getModule(); + blink.handleSettingEvent(event); + } + + ModuleRegistry modEntry18 = ModuleRegistry.KILLAURA; + KillAura killAura2 = modEntry18.getModule(); + killAura2.applyUpdate2(event); +} + + public double getCachedValue2() { + return this.cachedValue2; +} + + + @EventTarget + public void onLoadWorld(LoadWorldEvent event) { + if (ServerUtils.isHypixel()) { + ModuleRegistry modEntry = ModuleRegistry.INVMANAGER; + InvManager invManager = modEntry.getModule(); + invManager.handleSettingEvent((SettingEvent) null); + modEntry = ModuleRegistry.AUTOARMOR; + AutoArmor autoArmor = modEntry.getModule(); + autoArmor.handleSettingEvent((SettingEvent) null); + modEntry = ModuleRegistry.SCAFFOLD; + Scaffold scaffold = modEntry.getModule(); + scaffold.handleSettingEvent((SettingEvent)null); + modEntry = ModuleRegistry.SPEED; + Speed speedMod = modEntry.getModule(); + speedMod.handleSettingEvent((SettingEvent)null); + modEntry = ModuleRegistry.NOSLOWDOWN; + NoSlowDown noSlowDown = modEntry.getModule(); + noSlowDown.handleSettingEvent((SettingEvent)null); + modEntry = ModuleRegistry.KILLAURA; + KillAura killAura = modEntry.getModule(); + killAura.handleSettingEvent((SettingEvent)null); + modEntry = ModuleRegistry.NOFALL; + NoFall noFall = modEntry.getModule(); + noFall.handleSettingEvent((SettingEvent) null); + modEntry = ModuleRegistry.CRITICALS; + Criticals criticals = modEntry.getModule(); + criticals.handleSettingEvent((SettingEvent) null); + modEntry = ModuleRegistry.STEP; + Step step = modEntry.getModule(); + step.handleSettingEvent((SettingEvent)null); + modEntry = ModuleRegistry.DISABLER; + Disabler disabler = modEntry.getModule(); + disabler.handleSettingEvent((SettingEvent)null); + modEntry = ModuleRegistry.VELOCITY; + Velocity velocity = modEntry.getModule(); + velocity.handleSettingEvent((SettingEvent)null); + modEntry = ModuleRegistry.TARGETSTRAFE; + TargetStrafe targetStrafe = modEntry.getModule(); + targetStrafe.handleSettingEvent((SettingEvent) null); + modEntry = ModuleRegistry.WATERWALK; + WaterWalk waterWalk = modEntry.getModule(); + waterWalk.handleSettingEvent((SettingEvent) null); + modEntry = ModuleRegistry.GAMESPEED; + GameSpeed gameSpeed = modEntry.getModule(); + gameSpeed.handleSettingEvent((SettingEvent) null); + modEntry = ModuleRegistry.BLINK; + Blink blink = modEntry.getModule(); + blink.handleSettingEvent((SettingEvent) null); + } + + ModuleRegistry modEntry2 = ModuleRegistry.KILLAURA; + KillAura killAura2 = modEntry2.getModule(); + killAura2.applyUpdate2((SettingEvent) null); +} + + public IntProperty getCrystalGuiPosY() { + return this.crystalGuiPosY; +} + + public IntProperty getIntPropertyValue3() { + return this.getCrystalGuiPosY(); +} + + private Boolean supplyBoolean() { + boolean flag; + StringProperty strProp = this.mode; + flag = strProp.equals("Compact"); + label17: { + if (!flag) { + StringProperty strProp2 = this.mode; + flag = strProp2.equals("Dropdown"); + + if (!flag) { + flag = false; + break label17; + } + } + + flag = true; + } + + return flag; +} + + public static void executeClickGui2(ClickGui clickGui, String text, String str, int index, NotificationType notificationType) { + clickGui.applyUpdate5(text, str, index, notificationType); +} + + public IntProperty getDropdownTransparecny() { + return this.dropdownTransparecny; +} + + public IntProperty getIntProperty() { + return this.getDropdownTransparecny(); +} + + + + public boolean isStateReady2() { + Boolean propFlag = this.shadowEffectCrystal.get(); + return propFlag; +} + + @EventTarget + public void onRender2D(Render2DEvent event) { + if (this.novoline.isReadyState()) { + ScaledResolution scaledRes = event.getResolution(); + int scaledWidth = scaledRes.getScaledWidth() / 2; + StringBuilder sb = new StringBuilder(); + StringBuilder sb2 = sb.append("BETA "); + Novoline novolineInst = this.novoline; + String textStr2 = novolineInst.getVersion(); + String textStr = sb2.append(textStr2).toString(); + FontFamily fontFam = FontFamilySF_BOLD.FAMILY; + FontRenderer font = fontFam.ofSize(40); + int width = font.stringWidth(textStr) / 2; + GlStateManager.disableBlend(); + float floatVal = scaledWidth - width; + int color = ColorTheme.WHITE.getRGB(); + int color2 = ColorTheme.reAlpha(color, 30); + font.drawString(textStr, floatVal, 40.0F, color2); + GlStateManager.enableBlend(); + } +} + + @EventTarget + public void onTickUpdate1(TickUpdateEvent event) { + Minecraft mcClient = this.mc; + if (this.mc.theWorld == null) { + return; + } + + mcClient = this.mc; + + if (mcClient.thePlayer == null) { + return; + } + + mcClient = this.mc; + + int intVal = (mcClient.isSingleplayer() ? 1 : 0); + if (intVal != 0) { + return; + } + + HypixelLobbyType lobbyType = HypixelLobbyType.PRE; + intVal = (ServerUtils.evaluateCheck(lobbyType) ? 1 : 0); + + + if (intVal == 0) { + HypixelLobbyType lobbyType2 = HypixelLobbyType.LOBBY; + intVal = (ServerUtils.evaluateCheck(lobbyType2) ? 1 : 0); + + if (intVal == 0) { + HypixelLobbyType lobbyType3 = HypixelLobbyType.NONE; + intVal = (ServerUtils.evaluateCheck(lobbyType3) ? 1 : 0); + + if (intVal == 0) { + int intVal2 = ServerUtils.getIntValue() + 1; + ServerUtils.evaluateCheck(intVal2); + return; + } + } + } + + intVal = ServerUtils.getIntValue(); + + + if (intVal <= 0) { + return; + } + + intVal = 0; + + ServerUtils.evaluateCheck(intVal); +} + + + private JSONObject supplyJSONObject() { + String textStr = ""; + CloseableHttpClient closeableHttpClient = HttpClients.createDefault(); + StringBuilder sb = new StringBuilder(); + sb = sb.append("https://api.hypixel.net/punishmentstats?key="); + String textStr4 = this.cachedText2; + String textStr2 = sb.append(textStr4).toString(); + HttpGet httpGet = new HttpGet(textStr2); + httpGet.setHeader("xf-api-key", this.cachedText2); + httpGet.setHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"); + CloseableHttpResponse closeableHttpResponse = null; + + try { + closeableHttpResponse = closeableHttpClient.execute(httpGet); + } catch (IOException ex) { + ex.printStackTrace(); + } + + String textStr3 = null; + + try { + InputStream inputStream = closeableHttpResponse.getEntity().getContent(); + Charset charset = StandardCharsets.UTF_8; + textStr3 = IOUtils.toString(inputStream, charset); + } catch (IOException ex2) { + ex2.printStackTrace(); + } + + return new JSONObject(textStr3); +} + + public static void applyInt5(String[] args) { + stringArray = args; +} + + private Boolean supplyBoolean2() { + boolean flag; + label21: { + label23: { + StringProperty strProp = this.mode; + flag = strProp.equals("Dropdown"); + if (!flag) { + break label23; + } + + StringProperty strProp2 = this.dropdownDesign; + flag = strProp2.equals("Old"); + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + public String getStringValue2() { + HypixelChatChannel hypixelChatChannel = this.hypixelChatChannelField; + if (this.hypixelChatChannelField.equals(HypixelChatChannel.PM)) { + return "Conversation"; + } + + hypixelChatChannel = this.hypixelChatChannelField; + + String textStr = hypixelChatChannel.name(); + String lowerStr = textStr.toLowerCase(); + return StringScrambler.resolveString3(lowerStr); +} + + private void handleString(String text) { + Tab guiTab; + Novoline novolineInst = this.novoline; + ClickGUI clickGuiScreen = novolineInst.getClickGUI(); + if (clickGuiScreen == null) { + return; + } + + novolineInst = this.novoline; + clickGuiScreen = novolineInst.getClickGUI(); + + ClickGUI clickGuiScreen2 = clickGuiScreen; + List itemList = clickGuiScreen2.getTabs(); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + Tab guiTab2 = (Tab)iter.next(); + + EnumModuleType modCategory = guiTab2.getCategory(); + EnumModuleType modCategory2 = EnumModuleType.COMBAT; + if (modCategory == EnumModuleType.COMBAT) { + double doubleVal = clickGuiScreen2.intTable7[0] - 65; + guiTab2.setPosX(doubleVal); + double doubleVal2 = clickGuiScreen2.intTable7[1] - 100; + guiTab2.setPosY(doubleVal2); + } + + modCategory = guiTab2.getCategory(); + modCategory2 = EnumModuleType.MISC; + + if (modCategory == modCategory2) { + double doubleVal3 = clickGuiScreen2.intTable[0] - 65; + guiTab2.setPosX(doubleVal3); + double doubleVal4 = clickGuiScreen2.intTable[1] - 100; + guiTab2.setPosY(doubleVal4); + } + + modCategory = guiTab2.getCategory(); + modCategory2 = EnumModuleType.EXPLOITS; + + if (modCategory == modCategory2) { + double doubleVal5 = clickGuiScreen2.intTable4[0] - 65; + guiTab2.setPosX(doubleVal5); + double doubleVal6 = clickGuiScreen2.intTable4[1] - 100; + guiTab2.setPosY(doubleVal6); + } + + modCategory = guiTab2.getCategory(); + modCategory2 = EnumModuleType.MOVEMENT; + + if (modCategory == modCategory2) { + double doubleVal7 = clickGuiScreen2.intTable3[0] - 65; + guiTab2.setPosX(doubleVal7); + double doubleVal8 = clickGuiScreen2.intTable3[1] - 100; + guiTab2.setPosY(doubleVal8); + } + + modCategory = guiTab2.getCategory(); + modCategory2 = EnumModuleType.PLAYER; + + if (modCategory == modCategory2) { + double doubleVal9 = clickGuiScreen2.intTable2[0] - 65; + guiTab2.setPosX(doubleVal9); + double doubleVal10 = clickGuiScreen2.intTable2[1] - 100; + guiTab2.setPosY(doubleVal10); + } + + guiTab = guiTab2; + + modCategory = guiTab2.getCategory(); + modCategory2 = EnumModuleType.VISUALS; + + if (modCategory != modCategory2) { + continue; + } + + double doubleVal11 = clickGuiScreen2.intTable6[0] - 65; + guiTab2.setPosX(doubleVal11); + guiTab = guiTab2; + + double doubleVal12 = clickGuiScreen2.intTable6[1] - 100; + guiTab.setPosY(doubleVal12); + } + + ConfigScriptTab configScriptTab = clickGuiScreen2.getConfigTab(); + double doubleVal13 = clickGuiScreen2.intTable8[0] - 65; + configScriptTab.setPosX(doubleVal13); + ConfigScriptTab configScriptTab2 = clickGuiScreen2.getConfigTab(); + doubleVal13 = clickGuiScreen2.intTable8[1] - 70; + configScriptTab2.setPosY(doubleVal13); + clickGuiScreen2.getScriptTab().applyUpdate(clickGuiScreen2.intTable5[0] - 65); + + clickGuiScreen2.getScriptTab().applyUpdate2(clickGuiScreen2.intTable5[1] - 80); +} + + private void invokeCallback(JSONObject jSONObject, Throwable throwable) { + cc.novoline.modules.visual.ClickGui clickGuiMod; + cc.novoline.modules.visual.ClickGui clickGuiMod2; + int ticks; + + label50: { + + int intVal = (jSONObject.getBoolean("success") ? 1 : 0); + + if (intVal == 0) { + return; + } + + clickGuiMod = this; + + intVal = this.stateTicks7; + + + if (intVal != 0) { + ticks = this.stateTicks3; + + if (this.stateTicks3 != 0) { + break label50; + } + } + + this.stateTicks9 = jSONObject.getInt("watchdog_total"); + this.stateTicks = jSONObject.getInt("staff_total"); + this.stateTicks7 = this.stateTicks9; + clickGuiMod = this; + + clickGuiMod.stateTicks3 = this.stateTicks; + + return; + + } + + String textStr = "watchdog_total"; + this.stateTicks9 = jSONObject.getInt(textStr); + textStr = "staff_total"; + this.stateTicks = jSONObject.getInt(textStr); + ticks = this.stateTicks9 - this.stateTicks7; + + + if (ticks > 0) { + this.stateTicks8 = this.stateTicks8 + (this.stateTicks9 - this.stateTicks7); + } + + clickGuiMod2 = this; + + ticks = this.stateTicks - this.stateTicks3; + + + if (ticks > 0) { + this.stateTicks10 = this.stateTicks10 + (this.stateTicks - this.stateTicks3); + } + + this.stateTicks7 = this.stateTicks9; + clickGuiMod2 = this; + + clickGuiMod2.stateTicks3 = this.stateTicks; +} + + public DoubleProperty getCrystalGuiWidth() { + return this.crystalGuiWidth; +} + + public DoubleProperty getDoubleProperty() { + return this.getCrystalGuiWidth(); +} + + public Integer getInteger() { + return this.stateTicks11; +} + + public Integer getIntegerValue2() { + return this.stateTicks10; +} + + public void applyInt5(double amount) { + this.cachedValue = amount; +} + + public StringProperty getCrystalGuiCurrentTab() { + return this.crystalGuiCurrentTab; +} + + public StringProperty getStringPropertyX() { + return this.getCrystalGuiCurrentTab(); +} + + static { + applyInt5((String[])null); + } + + @Override + public void onDisable() { + EventManager.register(this); +} + + @EventTarget + public void onShader(ShaderEvent event) { + HUD hudMod = ModuleRegistry.HUD.getModule(); + StringProperty strProp = hudMod.getStringProperty11(); + boolean flag = strProp.equals("Black"); + if (!flag) { + return; + } + + ListProperty listProp = hudMod.getListPropertyR(); + flag = listProp.contains("Blur"); + + if (!flag) { + return; + } + + StringProperty strProp2 = hudMod.getStringProperty14(); + flag = strProp2.equals("Basic"); + + if (flag) { + Novoline novolineInst = this.novoline; + NotificationManager notifManager = novolineInst.getNotificationManager(); + List itemList = notifManager.getNotifications(); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + Notification notification = (Notification)iter.next(); + notification.smoothAnimation.renderVisual(notification.doubleField, notification.v, 0.05, ((java.lang.Runnable) (() -> ClickGui.handleNotification(notification))), 200L); + } + } +} + + private static void handleNotification(Notification notification) { + double doubleVal = notification.doubleField2; + double doubleVal2 = notification.doubleState; + double doubleVal3 = notification.doubleField2 + notification.doubleField3; + double doubleVal4 = notification.doubleState + notification.doubleField4; + int color = ColorTheme.BLACK.getRGB(); + RenderUtils.drawRect(doubleVal, doubleVal2, doubleVal3, doubleVal4, color); +} + + public BooleanProperty getDsv() { + return this.dsv; +} + + public BooleanProperty getBooleanProperty2() { + return this.getDsv(); +} + + public BooleanProperty getClose_previous() { + return this.close_previous; +} + + public BooleanProperty getBooleanPropertyA() { + return this.getClose_previous(); +} + + public DoubleProperty getCrystalGuiHeight() { + return this.crystalGuiHeight; +} + + public DoubleProperty getDoubleProperty2() { + return this.getCrystalGuiHeight(); +} + + public static String[] getStringArrayValue() { + return stringArray; +} + + public StringProperty getDropdownDesign() { + return this.dropdownDesign; +} + + public StringProperty getStringPropertyR() { + return this.getDropdownDesign(); +} + + @EventTarget + public void onPacket1(PacketEvent event) { + Object obj; + Object obj2; + cc.novoline.modules.visual.ClickGui clickGuiMod; + int intVal3 = (event.getState().equals(State.INCOMING) ? 1 : 0); + if ((intVal3 != 0)) { + label577: { + intVal3 = (event.getPacket() instanceof S12PacketEntityVelocity ? 1 : 0); + if ((intVal3 != 0)) { + label562: { + label561: { + int intVal; + S12PacketEntityVelocity entityVelocityPacket = (S12PacketEntityVelocity)event.getPacket(); + intVal3 = entityVelocityPacket.getEntityID(); + intVal = this.mc.thePlayer.getEntityId(); + if (intVal3 == intVal) { + intVal3 = entityVelocityPacket.getMotionX(); + intVal3 = Math.abs(intVal3); + intVal = 2000; + + if (intVal3 > 2000) { + break label561; + } + } + + intVal3 = entityVelocityPacket.getMotionZ(); + intVal3 = Math.abs(intVal3); + intVal = 200; + + if (intVal3 <= intVal) { + break label562; + } + } + + this.mc.thePlayer.intState3 = 20; + } + + break label577; + } + + intVal3 = (event.getPacket() instanceof PacketGameProfileHelper ? 1 : 0); + + if ((intVal3 != 0)) { + boolean flag2; + label543: { + label542: { + label579: { + this.stateTicks9 = 0; + this.stateTicks = 0; + this.stateTicks8 = 0; + this.stateTicks10 = 0; + this.stateTicks11 = 0; + this.stateTicks4 = 0; + this.lastTimestamp2 = System.currentTimeMillis(); + ModuleRegistry modEntry = ModuleRegistry.SESSION; + SessionInfo sessionInfo = modEntry.getModule(); + SimpleDateFormat simpleDateFormat = sessionInfo.getSimpleDateFormat(); + Date date = new Date(System.currentTimeMillis() - this.lastTimestamp2); + String textStr = simpleDateFormat.format(date); + String textStr2 = textStr.split(":")[0]; + this.lastTimestamp = Integer.parseInt(textStr2) * 3600000L; + Minecraft mcClient = this.mc; + flag2 = mcClient.isSingleplayer(); + if (flag2) { + break label579; + } + + Minecraft mcClient2 = this.mc; + String textStr3 = mcClient2.getCurrentServerData().serverIP; + String lowerStr = textStr3.toLowerCase(); + flag2 = lowerStr.contains("hypixel"); + + if (flag2) { + break label542; + } + + Minecraft mcClient3 = this.mc; + String textStr4 = mcClient3.getCurrentServerData().serverIP; + String lowerStr2 = textStr4.toLowerCase(); + flag2 = lowerStr2.contains("catgirls"); + + if (flag2) { + break label542; + } + } + + flag2 = false; + break label543; + } + + flag2 = true; + } + + this.stateFlag = flag2; + DoubleProperty doubleProp = this.dpi_scale; + Double propDouble = doubleProp.get(); + this.applyInt5(propDouble); + ModuleRegistry modEntry2 = ModuleRegistry.HUD; + HUD hudMod = modEntry2.getModule(); + hudMod.performStep23(); + } + } + + intVal3 = (event.getPacket() instanceof S01PacketJoinGame ? 1 : 0); + + + if ((intVal3 != 0)) { + Minecraft mcClient4 = this.mc; + NetHandlerPlayClient netHandler = mcClient4.getNetHandler(); + Collection collection = netHandler.getPlayerInfoMap(); + collection.clear(); + ModuleRegistry modEntry3 = ModuleRegistry.CHESTSTEALER; + ChestStealer stealer = modEntry3.getModule(); + List itemList = stealer.getStringList(); + itemList.clear(); + this.hypixelLobbyTypeField = HypixelLobbyType.NONE; + ModuleRegistry modEntry4 = ModuleRegistry.HUD; + HUD hudMod2 = modEntry4.getModule(); + hudMod2.performAction(); + } + + intVal3 = (event.getPacket() instanceof S02PacketChat ? 1 : 0); + + + if ((intVal3 != 0)) { + S02PacketChat chatPacket = (S02PacketChat)event.getPacket(); + intVal3 = (ServerUtils.isHypixel() ? 1 : 0); + + label519: + if ((intVal3 != 0)) { + IChatComponent chatComp = chatPacket.getChatComponent(); + String msgText = chatComp.getFormattedText(); + IChatComponent chatComp2 = chatPacket.getChatComponent(); + String textStr5 = chatComp2.getUnformattedText(); + intVal3 = (msgText.equals("\u00a7r\u00a7aSelected language: \u00a7r\u00a7eEnglish\u00a7r") ? 1 : 0); + if ((intVal3 != 0)) { + event.setCancelled(true); + } + + intVal3 = (msgText.contains("\u00a7r\u00a7ewas") ? 1 : 0); + + label581: { + if ((intVal3 == 0)) { + intVal3 = (textStr5.contains("by") ? 1 : 0); + + if ((intVal3 == 0)) { + break label581; + } + } + + String nameStr = this.mc.thePlayer.getName(); + intVal3 = (textStr5.contains(nameStr) ? 1 : 0); + + if ((intVal3 != 0)) { + intVal3 = (textStr5.split(" ")[0].equals(this.mc.thePlayer.getName()) ? 1 : 0); + + if ((intVal3 == 0)) { + this.stateTicks11++; + } + } + } + + String textStr6 = this.cachedText2; + intVal3 = (textStr6.isEmpty() ? 1 : 0); + + if ((intVal3 != 0)) { + intVal3 = (msgText.startsWith("\u00a7aYour new API key") ? 1 : 0); + + if ((intVal3 != 0)) { + this.cachedText2 = textStr5.replace("Your new API key is ", ""); + event.setCancelled(true); + } + } + + intVal3 = (msgText.startsWith("\u00a7aOpened a chat conversation with") ? 1 : 0); + + + if ((intVal3 != 0)) { + this.hypixelChatChannelField = HypixelChatChannel.PM; + String textStr7 = "Hypixel"; + StringBuilder sb = new StringBuilder(); + String textStr8 = "You are now in the "; + sb = sb.append(textStr8); + textStr8 = this.getStringValue2(); + sb = sb.append(textStr8); + textStr8 = " channel"; + this.applyUpdate5(textStr7, sb.append(textStr8).toString(), 3000, NotificationType.INFO); + event.setCancelled(true); + break label519; + } + + intVal3 = (msgText.equals("\u00a7aYou are now in the \u00a7r\u00a76ALL\u00a7r\u00a7a channel\u00a7r") ? 1 : 0); + + + + if ((intVal3 != 0)) { + this.hypixelChatChannelField = HypixelChatChannel.ALL; + String textStr9 = "Hypixel"; + StringBuilder sb2 = new StringBuilder(); + String textStr10 = "You are now in the "; + sb2 = sb2.append(textStr10); + textStr10 = this.getStringValue2(); + sb2 = sb2.append(textStr10); + textStr10 = " channel"; + this.applyUpdate5(textStr9, sb2.append(textStr10).toString(), 3000, NotificationType.INFO); + event.setCancelled(true); + break label519; + } + + intVal3 = (msgText.equals("\u00a7aYou are now in the \u00a7r\u00a76PARTY\u00a7r\u00a7a channel\u00a7r") ? 1 : 0); + + + + if ((intVal3 != 0)) { + this.hypixelChatChannelField = HypixelChatChannel.PARTY; + String textStr11 = "Hypixel"; + StringBuilder sb3 = new StringBuilder(); + String textStr12 = "You are now in the "; + sb3 = sb3.append(textStr12); + textStr12 = this.getStringValue2(); + sb3 = sb3.append(textStr12); + textStr12 = " channel"; + this.applyUpdate5(textStr11, sb3.append(textStr12).toString(), 3000, NotificationType.INFO); + event.setCancelled(true); + break label519; + } + + intVal3 = (msgText.equals("\u00a7aYou are now in the \u00a7r\u00a76GUILD\u00a7r\u00a7a channel\u00a7r") ? 1 : 0); + + + + if ((intVal3 != 0)) { + this.hypixelChatChannelField = HypixelChatChannel.GUILD; + String textStr13 = "Hypixel"; + StringBuilder sb4 = new StringBuilder(); + String textStr14 = "You are now in the "; + sb4 = sb4.append(textStr14); + textStr14 = this.getStringValue2(); + sb4 = sb4.append(textStr14); + textStr14 = " channel"; + this.applyUpdate5(textStr13, sb4.append(textStr14).toString(), 3000, NotificationType.INFO); + event.setCancelled(true); + break label519; + } + + intVal3 = (this.hypixelChatChannelField.equals(HypixelChatChannel.GUILD) ? 1 : 0); + + + if ((intVal3 == 0)) { + String textStr15 = "\u00a7r\u00a72Guild"; + intVal3 = (msgText.startsWith(textStr15) ? 1 : 0); + + if ((intVal3 != 0)) { + EntityPlayerSP player = this.mc.thePlayer; + IChatComponent chatComp3 = player.getDisplayName(); + textStr15 = chatComp3.getFormattedText(); + intVal3 = (msgText.contains(textStr15) ? 1 : 0); + + if ((intVal3 != 0)) { + this.hypixelChatChannelField = HypixelChatChannel.GUILD; + textStr15 = "Hypixel"; + StringBuilder sb5 = new StringBuilder(); + String textStr16 = "You are now in the "; + sb5 = sb5.append(textStr16); + textStr16 = this.getStringValue2(); + sb5 = sb5.append(textStr16); + textStr16 = " channel"; + this.applyUpdate5(textStr15, sb5.append(textStr16).toString(), 3000, NotificationType.INFO); + break label519; + } + } + } + + intVal3 = (this.hypixelChatChannelField.equals(HypixelChatChannel.PARTY) ? 1 : 0); + + if ((intVal3 == 0)) { + String textStr17 = "\u00a7r\u00a79Party"; + intVal3 = (msgText.startsWith(textStr17) ? 1 : 0); + + if ((intVal3 != 0)) { + EntityPlayerSP player2 = this.mc.thePlayer; + IChatComponent chatComp4 = player2.getDisplayName(); + textStr17 = chatComp4.getFormattedText(); + intVal3 = (msgText.contains(textStr17) ? 1 : 0); + + if ((intVal3 != 0)) { + this.hypixelChatChannelField = HypixelChatChannel.PARTY; + textStr17 = "Hypixel"; + StringBuilder sb6 = new StringBuilder(); + String textStr18 = "You are now in the "; + sb6 = sb6.append(textStr18); + textStr18 = this.getStringValue2(); + sb6 = sb6.append(textStr18); + textStr18 = " channel"; + this.applyUpdate5(textStr17, sb6.append(textStr18).toString(), 3000, NotificationType.INFO); + break label519; + } + } + } + + intVal3 = (this.hypixelChatChannelField.equals(HypixelChatChannel.PM) ? 1 : 0); + + if ((intVal3 == 0)) { + String textStr19 = "\u00a7dTo"; + intVal3 = (msgText.startsWith(textStr19) ? 1 : 0); + + if ((intVal3 != 0)) { + this.hypixelChatChannelField = HypixelChatChannel.PM; + textStr19 = "Hypixel"; + StringBuilder sb7 = new StringBuilder(); + String textStr20 = "You are now in the "; + sb7 = sb7.append(textStr20); + textStr20 = this.getStringValue2(); + sb7 = sb7.append(textStr20); + textStr20 = " channel"; + this.applyUpdate5(textStr19, sb7.append(textStr20).toString(), 3000, NotificationType.INFO); + break label519; + } + } + + intVal3 = (this.hypixelChatChannelField.equals(HypixelChatChannel.PARTY) ? 1 : 0); + + if ((intVal3 != 0)) { + String nameStr2 = this.mc.thePlayer.getName(); + intVal3 = (msgText.contains(nameStr2) ? 1 : 0); + + if ((intVal3 != 0)) { + nameStr2 = "\u00a7r\u00a7ehas disbanded the party!\u00a7r"; + intVal3 = (msgText.endsWith(nameStr2) ? 1 : 0); + + if ((intVal3 != 0)) { + this.sendPacketNoEvent(new C01PacketChatMessage("/chat all")); + break label519; + } + } + } + + intVal3 = (this.hypixelChatChannelField.equals(HypixelChatChannel.ALL) ? 1 : 0); + + if ((intVal3 == 0)) { + intVal3 = (msgText.equals("\u00a7cThe conversation you were in expired and you have been moved back to the ALL channel.\u00a7r") ? 1 : 0); + + if ((intVal3 != 0)) { + this.hypixelChatChannelField = HypixelChatChannel.ALL; + String textStr21 = "Hypixel"; + StringBuilder sb8 = new StringBuilder(); + String textStr22 = "You are now in the "; + sb8 = sb8.append(textStr22); + textStr22 = this.getStringValue2(); + sb8 = sb8.append(textStr22); + textStr22 = " channel"; + this.applyUpdate5(textStr21, sb8.append(textStr22).toString(), 3000, NotificationType.INFO); + } + } + } + } + + intVal3 = (event.getPacket() instanceof S45PacketTitle ? 1 : 0); + + if ((intVal3 != 0)) { + S45PacketTitle titlePacket = (S45PacketTitle)event.getPacket(); + intVal3 = (titlePacket.getType().equals(S45PacketTitle$Type.TITLE) ? 1 : 0); + + if ((intVal3 != 0)) { + IChatComponent chatComp5 = titlePacket.getMessage(); + String textStr23 = chatComp5.getUnformattedText(); + intVal3 = (textStr23.contains("VICTORY") ? 1 : 0); + + if ((intVal3 != 0)) { + this.stateTicks4++; + } + } + } + + intVal3 = (event.getPacket() instanceof S3DPacketDisplayScoreboard ? 1 : 0); + + if ((intVal3 != 0)) { + S3DPacketDisplayScoreboard displayScoreboardPacket = (S3DPacketDisplayScoreboard)event.getPacket(); + intVal3 = (ServerUtils.isHypixel() ? 1 : 0); + + label398: + if ((intVal3 != 0)) { + label584: { + String textStr24 = displayScoreboardPacket.getScoreName(); + this.hypixelLobbyTypeField2 = this.hypixelLobbyTypeField; + String textStr25 = "Mw"; + boolean flag3 = textStr24.equalsIgnoreCase(textStr25); + if (flag3) { + this.hypixelLobbyTypeField = HypixelLobbyType.MW; + break label584; + } + + textStr25 = "\u00a7e\u00a7lHYPIXEL"; + flag3 = textStr24.equalsIgnoreCase(textStr25); + + if (flag3) { + this.hypixelLobbyTypeField = HypixelLobbyType.UHC; + break label584; + } + + textStr25 = "SForeboard"; + flag3 = textStr24.equalsIgnoreCase(textStr25); + + if (flag3) { + this.hypixelLobbyTypeField = HypixelLobbyType.SW; + break label584; + } + + textStr25 = "BForeboard"; + flag3 = textStr24.equalsIgnoreCase(textStr25); + + if (flag3) { + this.hypixelLobbyTypeField = HypixelLobbyType.BW; + break label584; + } + + textStr25 = "PreScoreboard"; + flag3 = textStr24.equalsIgnoreCase(textStr25); + + if (flag3) { + this.hypixelLobbyTypeField = HypixelLobbyType.PRE; + break label584; + } + + textStr25 = "Duels"; + flag3 = textStr24.equalsIgnoreCase(textStr25); + + if (flag3) { + this.hypixelLobbyTypeField = HypixelLobbyType.DUELS; + break label584; + } + + textStr25 = "Pit"; + flag3 = textStr24.equalsIgnoreCase(textStr25); + + if (flag3) { + this.hypixelLobbyTypeField = HypixelLobbyType.PIT; + break label584; + } + + textStr25 = "Blitz SG"; + flag3 = textStr24.equalsIgnoreCase(textStr25); + + if (flag3) { + this.hypixelLobbyTypeField = HypixelLobbyType.SG; + break label584; + } + + textStr25 = "MurderMystery"; + flag3 = textStr24.equalsIgnoreCase(textStr25); + + if (flag3) { + this.hypixelLobbyTypeField = HypixelLobbyType.MM; + break label584; + } + + textStr25 = "health"; + flag3 = textStr24.contains(textStr25); + + if (flag3) { + break label584; + } + + textStr25 = "\u272b"; + flag3 = textStr24.contains(textStr25); + + if (!flag3) { + this.hypixelLobbyTypeField = HypixelLobbyType.NONE; + } + } + + HypixelLobbyType lobbyType = this.hypixelLobbyTypeField2; + HypixelLobbyType lobbyType2 = HypixelLobbyType.PRE; + if (this.hypixelLobbyTypeField2 != HypixelLobbyType.PRE) { + break label398; + } + + clickGuiMod = this; + + lobbyType = this.hypixelLobbyTypeField; + lobbyType2 = HypixelLobbyType.BW; + + if (lobbyType != lobbyType2) { + break label398; + } + + clickGuiMod = this; + + Novoline novolineInst = clickGuiMod.novoline; + TaskManager taskManager = novolineInst.getTaskManager(); + ClickGuiSupport clickGuiSupport = new ClickGuiSupport(this, 75, TaskStage.UPDATE); + taskManager.applyFutureTask(clickGuiSupport); + } + } + + intVal3 = (event.getPacket() instanceof S2DPacketOpenWindow ? 1 : 0); + + if ((intVal3 != 0)) { + S2DPacketOpenWindow openWindowPacket = (S2DPacketOpenWindow)event.getPacket(); + intVal3 = (ServerUtils.isHypixel() ? 1 : 0); + + if ((intVal3 != 0)) { + IChatComponent chatComp6 = openWindowPacket.getWindowTitle(); + intVal3 = (chatComp6.getFormattedText().equals("Select Language\u00a7r") ? 1 : 0); + + if ((intVal3 != 0)) { + event.setCancelled(true); + } + } + } + + intVal3 = (event.getPacket() instanceof S2EPacketCloseWindow ? 1 : 0); + + label319: + if ((intVal3 != 0)) { + label589: { + S2EPacketCloseWindow closeWindowPacket = (S2EPacketCloseWindow)event.getPacket(); + intVal3 = (this.mc.currentScreen instanceof GuiChat ? 1 : 0); + + if ((intVal3 != 0)) { + break label589; + } + + intVal3 = (this.mc.currentScreen instanceof InventoryEffectRendererSupport ? 1 : 0); + + + + if ((intVal3 != 0)) { + break label589; + } + + intVal3 = (this.mc.currentScreen instanceof GuiFontSelector ? 1 : 0); + + + + if ((intVal3 != 0)) { + break label589; + } + + intVal3 = (this.mc.currentScreen instanceof ClickGUI ? 1 : 0); + + + if ((intVal3 == 0)) { + break label319; + } + } + + event.setCancelled(true); + } + + obj = event.getPacket(); + + intVal3 = (obj instanceof S2FPacketSetSlot ? 1 : 0); + + if ((intVal3 == 0)) { + return; + } + + obj = event.getPacket(); + + label293: { + S2FPacketSetSlot setSlotPacket = (S2FPacketSetSlot)obj; + boolean flag4 = ServerUtils.isHypixel(); + if (!flag4) { + break label293; + } + + HypixelLobbyType lobbyType3 = HypixelLobbyType.LOBBY; + flag4 = ServerUtils.evaluateCheck(lobbyType3); + + label288: + if (flag4) { + ItemStack stack = setSlotPacket.func_149174_e(); + + if (stack == null) { + break label288; + } + + stack = setSlotPacket.func_149174_e(); + + + if (stack.getItem() instanceof ItemEditableBook) { + event.setCancelled(true); + } + } + } + + return; + } + + intVal3 = (event.getPacket() instanceof C03PacketPlayer ? 1 : 0); + + + if ((intVal3 != 0)) { + int intVal2 = (this.stateFlag ? 1 : 0); + + if (!this.stateFlag) { + return; + } + + intVal2 = this.mc.thePlayer.ticksExisted; + + + + if (intVal2 <= this.stateTicks5) { + return; + } + + intVal2 = (ServerUtils.isHypixel() ? 1 : 0); + + + label267: { + if (intVal2 != 0) { + this.popNotification("Novoline", "Hypixel bypasses enabled!", NotificationType.INFO); + this.sendPacketNoEvent(new C01PacketChatMessage("/language english")); + Novoline novolineInst2 = this.novoline; + TaskManager taskManager2 = novolineInst2.getTaskManager(); + ClickGuiTask clickGuiTask = new ClickGuiTask(this, 1500, TaskStage.TICK); + taskManager2.applyFutureTask(clickGuiTask); + break label267; + } + + this.applyUpdate5("Novoline", "Hypixel bypasses disabled! Contact staff", 6000, NotificationType.ERROR); + } + + this.stateFlag = false; + return; + } + + obj2 = event.getPacket(); + + intVal3 = (obj2 instanceof C01PacketChatMessage ? 1 : 0); + + + if ((intVal3 == 0)) { + return; + } + + obj2 = event.getPacket(); + + C01PacketChatMessage chatMessagePacket = (C01PacketChatMessage)obj2; + boolean flag5 = ServerUtils.isHypixel(); + if (!flag5) { + return; + } + + String msgText2 = chatMessagePacket.getMessage(); + flag5 = msgText2.startsWith("/language"); + + if (flag5) { + event.setCancelled(true); + } +} + + public String getCachedText2() { + return this.cachedText2; +} + + public StringProperty getMode() { + return this.mode; +} + + public StringProperty getStringProperty7() { + return this.getMode(); +} + + @EventTarget + public void onTickUpdate2(TickUpdateEvent event) { + boolean fullscreenSetting = this.flagValue; + if (fullscreenSetting == this.mc.gameSettings.fullScreen) return; + this.flagValue = this.mc.gameSettings.fullScreen; + fullscreenSetting = this.flagValue; + + try { + if (fullscreenSetting) { + String property = "org.lwjgl.opengl.Window.undecorated"; + String value = "true"; + System.setProperty(property, value); + DisplayMode desktopMode = Display.getDesktopDisplayMode(); + Display.setDisplayMode(desktopMode); + Display.setLocation(0, 0); + Display.setFullscreen(false); + Display.setResizable(false); + } else { + String property = "org.lwjgl.opengl.Window.undecorated"; + String value = "false"; + System.setProperty(property, value); + DisplayMode gameMode = new DisplayMode(this.mc.displayWidth, this.mc.displayHeight); + Display.setDisplayMode(gameMode); + Display.setFullscreen(true); + Display.setResizable(true); + } + } catch (LWJGLException exception) { + exception.printStackTrace(); + } +} + + public HypixelLobbyType getADEO() { + return this.hypixelLobbyTypeField2; +} + + public StringProperty getOpenAnimation() { + return this.openAnimation; +} + + public StringProperty getStringProperty8() { + return this.getOpenAnimation(); +} + + public long getLastTimestamp() { + return this.lastTimestamp; +} + + public Integer getIntegerValue3() { + return this.stateTicks8; +} + + public DoubleProperty getDpiScaleCrystal() { + return this.dpiScaleCrystal; +} + + public DoubleProperty getDoublePropertyK() { + return this.getDpiScaleCrystal(); +} + + public HypixelLobbyType getADEP() { + return this.hypixelLobbyTypeField; +} + +} diff --git a/src/main/java/cc/novoline/modules/visual/Crosshair.java b/src/main/java/cc/novoline/modules/visual/Crosshair.java new file mode 100644 index 0000000..06e5156 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/Crosshair.java @@ -0,0 +1,215 @@ +package cc.novoline.modules.visual; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.MovementUtils; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.shader.RoundedTextureShader; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import java.awt.Color; +import cc.novoline.modules.ModuleManager; +import net.minecraft.util.MathHelper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.ScaledResolution; + +public class Crosshair extends AbstractModule { + @Property("gap") + private DoubleProperty gap; + @Property("dot") + private BooleanProperty dot; + @Property("color-mode") + private StringProperty colorMode; + @Property("color") + private ColorProperty color; + private double cachedValue; + @Property("sise") + private DoubleProperty sise; + @Property("length") + private DoubleProperty length; + @Property("width") + private DoubleProperty width; + @Property("dynamic") + private BooleanProperty dynamic; + + + private Boolean supplyBoolean() { + Boolean propFlag = this.dot.get(); + boolean flag = propFlag; + flag = !flag; + + return flag; +} + + private Boolean supplyBoolean2() { + Boolean propFlag = this.dot.get(); + boolean flag = propFlag; + flag = !flag; + + return flag; +} + + private Boolean supplyBoolean3() { + Boolean propFlag = this.dot.get(); + boolean flag = propFlag; + flag = !flag; + + return flag; +} + + + @EventTarget + public void onRender2D(Render2DEvent event) { + cc.novoline.modules.visual.Crosshair crosshair; + ScaledResolution scaledRes; + Color awtColor; + label61: { + scaledRes = event.getResolution(); + Crosshair crosshair2 = this; + + StringProperty strProp = this.colorMode; + if (!strProp.equals("Custom")) { + awtColor = new Color(ColorTheme.getHudColor(0L)); + break label61; + } + + crosshair2 = this; + + + ColorProperty colorProp = crosshair2.color; + awtColor = colorProp.getAwtColor(); + } + + Color awtColor2; + double scaledWidthD; + double scaledHeightD; + double doubleVal; + label55: { + awtColor2 = awtColor; + scaledWidthD = scaledRes.getScaledWidthDoubleGui() / 2.0; + scaledHeightD = scaledRes.getScaledHeightDoubleGui() / 2.0; + doubleVal = MovementUtils.applyGuiScale(true); + Minecraft mcClient = this.mc; + double doubleVal2 = 2000 / mcClient.getDebugFPS(); + Crosshair crosshair3 = this; + + BooleanProperty boolProp = this.dynamic; + Boolean propFlag = boolProp.get(); + if (propFlag) { + label50: { + double doubleVal8; + { + EntityPlayerSP player = this.mc.thePlayer; + doubleVal8 = player.getDouble8() * 5.0; + if (this.cachedValue < doubleVal8) { + double doubleVal3 = this.cachedValue + 0.025 * doubleVal2; + this.cachedValue = MathHelper.clamp_double(doubleVal3, 0.0, doubleVal8); + break label50; + } + + crosshair = this; + + if (this.cachedValue <= doubleVal8) { + break label50; + } + + crosshair = this; + } + + double doubleVal4 = this.cachedValue - 0.025 * doubleVal2; + crosshair.cachedValue = MathHelper.clamp_double(doubleVal4, doubleVal8, 999.0); + } + + break label55; + } + + crosshair3 = this; + + + crosshair3.cachedValue = 0.0; + } + + label33: { + BooleanProperty boolProp2 = this.dot; + Object obj = boolProp2.get(); + if (((Boolean) obj)) { + DoubleProperty doubleProp = this.sise; + Double propDouble = doubleProp.get(); + double doubleVal9 = propDouble + this.cachedValue; + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + roundedTextureShader.handleDouble(scaledWidthD, scaledHeightD, doubleVal9, 2.0, awtColor2, true); + break label33; + } + + DoubleProperty doubleProp2 = this.width; + obj = doubleProp2.get(); + + Double doubleVal5 = (Double)obj; + double doubleVal10 = doubleVal5; + DoubleProperty doubleProp3 = this.length; + Double propDouble2 = doubleProp3.get(); + double doubleVal11 = propDouble2; + DoubleProperty doubleProp4 = this.gap; + Double propDouble3 = doubleProp4.get(); + double doubleVal6 = propDouble3 + this.cachedValue; + RoundedTextureShader roundedTextureShader2 = RoundedTextureShader.getInstance(); + double doubleVal7 = scaledWidthD + doubleVal6 + 1.0; + roundedTextureShader2.drawRoundedRect(doubleVal7, scaledHeightD, doubleVal11, 1.0, 0.0, doubleVal10, awtColor2, true); + RoundedTextureShader roundedTextureShader3 = RoundedTextureShader.getInstance(); + doubleVal7 = scaledWidthD - doubleVal11 - doubleVal6; + roundedTextureShader3.drawRoundedRect(doubleVal7, scaledHeightD, doubleVal11, 1.0, 0.0, doubleVal10, awtColor2, true); + RoundedTextureShader roundedTextureShader4 = RoundedTextureShader.getInstance(); + double doubleVal12 = scaledHeightD + doubleVal6 + 1.0; + roundedTextureShader4.drawRoundedRect(scaledWidthD, doubleVal12, 1.0, doubleVal11, 0.0, doubleVal10, awtColor2, true); + RoundedTextureShader roundedTextureShader5 = RoundedTextureShader.getInstance(); + doubleVal12 = scaledHeightD - doubleVal11 - doubleVal6; + roundedTextureShader5.drawRoundedRect(scaledWidthD, doubleVal12, 1.0, doubleVal11, 0.0, doubleVal10, awtColor2, true); + } + + MovementUtils.unscale(doubleVal); +} + + public Crosshair(ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + StringProperty strProp = StringProperty.of("Synced"); + String[] stringArr = new String[]{"Synced", "Custom"}; + this.colorMode = strProp.acceptableValues(stringArr); + Color awtColor = Color.CYAN; + int color2 = awtColor.getRGB(); + Integer intVal = color2; + this.color = ColorProperty.e(intVal); + this.width = DoubleProperty.of(1.0).minimum(0.5).maximum(2.0); + this.gap = DoubleProperty.of(4.0).minimum(1.0).maximum(8.0); + this.length = DoubleProperty.of(5.0).minimum(2.0).maximum(16.0); + this.dot = BooleanProperty.of(false); + this.sise = DoubleProperty.of(4.0).minimum(2.0).maximum(8.0); + this.dynamic = BooleanProperty.of(false); + Setting setting = new Setting("CH_COLOR_TYPE", "Color Type", SettingType.COMBOBOX, this, this.colorMode); + SettingManager.register(setting); + setting = new Setting("CH_COLOR", "Color", SettingType.COLOR_PICKER, this, this.color, null, () -> this.colorMode.equals("Custom")); + SettingManager.register(setting); + setting = new Setting("CH_DOT", "Dot", SettingType.CHECKBOX, this, this.dot); + SettingManager.register(setting); + setting = new Setting("CH_DOT_SIZE", "Size", SettingType.SLIDER, this, this.sise, 0.5, () -> this.dot.get()); + SettingManager.register(setting); + setting = new Setting("CH_WIDTH", "Width", SettingType.SLIDER, this, this.width, 0.1, this::supplyBoolean3); + SettingManager.register(setting); + setting = new Setting("CH_GAP", "Gap", SettingType.SLIDER, this, this.gap, 0.5, this::supplyBoolean2); + SettingManager.register(setting); + setting = new Setting("CH_LENGTH", "Length", SettingType.SLIDER, this, this.length, 0.5, this::supplyBoolean); + SettingManager.register(setting); + setting = new Setting("CH_DYNAMIC", "Dynamic", SettingType.CHECKBOX, this, this.dynamic); + SettingManager.register(setting); +} + +} diff --git a/src/main/java/cc/novoline/modules/visual/CustomHitGlint.java b/src/main/java/cc/novoline/modules/visual/CustomHitGlint.java new file mode 100644 index 0000000..3799916 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/CustomHitGlint.java @@ -0,0 +1,69 @@ +package cc.novoline.modules.visual; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ColorTheme; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import java.awt.Color; +import cc.novoline.modules.ModuleManager; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class CustomHitGlint extends AbstractModule { + @Property("color-mode") + private final StringProperty colorMode; + @Property("color") + private final ColorProperty color; + @Property("legacy-render") + private final BooleanProperty legacyRender; + + + public CustomHitGlint(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + StringProperty strProp = StringProperty.of("Client"); + String[] stringArr = new String[]{"Client", "Custom"}; + this.colorMode = strProp.acceptableValues(stringArr); + Color awtColor = new Color(200, 200, 200); + int color2 = awtColor.getRGB(); + Integer intVal = color2; + this.color = ColorProperty.e(intVal); + this.legacyRender = BooleanProperty.of(false); + Setting setting = new Setting("CHG_COLOR_MODE", "Color Mode", SettingType.COMBOBOX, this, this.colorMode); + SettingManager.register(setting); + setting = new Setting("CHG_COLOR", "Color", SettingType.COLOR_PICKER, this, this.color, null, () -> this.colorMode.equals("Custom")); + SettingManager.register(setting); + setting = new Setting("CHG_LEGACY_RENDER", "Legacy render", SettingType.CHECKBOX, this, this.legacyRender); + SettingManager.register(setting); +} + + public BooleanProperty getLegacyRender() { + return this.legacyRender; +} + + public BooleanProperty getBooleanProperty5() { + return this.getLegacyRender(); +} + + + public Color getColorValue() { + CustomHitGlint customHitGlint = this; + + StringProperty strProp = this.colorMode; + if (!strProp.equals("Custom")) { + return new Color(ColorTheme.getHudColor(0L)); + } + + customHitGlint = this; + + + ColorProperty colorProp = customHitGlint.color; + return colorProp.getAwtColor(); +} + +} diff --git a/src/main/java/cc/novoline/modules/visual/DMGParticles.java b/src/main/java/cc/novoline/modules/visual/DMGParticles.java new file mode 100644 index 0000000..87dbc2c --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/DMGParticles.java @@ -0,0 +1,292 @@ +package cc.novoline.modules.visual; + +import cc.novoline.events.events.EntityTickEvent; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.render.ParticleVec3d; +import cc.novoline.utils.render.DamageParticle; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.PlayerUpdateEvent; +import cc.novoline.events.events.Render3DEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.StringProperty; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Random; +import java.util.function.Consumer; +import cc.novoline.modules.ModuleManager; +import cc.novoline.utils.fonts.holders.FontSF_BOLD_Holder; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.entity.EntityLivingBase; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.lwjgl.opengl.GL11; + +public class DMGParticles extends AbstractModule { + private final HashMap hashMapField; + @Property("font") + private StringProperty font; + private final List damageParticleList; + + @EventTarget + public void onPlayerUpdate(PlayerUpdateEvent event) { + List itemList = this.damageParticleList; + Consumer consumer = this::lambdaImpl$onUpdate$0; + itemList.forEach(consumer); +} + + + private void lambdaImpl$onUpdate$0(DamageParticle damageParticle) { + damageParticle.ticks++; + int intVal = damageParticle.ticks; + byte byteVal = 10; + if (damageParticle.ticks <= 10) { + damageParticle.location.createParticleVec3d2(damageParticle.location.getCachedValue() + damageParticle.ticks * 0.005); + } + + intVal = damageParticle.ticks; + + if (intVal > 20) { + List itemList = this.damageParticleList; + itemList.remove(damageParticle); + } +} + + + + public static double computeDoubleFromDouble(double value, int index) { + if (index < 0) { + throw new IllegalArgumentException(); + } else { + return new BigDecimal(value).setScale(index, RoundingMode.HALF_UP).doubleValue(); + } +} + + @EventTarget + public void onRender3D(Render3DEvent event) { + boolean flag2 = HUD.H(); + Iterator iter = this.damageParticleList.iterator(); + boolean flag = flag2; + + while (true) { + if (!iter.hasNext()) { + break; + } + + DamageParticle damageParticle = (DamageParticle)iter.next(); + double doubleVal = damageParticle.location.getCachedValue3(); + Minecraft mcClient = this.mc; + double doubleVal2 = doubleVal - mcClient.getRenderManager().renderPosX; + double doubleVal3 = damageParticle.location.getCachedValue(); + Minecraft mcClient2 = this.mc; + double doubleVal4 = doubleVal3 - mcClient2.getRenderManager().renderPosY; + double doubleVal5 = damageParticle.location.getCachedValue2(); + Minecraft mcClient3 = this.mc; + double doubleVal6 = doubleVal5 - mcClient3.getRenderManager().renderPosZ; + GL11.glPushMatrix(); + GlStateManager.performStep24(); + GlStateManager.renderStep4(1.0F, -1500000.0F); + float floatVal = (float)doubleVal2; + float floatVal4 = (float)doubleVal4; + float floatVal5 = (float)doubleVal6; + GL11.glTranslatef(floatVal, floatVal4, floatVal5); + Minecraft mcClient4 = this.mc; + float floatVal2 = -mcClient4.getRenderManager().playerViewY; + GL11.glRotatef(floatVal2, 0.0F, 1.0F, 0.0F); + GameSettings gameSettings2 = this.mc.gameSettings; + floatVal2 = gameSettings2.getThirdPersonView() == 2 ? -1.0F : 1.0F; + + label32: { + label31: { + float floatVal6 = floatVal2; + Minecraft mcClient5 = this.mc; + float floatVal3 = mcClient5.getRenderManager().floatState; + GL11.glRotatef(floatVal3, floatVal6, 0.0F, 0.0F); + double doubleVal7 = 0.03; + GL11.glScaled(-0.03, -0.03, 0.03); + RenderUtils.renderVisual2(); + RenderUtils.stop3D(); + GL11.glDepthMask(false); + StringProperty strProp = this.font; + flag2 = strProp.equals("Vanilla"); + if (!flag2) { + break label31; + } + + net.minecraft.client.gui.FontRenderer font2 = this.mc.fontRendererObj; + String textStr = damageParticle.text; + net.minecraft.client.gui.FontRenderer font3 = this.mc.fontRendererObj; + String textStr4 = damageParticle.text; + floatVal5 = -(font3.getStringWidth(textStr4) / 2); + net.minecraft.client.gui.FontRenderer font4 = this.mc.fontRendererObj; + float floatVal7 = -(font4.getFontHeight() - 1); + font2.resolveInt(textStr, floatVal5, floatVal7, 0, true); + + if (flag) { + break label32; + } + } + + FontRenderer font5 = FontSF_BOLD_Holder.FONT; + String textStr2 = damageParticle.text; + net.minecraft.client.gui.FontRenderer font6 = this.mc.fontRendererObj; + String textStr3 = damageParticle.text; + double doubleVal8 = -(font6.getStringWidth(textStr3) / 2); + net.minecraft.client.gui.FontRenderer font7 = this.mc.fontRendererObj; + double doubleVal9 = -(font7.getFontHeight() - 1); + font5.drawElement5(textStr2, doubleVal8, doubleVal9, 0, true); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDepthMask(true); + GlStateManager.renderStep4(1.0F, 1500000.0F); + GlStateManager.performStep23(); + GlStateManager.disableBlend(); + GL11.glPopMatrix(); + } +} + + + public DMGParticles(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.hashMapField = new HashMap<>(); + this.damageParticleList = new ArrayList<>(); + StringProperty strProp = StringProperty.of("Vanilla"); + String[] stringArr = new String[]{"Client", "Vanilla"}; + this.font = strProp.acceptableValues(stringArr); + SettingManager.register(new Setting("DMG_PARTICLES_FONT", "Font", SettingType.COMBOBOX, this, this.font)); +} + + + @EventTarget + public void handleEntityTickEvent(EntityTickEvent event) { + java.lang.String textStr; + int intVal5 = (HUD.H() ? 1 : 0); + EntityLivingBase living = (EntityLivingBase)event.getTrackedEntity2(); + boolean flag = (intVal5 != 0); + if (living != this.mc.thePlayer) { + HashMap hashMap = this.hashMapField; + EntityLivingBase living2 = living; + if (flag) { + if (!this.hashMapField.containsKey(living)) { + HashMap hashMap2 = this.hashMapField; + float health2 = living.getHealth(); + hashMap2.put(living, health2); + } + + hashMap = this.hashMapField; + living2 = living; + } + + Float floatVal = (Float)hashMap.get(living2); + float floatVal2 = floatVal; + float health = living.getHealth(); + float floatVal3; + int intVal = (floatVal3 = floatVal2 - health) == 0.0F ? 0 : (floatVal3 < 0.0F ? -1 : 1); + if (flag) { + if (intVal == 0) { + return; + } + + float floatVal4; + intVal = (floatVal4 = health - floatVal2) == 0.0F ? 0 : (floatVal4 < 0.0F ? -1 : 1); + } + + if (flag) { + intVal = intVal > 0 ? 1 : 0; + } + + int intVal2; + intVal2 = intVal; + intVal5 = living.hurtResistantTime; + label62: + if (flag) { + label67: + if (living.hurtResistantTime >= 18) { + label92: { + double motionY2; + intVal5 = (motionY2 = this.mc.thePlayer.motionY - 0.0) == 0.0 ? 0 : (motionY2 < 0.0 ? -1 : 1); + if (flag) { + if (intVal5 >= 0) { + break label92; + } + + intVal5 = (this.mc.thePlayer.onGround ? 1 : 0); + } + + if (!flag) { + break label62; + } + + if (intVal5 == 0) { + break label67; + } + } + + intVal5 = 0; + break label62; + } + + intVal5 = 1; + } + + label58: { + int intVal3 = intVal5; + int intVal4 = intVal2; + if (flag) { + if (intVal2 != 0) { + textStr = "\u00a7a"; + break label58; + } + + intVal4 = intVal3; + } + + textStr = intVal4 != 0 ? "\u00a7c" : "\u00a7e"; + } + + String textStr2 = textStr; + String textStr3; + if (floatVal2 - health < 0.0F) { + StringBuilder sb2 = new StringBuilder().append(textStr2); + double doubleVal = computeDoubleFromDouble((floatVal2 - health) * -1.0F, 1); + textStr3 = sb2.append(doubleVal).toString(); + } else { + StringBuilder sb4 = new StringBuilder().append(textStr2); + double doubleVal2 = computeDoubleFromDouble(floatVal2 - health, 1); + textStr3 = sb4.append(doubleVal2).toString(); + } + + String textStr4 = textStr3; + ParticleVec3d particleVec3d = new ParticleVec3d(living); + double posY = living.getAxisAlignedBB().minY; + double posY2 = living.getAxisAlignedBB().maxY; + particleVec3d.createParticleVec3d2(posY + (posY2 - living.getAxisAlignedBB().minY) / 2.0); + double doubleVal3 = particleVec3d.getCachedValue3() - 0.5; + Random random = new Random(System.currentTimeMillis()); + particleVec3d.withCachedValue3(doubleVal3 + random.nextInt(5) * 0.1); + double doubleVal4 = particleVec3d.getCachedValue2() - 0.5; + Random random2 = new Random(System.currentTimeMillis() + 1L); + particleVec3d.createParticleVec3d(doubleVal4 + random2.nextInt(5) * 0.1); + List itemList = this.damageParticleList; + DamageParticle damageParticle = new DamageParticle(particleVec3d, textStr4); + itemList.add(damageParticle); + this.hashMapField.remove(living); + HashMap hashMap3 = this.hashMapField; + float health3 = living.getHealth(); + hashMap3.put(living, health3); + } +} + +} diff --git a/src/main/java/cc/novoline/modules/visual/Glint.java b/src/main/java/cc/novoline/modules/visual/Glint.java new file mode 100644 index 0000000..85cf904 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/Glint.java @@ -0,0 +1,69 @@ +package cc.novoline.modules.visual; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ColorTheme; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.ModuleManager; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class Glint extends AbstractModule { + @Property("glint-color") + private final ColorProperty glintColor; + @Property("synced") + private final BooleanProperty synced; + + public Glint(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + Integer intVal = -7697665; + this.glintColor = ColorProperty.e(intVal); + this.synced = BooleanProperty.of(false); + Setting setting = new Setting("GLINT_COLOR", "Glint color", SettingType.COLOR_PICKER, this, this.glintColor, null, this::lambdaImpl$new$0); + SettingManager.register(setting); + setting = new Setting("GLINT_SYNCED", "Synced", SettingType.CHECKBOX, this, this.synced); + SettingManager.register(setting); +} + + public int getIntValue16() { + Glint glint = this; + + BooleanProperty boolProp = this.synced; + Boolean propFlag = boolProp.get(); + if (propFlag) { + return ColorTheme.getHudColor(0L); + } + + glint = this; + + + ColorProperty colorProp = glint.glintColor; + Integer color = colorProp.getColorInt(); + return color; +} + + + private Boolean lambdaImpl$new$0() { + Boolean propFlag = this.synced.get(); + boolean flag = propFlag; + flag = !flag; + + return flag; +} + + + public ColorProperty getGlintColor() { + return this.glintColor; +} + + public ColorProperty getColorProperty() { + return this.getGlintColor(); +} + + +} diff --git a/src/main/java/cc/novoline/modules/visual/Glow.java b/src/main/java/cc/novoline/modules/visual/Glow.java new file mode 100644 index 0000000..6edaf8a --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/Glow.java @@ -0,0 +1,383 @@ +package cc.novoline.modules.visual; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ColorTheme; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.shader.GaussianBlurShader; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import java.awt.Color; +import java.util.Iterator; +import java.util.List; +import java.util.function.Predicate; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import net.minecraft.entity.EntityCreatureSupport; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.entity.Entity; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.monster.EntitySlime; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class Glow extends AbstractModule { + @Property("color-shader-mode") + private StringProperty colorShaderMode; + @Property("color") + private ColorProperty color; + @Property("color-outline-state") + private StringProperty colorOutlineState; + @Property("color-outline-mode") + private StringProperty colorOutlineMode; + @Property("mode") + private StringProperty mode; + @Property("targets") + private ListProperty targets; + @Property("radius") + private IntProperty radius; + + private Boolean supplyBoolean() { + boolean flag; + label21: { + label23: { + StringProperty strProp = this.mode; + flag = strProp.equals("Outline"); + if (!flag) { + break label23; + } + + StringProperty strProp2 = this.colorOutlineMode; + flag = strProp2.equals("Synced"); + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + public ColorProperty getColor() { + return this.color; +} + + public ColorProperty getColorProperty3() { + return this.getColor(); +} + + private Boolean supplyBoolean2() { + boolean flag; + label35: { + label37: { + StringProperty strProp = this.mode; + flag = strProp.equals("Shader"); + if (flag) { + StringProperty strProp2 = this.colorShaderMode; + flag = strProp2.equals("Static"); + + if (flag) { + break label37; + } + } + + StringProperty strProp3 = this.mode; + flag = strProp3.equals("Outline"); + + label38: { + if (!flag) { + break label38; + } + + StringProperty strProp4 = this.colorOutlineMode; + flag = strProp4.equals("Static"); + + if (flag) { + break label37; + } + } + + flag = false; + break label35; + } + + flag = true; + } + + return flag; +} + + public StringProperty getColorOutlineMode() { + return this.colorOutlineMode; +} + + public StringProperty getStringPropertyValue3() { + return this.getColorOutlineMode(); +} + + + private void executeCallback() { + this.mc.entityRenderer.renderStep(this.mc.timer.renderPartialTicks, 0); + List itemList = this.mc.theWorld.obtainList3(); + Stream stream2 = itemList.stream(); + Predicate predicate = this::applyInt5; + Stream stream3 = stream2.filter(predicate); + Collector collector = Collectors.toList(); + List itemList2 = (java.util.List) stream3.collect(collector); + Iterator iter = itemList2.iterator(); + + while (true) { + if (iter.hasNext()) { + Entity entity2 = (Entity)iter.next(); + Minecraft mcClient = this.mc; + mcClient.getRenderManager().updateState(entity2, this.mc.timer.renderPartialTicks); + + + continue; + + } + + this.mc.entityRenderer.renderStep7(); + break; + } +} + + public StringProperty getColorShaderMode() { + return this.colorShaderMode; +} + + public StringProperty getStringPropertyValue4() { + return this.getColorShaderMode(); +} + + + public ListProperty getTargets() { + return this.targets; +} + + public ListProperty getListProperty2() { + return this.getTargets(); +} + + public Glow(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + StringProperty strProp = StringProperty.of("Outline"); + String[] stringArr = new String[]{"Shader", "Outline"}; + this.mode = strProp.acceptableValues(stringArr); + this.radius = IntProperty.of(15).minimum(1).maximum(50); + Integer intVal = -5751202; + this.color = ColorProperty.e(intVal); + StringProperty strProp2 = StringProperty.of("Static"); + stringArr = new String[]{"Team", "Static", "Synced"}; + this.colorOutlineMode = strProp2.acceptableValues(stringArr); + StringProperty strProp3 = StringProperty.of("Dynamic"); + stringArr = new String[]{"Static", "Dynamic"}; + this.colorOutlineState = strProp3.acceptableValues(stringArr); + StringProperty strProp4 = StringProperty.of("Static"); + stringArr = new String[]{"Static", "Synced", "Material"}; + this.colorShaderMode = strProp4.acceptableValues(stringArr); + ListProperty listProp = ListProperty.of("Players"); + stringArr = new String[]{"Players", "Animals", "Mobs", "Passives"}; + this.targets = listProp.acceptableValues((Object[])stringArr); + Setting setting = new Setting("GLOW_MODE", "Mode", SettingType.COMBOBOX, this, this.mode); + SettingManager.register(setting); + setting = new Setting("GLOW_TARGETS", "Targets", SettingType.SELECTBOX, this, this.targets); + SettingManager.register(setting); + setting = new Setting("GLOW_OUTLINE_COLOR", "Outline Color", SettingType.COMBOBOX, this, this.colorOutlineMode, () -> this.mode.equals("Outline")); + SettingManager.register(setting); + setting = new Setting("GLOW_OUTLINE_STATE", "Color State", SettingType.COMBOBOX, this, this.colorOutlineState, this::supplyBoolean); + SettingManager.register(setting); + setting = new Setting("GLOW_SHADER_COLOR", "Shader Color", SettingType.COMBOBOX, this, this.colorShaderMode, () -> this.mode.equals("Shader")); + SettingManager.register(setting); + setting = new Setting("GLOW_COLOR", "Color", SettingType.COLOR_PICKER, this, this.color, null, this::supplyBoolean2); + SettingManager.register(setting); + setting = new Setting("GLOW_SHADER_RADIUS", "Radius", SettingType.SLIDER, this, this.radius, 1.0, () -> this.mode.equals("Shader")); + SettingManager.register(setting); +} + + public IntProperty getRadius() { + return this.radius; +} + + public IntProperty getIntPropertyValue4() { + return this.getRadius(); +} + + @Override + public void onEnable() {} + + + @EventTarget + public void onRender2D(Render2DEvent event) { + GaussianBlurShader gaussianBlurShader; + java.lang.Integer intVal; + cc.novoline.modules.visual.Glow glow; + if (this.mode.equals("Shader")) { + int intVal3; + Color awtColor; + Runnable runnable; + label26: { + + gaussianBlurShader = GaussianBlurShader.getGaussianBlurShader(); + IntProperty intProp = this.radius; + Integer intVal2 = intProp.get(); + intVal = intVal2; + intVal3 = this.color.getAlpha(); + runnable = this::executeCallback; + StringProperty strProp = this.colorShaderMode; + boolean flag = strProp.equals("Synced"); + if (flag) { + awtColor = new Color(ColorTheme.getHudColor(0L)); + break label26; + } + + glow = this; + + StringProperty strProp2 = this.colorShaderMode; + flag = strProp2.equals("Static"); + + if (!flag) { + awtColor = null; + break label26; + } + + glow = this; + + ColorProperty colorProp = glow.color; + awtColor = colorProp.getAwtColor(); + } + + gaussianBlurShader.renderVisual(intVal, intVal3, true, runnable, awtColor); + } +} + + public StringProperty getColorOutlineState() { + return this.colorOutlineState; +} + + public StringProperty getStringProperty9() { + return this.getColorOutlineState(); +} + + + public StringProperty getMode() { + return this.mode; +} + + public StringProperty getStringPropertyValue5() { + return this.getMode(); +} + + public boolean applyInt5(Entity entity) { + Entity entity2 = entity; + if (entity == null) { + return false; + } + + entity2 = entity; + + boolean flag = entity2.isConditionMet16(); + if (!flag) { + return false; + } + + entity2 = entity; + + flag = entity.isConditionMet23(); + + if (flag) { + return false; + } + + entity2 = entity; + + if (entity2 != this.mc.thePlayer) { + boolean flag2 = this.checkEntity4(entity); + + if (flag2) { + return true; + } + } + + return false; +} + + private boolean checkEntity4(Entity entity) { + boolean flag = HUD.Q(); + ListProperty listProp = this.targets; + boolean flag2 = listProp.contains("Players"); + if (flag2) { + boolean flag3 = entity instanceof EntityPlayer; + + if (flag3) { + return true; + } + } + + listProp = this.targets; + flag2 = listProp.contains("Mobs"); + + if (flag2) { + boolean flag4 = entity instanceof EntityMob; + + if (flag4) { + return true; + } + + boolean flag5 = entity instanceof EntitySlime; + + if (flag5) { + return true; + } + } + + listProp = this.targets; + flag2 = listProp.contains("Passives"); + + if (flag2) { + boolean flag6 = entity instanceof EntityVillager; + + if (flag6) { + return true; + } + + boolean flag7 = entity instanceof EntityCreatureSupport; + + if (flag7) { + return true; + } + } + + listProp = this.targets; + flag2 = listProp.contains("Animals"); + + + if (!flag2) { + return false; + } + + flag2 = entity instanceof EntityAnimal; + + + return flag ? flag2 : flag2; +} + + +} diff --git a/src/main/java/cc/novoline/modules/visual/HUD.java b/src/main/java/cc/novoline/modules/visual/HUD.java new file mode 100644 index 0000000..194d551 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/HUD.java @@ -0,0 +1,10408 @@ +package cc.novoline.modules.visual; + +import cc.novoline.events.events.MiddleClickEvent; +import cc.novoline.events.events.ModuleStateEvent; +import cc.novoline.events.type.GuiState; +import cc.novoline.gui.screen.font.GuiFontSelector; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.modules.binds.ModuleKeybind; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.MovementUtils; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.ServerCommandTracker; +import cc.novoline.utils.ServerUtils; +import cc.novoline.utils.StringScrambler; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontFamilyINTER_BOLD; +import cc.novoline.utils.fonts.holders.FontFamilyINTER_MEDIUM; +import cc.novoline.utils.fonts.holders.FontFamilyINTER_REGULAR; +import cc.novoline.utils.fonts.holders.FontFamilyJETBRAINS_BOLD; +import cc.novoline.utils.fonts.holders.FontFamilyJETBRAINS_MEDIUM; +import cc.novoline.utils.fonts.holders.FontFamilyJETBRAINS_REGULAR; +import cc.novoline.utils.fonts.holders.FontFamilyMINECRAFT; +import cc.novoline.utils.fonts.holders.FontFamilyPOPPING_BOLD; +import cc.novoline.utils.fonts.holders.FontFamilyPOPPING_MEDIUM; +import cc.novoline.utils.fonts.holders.FontFamilyPOPPING_REGULAR; +import cc.novoline.utils.fonts.holders.FontFamilySF_MEDIUM; +import cc.novoline.utils.fonts.holders.FontFamilyVOLTE_BOLD; +import cc.novoline.utils.fonts.holders.FontFamilyVOLTE_MEDIUM; +import cc.novoline.utils.fonts.holders.FontFamilyVOLTE_REGULAR; +import cc.novoline.utils.fonts.holders.FontFamilyWEXICONS; +import cc.novoline.utils.fonts.impl.CachedFontFamily; +import cc.novoline.utils.render.KeystrokesButton; +import cc.novoline.utils.render.HudPotionEntry; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.shader.GaussianBlurShader; +import cc.novoline.utils.shader.StencilBlurPass; +import cc.novoline.utils.shader.RoundedTextureShader; +import cc.novoline.utils.tasks.TaskManager; +import cc.novoline.utils.tasks.TaskStage; +import cc.novoline.utils.tasks.impl.HUDSupport; +import cc.novoline.utils.tasks.impl.HUDTask; + +import cc.novoline.Novoline; +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.KeyPressEvent; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.events.events.RenderGuiEvent; +import cc.novoline.events.events.SettingEvent; +import cc.novoline.events.events.ShaderEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.ConfigManager; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.FloatProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import com.google.common.collect.Lists; +import cc.novoline.modules.configurations.holder.ModuleHolder; +import cc.novoline.modules.ModuleRegistry; +import it.unimi.dsi.fastutil.objects.ObjectCollection; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.FontFormatException; +import java.awt.Toolkit; +import java.io.FileInputStream; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.LinkOption; +import java.nio.file.OpenOption; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; +import java.nio.file.attribute.FileAttribute; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.gui.GuiChat; +import cc.novoline.utils.fonts.holders.FontFamilySF_BOLD; + +import net.minecraft.client.gui.GuiCustomizeWorldScreenScreen; +import cc.novoline.utils.fonts.holders.FontFamilySF_REGULAR; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.MathHelper; +import net.minecraft.client.settings.KeyBinding; + +import cc.novoline.utils.fonts.api.FontFamily; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.InventoryEffectRenderer; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import net.skidunion.security.ProtectionSession; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +public class HUD extends AbstractModule { + private double cachedValue; + private FontFamily fontFamilyField; + @Property("name-hide-on-debug") + private BooleanProperty nameHideOnDebug; + private StencilBlurPass stencilBlurPassField; + @Property("watermark-background-type") + private StringProperty watermarkBackgroundType; + @Property("notification-style") + private StringProperty notificationStyle; + @Property("chat-roundness") + private DoubleProperty chatRoundness; + @Property("keybinds-pos-x") + private IntProperty keybindsPosX; + private int intValueField; + @Property("potions-blur") + private BooleanProperty potionsBlur; + private double cachedValue2; + private FontFamily fontFamilyField2; + @Property("notification-font") + private StringProperty notificationFont; + private Runnable runnableField; + private double cachedValue3; + @Property("module-list-y-position") + private IntProperty moduleListYPosition; + private List itemStackList; + private Dimension dimensionField; + private double cachedValue4; + @Property("potion-alpha") + private IntProperty potionAlpha; + @Property("ram-x-position") + private IntProperty ramXPosition; + @Property("client-font") + private StringProperty clientFont; + @Property("watermark-pos-y") + private DoubleProperty watermarkPosY; + private FontFamily fontFamilyField3; + @Property("tps-x-position") + private IntProperty tpsXPosition; + @Property("information-padding") + private DoubleProperty informationPadding; + @Property("chat-alpha") + private IntProperty chatAlpha; + private FontFamily fontFamilyField4; + @Property("armor-background-alpha") + private IntProperty armorBackgroundAlpha; + @Property("module-list-bar-aligment") + private StringProperty moduleListBarAligment; + @Property("show-hotbar-settings") + private BooleanProperty showHotbarSettings; + private TimerUtil timer; + private FontFamily fontFamilyField5; + @Property("font") + private StringProperty font; + @Property("armor-align") + private StringProperty armorAlign; + @Property("watermark-outline-width") + private FloatProperty watermarkOutlineWidth; + private double cachedValue5; + @Property("module-list-aligment") + private StringProperty moduleListAligment; + @Property("key-strokes-smoothness") + private IntProperty keyStrokesSmoothness; + @Property("hud-module-list") + private BooleanProperty hudModuleList; + private int stateTicks; + @Property("module-list-glow-radius") + private IntProperty moduleListGlowRadius; + @Property("key-strokes-pos-x") + private IntProperty keyStrokesPosX; + @Property("show-time") + private BooleanProperty showTime; + @Property("name-type") + private StringProperty nameType; + private boolean stateFlag; + private double cachedValue6; + @Property("armor-blur") + private BooleanProperty armorBlur; + @Property("chat-smoothness") + private IntProperty chatSmoothness; + private int stateTicks2; + @Property("armor-background-roundness") + private DoubleProperty armorBackgroundRoundness; + private FontFamily fontFamilyField6; + private int stateTicks3; + private FontFamily fontFamilyField7; + @Property("potion-icon") + private BooleanProperty potionIcon; + @Property("watermark-shaders") + private ListProperty watermarkShaders; + private FontFamily fontFamilyField8; + @Property("notification-show-delay") + private BooleanProperty notificationShowDelay; + @Property("tps-ram-blur") + private BooleanProperty tpsRamBlur; + @Property("name-scale") + private DoubleProperty nameScale; + @Property("hud-keybinds") + private BooleanProperty hudKeybinds; + @Property("module-list-shaders") + private ListProperty moduleListShaders; + private int stateTicks4; + private double cachedValue7; + private double cachedValue8; + @Property("keystrokes-blur") + private BooleanProperty keystrokesBlur; + @Property("potion-style") + private StringProperty potionStyle; + private List keystrokesButtonList; + @Property("name-glow-radius") + private IntProperty nameGlowRadius; + private List potionEffectList; + private boolean stateFlag2; + @Property("chat-size") + public IntProperty chatSize; + @Property("module-list-glow-alpha") + private IntProperty moduleListGlowAlpha; + @Property("watermark-name-color") + private StringProperty watermarkNameColor; + private boolean stateFlag3; + private int stateTicks5; + @Property("keybinds-blur") + private BooleanProperty keybindsBlur; + @Property("hud-keyStrokes") + private BooleanProperty hudKeyStrokes; + private int stateTicks6; + private double cachedValue9; + @Property("module-list-padding") + private DoubleProperty moduleListPadding; + @Property("hud-name") + private BooleanProperty hudName; + private double cachedValue10; + @Property("ram-y-position") + private IntProperty ramYPosition; + @Property("show-inventory-settings") + private BooleanProperty showInventorySettings; + @Property("inventory-animation") + private StringProperty inventoryAnimation; + @Property("name-position-x") + private IntProperty namePositionX; + @Property("tps-y-position") + private IntProperty tpsYPosition; + @Property("keybinds-smoothness") + private IntProperty keybindsSmoothness; + private double cachedValue11; + private boolean stateFlag4; + @Property("show-potion-settings") + private BooleanProperty showPotionSettings; + @Property("module-list-background-alpha") + private IntProperty moduleListBackgroundAlpha; + private static boolean stateFlag9; + @Property("font-outline") + private BooleanProperty fontOutline; + private FontFamily fontFamilyField9; + private List abstractModuleList; + @Property("notification-bg-color") + private StringProperty notificationBgColor; + @Property("hotbar-style") + private StringProperty hotbarStyle; + @Property("module-list-background") + private StringProperty moduleListBackground; + private int stateTicks7; + private static final long XOR_KEY = 139398327535342L; + @Property("key-strokes-radius") + private DoubleProperty keyStrokesRadius; + @Property("show-keybinds-settings") + private BooleanProperty showKeybindsSettings; + @Property("potion-length-sorting") + private BooleanProperty potionLengthSorting; + @Property("watermark-alpha") + private IntProperty watermarkAlpha; + @Property("potion-smoothness") + private IntProperty potionSmoothness; + private double cachedValue12; + private Runnable runnableField2; + @Property("armor-background-smoothness") + private IntProperty armorBackgroundSmoothness; + @Property("module-list-width-offset") + private DoubleProperty moduleListWidthOffset; + @Property("module-list-background-color") + private StringProperty moduleListBackgroundColor; + private double cachedValue13; + @Property("hotbar-smoothness") + private IntProperty hotbarSmoothness; + private String cachedText; + @Property("hotbar-alpha") + private IntProperty hotbarAlpha; + @Property("module-list-name-case") + private StringProperty moduleListNameCase; + private int stateTicks8; + private FontFamily fontFamilyField10; + @Property("potion-background") + private BooleanProperty potionBackground; + @Property("potions-y-position") + private IntProperty potionsYPosition; + @Property("fade-begin-color") + private ColorProperty fadeBeginColor; + @Property("show-version") + private BooleanProperty showVersion; + private int intState2; + @Property("watermark-roundess") + private IntProperty watermarkRoundess; + private FontFamily fontFamilyField11; + private int stateTicks9; + @Property("potions-x-position") + private IntProperty potionsXPosition; + @Property("name-font-size") + private IntProperty nameFontSize; + @Property("show-armor-settings") + private BooleanProperty showArmorSettings; + private int stateTicks10; + @Property("potion-roundness") + private DoubleProperty potionRoundness; + private FontFamily fontFamilyField12; + @Property("module-list-x-position") + private IntProperty moduleListXPosition; + private FontFamily fontFamilyField13; + @Property("hotbar-blur") + private BooleanProperty hotbarBlur; + private int stateTicks11; + private double cachedValue14; + @Property("armor-x-position") + private IntProperty armorXPosition; + @Property("show-name-settings") + private BooleanProperty showNameSettings; + @Property("module-list-glow-type") + private StringProperty moduleListGlowType; + @Property("watermark-pos-x") + private DoubleProperty watermarkPosX; + private FontFamily fontFamilyField14; + @Property("watermark-name-effect") + private StringProperty watermarkNameEffect; + private double cachedValue15; + @Property("hud-hotbar") + private BooleanProperty hudHotbar; + private FontFamily fontFamilyField15; + @Property("show-information-settings") + private BooleanProperty showInformationSettings; + @Property("show-notification-settings") + private BooleanProperty showNotificationSettings; + @Property("watermark-smoothness") + private IntProperty watermarkSmoothness; + @Property("keybinds-alpha") + private IntProperty keybindsAlpha; + @Property("notification-alpha") + private IntProperty notificationAlpha; + @Property("key-strokes-pos-y") + private IntProperty keyStrokesPosY; + private int stateTicks12; + @Property("armor-background") + private BooleanProperty armorBackground; + @Property("name-glow") + private BooleanProperty nameGlow; + @Property("module-list-name-height") + private DoubleProperty moduleListNameHeight; + private boolean stateFlag5; + private int stateTicks13; + @Property("module-list-suffixes") + private StringProperty moduleListSuffixes; + @Property("module-list-glow-mode") + private StringProperty moduleListGlowMode; + @Property("fade-end-color") + private ColorProperty fadeEndColor; + @Property("tps-ram-alpha") + private IntProperty tpsRamAlpha; + @Property("armor-y-position") + private IntProperty armorYPosition; + @Property("module-list-sorting") + private StringProperty moduleListSorting; + @Property("information-elements") + private ListProperty informationElements; + @Property("watermark-addons") + private ListProperty watermarkAddons; + @Property("show-keystrokes-settings") + private BooleanProperty showKeystrokesSettings; + private boolean stateFlag6; + private int stateTicks14; + @Property("color-effect") + private StringProperty colorEffect; + @Property("name-client-name") + private StringProperty nameClientName; + @Property("time-format") + private StringProperty timeFormat; + @Property("key-strokes-alpha") + private IntProperty keyStrokesAlpha; + @Property("notification-shader") + private ListProperty notificationShader; + private boolean stateFlag7; + @Property("watermark-style") + private StringProperty watermarkStyle; + @Property("notification-accent-color") + private StringProperty notificationAccentColor; + @Property("shadow-offset") + private static FloatProperty shadowOffset; + @Property("font-size") + private IntProperty fontSize; + private int stateTicks15; + @Property("name-position-y") + private IntProperty namePositionY; + @Property("keybinds-hide-on-debug") + private BooleanProperty keybindsHideOnDebug; + @Property("font-type") + private StringProperty fontType; + @Property("outline-width") + private FloatProperty outlineWidth; + @Property("modulelist-hide-on-debug") + private BooleanProperty modulelistHideOnDebug; + @Property("keybinds-pos-y") + private IntProperty keybindsPosY; + private boolean stateFlag8; + private List hudPotionEntryList; + @Property("chat-height") + private IntProperty chatHeight; + private FontFamily fontFamilyField16; + @Property("chat-font") + private StringProperty chatFont; + @Property("hud-information") + private BooleanProperty hudInformation; + private FontFamily fontFamilyField17; + @Property("name-glow-alpha") + private IntProperty nameGlowAlpha; + @Property("keybinds-bar-color") + private StringProperty keybindsBarColor; + @Property("keystrokes-hide-on-debug") + private BooleanProperty keystrokesHideOnDebug; + private double cachedValue16; + @Property("show-module-list-settings") + private BooleanProperty showModuleListSettings; + @Property("show-tps-ram-settings") + private BooleanProperty showTpsRamSettings; + @Property("color") + private ColorProperty color; + private StencilBlurPass stencilBlurPassField2; + private int stateTicks16; + private double cachedValue17; + @Property("show-chat-settings") + private BooleanProperty showChatSettings; + @Property("tpr-ram-smoothness") + private IntProperty tprRamSmoothness; + + private Boolean supplyBoolean() { + boolean flag = this.font.equals("Vanilla"); + flag = !flag; + + return flag; +} + + public StringProperty getNotificationAccentColor() { + return this.notificationAccentColor; +} + + public StringProperty getStringProperty10() { + return this.getNotificationAccentColor(); +} + + public ListProperty getNotificationShader() { + return this.notificationShader; +} + + public ListProperty getListPropertyR() { + return this.getNotificationShader(); +} + + private static void handleKeystrokesButton(KeystrokesButton keystrokesButton) { + List itemList = keystrokesButton.getKeystrokesRippleList(); + itemList.clear(); +} + + private Boolean supplyBoolean2() { + boolean flag; + label45: { + label47: { + Boolean propFlag = this.hudInformation.get(); + flag = propFlag; + if (!flag) { + break label47; + } + + BooleanProperty boolProp = this.showPotionSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label47; + } + + BooleanProperty boolProp2 = this.showInformationSettings; + propFlag = boolProp2.get(); + flag = propFlag; + + if (!flag) { + break label47; + } + + ListProperty listProp = this.informationElements; + flag = listProp.contains("Potions"); + + if (!flag) { + break label47; + } + + StringProperty strProp = this.potionStyle; + flag = strProp.equals("New"); + + if (flag) { + flag = true; + break label45; + } + } + + flag = false; + } + + return flag; +} + + @EventTarget + public void onShader(ShaderEvent event) { + boolean flag; + flag = this.isFlagX(); + { + if (flag) { + ListProperty listProp = this.moduleListShaders; + flag = listProp.contains("Blur"); + + if (flag) { + double doubleVal = MovementUtils.evaluateDouble(true); + List itemList = this.abstractModuleList; + Stream stream2 = itemList.stream(); + Predicate predicate = HUD::matchesAbstractModule; + Stream stream3 = stream2.filter(predicate); + Consumer consumer = (AbstractModule abstractModule2) -> { abstractModule2.handleRunnable(((java.lang.Runnable) () -> HUD.handleAbstractModule(abstractModule2))); }; + stream3.forEach(consumer); + MovementUtils.unscale(doubleVal); + } + } + + flag = this.isStateReady3(); + } + + if (flag) { + BooleanProperty boolProp = this.keybindsBlur; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + double doubleVal2 = MovementUtils.evaluateDouble(true); + IntProperty intProp = this.keybindsPosX; + Integer intVal = intProp.get(); + int intVal2 = intVal; + IntProperty intProp2 = this.keybindsPosY; + Integer intVal3 = intProp2.get(); + int intVal4 = intVal3; + double doubleVal3 = intVal2 - 3; + double doubleVal17 = intVal4 - 21.5; + double doubleVal18 = this.cachedValue8 + 1.0; + double doubleVal19 = this.cachedValue12 - 0.5; + int color2 = ColorTheme.BLACK.getStateTicks(); + RenderUtils.drawRect(doubleVal3, doubleVal17, doubleVal18, doubleVal19, color2); + MovementUtils.unscale(doubleVal2); + } + } + + flag = this.isStateReady2(); + + if (flag) { + StringProperty strProp = this.nameType; + String textStr = "Watermark"; + flag = strProp.equals(textStr); + + if (flag) { + StringProperty strProp2 = this.watermarkStyle; + textStr = "Basic"; + flag = strProp2.equals(textStr); + + if (flag) { + ListProperty listProp2 = this.watermarkShaders; + textStr = "Blur"; + flag = listProp2.contains(textStr); + + if (flag) { + double doubleVal4 = MovementUtils.evaluateDouble(true); + this.runnableField2.run(); + MovementUtils.unscale(doubleVal4); + } + } + } + } + + flag = this.isStateReady4(); + + if (flag) { + BooleanProperty boolProp2 = this.keystrokesBlur; + Boolean propFlag2 = boolProp2.get(); + flag = propFlag2; + + if (flag) { + double doubleVal5 = MovementUtils.evaluateDouble(true); + List itemList2 = this.keystrokesButtonList; + Consumer consumer2 = (KeystrokesButton keystrokesButton7) -> { keystrokesButton7.renderVisual(false, Color.BLACK); }; + itemList2.forEach(consumer2); + GL11.glScaled(1.0 / doubleVal5, 1.0 / doubleVal5, 1.0 / doubleVal5); + } + } + + BooleanProperty boolProp3 = this.hudHotbar; + Boolean propFlag3 = boolProp3.get(); + flag = propFlag3; + + if (flag) { + BooleanProperty boolProp4 = this.hotbarBlur; + Boolean propFlag4 = boolProp4.get(); + flag = propFlag4; + + if (flag) { + StringProperty strProp3 = this.hotbarStyle; + flag = strProp3.equals("Basic"); + + if (flag) { + ScaledResolution scaledRes = new ScaledResolution(this.mc); + double scaledWidthD = scaledRes.getScaledWidth() / 2; + double scaledHeightD = scaledRes.getScaledHeight(); + double doubleVal6 = scaledWidthD - 90.5; + double doubleVal20 = scaledHeightD - 22.5; + double doubleVal21 = scaledWidthD + 90.5; + ColorTheme colorTheme = ColorTheme.BLACK; + int intVal13 = colorTheme.getStateTicks(); + RenderUtils.drawRect(doubleVal6, doubleVal20, doubleVal21, scaledHeightD, intVal13); + } + } + } + + BooleanProperty boolProp5 = this.hudInformation; + Boolean propFlag5 = boolProp5.get(); + flag = propFlag5; + + if (flag) { + ListProperty listProp3 = this.informationElements; + flag = listProp3.contains("TPS"); + + if (flag) { + BooleanProperty boolProp6 = this.tpsRamBlur; + Boolean propFlag6 = boolProp6.get(); + flag = propFlag6; + + if (flag) { + IntProperty intProp3 = this.tpsXPosition; + Integer intVal5 = intProp3.get(); + int intVal6 = intVal5; + IntProperty intProp4 = this.tpsYPosition; + Integer intVal7 = intProp4.get(); + int intVal8 = intVal7; + double doubleVal7 = MovementUtils.evaluateDouble(true); + double doubleVal8 = 42.0; + double doubleVal9 = 47.0; + double doubleVal10 = intVal6; + double doubleVal22 = intVal8; + double doubleVal23 = intVal6 + doubleVal8; + double doubleVal24 = intVal8 + doubleVal9; + ColorTheme colorTheme2 = ColorTheme.BLACK; + int intVal14 = colorTheme2.getStateTicks(); + RenderUtils.drawRect(doubleVal10, doubleVal22, doubleVal23, doubleVal24, intVal14); + GL11.glScaled(1.0 / doubleVal7, 1.0 / doubleVal7, 1.0 / doubleVal7); + } + } + } + + BooleanProperty boolProp7 = this.hudInformation; + Boolean propFlag7 = boolProp7.get(); + flag = propFlag7; + + if (flag) { + ListProperty listProp4 = this.informationElements; + flag = listProp4.contains("RAM"); + + if (flag) { + BooleanProperty boolProp8 = this.tpsRamBlur; + Boolean propFlag8 = boolProp8.get(); + flag = propFlag8; + + if (flag) { + IntProperty intProp5 = this.ramXPosition; + Integer intVal9 = intProp5.get(); + int intVal10 = intVal9; + IntProperty intProp6 = this.ramYPosition; + Integer intVal11 = intProp6.get(); + int intVal12 = intVal11; + double doubleVal11 = MovementUtils.evaluateDouble(true); + double doubleVal12 = 42.0; + double doubleVal13 = 47.0; + double doubleVal14 = intVal10; + double doubleVal25 = intVal12; + double doubleVal26 = intVal10 + doubleVal12; + double doubleVal27 = intVal12 + doubleVal13; + ColorTheme colorTheme3 = ColorTheme.BLACK; + int intVal15 = colorTheme3.getStateTicks(); + RenderUtils.drawRect(doubleVal14, doubleVal25, doubleVal26, doubleVal27, intVal15); + MovementUtils.unscale(doubleVal11); + } + } + } + + BooleanProperty boolProp9 = this.hudInformation; + Boolean propFlag9 = boolProp9.get(); + flag = propFlag9; + + if (flag) { + ListProperty listProp5 = this.informationElements; + String textStr2 = "Potions"; + flag = listProp5.contains(textStr2); + + if (flag) { + StringProperty strProp4 = this.potionStyle; + textStr2 = "New"; + flag = strProp4.equals(textStr2); + + if (flag) { + BooleanProperty boolProp10 = this.potionBackground; + Boolean propFlag10 = boolProp10.get(); + flag = propFlag10; + + if (flag) { + BooleanProperty boolProp11 = this.potionsBlur; + propFlag10 = boolProp11.get(); + flag = propFlag10; + + if (flag) { + double doubleVal15 = MovementUtils.evaluateDouble(true); + List itemList3 = this.getListValue3(); + Consumer consumer3 = this::handlePotionEffect; + itemList3.forEach(consumer3); + MovementUtils.unscale(doubleVal15); + } + } + } + } + } + + BooleanProperty boolProp12 = this.hudInformation; + Boolean propFlag11 = boolProp12.get(); + flag = propFlag11; + + if (!flag) { + return; + } + + ListProperty listProp6 = this.informationElements; + flag = listProp6.contains("Armor"); + + if (!flag) { + return; + } + + BooleanProperty boolProp13 = this.armorBackground; + Boolean propFlag12 = boolProp13.get(); + flag = propFlag12; + + if (!flag) { + return; + } + + BooleanProperty boolProp14 = this.armorBlur; + Boolean propFlag13 = boolProp14.get(); + flag = propFlag13; + + + if (!flag) { + return; + } + + flag = true; + + + double doubleVal16 = MovementUtils.evaluateDouble(flag); + this.applyFlag(false, Color.BLACK); + MovementUtils.unscale(doubleVal16); +} + + private Boolean supplyBoolean3() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudKeybinds.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showKeybindsSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private Boolean supplyBoolean4() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudModuleList.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showModuleListSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + public double computeDoubleValue(int value) { + HUD hudMod = this; + + StringProperty strProp = this.font; + if (strProp.equals("Vanilla")) { + net.minecraft.client.gui.FontRenderer font2 = this.mc.fontRendererObj; + return font2.computeDouble(); + } + + hudMod = this; + + + FontRenderer font3 = hudMod.resolveFontRenderer(value); + return font3.getStateTicks6(); +} + + private Boolean supplyBoolean5() { + boolean flag; + label37: { + label39: { + Boolean propFlag = this.hudInformation.get(); + flag = propFlag; + if (!flag) { + break label39; + } + + BooleanProperty boolProp = this.showArmorSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label39; + } + + BooleanProperty boolProp2 = this.showInformationSettings; + propFlag = boolProp2.get(); + flag = propFlag; + + if (!flag) { + break label39; + } + + ListProperty listProp = this.informationElements; + flag = listProp.contains("Armor"); + + if (flag) { + flag = true; + break label37; + } + } + + flag = false; + } + + return flag; +} + + public int computeFontRendererInt(FontRenderer fontRenderer, String text) { + StringProperty strProp = this.font; + int intVal = (strProp.equals("Vanilla") ? 1 : 0); + if (intVal != 0) { + intVal = this.mc.fontRendererObj.getStringWidth(text); + } else { + intVal = fontRenderer.evaluateInt2(text); + } + + return intVal; +} + + private Boolean supplyBoolean6() { + boolean flag; + label29: { + label31: { + Boolean propFlag = this.hudInformation.get(); + flag = propFlag; + if (!flag) { + break label31; + } + + BooleanProperty boolProp = this.showInformationSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label31; + } + + ListProperty listProp = this.informationElements; + flag = listProp.contains("Armor"); + + if (flag) { + flag = true; + break label29; + } + } + + flag = false; + } + + return flag; +} + + private Boolean supplyBoolean7() { + boolean flag; + label45: { + label47: { + Boolean propFlag = this.hudInformation.get(); + flag = propFlag; + if (!flag) { + break label47; + } + + BooleanProperty boolProp = this.showArmorSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label47; + } + + BooleanProperty boolProp2 = this.showInformationSettings; + propFlag = boolProp2.get(); + flag = propFlag; + + if (!flag) { + break label47; + } + + ListProperty listProp = this.informationElements; + flag = listProp.contains("Armor"); + + if (!flag) { + break label47; + } + + BooleanProperty boolProp3 = this.armorBackground; + propFlag = boolProp3.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label45; + } + } + + flag = false; + } + + return flag; +} + + public void renderElement(String text, double value, double amount) { + byte byteVal = 0; + + for (char ch : text.toCharArray()) { + double doubleVal; + label20: { + String textStr = String.valueOf(ch); + long longVal = byteVal; + this.drawElement3(textStr, value, amount, ColorTheme.getHudColor(longVal)); + HUD hudMod = this; + StringProperty strProp = this.font; + if (strProp.equals("Vanilla")) { + net.minecraft.client.gui.FontRenderer font2 = this.mc.fontRendererObj; + doubleVal = font2.setUnicodeFlag(ch); + break label20; + } + + hudMod = this; + + FontRenderer font3 = hudMod.getA2mO(); + doubleVal = font3.evaluateInt2(ch); + } + + value += doubleVal; + byteVal -= 120; + + } +} + + private Boolean supplyBoolean8() { + boolean flag; + label29: { + label31: { + Boolean propFlag = this.hudName.get(); + flag = propFlag; + if (!flag) { + break label31; + } + + BooleanProperty boolProp = this.showNameSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label31; + } + + StringProperty strProp = this.nameType; + flag = strProp.equals("Watermark"); + + if (flag) { + flag = true; + break label29; + } + } + + flag = false; + } + + return flag; +} + + private String getString() { + String propStr = this.timeFormat.get(); + boolean flag = propStr.contains("12H"); + StringProperty strProp = this.timeFormat; + String propStr2 = strProp.get(); + boolean flag2 = propStr2.contains("Seconds"); + StringBuilder sb = new StringBuilder(); + String textStr = flag ? "hh" : "HH"; + StringBuilder sb2 = sb.append(textStr); + String textStr2 = ":mm"; + sb2 = sb2.append(textStr2); + textStr2 = flag2 ? ":ss" : ""; + + StringBuilder sb3 = sb2.append(textStr2); + String textStr3 = flag ? " a" : ""; + String textStr4 = sb3.append(textStr3).toString(); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat(textStr4); + long timeMs = System.currentTimeMillis(); + Long longVal = timeMs; + return simpleDateFormat.format(longVal); +} + + private Boolean supplyBoolean9() { + boolean flag; + label29: { + label31: { + Boolean propFlag = this.hudName.get(); + flag = propFlag; + if (!flag) { + break label31; + } + + BooleanProperty boolProp = this.showNameSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label31; + } + + StringProperty strProp = this.nameType; + flag = strProp.equals("Watermark"); + + if (!flag) { + flag = true; + break label29; + } + } + + flag = false; + } + + return flag; +} + + public void drawElement(FontRenderer fontRenderer, String text, double value, double amount, boolean flag, boolean enabled) { + byte byteVal = 0; + char[] charArr = text.toCharArray(); + int len = charArr.length; + int intVal = 0; + + while (intVal < len) { + double doubleVal; + label20: { + char ch = charArr[intVal]; + String textStr = String.valueOf(ch); + long longVal = byteVal; + this.drawElement(fontRenderer, textStr, value, amount, ColorTheme.getHudColor(longVal), flag); + StringProperty strProp = this.font; + textStr = "Vanilla"; + int intVal2 = (strProp.equals(textStr) ? 1 : 0); + if (intVal2 == 0) { + doubleVal = fontRenderer.evaluateInt2(ch); + break label20; + } + + net.minecraft.client.gui.FontRenderer font2 = this.mc.fontRendererObj; + intVal2 = font2.setUnicodeFlag(ch); + + doubleVal = intVal2; + } + + value += doubleVal; + byteVal -= 120; + intVal++; + + } +} + + public static boolean H() { + return stateFlag9; +} + + public void applyUpdate5(String text, double value, double amount, int index) { + HUD hudMod; + boolean flag = this.font.equals("Vanilla"); + if (flag) { + this.mc.fontRendererObj.resolveInt(text, value - this.evaluateInt(text) * 0.5, amount, index, true); + return; + } + + hudMod = this; + + BooleanProperty boolProp = this.fontOutline; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + FontRenderer font2 = this.getA2mO(); + double doubleVal = value - this.evaluateInt(text) * 0.5; + Float propFloat = this.outlineWidth.get(); + float floatVal = propFloat; + font2.drawElement5(text, doubleVal, amount, index, floatVal); + return; + } + + hudMod = this; + + FontRenderer font3 = hudMod.getA2mO(); + double doubleVal2 = value - this.evaluateInt(text) * 0.5; + font3.drawElement5(text, doubleVal2, amount, index, true); +} + + private Boolean supplyBoolean10() { + boolean flag; + label29: { + label28: { + label31: { + Boolean propFlag = this.showNotificationSettings.get(); + flag = propFlag; + if (!flag) { + break label31; + } + + StringProperty strProp = this.notificationStyle; + flag = strProp.equals("Basic"); + + if (flag) { + break label28; + } + + StringProperty strProp2 = this.notificationStyle; + flag = strProp2.equals("Old"); + + if (flag) { + break label28; + } + } + + flag = false; + break label29; + } + + flag = true; + } + + return flag; +} + + private Boolean supplyBoolean11() { + boolean flag; + label53: { + label55: { + Boolean propFlag = this.hudInformation.get(); + flag = propFlag; + if (!flag) { + break label55; + } + + BooleanProperty boolProp = this.showPotionSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label55; + } + + BooleanProperty boolProp2 = this.showInformationSettings; + propFlag = boolProp2.get(); + flag = propFlag; + + if (!flag) { + break label55; + } + + ListProperty listProp = this.informationElements; + flag = listProp.contains("Potions"); + + if (!flag) { + break label55; + } + + StringProperty strProp = this.potionStyle; + flag = strProp.equals("New"); + + if (!flag) { + break label55; + } + + BooleanProperty boolProp3 = this.potionBackground; + propFlag = boolProp3.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label53; + } + } + + flag = false; + } + + return flag; +} + + public HUD(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, long time, String text) { + super(moduleManager, enumModuleType, text); + time = XOR_KEY ^ time; + ItemStack[] stackArr = new ItemStack[]{ + new ItemStack(Items.diamond_sword), new ItemStack(Items.diamond_helmet), new ItemStack(Items.diamond_chestplate), new ItemStack(Items.diamond_leggings), new ItemStack(Items.diamond_boots) + }; + this.itemStackList = Lists.newArrayList(stackArr); + PotionEffect[] potionEffectArr = new PotionEffect[]{new PotionEffect(1, 4800), new PotionEffect(10, 4800), new PotionEffect(11, 4800), new PotionEffect(12, 4800)}; + this.potionEffectList = Lists.newArrayList(potionEffectArr); + this.dimensionField = Toolkit.getDefaultToolkit().getScreenSize(); + this.cachedValue14 = this.dimensionField.getWidth() * 0.5; + this.cachedValue15 = this.dimensionField.getHeight() * 0.5; + StringBuilder sb = new StringBuilder(); + String pathStr = this.novoline.getDataFolderString(); + StringBuilder sb2 = sb.append(pathStr); + this.cachedText = sb2.append("custom_font.novo").toString(); + this.fontFamilyField4 = FontFamilySF_REGULAR.FAMILY; + this.fontFamilyField13 = FontFamilySF_MEDIUM.FAMILY; + this.fontFamilyField3 = FontFamilySF_BOLD.FAMILY; + this.fontFamilyField2 = FontFamilyPOPPING_REGULAR.FAMILY; + this.fontFamilyField17 = FontFamilyPOPPING_MEDIUM.FAMILY; + this.fontFamilyField12 = FontFamilyPOPPING_BOLD.FAMILY; + this.fontFamilyField7 = FontFamilyVOLTE_REGULAR.FAMILY; + this.fontFamilyField11 = FontFamilyVOLTE_MEDIUM.FAMILY; + this.fontFamilyField = FontFamilyVOLTE_BOLD.FAMILY; + this.fontFamilyField8 = FontFamilyINTER_REGULAR.FAMILY; + this.fontFamilyField6 = FontFamilyINTER_MEDIUM.FAMILY; + this.fontFamilyField5 = FontFamilyINTER_BOLD.FAMILY; + this.fontFamilyField15 = FontFamilyJETBRAINS_REGULAR.FAMILY; + this.fontFamilyField14 = FontFamilyJETBRAINS_MEDIUM.FAMILY; + this.fontFamilyField10 = FontFamilyJETBRAINS_BOLD.FAMILY; + this.fontFamilyField16 = FontFamilyMINECRAFT.FAMILY; + boolean flag6 = Q(); + this.fontFamilyField9 = null; + StringProperty strProp = StringProperty.of("Client"); + String[] stringArr = new String[]{"Vanilla", "Client", "Custom"}; + this.font = strProp.acceptableValues(stringArr); + this.fontOutline = BooleanProperty.of(false); + this.outlineWidth = FloatProperty.of(1.5F).minimum(0.5F).maximum(1.5F); + StringProperty strProp2 = StringProperty.of("Poppin"); + String[] stringArr2 = new String[]{"Inter", "Volte", "Poppin", "Jetbrains", "San Francisco"}; + this.clientFont = strProp2.acceptableValues(stringArr2); + StringProperty strProp3 = StringProperty.of("Medium"); + String[] stringArr3 = new String[]{"Regular", "Medium", "Bold"}; + this.fontType = strProp3.acceptableValues(stringArr3); + this.fontSize = IntProperty.of(17).minimum(15).maximum(40); + StringProperty strProp4 = StringProperty.of("Fade"); + String[] stringArr4 = new String[]{"Fade", "Static", "Breath", "Rainbow", "Brightness"}; + this.colorEffect = strProp4.acceptableValues(stringArr4); + Color awtColor = new Color(0, 100, 255); + int color2 = awtColor.getRGB(); + Integer intVal = color2; + this.color = ColorProperty.e(intVal); + Color awtColor2 = new Color(-13790475); + int color3 = awtColor2.getRGB(); + Integer intVal2 = color3; + this.fadeBeginColor = ColorProperty.e(intVal2); + Color awtColor3 = new Color(-3126795); + int color4 = awtColor3.getRGB(); + Integer intVal3 = color4; + this.fadeEndColor = ColorProperty.e(intVal3); + this.hudName = BooleanProperty.of(true); + this.hudHotbar = BooleanProperty.of(true); + this.hudKeybinds = BooleanProperty.of(false); + this.hudKeyStrokes = BooleanProperty.of(false); + this.hudModuleList = BooleanProperty.of(true); + this.hudInformation = BooleanProperty.of(true); + this.nameClientName = StringProperty.of("Novoline"); + IntProperty intProp4 = IntProperty.of(5).minimum(1); + Integer intVal4 = ((int)this.cachedValue14); + this.namePositionX = intProp4.maximum(intVal4); + IntProperty intProp5 = IntProperty.of(6); + intVal4 = 1; + IntProperty intProp6 = intProp5.minimum(intVal4); + int intVal5 = (int)this.cachedValue15; + Integer intVal6 = intVal5; + this.namePositionY = intProp6.maximum(intVal6); + StringProperty strProp5 = StringProperty.of("Lower"); + String[] stringArr5 = new String[]{"Basic", "Lower", "Upper"}; + this.moduleListNameCase = strProp5.acceptableValues(stringArr5); + StringProperty strProp6 = StringProperty.of("Basic"); + String[] stringArr6 = new String[]{"None", "Basic", "Dash", "Bracket"}; + this.moduleListSuffixes = strProp6.acceptableValues(stringArr6); + this.moduleListPadding = DoubleProperty.of(4.5).minimum(0.0).maximum(7.0); + this.moduleListNameHeight = DoubleProperty.of(0.5).minimum(0.0).maximum(2.0); + StringProperty strProp7 = StringProperty.of("Right"); + String[] stringArr7 = new String[]{"Left", "Right"}; + this.moduleListAligment = strProp7.acceptableValues(stringArr7); + StringProperty strProp8 = StringProperty.of("Up"); + String[] stringArr8 = new String[]{"Up", "Down"}; + this.moduleListSorting = strProp8.acceptableValues(stringArr8); + StringProperty strProp9 = StringProperty.of("Stripe"); + String[] stringArr9 = new String[]{"None", "Basic", "Bar", "Stripe", "Outlined"}; + this.moduleListBackground = strProp9.acceptableValues(stringArr9); + StringProperty strProp10 = StringProperty.of("Both"); + String[] stringArr10 = new String[]{"Both", "Vertical", "Horizontal"}; + this.moduleListBarAligment = strProp10.acceptableValues(stringArr10); + StringProperty strProp11 = StringProperty.of("Dependant"); + String[] stringArr11 = new String[]{"Black", "Dependant"}; + this.moduleListBackgroundColor = strProp11.acceptableValues(stringArr11); + IntProperty intProp7 = IntProperty.of(50); + intVal6 = 50; + IntProperty intProp8 = intProp7.minimum(intVal6); + intVal6 = 255; + this.moduleListBackgroundAlpha = intProp8.maximum(intVal6); + int intVal7 = (int)this.cachedValue14 - 6; + Integer intVal8 = intVal7; + IntProperty intProp9 = IntProperty.of(intVal8); + intVal6 = 1; + IntProperty intProp10 = intProp9.minimum(intVal6); + int intVal9 = (int)this.cachedValue14; + Integer intVal10 = intVal9; + this.moduleListXPosition = intProp10.maximum(intVal10); + IntProperty intProp11 = IntProperty.of(12); + intVal10 = 1; + IntProperty intProp12 = intProp11.minimum(intVal10); + int intVal11 = (int)this.cachedValue15; + Integer intVal12 = intVal11; + this.moduleListYPosition = intProp12.maximum(intVal12); + ListProperty listProp = ListProperty.of("Coordinates", "UserInfo"); + String[] stringArr12 = new String[]{"Coordinates", "UserInfo", "FPS", "BPS", "Ping", "Potions", "Armor", "TPS", "RAM"}; + this.informationElements = listProp.acceptableValues((Object[])stringArr12); + this.informationPadding = DoubleProperty.of(2.0).minimum(0.0).maximum(4.0); + StringProperty strProp12 = StringProperty.of("Vanilla"); + String[] stringArr13 = new String[]{"Synced", "Vanilla"}; + this.chatFont = strProp12.acceptableValues(stringArr13); + IntProperty intProp13 = IntProperty.of(120); + intVal12 = 100; + IntProperty intProp14 = intProp13.minimum(intVal12); + intVal12 = 200; + this.chatAlpha = intProp14.maximum(intVal12); + this.chatRoundness = DoubleProperty.of(0.0).minimum(0.0).maximum(10.0); + IntProperty intProp15 = IntProperty.of(4); + intVal12 = 0; + IntProperty intProp16 = intProp15.minimum(intVal12); + intVal12 = 10; + this.chatSmoothness = intProp16.maximum(intVal12); + IntProperty intProp17 = IntProperty.of(0); + intVal12 = 0; + IntProperty intProp18 = intProp17.minimum(intVal12); + intVal12 = 60; + this.chatHeight = intProp18.maximum(intVal12); + IntProperty intProp19 = IntProperty.of(100); + intVal12 = 100; + IntProperty intProperty = intProp19.minimum(intVal12); + intVal12 = 300; + this.chatSize = intProperty.maximum(intVal12); + StringProperty strProp13 = StringProperty.of("None"); + String[] stringArr14 = new String[]{"None", "Slide", "Scale"}; + this.inventoryAnimation = strProp13.acceptableValues(stringArr14); + boolean flag = flag6; + IntProperty intProperty2 = IntProperty.of(10).minimum(1); + int intVal13 = (int)this.cachedValue14; + Integer intVal14 = intVal13; + this.keybindsPosX = intProperty2.maximum(intVal14); + int intVal15 = (int)this.cachedValue15 / 2; + Integer intVal16 = intVal15; + IntProperty intProperty3 = IntProperty.of(intVal16).minimum(1); + int intVal17 = (int)this.cachedValue15; + Integer intVal18 = intVal17; + this.keybindsPosY = intProperty3.maximum(intVal18); + StringProperty strProp14 = StringProperty.of("White"); + String[] stringArr15 = new String[]{"White", "Colored"}; + this.keybindsBarColor = strProp14.acceptableValues(stringArr15); + this.keybindsAlpha = IntProperty.of(100).minimum(100).maximum(200); + this.keybindsSmoothness = IntProperty.of(2).minimum(0).maximum(16); + this.keybindsBlur = BooleanProperty.of(false); + int intVal19 = (int)this.cachedValue14 / 4; + Integer intVal20 = intVal19; + IntProperty intProperty4 = IntProperty.of(intVal20).minimum(1); + int intVal21 = (int)this.cachedValue14; + Integer intVal22 = intVal21; + this.keyStrokesPosX = intProperty4.maximum(intVal22); + IntProperty intProperty5 = IntProperty.of(30).minimum(1); + int intVal23 = (int)this.cachedValue15; + Integer intVal24 = intVal23; + this.keyStrokesPosY = intProperty5.maximum(intVal24); + this.keyStrokesAlpha = IntProperty.of(100).minimum(100).maximum(200); + this.keyStrokesRadius = DoubleProperty.of(0.0).minimum(0.0).maximum(26.0); + this.keyStrokesSmoothness = IntProperty.of(2).minimum(0).maximum(8); + this.cachedValue11 = 26.0; + this.cachedValue5 = 28.0; + this.cachedValue2 = 26.0; + this.stencilBlurPassField = new StencilBlurPass(); + this.stencilBlurPassField2 = new StencilBlurPass(); + this.nameHideOnDebug = BooleanProperty.of(false); + this.modulelistHideOnDebug = BooleanProperty.of(false); + this.keybindsHideOnDebug = BooleanProperty.of(false); + this.keystrokesHideOnDebug = BooleanProperty.of(false); + IntProperty intProperty6 = IntProperty.of(250).minimum(1); + int intVal25 = (int)this.cachedValue14; + Integer intVal26 = intVal25; + this.tpsXPosition = intProperty6.maximum(intVal26); + int intVal27 = (int)this.cachedValue15 / 2; + Integer intVal28 = intVal27; + IntProperty intProperty7 = IntProperty.of(intVal28).minimum(1); + int intVal29 = (int)this.cachedValue15; + Integer intVal30 = intVal29; + this.tpsYPosition = intProperty7.maximum(intVal30); + IntProperty intProperty8 = IntProperty.of(200).minimum(1); + int intVal31 = (int)this.cachedValue14; + Integer intVal32 = intVal31; + this.ramXPosition = intProperty8.maximum(intVal32); + int intVal33 = (int)this.cachedValue15 / 2; + Integer intVal34 = intVal33; + IntProperty intProperty9 = IntProperty.of(intVal34).minimum(1); + int intVal35 = (int)this.cachedValue15; + Integer intVal36 = intVal35; + this.ramYPosition = intProperty9.maximum(intVal36); + this.tpsRamAlpha = IntProperty.of(120).maximum(200).minimum(100); + this.tprRamSmoothness = IntProperty.of(2).minimum(1).maximum(16); + StringProperty strProp15 = StringProperty.of("New"); + String[] stringArr16 = new String[]{"New", "Basic"}; + this.hotbarStyle = strProp15.acceptableValues(stringArr16); + StringProperty strProp16 = StringProperty.of("Old"); + String[] stringArr17 = new String[]{"Old", "Basic", "OnePlus"}; + this.notificationStyle = strProp16.acceptableValues(stringArr17); + StringProperty strProp17 = StringProperty.of("Default"); + String[] stringArr18 = new String[]{"Default", "Vanilla"}; + this.notificationFont = strProp17.acceptableValues(stringArr18); + StringProperty strProp18 = StringProperty.of("Synced"); + String[] stringArr19 = new String[]{"Type", "Synced"}; + this.notificationAccentColor = strProp18.acceptableValues(stringArr19); + StringProperty strProp19 = StringProperty.of("Black"); + String[] strArr = new String[]{"Grey", "Black"}; + this.notificationBgColor = strProp19.acceptableValues(strArr); + Integer intVal37 = 150; + IntProperty intProperty10 = IntProperty.of(intVal37); + Integer intVal38 = 50; + IntProperty intProperty11 = intProperty10.minimum(intVal38); + Integer intVal39 = 200; + this.notificationAlpha = intProperty11.maximum(intVal39); + ListProperty listProp2 = ListProperty.of("Blur"); + String[] strArr2 = new String[]{"Blur", "Shadow"}; + this.notificationShader = listProp2.acceptableValues((Object[])strArr2); + this.notificationShowDelay = BooleanProperty.of(false); + Integer intVal40 = 10; + IntProperty intProperty12 = IntProperty.of(intVal40); + Integer intVal41 = 1; + IntProperty intProperty13 = intProperty12.minimum(intVal41); + int intVal42 = (int)this.cachedValue14; + Integer intVal43 = intVal42; + this.potionsXPosition = intProperty13.maximum(intVal43); + int intVal44 = (int)this.cachedValue15 / 2; + Integer intVal45 = intVal44; + IntProperty intProperty14 = IntProperty.of(intVal45); + Integer intVal46 = 1; + IntProperty intProperty15 = intProperty14.minimum(intVal46); + int intVal47 = (int)this.cachedValue15; + Integer intVal48 = intVal47; + this.potionsYPosition = intProperty15.maximum(intVal48); + StringProperty stringProperty = StringProperty.of("Basic"); + String[] strArr3 = new String[]{"Basic", "New"}; + this.potionStyle = stringProperty.acceptableValues(strArr3); + this.potionBackground = BooleanProperty.of(true); + this.potionIcon = BooleanProperty.of(true); + Integer intVal49 = 100; + IntProperty intProperty16 = IntProperty.of(intVal49); + Integer intVal50 = 100; + IntProperty intProperty17 = intProperty16.minimum(intVal50); + Integer intVal51 = 200; + this.potionAlpha = intProperty17.maximum(intVal51); + Double doubleVal = 0.0; + DoubleProperty doubleProp11 = DoubleProperty.of(doubleVal); + Double doubleVal2 = 0.0; + DoubleProperty doubleProp12 = doubleProp11.minimum(doubleVal2); + Double doubleVal3 = 16.0; + this.potionRoundness = doubleProp12.maximum(doubleVal3); + Integer intVal52 = 2; + IntProperty intProperty18 = IntProperty.of(intVal52); + Integer intVal53 = 0; + IntProperty intProperty19 = intProperty18.minimum(intVal53); + Integer intVal54 = 16; + this.potionSmoothness = intProperty19.maximum(intVal54); + this.potionLengthSorting = BooleanProperty.of(true); + int intVal55 = (int)this.cachedValue14 / 2; + Integer intVal56 = intVal55; + IntProperty intProperty20 = IntProperty.of(intVal56); + Integer intVal57 = 1; + IntProperty intProperty21 = intProperty20.minimum(intVal57); + int intVal58 = (int)this.cachedValue14; + Integer intVal59 = intVal58; + this.armorXPosition = intProperty21.maximum(intVal59); + int intVal60 = (int)this.cachedValue15 - 35; + Integer intVal61 = intVal60; + IntProperty intProperty22 = IntProperty.of(intVal61); + Integer intVal62 = 1; + IntProperty intProperty23 = intProperty22.minimum(intVal62); + int intVal63 = (int)this.cachedValue15; + Integer intVal64 = intVal63; + this.armorYPosition = intProperty23.maximum(intVal64); + StringProperty stringProperty2 = StringProperty.of("Horizontal"); + String[] strArr4 = new String[]{"Horizontal", "Vertical"}; + this.armorAlign = stringProperty2.acceptableValues(strArr4); + Boolean flag2 = true; + this.armorBackground = BooleanProperty.of(flag2); + Integer intVal65 = 150; + IntProperty intProperty24 = IntProperty.of(intVal65); + Integer intVal66 = 100; + IntProperty intProperty25 = intProperty24.minimum(intVal66); + Integer intVal67 = 200; + this.armorBackgroundAlpha = intProperty25.maximum(intVal67); + Double doubleVal4 = 0.0; + DoubleProperty doubleProp13 = DoubleProperty.of(doubleVal4); + Double doubleVal5 = 0.0; + DoubleProperty doubleProp14 = doubleProp13.minimum(doubleVal5); + Double doubleVal6 = 12.0; + this.armorBackgroundRoundness = doubleProp14.maximum(doubleVal6); + Integer intVal68 = 6; + IntProperty intProperty26 = IntProperty.of(intVal68); + Integer intVal69 = 0; + IntProperty intProperty27 = intProperty26.minimum(intVal69); + Integer intVal70 = 16; + this.armorBackgroundSmoothness = intProperty27.maximum(intVal70); + Integer intVal71 = 100; + IntProperty intProperty28 = IntProperty.of(intVal71); + Integer intVal72 = 100; + IntProperty intProperty29 = intProperty28.minimum(intVal72); + Integer intVal73 = 200; + this.hotbarAlpha = intProperty29.maximum(intVal73); + Integer intVal74 = 2; + IntProperty intProperty30 = IntProperty.of(intVal74); + Integer intVal75 = 0; + IntProperty intProperty31 = intProperty30.minimum(intVal75); + Integer intVal76 = 8; + this.hotbarSmoothness = intProperty31.maximum(intVal76); + this.showNameSettings = BooleanProperty.of(true); + this.showModuleListSettings = BooleanProperty.of(true); + this.showInformationSettings = BooleanProperty.of(true); + this.showPotionSettings = BooleanProperty.of(true); + this.showArmorSettings = BooleanProperty.of(true); + this.showTpsRamSettings = BooleanProperty.of(true); + this.showHotbarSettings = BooleanProperty.of(true); + this.showNotificationSettings = BooleanProperty.of(true); + this.showChatSettings = BooleanProperty.of(true); + this.showInventorySettings = BooleanProperty.of(true); + this.showKeybindsSettings = BooleanProperty.of(true); + this.showKeystrokesSettings = BooleanProperty.of(true); + this.keystrokesBlur = BooleanProperty.of(false); + this.hotbarBlur = BooleanProperty.of(false); + this.tpsRamBlur = BooleanProperty.of(false); + this.potionsBlur = BooleanProperty.of(false); + this.armorBlur = BooleanProperty.of(false); + Double doubleVal7 = 0.5; + DoubleProperty doubleProp15 = DoubleProperty.of(doubleVal7); + Double doubleVal8 = 0.0; + DoubleProperty doubleProp16 = doubleProp15.minimum(doubleVal8); + Double doubleVal9 = 3.0; + this.moduleListWidthOffset = doubleProp16.maximum(doubleVal9); + ListProperty listProp3 = ListProperty.of("Blur"); + String[] strArr5 = new String[]{"Glow", "Blur"}; + this.moduleListShaders = listProp3.acceptableValues((Object[])strArr5); + StringProperty stringProperty3 = StringProperty.of("Background"); + String[] strArr6 = new String[]{"Font", "Background"}; + this.moduleListGlowMode = stringProperty3.acceptableValues(strArr6); + StringProperty stringProperty4 = StringProperty.of("Colorful"); + String[] strArr7 = new String[]{"Colorful", "Shadow"}; + this.moduleListGlowType = stringProperty4.acceptableValues(strArr7); + Integer intVal77 = 5; + IntProperty intProperty32 = IntProperty.of(intVal77); + Integer intVal78 = 5; + IntProperty intProperty33 = intProperty32.minimum(intVal78); + Integer intVal79 = 25; + this.moduleListGlowRadius = intProperty33.maximum(intVal79); + Integer intVal80 = 180; + IntProperty intProperty34 = IntProperty.of(intVal80); + Integer intVal81 = 50; + IntProperty intProperty35 = intProperty34.minimum(intVal81); + Integer intVal82 = 255; + this.moduleListGlowAlpha = intProperty35.maximum(intVal82); + Integer intVal83 = 22; + IntProperty intProperty36 = IntProperty.of(intVal83); + Integer intVal84 = 18; + IntProperty intProperty37 = intProperty36.minimum(intVal84); + Integer intVal85 = 40; + this.nameFontSize = intProperty37.maximum(intVal85); + Double doubleVal10 = 1.0; + DoubleProperty doubleProp17 = DoubleProperty.of(doubleVal10); + Double doubleVal11 = 1.0; + DoubleProperty doubleProp18 = doubleProp17.minimum(doubleVal11); + Double doubleVal12 = 3.0; + this.nameScale = doubleProp18.maximum(doubleVal12); + StringProperty stringProperty5 = StringProperty.of("Watermark"); + String[] strArr8 = new String[]{"Basic", "Old", "Watermark"}; + this.nameType = stringProperty5.acceptableValues(strArr8); + Boolean flag3 = true; + this.showVersion = BooleanProperty.of(flag3); + Boolean flag4 = true; + this.showTime = BooleanProperty.of(flag4); + StringProperty stringProperty6 = StringProperty.of("24H"); + String[] strArr9 = new String[]{"12H", "24H", "12H, Seconds", "24H, Seconds"}; + this.timeFormat = stringProperty6.acceptableValues(strArr9); + this.nameGlow = BooleanProperty.of(false); + Integer intVal86 = 12; + IntProperty intProperty38 = IntProperty.of(intVal86); + Integer intVal87 = 5; + IntProperty intProperty39 = intProperty38.minimum(intVal87); + Integer intVal88 = 20; + this.nameGlowRadius = intProperty39.maximum(intVal88); + Integer intVal89 = 160; + IntProperty intProperty40 = IntProperty.of(intVal89); + Integer intVal90 = 50; + IntProperty intProperty41 = intProperty40.minimum(intVal90); + Integer intVal91 = 255; + this.nameGlowAlpha = intProperty41.maximum(intVal91); + Double doubleVal13 = 6.0; + DoubleProperty doubleProp19 = DoubleProperty.of(doubleVal13); + Double doubleVal14 = 0.0; + DoubleProperty doubleProperty = doubleProp19.minimum(doubleVal14); + double doubleVal15 = this.cachedValue14; + Double doubleVal16 = doubleVal15; + this.watermarkPosX = doubleProperty.maximum(doubleVal16); + Double doubleVal17 = 6.0; + DoubleProperty doubleProperty2 = DoubleProperty.of(doubleVal17); + Double doubleVal18 = 0.0; + DoubleProperty doubleProperty3 = doubleProperty2.minimum(doubleVal18); + double doubleVal19 = this.cachedValue15; + Double doubleVal20 = doubleVal19; + this.watermarkPosY = doubleProperty3.maximum(doubleVal20); + String[] strArr10 = new String[]{"Version", "Username", "Ping", "Server"}; + ListProperty listProp4 = ListProperty.of(strArr10); + String[] strArr11 = new String[]{"Version", "Username", "FPS", "Ping", "Server", "Time"}; + this.watermarkAddons = listProp4.acceptableValues((Object[])strArr11); + StringProperty stringProperty7 = StringProperty.of("Neverlose"); + String[] strArr12 = new String[]{"Basic", "Neverlose"}; + this.watermarkStyle = stringProperty7.acceptableValues(strArr12); + StringProperty stringProperty8 = StringProperty.of("Basic"); + String[] strArr13 = new String[]{"Bar", "Basic", "Outlined"}; + this.watermarkBackgroundType = stringProperty8.acceptableValues(strArr13); + Integer intVal92 = 180; + IntProperty intProperty42 = IntProperty.of(intVal92); + Integer intVal93 = 50; + IntProperty intProperty43 = intProperty42.minimum(intVal93); + Integer intVal94 = 255; + this.watermarkAlpha = intProperty43.maximum(intVal94); + Integer intVal95 = 0; + IntProperty intProperty44 = IntProperty.of(intVal95); + Integer intVal96 = 0; + IntProperty intProperty45 = intProperty44.minimum(intVal96); + Integer intVal97 = 12; + this.watermarkRoundess = intProperty45.maximum(intVal97); + Integer intVal98 = 6; + IntProperty intProperty46 = IntProperty.of(intVal98); + Integer intVal99 = 0; + IntProperty intProperty47 = intProperty46.minimum(intVal99); + Integer intVal100 = 12; + this.watermarkSmoothness = intProperty47.maximum(intVal100); + Float floatVal = 2.0F; + FloatProperty floatProp3 = FloatProperty.of(floatVal); + FloatProperty floatProp4 = floatProp3.minimum(2.0F); + this.watermarkOutlineWidth = floatProp4.maximum(4.0F); + ListProperty listProp5 = ListProperty.of("Glow"); + String[] strArr14 = new String[]{"Blur", "Glow"}; + this.watermarkShaders = listProp5.acceptableValues((Object[])strArr14); + StringProperty stringProperty9 = StringProperty.of("White"); + String[] strArr15 = new String[]{"White", "Synced"}; + this.watermarkNameColor = stringProperty9.acceptableValues(strArr15); + StringProperty stringProperty10 = StringProperty.of("Glitch"); + String[] strArr16 = new String[]{"Glow", "Glitch", "None"}; + this.watermarkNameEffect = stringProperty10.acceptableValues(strArr16); + this.timer = new TimerUtil(); + this.abstractModuleList = new ArrayList<>(); + HudPotionEntry[] hudPotionEntryArr = new HudPotionEntry[]{ + new HudPotionEntry(this, 0), + new HudPotionEntry(this, 1), + new HudPotionEntry(this, 2), + new HudPotionEntry(this, 3), + new HudPotionEntry(this, 4), + new HudPotionEntry(this, 5), + new HudPotionEntry(this, 6), + new HudPotionEntry(this, 7), + new HudPotionEntry(this, 8) + }; + this.hudPotionEntryList = Lists.newArrayList(hudPotionEntryArr); + this.keystrokesButtonList = new ArrayList<>(); + Setting setting = new Setting("HUD_FONT_REPOSITORY", "Font Repository", SettingType.BUTTON, this, this::lambdaImpl$new$0); + SettingManager.register(setting); + Setting setting2 = new Setting("HUD_FONT_SEPARATOR", "Font Settings", SettingType.SEPARATOR, this); + SettingManager.register(setting2); + Setting setting3 = new Setting("HUD_FONT", "Font", SettingType.COMBOBOX, this, this.font); + SettingManager.register(setting3); + Setting setting4 = new Setting("HUD_FONT_CLIENT", "Client Font", SettingType.COMBOBOX, this, this.clientFont, () -> this.font.equals("Client")); + SettingManager.register(setting4); + Setting setting5 = new Setting("HUD_FONT_TYPE", "Font Type", SettingType.COMBOBOX, this, this.fontType, () -> this.font.equals("Client")); + SettingManager.register(setting5); + Setting setting6 = new Setting("HUD_FONT_SIZE", "Font Size", SettingType.SLIDER, this, this.fontSize, 1.0, this::supplyBoolean); + SettingManager.register(setting6); + Setting setting7 = new Setting("HUD_FONT_SHADOW_OFFSET", "Shadow Offset", SettingType.SLIDER, this, shadowOffset, 0.1, this::supplyBoolean27); + SettingManager.register(setting7); + Setting setting8 = new Setting("HUD_FONT_OUTLINE", "Font Outline", SettingType.CHECKBOX, this, this.fontOutline, this::supplyBoolean61); + SettingManager.register(setting8); + Setting setting9 = new Setting("HUD_FONT_OUTLINE_WIDTH", "Outline Width", SettingType.SLIDER, this, this.outlineWidth, 0.1, this::supplyBoolean48); + SettingManager.register(setting9); + Setting setting10 = new Setting("HUD_COLOR_SEPARATOR", "Color Settings", SettingType.SEPARATOR, this); + SettingManager.register(setting10); + Setting setting11 = new Setting("HUD_COLOR_EFFECT", "Color Effect", SettingType.COMBOBOX, this, this.colorEffect); + SettingManager.register(setting11); + Setting setting12 = new Setting("HUD_COLOR", "Color", SettingType.COLOR_PICKER, this, this.color, null, this::supplyBoolean79); + SettingManager.register(setting12); + Setting setting13 = new Setting("HUD_FADE_BEGIN_COLOR", "Fade Begin Color", SettingType.COLOR_PICKER, this, this.fadeBeginColor, null, () -> this.colorEffect.equals("Fade")); + SettingManager.register(setting13); + Setting setting14 = new Setting("HUD_FADE_END_COLOR", "Fade End Color", SettingType.COLOR_PICKER, this, this.fadeEndColor, null, () -> this.colorEffect.equals("Fade")); + SettingManager.register(setting14); + Setting setting15 = new Setting("HUD_ELEMENTS", "Elements", SettingType.SEPARATOR, this); + SettingManager.register(setting15); + Setting setting16 = new Setting("HUD_NAME", "Name", SettingType.CHECKBOX, this, this.hudName); + SettingManager.register(setting16); + Setting setting17 = new Setting("HUD_HOTBAR", "Hotbar", SettingType.CHECKBOX, this, this.hudHotbar); + SettingManager.register(setting17); + Setting setting18 = new Setting("HUD_KEYBINDS", "Keybinds", SettingType.CHECKBOX, this, this.hudKeybinds); + SettingManager.register(setting18); + Setting setting19 = new Setting("HUD_KEYSTROKES", "KeyStrokes", SettingType.CHECKBOX, this, this.hudKeyStrokes); + SettingManager.register(setting19); + Setting setting20 = new Setting("HUD_MODULE_LIST", "ModuleList", SettingType.CHECKBOX, this, this.hudModuleList); + SettingManager.register(setting20); + Setting setting21 = new Setting("HUD_INFORMATION", "Information", SettingType.CHECKBOX, this, this.hudInformation); + SettingManager.register(setting21); + Setting setting22 = new Setting("HUD_NAME_SEPARATOR", "Name Settings", this, this.showNameSettings, () -> this.hudName.get()); + SettingManager.register(setting22); + Setting setting23 = new Setting("HUD_NAME_CLIENT_NAME", "Client Name", SettingType.TEXTBOX, this, "Client Name", this.nameClientName, this::supplyBoolean65); + SettingManager.register(setting23); + Setting setting24 = new Setting("HUD_NAME_FONT_SIZE", "Font Size", SettingType.SLIDER, this, this.nameFontSize, 2.0, this::supplyBoolean25); + SettingManager.register(setting24); + Setting setting25 = new Setting("HUD_NAME_SCALE", "Scale", SettingType.SLIDER, this, this.nameScale, 0.5, this::supplyBoolean18); + SettingManager.register(setting25); + Setting setting26 = new Setting("HUD_NAME_TYPE", "Name Type", SettingType.COMBOBOX, this, this.nameType, this::supplyBoolean81); + SettingManager.register(setting26); + Setting setting27 = new Setting("HUD_WATERMARK_ADDONS", "Addons", SettingType.SELECTBOX, this, this.watermarkAddons, this::supplyBoolean31); + SettingManager.register(setting27); + Setting setting28 = new Setting("HUD_NAME_SHOW_VERSION", "Show Version", SettingType.CHECKBOX, this, this.showVersion, this::supplyBoolean59); + SettingManager.register(setting28); + Setting setting29 = new Setting("HUD_NAME_SHOW_TIME", "Show Time", SettingType.CHECKBOX, this, this.showTime, this::supplyBoolean9); + SettingManager.register(setting29); + Setting setting30 = new Setting("HUD_NAME_TIME_FORMAT", "Time Format", SettingType.COMBOBOX, this, this.timeFormat, this::supplyBoolean57); + SettingManager.register(setting30); + Setting setting31 = new Setting("HUD_NAME_WATERMARK_STYLE", "Style", SettingType.COMBOBOX, this, this.watermarkStyle, this::supplyBoolean8); + SettingManager.register(setting31); + Setting setting32 = new Setting("HUD_WATERMARK_BACKGROUND_TYPE", "Background Type", SettingType.COMBOBOX, this, this.watermarkBackgroundType, this::supplyBoolean35); + SettingManager.register(setting32); + Setting setting33 = new Setting("HUD_WATERMARK_ALPHA", "Background Alpha", SettingType.SLIDER, this, this.watermarkAlpha, 5.0, this::supplyBoolean22); + SettingManager.register(setting33); + Setting setting34 = new Setting("HUD_WATERMARK_ROUNDNESS", "Roundness", SettingType.SLIDER, this, this.watermarkRoundess, 1.0, this::supplyBoolean16); + SettingManager.register(setting34); + Setting setting35 = new Setting("HUD_WATERMARK_OUTLINE_WIDTH", "Outline Width", SettingType.SLIDER, this, this.watermarkOutlineWidth, 0.1, this::supplyBoolean74); + SettingManager.register(setting35); + Setting setting36 = new Setting("HUD_WATERMARK_SMOOTHNESS", "Smoothness", SettingType.SLIDER, this, this.watermarkSmoothness, 1.0, this::supplyBoolean66); + SettingManager.register(setting36); + Setting setting37 = new Setting("HUD_WATERMARK_SHADERS", "Shaders", SettingType.SELECTBOX, this, this.watermarkShaders, this::supplyBoolean19); + SettingManager.register(setting37); + Setting setting38 = new Setting("HUD_WATERMARK_NAME_COLOR", "Name Color", SettingType.COMBOBOX, this, this.watermarkNameColor, this::supplyBoolean70); + SettingManager.register(setting38); + Setting setting39 = new Setting("HUD_WATERMARK_NAME_EFFECT", "Name Effect", SettingType.COMBOBOX, this, this.watermarkNameEffect, this::supplyBoolean45); + SettingManager.register(setting39); + Setting setting40 = new Setting("HUD_NAME_GLOW", "Glow", SettingType.CHECKBOX, this, this.nameGlow, this::supplyBoolean47); + SettingManager.register(setting40); + Setting setting41 = new Setting("HUD_NAME_GLOW_RADIUS", "Glow Radius", SettingType.SLIDER, this, this.nameGlowRadius, 1.0, this::supplyBoolean76); + SettingManager.register(setting41); + Setting setting42 = new Setting("HUD_NAME_GLOW_ALPHA", "Glow Alpha", SettingType.SLIDER, this, this.nameGlowAlpha, 5.0, this::supplyBoolean72); + SettingManager.register(setting42); + Setting setting43 = new Setting("HUD_NAME_HIDE_ON_DEBUG", "F3 Hide", SettingType.CHECKBOX, this, this.nameHideOnDebug, this::supplyBoolean71); + SettingManager.register(setting43); + Setting setting44 = new Setting("HUD_MODULELIST_SEPARATOR", "ModuleList Settings", this, this.showModuleListSettings, () -> this.hudModuleList.get()); + SettingManager.register(setting44); + Setting setting45 = new Setting("HUD_MODULE_LIST_NAME_CASE", "Names Case", SettingType.COMBOBOX, this, this.moduleListNameCase, this::supplyBoolean60); + SettingManager.register(setting45); + Setting setting46 = new Setting("HUD_MODULE_LIST_SUFFIXES", "Suffixes Style", SettingType.COMBOBOX, this, this.moduleListSuffixes, this::supplyBoolean14); + SettingManager.register(setting46); + Setting setting47 = new Setting("HUD_MODULE_LIST_PADDING", "Padding", SettingType.SLIDER, this, this.moduleListPadding, 0.5, this::supplyBoolean4); + SettingManager.register(setting47); + Setting setting48 = new Setting("HUD_MODULE_LIST_LINE_OFFSET", "Line Offset", SettingType.SLIDER, this, this.moduleListNameHeight, 0.05, this::supplyBoolean15); + SettingManager.register(setting48); + Setting setting49 = new Setting("HUD_MODULE_LIST_ALIGMENT", "Align", SettingType.COMBOBOX, this, this.moduleListAligment, this::supplyBoolean24); + SettingManager.register(setting49); + Setting setting50 = new Setting("HUD_MODULE_LIST_SORTING", "Sorting", SettingType.COMBOBOX, this, this.moduleListSorting, this::supplyBoolean67); + SettingManager.register(setting50); + Setting setting51 = new Setting("HUD_MODULE_LIST_BACKGROUND", "Background Type", SettingType.COMBOBOX, this, this.moduleListBackground, this::supplyBoolean64); + SettingManager.register(setting51); + Setting setting52 = new Setting("HUD_MODULE_LIST_BACKGROUND_BAR_ALIGMENT", "Bar Align", SettingType.COMBOBOX, this, this.moduleListBarAligment, this::supplyBoolean50); + SettingManager.register(setting52); + Setting setting53 = new Setting("HUD_MODULE_LIST_BACKGROUND_COLOR", "Background Color", SettingType.COMBOBOX, this, this.moduleListBackgroundColor, this::supplyBoolean75); + SettingManager.register(setting53); + Setting setting54 = new Setting("HUD_MODULE_LIST_SIDE_OFFSETS", "Side Offsets", SettingType.SLIDER, this, this.moduleListWidthOffset, 0.1, this::supplyBoolean83); + SettingManager.register(setting54); + Setting setting55 = new Setting("HUD_MODULE_LIST_BACKGROUND_ALPHA", "Background Alpha", SettingType.SLIDER, this, this.moduleListBackgroundAlpha, 5.0, this::supplyBoolean42); + SettingManager.register(setting55); + Setting setting56 = new Setting("HUD_MODULE_LIST_SHADERS", "Shaders", SettingType.SELECTBOX, this, this.moduleListShaders, this::supplyBoolean82); + SettingManager.register(setting56); + Setting setting57 = new Setting("HUD_MODULE_LIST_GLOW_MODE", "Glow Mode", SettingType.COMBOBOX, this, this.moduleListGlowMode, this::supplyBoolean13); + SettingManager.register(setting57); + Setting setting58 = new Setting("HUD_MODULE_LIST_GLOW_TYPE", "Glow Type", SettingType.COMBOBOX, this, this.moduleListGlowType, this::supplyBoolean69); + SettingManager.register(setting58); + Setting setting59 = new Setting("HUD_MODULE_LIST_GLOW_RADIUS", "Glow Radius", SettingType.SLIDER, this, this.moduleListGlowRadius, 1.0, this::supplyBoolean40); + SettingManager.register(setting59); + Setting setting60 = new Setting("HUD_MODULE_LIST_GLOW_ALPHA", "Glow Alpha", SettingType.SLIDER, this, this.moduleListGlowAlpha, 5.0, this::supplyBoolean26); + SettingManager.register(setting60); + Setting setting61 = new Setting("HUD_MODULE_LIST_HIDE_ON_DEBUG", "F3 Hide", SettingType.CHECKBOX, this, this.modulelistHideOnDebug, this::supplyBoolean52); + SettingManager.register(setting61); + Setting setting62 = new Setting("HUD_INFORMATION_SEPARATOR", "Information Settings", this, this.showInformationSettings, () -> this.hudInformation.get()); + SettingManager.register(setting62); + Setting setting63 = new Setting("HUD_INFORMATION_ELEMENTS", "Elements", SettingType.SELECTBOX, this, this.informationElements, this::supplyBoolean12); + SettingManager.register(setting63); + Setting setting64 = new Setting("HUD_INFORMATION_PADDING", "Padding", SettingType.SLIDER, this, this.informationPadding, 0.1, this::supplyBoolean17); + SettingManager.register(setting64); + Setting setting65 = new Setting("HUD_INFORMATION_POTION_SEPARATOR", "Potions Settings", this, this.showPotionSettings, this::supplyBoolean80); + SettingManager.register(setting65); + Setting setting66 = new Setting("HUD_INFORMATION_POTION_STYLE", "Style", SettingType.COMBOBOX, this, this.potionStyle, this::supplyBoolean62); + SettingManager.register(setting66); + Setting setting67 = new Setting("HUD_INFORMATION_POTION_ICONS", "Icons", SettingType.CHECKBOX, this, this.potionIcon, this::supplyBoolean28); + SettingManager.register(setting67); + Setting setting68 = new Setting("HUD_INFORMATION_POTION_BACKGROUND", "Background", SettingType.CHECKBOX, this, this.potionBackground, this::supplyBoolean56); + SettingManager.register(setting68); + Setting setting69 = new Setting("HUD_INFORMATION_POTION_ALPHA", "Alpha", SettingType.SLIDER, this, this.potionAlpha, 5.0, this::supplyBoolean55); + SettingManager.register(setting69); + Setting setting70 = new Setting("HUD_INFORMATION_POTION_ROUNDNESS", "Roundness", SettingType.SLIDER, this, this.potionRoundness, 1.0, this::supplyBoolean51); + SettingManager.register(setting70); + Setting setting71 = new Setting("HUD_INFORMATION_POTION_SMOOTHNESS", "Smoothness", SettingType.SLIDER, this, this.potionSmoothness, 1.0, this::supplyBoolean11); + SettingManager.register(setting71); + Setting setting72 = new Setting("HUD_INFORMATION_POTION_LENGTH_SORT", "Length Sorting", SettingType.CHECKBOX, this, this.potionLengthSorting, this::supplyBoolean53); + SettingManager.register(setting72); + Setting setting73 = new Setting("HUD_INFORMATION_POTION_BLUR", "Blur", SettingType.CHECKBOX, this, this.potionsBlur, this::supplyBoolean2); + SettingManager.register(setting73); + Setting setting74 = new Setting("HUD_INFORMATION_ARMOR_SEPARATOR", "Armor Settings", this, this.showArmorSettings, this::supplyBoolean6); + SettingManager.register(setting74); + Setting setting75 = new Setting("HUD_INFORMATION_ARMOR_ALIGN", "Aligment", SettingType.COMBOBOX, this, this.armorAlign, this::supplyBoolean5); + SettingManager.register(setting75); + Setting setting76 = new Setting("HUD_INFORMATION_ARMOR_BACKGROUND", "Background", SettingType.CHECKBOX, this, this.armorBackground, this::supplyBoolean36); + SettingManager.register(setting76); + Setting setting77 = new Setting("HUD_INFORMATION_ARMOR_ALPHA", "Alpha", SettingType.SLIDER, this, this.armorBackgroundAlpha, 5.0, this::supplyBoolean23); + SettingManager.register(setting77); + Setting setting78 = new Setting("HUD_INFORMATION_ARMOR_ROUNDNESS", "Roundness", SettingType.SLIDER, this, this.armorBackgroundRoundness, 1.0, this::supplyBoolean37); + SettingManager.register(setting78); + Setting setting79 = new Setting("HUD_INFORMATION_ARMOR_SMOOTHNESS", "Smoothness", SettingType.SLIDER, this, this.armorBackgroundSmoothness, 1.0, this::supplyBoolean41); + SettingManager.register(setting79); + Setting setting80 = new Setting("HUD_INFORMATION_ARMOR_BLUR", "Blur", SettingType.CHECKBOX, this, this.armorBlur, this::supplyBoolean7); + SettingManager.register(setting80); + Setting setting81 = new Setting("HUD_INFORMATION_TPS_RAM_SETTINGS", "TPS/RAM Settings", this, this.showTpsRamSettings, this::supplyBoolean63); + SettingManager.register(setting81); + Setting setting82 = new Setting("HUD_INFORMATION_TPS_RAM_ALPHA", "Alpha", SettingType.SLIDER, this, this.tpsRamAlpha, 5.0, this::supplyBoolean58); + SettingManager.register(setting82); + Setting setting83 = new Setting("HUD_INFORMATION_TPS_RAM_SMOOTHNESS", "Smoothness", SettingType.SLIDER, this, this.tprRamSmoothness, 1.0, this::supplyBoolean43); + SettingManager.register(setting83); + Setting setting84 = new Setting("HUD_INFORMATION_TPS_RAM_BLUR", "Blur", SettingType.CHECKBOX, this, this.tpsRamBlur, this::supplyBoolean85); + SettingManager.register(setting84); + Setting setting85 = new Setting("HUD_KEYBNINDS_SEPARATOR", "Keybinds Settings", this, this.showKeybindsSettings, () -> this.hudKeybinds.get()); + SettingManager.register(setting85); + Setting setting86 = new Setting("HUD_KEYBINDS_BAR_COLOR", "Bar Color", SettingType.COMBOBOX, this, this.keybindsBarColor, this::supplyBoolean77); + SettingManager.register(setting86); + Setting setting87 = new Setting("HUD_KEYBINDS_ALPHA", "Alpha", SettingType.SLIDER, this, this.keybindsAlpha, 5.0, this::supplyBoolean73); + SettingManager.register(setting87); + Setting setting88 = new Setting("HUD_KEYBINDS_SMOOTHNESS", "Smoothness", SettingType.SLIDER, this, this.keybindsSmoothness, 1.0, this::supplyBoolean20); + SettingManager.register(setting88); + Setting setting89 = new Setting("HUD_KEYBINDS_BLUR", "Blur", SettingType.CHECKBOX, this, this.keybindsBlur, this::supplyBoolean54); + SettingManager.register(setting89); + Setting setting90 = new Setting("HUD_KEYBINDS_HIDE_ON_DEBUG", "F3 Hide", SettingType.CHECKBOX, this, this.keybindsHideOnDebug, this::supplyBoolean3); + SettingManager.register(setting90); + Setting setting91 = new Setting("HUD_KEYSTROKES_SEPARATOR", "KeyStrokes Settings", this, this.showKeystrokesSettings, () -> this.hudKeyStrokes.get()); + SettingManager.register(setting91); + Setting setting92 = new Setting("HUD_KEYSTROKES_ALPHA", "Alpha", SettingType.SLIDER, this, this.keyStrokesAlpha, 5.0, this::supplyBoolean44); + SettingManager.register(setting92); + Setting setting93 = new Setting("HUD_KEYSTROKES_RADIUS", "Roundness", SettingType.SLIDER, this, this.keyStrokesRadius, 1.0, this::supplyBoolean29); + SettingManager.register(setting93); + Setting setting94 = new Setting("HUD_KEYSTROKES_SMOOTHNESS", "Smoothness", SettingType.SLIDER, this, this.keyStrokesSmoothness, 1.0, this::supplyBoolean78); + SettingManager.register(setting94); + Setting setting95 = new Setting("HUD_KEYSTROKES_HIDE_ON_DEBUG", "F3 Hide", SettingType.CHECKBOX, this, this.keystrokesHideOnDebug, this::supplyBoolean32); + SettingManager.register(setting95); + Setting setting96 = new Setting("HUD_KEYSTROKES_BLUR", "Blur", SettingType.CHECKBOX, this, this.keystrokesBlur, this::supplyBoolean21); + SettingManager.register(setting96); + Setting setting97 = new Setting("HUD_HOTBAR_SEPARATOR", "Hotbar Settings", this, this.showHotbarSettings, () -> this.hudHotbar.get()); + SettingManager.register(setting97); + Setting setting98 = new Setting("HUD_HOTBAR_STYLE", "Style", SettingType.COMBOBOX, this, this.hotbarStyle, this::supplyBoolean68); + SettingManager.register(setting98); + Setting setting99 = new Setting("HUD_HOTBAR_ALPHA", "Alpha", SettingType.SLIDER, this, this.hotbarAlpha, 5.0, this::supplyBoolean39); + SettingManager.register(setting99); + Setting setting100 = new Setting("HUD_HOTBAR_SMOOTHNESS", "Smoothness", SettingType.SLIDER, this, this.hotbarSmoothness, 1.0, this::supplyBoolean46); + SettingManager.register(setting100); + Setting setting101 = new Setting("HUD_HOTBAR_BLUR", "Blur", SettingType.CHECKBOX, this, this.hotbarBlur, this::supplyBoolean49); + SettingManager.register(setting101); + Setting setting102 = new Setting("HUD_NOTIFICATION_SEPARATOR", "Notification Settings", this, this.showNotificationSettings); + SettingManager.register(setting102); + Setting setting103 = new Setting("HUD_NOTIFICATION_STYLE", "Style", SettingType.COMBOBOX, this, this.notificationStyle, this.showNotificationSettings::get); + SettingManager.register(setting103); + Setting setting104 = new Setting("HUD_NOTIFICATION_FONT", "Font", SettingType.COMBOBOX, this, this.notificationFont, this::supplyBoolean10); + SettingManager.register(setting104); + Setting setting105 = new Setting("HUD_NOTIFICATION_ACCENT_COLOR", "Accent Color", SettingType.COMBOBOX, this, this.notificationAccentColor, this::supplyBoolean30); + SettingManager.register(setting105); + Setting setting106 = new Setting("HUD_NOTIFICATION_BACKGROUND_COLOR", "Background Color", SettingType.COMBOBOX, this, this.notificationBgColor, this::supplyBoolean38); + SettingManager.register(setting106); + Setting setting107 = new Setting("HUD_NOTIFICATION_ALPHA", "Alpha", SettingType.SLIDER, this, this.notificationAlpha, 5.0, this::supplyBoolean33); + SettingManager.register(setting107); + Setting setting108 = new Setting("HUD_NOTIFICATION_SHADER", "Shaders", SettingType.SELECTBOX, this, this.notificationShader, this::supplyBoolean34); + SettingManager.register(setting108); + Setting setting109 = new Setting("HUD_NOTIFICATION_SHOW_DELAY", "Show Delay", SettingType.CHECKBOX, this, this.notificationShowDelay, this::supplyBoolean84); + SettingManager.register(setting109); + Setting setting110 = new Setting("HUD_CHAT_SEPARATOR", "Chat Settings", this, this.showChatSettings); + SettingManager.register(setting110); + Setting setting111 = new Setting("HUD_CHAT_FONT", "Font", SettingType.COMBOBOX, this, this.chatFont, () -> this.showChatSettings.get()); + SettingManager.register(setting111); + Setting setting112 = new Setting("HUD_CHAT_FONT", "Alpha", SettingType.SLIDER, this, this.chatAlpha, 5.0, () -> this.showChatSettings.get()); + SettingManager.register(setting112); + Setting setting113 = new Setting("HUD_CHAT_ROUNDESS", "Roundess", SettingType.SLIDER, this, this.chatRoundness, 1.0, () -> this.showChatSettings.get()); + SettingManager.register(setting113); + Setting setting114 = new Setting("HUD_CHAT_SMOOTHNESS", "Smoothness", SettingType.SLIDER, this, this.chatSmoothness, 1.0, () -> this.showChatSettings.get()); + SettingManager.register(setting114); + Setting setting115 = new Setting("HUD_CHAT_FONT", "Height", SettingType.SLIDER, this, this.chatHeight, 1.0, () -> this.showChatSettings.get()); + SettingManager.register(setting115); + Setting setting116 = new Setting("OM_CHAT_SIZE", "Chat Size", SettingType.SLIDER, this, this.chatSize, 5.0, "lines", () -> this.showChatSettings.get()); + SettingManager.register(setting116); + Setting setting117 = new Setting("HUD_INVENTORY_SEPARATOR", "Inventory Settings", this, this.showInventorySettings); + SettingManager.register(setting117); + Setting setting118 = new Setting("HUD_INVENTORY_ANIMATION", "Animation", SettingType.COMBOBOX, this, this.inventoryAnimation, () -> this.showInventorySettings.get()); + SettingManager.register(setting118); + Path filePath = Paths.get(this.cachedText); + + LinkOption[] linkOptionArr = new LinkOption[0]; + if (!Files.exists(filePath, linkOptionArr)) { + return; + } + + + + try { + if (!flag) filePath = Paths.get(this.cachedText); + List itemList = Files.readAllLines(filePath); + Iterator iter = itemList.iterator(); + + label35: + while (true) { + if (!iter.hasNext()) { + break; + } + + String textStr = (String)iter.next(); + this.createString(textStr); + + do { + boolean flag5 = flag; + if (time >= 0L) { + + flag5 = flag; + } + + if (!flag5) { + continue label35; + } + } while (time <= 0L); + + return; + } + } catch (IOException ex) { + ex.printStackTrace(); + } +} + + private Boolean supplyBoolean12() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudInformation.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showInformationSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private static boolean matchesAbstractModule(AbstractModule module) { + int intVal = (module.getSmoothAnimation2().getCachedValue2() > 0.0) ? 1 : 0; + + return ((intVal & 1) != 0); +} + + private Boolean supplyBoolean13() { + boolean flag; + label29: { + label31: { + Boolean propFlag = this.hudModuleList.get(); + flag = propFlag; + if (!flag) { + break label31; + } + + BooleanProperty boolProp = this.showModuleListSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label31; + } + + ListProperty listProp = this.moduleListShaders; + flag = listProp.contains("Glow"); + + if (flag) { + flag = true; + break label29; + } + } + + flag = false; + } + + return flag; +} + + public int applyUpdate4(String text, int value, String str) { + HUD hudMod = this; + StringProperty strProp = this.font; + if (strProp.equals("Vanilla")) { + return this.mc.fontRendererObj.getStringWidth(str); + } + + hudMod = this; + + FontRenderer font2 = hudMod.getA2mA(text, value); + return font2.evaluateInt2(str); +} + + private static boolean invokeCallback(ClickGui clickGui, AbstractModule module) { + boolean flag = Q(); + AbstractModule mod = module; + + if (module == clickGui) { + return false; + } + + mod = module; + + + boolean flag2 = mod.isHidden(); + return flag ? flag2 : !flag2; +} + + public StringProperty getNotificationBgColor() { + return this.notificationBgColor; +} + + public StringProperty getStringProperty11() { + return this.getNotificationBgColor(); +} + + public StringProperty getColorEffect() { + return this.colorEffect; +} + + public StringProperty getStringProperty12() { + return this.getColorEffect(); +} + + private int applyUpdate2(AbstractModule module) { + int intVal = (module.isEnabled() ? 1 : 0); + if (intVal != 0) { + ColorTheme colorTheme = ColorTheme.WHITE; + intVal = colorTheme.getStateTicks(); + } else { + ColorTheme colorTheme2 = ColorTheme.GREY; + intVal = colorTheme2.evaluateInt2(0.65); + } + + return intVal; +} + + static { + applyUpdate2(true); + Float floatVal = 2.0F; + FloatProperty floatProperty = FloatProperty.of(floatVal); + FloatProperty floatProperty2 = floatProperty.minimum(1.0F); + shadowOffset = floatProperty2.h(3.0F); + } + + private Boolean supplyBoolean14() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudModuleList.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showModuleListSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private void handleList(List list) { + label16: { + if (!this.moduleListGlowMode.equals("Font")) { + break label16; + } + + Consumer consumer = (AbstractModule abstractModule3) -> { abstractModule3.handleRunnable(((java.lang.Runnable) () -> HUD.handleAbstractModule3(abstractModule3))); }; + list.forEach(consumer); + + + return; + + } + + Consumer consumer2 = (AbstractModule abstractModule4) -> { abstractModule4.handleRunnable(((java.lang.Runnable) () -> HUD.handleAbstractModule2(abstractModule4))); }; + list.forEach(consumer2); +} + + private Boolean supplyBoolean15() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudModuleList.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showModuleListSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private static void invokeCallback2(double value, double amount, double offset, double dist, int index, double value2, double value3, int count, int num) { + double doubleVal = value - 2.0 - amount; + double doubleVal2 = offset - dist; + double doubleVal3 = value + index + 2.0 + value2 + value3; + double doubleVal4 = offset + count + dist; + RenderUtils.drawRect(doubleVal, doubleVal2, doubleVal3, doubleVal4, num); +} + + private Boolean supplyBoolean16() { + boolean flag; + label43: { + label42: { + label45: { + Boolean propFlag = this.hudName.get(); + flag = propFlag; + if (!flag) { + break label45; + } + + BooleanProperty boolProp = this.showNameSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label45; + } + + StringProperty strProp = this.nameType; + flag = strProp.equals("Watermark"); + + if (!flag) { + break label45; + } + + StringProperty strProp2 = this.watermarkBackgroundType; + flag = strProp2.equals("Bar"); + + if (!flag) { + break label42; + } + + StringProperty strProp3 = this.watermarkStyle; + flag = strProp3.equals("Neverlose"); + + if (flag) { + break label42; + } + } + + flag = false; + break label43; + } + + flag = true; + } + + return flag; +} + + private List getList() { + ObjectCollection objectCollection = this.moduleManager.getModules().values(); + Stream stream2 = objectCollection.stream(); + Predicate predicate = HUD::matchesModuleHolder; + Stream stream3 = stream2.filter(predicate); + Function mapper = ((java.util.function.Function) ModuleHolder::getModule); + Stream stream4 = stream3.map(mapper); + Collector collector = Collectors.toList(); + return (java.util.List) stream4.collect(collector); +} + + private static void handleAbstractModule(AbstractModule module) { + module.callbackTask4.run(); +} + + public StringProperty getChatFont() { + return this.chatFont; +} + + public StringProperty getStringProperty13() { + return this.getChatFont(); +} + + private boolean isStateReady2() { + boolean flag = Q(); + Boolean propFlag = this.hudName.get(); + boolean flag2 = propFlag; + if (!flag2) { + return false; + } + + Boolean propFlag2 = this.nameHideOnDebug.get(); + flag2 = this.matchesFlag(propFlag2); + + return flag ? flag2 : flag2; +} + + private Boolean supplyBoolean17() { + boolean flag; + label29: { + label31: { + Boolean propFlag = this.hudInformation.get(); + flag = propFlag; + if (!flag) { + break label31; + } + + ListProperty listProp = this.informationElements; + flag = listProp.isEmpty(); + + if (flag) { + break label31; + } + + BooleanProperty boolProp = this.showInformationSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label29; + } + } + + flag = false; + } + + return flag; +} + + private Boolean supplyBoolean18() { + boolean flag; + label29: { + label31: { + Boolean propFlag = this.hudName.get(); + flag = propFlag; + if (!flag) { + break label31; + } + + BooleanProperty boolProp = this.showNameSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label31; + } + + StringProperty strProp = this.font; + flag = strProp.equals("Vanilla"); + + if (flag) { + flag = true; + break label29; + } + } + + flag = false; + } + + return flag; +} + + private void invokeCallback3( + AbstractModule module, double[] doubleArray, double value, int[] intArray, boolean flag, boolean enabled, int index, int count, List list + ) { + double doubleVal; + double doubleVal2; + int intVal; + int intVal2; + int intVal3; + int intVal4; + int intVal5; + int intVal6; + int intVal7; + AbstractModule mod; + label387: { + double doubleVal3; + label381: { + Minecraft mcClient = this.mc; + doubleVal3 = 2000 / mcClient.computeInt2(); + mod = this; + + TimerUtil timerUtil = this.timer; + if (timerUtil.checkLong(50L)) { + mod = this; + + if (!(this.mc.currentScreen instanceof GuiChat)) { + if (module.getDoubleValue4() != 0.0) { + break label381; + } + } + } + + mod = module; + + mod.handleDouble(doubleArray[0]); + + break label387; + + } + + if (module.getDoubleValue4() > doubleArray[0]) { + double doubleVal25 = module.getDoubleValue4() - 0.0625 * doubleVal3; + double doubleVal26 = doubleArray[0]; + module.handleDouble(MathHelper.clamp_double(doubleVal25, doubleVal26, 999.0)); + break label387; + } + + mod = module; + + if (module.getDoubleValue4() < doubleArray[0]) { + double doubleVal4 = module.getDoubleValue4() + 0.0625 * doubleVal3; + double doubleVal27 = doubleArray[0]; + module.handleDouble(MathHelper.clamp_double(doubleVal4, 0.0, doubleVal27)); + } + } + + mod = module; + + String displayName; + int intVal18; + double doubleVal5; + double doubleVal28; + double doubleVal29; + label356: { + displayName = mod.getFormattedDisplayName(); + intVal18 = this.evaluateInt(displayName); + doubleVal5 = value; + doubleVal28 = module.getDoubleValue4(); + StringProperty strProp = this.moduleListAligment; + int intVal8 = (strProp.equals("Right") ? 1 : 0); + + if (intVal8 == 0) { + doubleVal29 = 0.0; + break label356; + } + + intVal8 = intVal18; + + + doubleVal29 = intVal8; + } + + label349: { + int color2; + double doubleVal30; + + double doubleVal6 = doubleVal5 - doubleVal29; + DoubleProperty doubleProp = this.moduleListPadding; + Double propDouble = doubleProp.get(); + double doubleVal31 = propDouble * 0.5; + long longVal = intArray[0]; + color2 = ColorTheme.getHudColor(longVal); + DoubleProperty doubleProp2 = this.moduleListWidthOffset; + Double propDouble2 = doubleProp2.get(); + double doubleVal32 = propDouble2; + double doubleVal33 = flag != false ? 1.0 + doubleVal32 : 0.0; + double doubleVal34 = enabled != false ? 1.0 + doubleVal32 : 0.0; + doubleVal30 = doubleVal6; + module.callbackTask4 = $lambdaCapture$114(doubleVal30, doubleVal32, doubleVal28, doubleVal31, intVal18, doubleVal33, doubleVal34, index, color2); + StringProperty strProp2 = this.moduleListBackground; + intVal = (strProp2.equals("None") ? 1 : 0); + + if (intVal == 0) { + StringProperty strProp3 = this.moduleListBackgroundColor; + int intVal9 = (strProp3.equals("Black") ? 1 : 0); + if (intVal9 != 0) { + ColorTheme colorTheme = ColorTheme.BLACK; + intVal9 = colorTheme.getStateTicks(); + } else { + intVal9 = color2; + } + + String propStr; + String propStr2; + byte byteVal; + IntProperty intProp = this.moduleListBackgroundAlpha; + Integer intVal10 = intProp.get(); + int intVal19 = intVal10; + int color3 = ColorTheme.reAlpha(intVal9, intVal19); + double doubleVal7 = doubleVal6 - 2.0 - doubleVal32; + doubleVal29 = doubleVal28 - doubleVal31; + double doubleVal35 = doubleVal6 + intVal18 + 2.0 + doubleVal33 + doubleVal34; + double doubleVal36 = doubleVal28 + index + doubleVal31; + RenderUtils.drawRect(doubleVal7, doubleVal29, doubleVal35, doubleVal36, color3); + StringProperty strProp4 = this.moduleListBackground; + propStr = strProp4.get(); + StringProperty strProp5 = this.moduleListBarAligment; + propStr2 = strProp5.get(); + byteVal = (byte)(propStr.equals("Outlined") ? 1 : 0); + intVal2 = byteVal; + label325: { + label333: + if (byteVal == 0) { + label394: { + intVal2 = (propStr.equals("Bar") ? 1 : 0); + + if (intVal2 == 0) { + break label394; + } + + intVal2 = (propStr2.equals("Vertical") ? 1 : 0); + + + if (intVal2 != 0) { + break label333; + } + + intVal2 = (propStr2.equals("Both") ? 1 : 0); + + if (intVal2 != 0) { + break label333; + } + } + + intVal2 = 0; + break label325; + } + + intVal2 = 1; + } + + int intVal11 = intVal2; + intVal3 = byteVal; + label303: { + label311: + if (byteVal == 0) { + label397: { + intVal3 = (propStr.equals("Bar") ? 1 : 0); + + if (intVal3 == 0) { + break label397; + } + + intVal3 = (propStr2.equals("Horizontal") ? 1 : 0); + + + if (intVal3 != 0) { + break label311; + } + + intVal3 = (propStr2.equals("Both") ? 1 : 0); + + if (intVal3 != 0) { + break label311; + } + } + + intVal3 = 0; + break label303; + } + + intVal3 = 1; + } + + int intVal12 = intVal3; + StringProperty strProp6 = this.moduleListSorting; + byte byteVal2 = (byte)(strProp6.equals("Up") ? 1 : 0); + byte byteVal3 = (byte)(propStr.equals("Stripe") ? 1 : 0); + intVal = byteVal3; + + if (byteVal3 != 0) { + double doubleVal8 = doubleVal30 + intVal18 + 2.0 + doubleVal33; + doubleVal29 = doubleVal28 - doubleVal31 + 1.0; + doubleVal35 = doubleVal30 + intVal18 + 3.5 + doubleVal33; + doubleVal36 = doubleVal28 + index + doubleVal31 - 1.0; + RenderUtils.drawRect(doubleVal8, doubleVal29, doubleVal35, doubleVal36, color2); + } + + intVal = intVal12; + + + if (intVal != 0) { + intVal = count; + + label293: + if (count == 0) { + if (byteVal2 != 0) { + label289: { + label401: { + intVal4 = byteVal; + + if (byteVal == 0) { + intVal4 = (enabled ? 1 : 0); + + if (enabled == false) { + break label401; + } + } + + intVal4 = intVal11; + + if (intVal4 != 0) { + intVal4 = 3; + break label289; + } + } + + intVal4 = 2; + } + + label274: { + label402: { + doubleVal = doubleVal6 - intVal4 - doubleVal32; + doubleVal29 = doubleVal28 - doubleVal31 - 1.0; + doubleVal35 = doubleVal6 + intVal18; + intVal5 = byteVal; + + if (byteVal == 0) { + intVal5 = (flag ? 1 : 0); + + if (flag == false) { + break label402; + } + } + + intVal5 = intVal11; + + if (intVal5 != 0) { + intVal5 = 3; + break label274; + } + } + + intVal5 = 2; + } + + doubleVal35 = doubleVal35 + intVal5 + doubleVal33 + doubleVal34; + doubleVal36 = doubleVal28 - doubleVal31; + RenderUtils.drawRect(doubleVal, doubleVal29, doubleVal35, doubleVal36, color2); + break label293; + } + + label257: { + label403: { + intVal6 = byteVal; + + if (byteVal == 0) { + intVal6 = (enabled ? 1 : 0); + + if (enabled == false) { + break label403; + } + } + + intVal6 = intVal11; + + if (intVal6 != 0) { + intVal6 = 3; + break label257; + } + } + + intVal6 = 2; + } + + label242: { + label404: { + doubleVal2 = doubleVal6 - intVal6 - doubleVal32; + doubleVal29 = doubleVal28 + index + doubleVal31; + doubleVal35 = doubleVal6 + intVal18; + intVal7 = byteVal; + + if (byteVal == 0) { + intVal7 = (flag ? 1 : 0); + + if (flag == false) { + break label404; + } + } + + intVal7 = intVal11; + + if (intVal7 != 0) { + intVal7 = 3; + break label242; + } + } + + intVal7 = 2; + } + + doubleVal35 = doubleVal35 + intVal7 + doubleVal33 + doubleVal34; + doubleVal36 = doubleVal28 + index + doubleVal31 + 1.0; + RenderUtils.drawRect(doubleVal2, doubleVal29, doubleVal35, doubleVal36, color2); + } + } + + intVal = intVal11; + + + label222: + if (intVal != 0) { + if (flag != false) { + double doubleVal9 = doubleVal6 + intVal18 + 2.0 + doubleVal33; + doubleVal29 = doubleVal28 - doubleVal31; + doubleVal35 = doubleVal6 + intVal18 + 3.0 + doubleVal33; + doubleVal36 = doubleVal28 + index + doubleVal31; + RenderUtils.drawRect(doubleVal9, doubleVal29, doubleVal35, doubleVal36, color2); + break label222; + } + + double doubleVal10 = doubleVal6 - 3.0 - doubleVal32; + doubleVal29 = doubleVal28 - doubleVal31; + doubleVal35 = doubleVal6 - 2.0 - doubleVal32; + doubleVal36 = doubleVal28 + index + doubleVal31; + RenderUtils.drawRect(doubleVal10, doubleVal29, doubleVal35, doubleVal36, color2); + } + + intVal = byteVal; + + + label214: + if (intVal != 0) { + label212: { + if (flag != false) { + double doubleVal11 = doubleVal6 - 3.0 - doubleVal32; + doubleVal29 = doubleVal28 - doubleVal31; + doubleVal35 = doubleVal6 - 2.0 - doubleVal32; + doubleVal36 = doubleVal28 + index + doubleVal31; + RenderUtils.drawRect(doubleVal11, doubleVal29, doubleVal35, doubleVal36, color2); + break label212; + } + + double doubleVal12 = doubleVal6 + intVal18 + 2.0 + doubleVal34; + doubleVal29 = doubleVal28 - doubleVal31; + doubleVal35 = doubleVal6 + intVal18 + 3.0 + doubleVal34; + doubleVal36 = doubleVal28 + index + doubleVal31; + RenderUtils.drawRect(doubleVal12, doubleVal29, doubleVal35, doubleVal36, color2); + } + + int intVal13 = (flag ? 1 : 0); + + if (flag != false) { + int intVal14 = byteVal2; + + if (byteVal2 != 0) { + if (count < list.size() - 1) { + double doubleVal13 = doubleVal6 - 3.0 - doubleVal32; + doubleVal29 = doubleVal28 + index + doubleVal31; + doubleVal35 = doubleVal6 + intVal18; + int intVal20 = count + 1; + doubleVal35 = doubleVal35 - this.evaluateInt(((AbstractModule)list.get(intVal20)).getFormattedDisplayName()) - 3.0 - doubleVal32; + doubleVal36 = doubleVal28 + index + doubleVal31 + 1.0; + RenderUtils.drawRect(doubleVal13, doubleVal29, doubleVal35, doubleVal36, color2); + break label214; + } + + double doubleVal14 = doubleVal6 - 3.0 - doubleVal32; + doubleVal29 = doubleVal28 + index + doubleVal31; + doubleVal35 = doubleVal6 + intVal18 + 3.0 + doubleVal33; + doubleVal36 = doubleVal28 + index + doubleVal31 + 1.0; + RenderUtils.drawRect(doubleVal14, doubleVal29, doubleVal35, doubleVal36, color2); + break label214; + } + + intVal14 = count; + + + if (intVal14 < list.size() - 1) { + double doubleVal15 = doubleVal6 - 3.0 - doubleVal32; + doubleVal29 = doubleVal28 - doubleVal31 - 1.0; + doubleVal35 = doubleVal6 + intVal18; + int intVal15 = count + 1; + doubleVal35 = doubleVal35 - this.evaluateInt(((AbstractModule)list.get(intVal15)).getFormattedDisplayName()) - 3.0 - doubleVal32; + doubleVal36 = doubleVal28 - doubleVal31; + RenderUtils.drawRect(doubleVal15, doubleVal29, doubleVal35, doubleVal36, color2); + break label214; + } + + double doubleVal16 = doubleVal6 - 3.0 - doubleVal32; + doubleVal29 = doubleVal28 - doubleVal31 - 1.0; + doubleVal35 = doubleVal6 + intVal18 + 3.0 + doubleVal33; + doubleVal36 = doubleVal28 - doubleVal31; + RenderUtils.drawRect(doubleVal16, doubleVal29, doubleVal35, doubleVal36, color2); + break label214; + } + + intVal13 = byteVal2; + + + + if (intVal13 != 0) { + if (count < list.size() - 1) { + int intVal16 = count + 1; + double doubleVal17 = doubleVal6 + this.evaluateInt(((AbstractModule)list.get(intVal16)).getFormattedDisplayName()) + 3.0 + doubleVal34; + doubleVal29 = doubleVal28 + index + doubleVal31; + doubleVal35 = doubleVal6 + intVal18 + 3.0 + doubleVal34; + doubleVal36 = doubleVal28 + index + doubleVal31 + 1.0; + RenderUtils.drawRect(doubleVal17, doubleVal29, doubleVal35, doubleVal36, color2); + break label214; + } + + double doubleVal18 = doubleVal6 - 3.0 - doubleVal32; + doubleVal29 = doubleVal28 + index + doubleVal31; + doubleVal35 = doubleVal6 + intVal18 + 3.0 + doubleVal34; + doubleVal36 = doubleVal28 + index + doubleVal31 + 1.0; + RenderUtils.drawRect(doubleVal18, doubleVal29, doubleVal35, doubleVal36, color2); + break label214; + } + + intVal13 = count; + + + if (intVal13 < list.size() - 1) { + int intVal17 = count + 1; + double doubleVal19 = doubleVal6 + this.evaluateInt(((AbstractModule)list.get(intVal17)).getFormattedDisplayName()) + 3.0 + doubleVal34; + doubleVal29 = doubleVal28 - doubleVal31 - 1.0; + doubleVal35 = doubleVal6 + intVal18 + 3.0 + doubleVal34; + doubleVal36 = doubleVal28 - doubleVal31; + RenderUtils.drawRect(doubleVal19, doubleVal29, doubleVal35, doubleVal36, color2); + break label214; + } + + double doubleVal20 = doubleVal6 - 3.0 - doubleVal32; + doubleVal29 = doubleVal28 - doubleVal31 - 1.0; + doubleVal35 = doubleVal6 + intVal18 + 3.0 + doubleVal34; + doubleVal36 = doubleVal28 - doubleVal31; + RenderUtils.drawRect(doubleVal20, doubleVal29, doubleVal35, doubleVal36, color2); + } + } + + module.callbackTask6 = $lambdaCapture$115(this, displayName, doubleVal30, doubleVal28, color2); + mod = this; + + StringProperty strProp7 = this.font; + intVal = (strProp7.equals("Vanilla") ? 1 : 0); + + if (intVal != 0) { + double doubleVal37 = doubleVal30 + 0.5; + Double propDouble3 = this.moduleListNameHeight.get(); + this.drawElement3(displayName, doubleVal37, doubleVal28 + propDouble3, color2); + break label349; + } + + mod = this; + + DoubleProperty doubleProp3 = this.moduleListNameHeight; + Double propDouble4 = doubleProp3.get(); + ((HUD) mod).drawElement3(displayName, doubleVal30, doubleVal28 + propDouble4, color2); + } + + label168: { + StringProperty strProp8 = this.moduleListSorting; + boolean flag3 = strProp8.equals("Down"); + if (flag3) { + double doubleVal21 = doubleArray[0]; + double doubleVal22 = index; + DoubleProperty doubleProp4 = this.moduleListPadding; + Double propDouble5 = doubleProp4.get(); + doubleArray[0] = doubleVal21 - (doubleVal22 + propDouble5); + break label168; + } + + StringProperty strProp9 = this.moduleListSorting; + flag3 = strProp9.equals("Up"); + + if (flag3) { + double doubleVal23 = doubleArray[0]; + double doubleVal24 = index; + DoubleProperty doubleProp5 = this.moduleListPadding; + Double propDouble6 = doubleProp5.get(); + doubleArray[0] = doubleVal23 + (doubleVal24 + propDouble6); + } + } + + intArray[0] -= 180; +} + + private Boolean supplyBoolean19() { + boolean flag; + label37: { + label39: { + Boolean propFlag = this.hudName.get(); + flag = propFlag; + if (!flag) { + break label39; + } + + BooleanProperty boolProp = this.showNameSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label39; + } + + StringProperty strProp = this.nameType; + flag = strProp.equals("Watermark"); + + if (!flag) { + break label39; + } + + StringProperty strProp2 = this.watermarkStyle; + flag = strProp2.equals("Basic"); + + if (flag) { + flag = true; + break label37; + } + } + + flag = false; + } + + return flag; +} + + private String applyUpdate2(PotionEffect potionEffect) { + String nameStr = Potion.potionTypes[potionEffect.getPotionID2()].getName(); + Object[] objArr = new Object[0]; + return GuiCustomizeWorldScreenScreen.resolveString(nameStr, objArr); +} + + public StringProperty getModuleListNameCase() { + return this.moduleListNameCase; +} + + public StringProperty getStringPropertyValue6() { + return this.getModuleListNameCase(); +} + + private Boolean supplyBoolean20() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudKeybinds.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showKeybindsSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + public double applyInt5(FontRenderer fontRenderer) { + HUD hudMod = this; + + StringProperty strProp = this.font; + if (!strProp.equals("Vanilla")) { + return fontRenderer.getStateTicks6(); + } + + hudMod = this; + + + net.minecraft.client.gui.FontRenderer font2 = hudMod.mc.fontRendererObj; + return font2.computeDouble(); +} + + private void resolveHelper(Render2DEvent event) { + FontRenderer font2 = FontFamilySF_BOLD.FAMILY.ofSize(17); + long longVal = Runtime.getRuntime().maxMemory(); + long longVal2 = Runtime.getRuntime().totalMemory(); + long longVal3 = Runtime.getRuntime().freeMemory(); + long longVal4 = longVal2 - longVal3; + long longVal5 = this.queryLong(longVal); + long longVal6 = this.queryLong(longVal4); + IntProperty intProp = this.ramXPosition; + Integer intVal = intProp.get(); + int intVal2 = intVal; + IntProperty intProp2 = this.ramYPosition; + Integer intVal3 = intProp2.get(); + int intVal5 = intVal3; + double doubleVal3 = 42.0; + double doubleVal4 = 47.0; + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal5 = intVal2; + double doubleVal6 = intVal5; + Integer intVal4 = this.tprRamSmoothness.get(); + double doubleVal7 = intVal4.intValue(); + Integer intVal6 = this.tpsRamAlpha.get(); + Color awtColor = new Color(0, 0, 0, intVal6); + roundedTextureShader.drawRoundedRect(doubleVal5, doubleVal6, doubleVal3, doubleVal4, 0.0, doubleVal7, awtColor, true); + double doubleVal = intVal2 + doubleVal3 / 2.0 + 0.25; + doubleVal5 = intVal5 + 18; + double doubleVal8 = 360.0 / longVal5 * longVal6; + int color2 = ColorTheme.getColor(0, 0, 0, 50); + RenderUtils.drawElement6(doubleVal, doubleVal5, 0.0, doubleVal8, 13.25, 4.5F, color2); + GaussianBlurShader gaussianBlurShader = GaussianBlurShader.getGaussianBlurShader(); + Runnable runnable = ((java.lang.Runnable) (() -> HUD.invokeCallback6(intVal2, doubleVal3, intVal5, longVal5, longVal6))); + gaussianBlurShader.renderVisual(8, 280, true, runnable, null); + double doubleVal2 = intVal2 + doubleVal3 / 2.0 + 0.25; + doubleVal5 = intVal5 + 18; + doubleVal8 = 360.0 / longVal5 * longVal6; + RenderUtils.drawElement5(doubleVal2, doubleVal5, 0.0, doubleVal8, 13.25, 4.5F, 22L); + String textStr = "RAM"; + doubleVal6 = intVal2 + doubleVal3 / 2.0; + doubleVal8 = intVal5 + 16; + font2.drawCenteredString(textStr, doubleVal6, doubleVal8, 16777215, true); + StringBuilder sb = new StringBuilder(); + doubleVal5 = 100.0 / longVal5 * longVal6; + doubleVal5 = MathHelper.resolveInt5(doubleVal5, 1); + StringBuilder sb2 = sb.append(doubleVal5); + String textStr2 = sb2.append("%").toString(); + doubleVal6 = intVal2 + doubleVal3 / 2.0; + doubleVal8 = intVal5 + 37.5; + font2.drawCenteredString(textStr2, doubleVal6, doubleVal8, 16777215, true); +} + + private Boolean supplyBoolean21() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudKeyStrokes.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showKeystrokesSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private FontFamily getFontFamily() { + int intVal; + int intVal2; + boolean flag = Q(); + StringProperty strProp = this.font; + boolean flag2 = strProp.equals("Client"); + + if (flag2) { + strProp = this.clientFont; + String propStr = strProp.get(); + byte byteVal = -1; + intVal = propStr.hashCode(); + + switch (intVal) { + case 70808764: + intVal = (propStr.equals("Inter") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 0; + if (!flag) { + break; + } + case 82837092: + intVal = (propStr.equals("Volte") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 1; + if (!flag) { + break; + } + case -1898676796: + intVal = (propStr.equals("Poppin") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 2; + if (!flag) { + break; + } + case 2107684854: + intVal = (propStr.equals("Jetbrains") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 3; + if (!flag) { + break; + } + case 1540367136: + intVal = (propStr.equals("San Francisco") ? 1 : 0); + + if (intVal != 0) { + byteVal = 4; + } + } + + intVal = byteVal; + + label349: { + String propStr2; + byte byteVal2; + + label350: { + + label351: { + + label352: { + switch (intVal) { + case 0: + strProp = this.fontType; + propStr2 = strProp.get(); + byteVal2 = -1; + intVal2 = propStr2.hashCode(); + + switch (intVal2) { + case -1543850116: + intVal2 = (propStr2.equals("Regular") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal2 = 0; + if (!flag) { + break; + } + case -1994163307: + intVal2 = (propStr2.equals("Medium") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal2 = 1; + if (!flag) { + break; + } + case 2076325: + intVal2 = (propStr2.equals("Bold") ? 1 : 0); + + if (intVal2 != 0) { + byteVal2 = 2; + } + } + + intVal2 = byteVal2; + + switch (intVal2) { + case 0: + return this.fontFamilyField8; + case 1: + return this.fontFamilyField6; + case 2: + return this.fontFamilyField5; + } + case 1: + strProp = this.fontType; + propStr2 = strProp.get(); + byteVal2 = -1; + intVal2 = propStr2.hashCode(); + break; + case 2: + break label352; + case 3: + break label351; + case 4: + break label350; + default: + break label349; + } + + switch (intVal2) { + case -1543850116: + intVal2 = (propStr2.equals("Regular") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal2 = 0; + if (!flag) { + break; + } + case -1994163307: + intVal2 = (propStr2.equals("Medium") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal2 = 1; + if (!flag) { + break; + } + case 2076325: + intVal2 = (propStr2.equals("Bold") ? 1 : 0); + + if (intVal2 != 0) { + byteVal2 = 2; + } + } + + intVal2 = byteVal2; + + switch (intVal2) { + case 0: + return this.fontFamilyField7; + case 1: + return this.fontFamilyField11; + case 2: + return this.fontFamilyField; + } + } + + strProp = this.fontType; + propStr2 = strProp.get(); + byteVal2 = -1; + intVal2 = propStr2.hashCode(); + + switch (intVal2) { + case -1543850116: + intVal2 = (propStr2.equals("Regular") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal2 = 0; + if (!flag) { + break; + } + case -1994163307: + intVal2 = (propStr2.equals("Medium") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal2 = 1; + if (!flag) { + break; + } + case 2076325: + intVal2 = (propStr2.equals("Bold") ? 1 : 0); + + if (intVal2 != 0) { + byteVal2 = 2; + } + } + + intVal2 = byteVal2; + + switch (intVal2) { + case 0: + return this.fontFamilyField2; + case 1: + return this.fontFamilyField17; + case 2: + return this.fontFamilyField12; + } + } + + strProp = this.fontType; + propStr2 = strProp.get(); + byteVal2 = -1; + intVal2 = propStr2.hashCode(); + + switch (intVal2) { + case -1543850116: + intVal2 = (propStr2.equals("Regular") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal2 = 0; + if (!flag) { + break; + } + case -1994163307: + intVal2 = (propStr2.equals("Medium") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal2 = 1; + if (!flag) { + break; + } + case 2076325: + intVal2 = (propStr2.equals("Bold") ? 1 : 0); + + if (intVal2 != 0) { + byteVal2 = 2; + } + } + + intVal2 = byteVal2; + + switch (intVal2) { + case 0: + return this.fontFamilyField15; + case 1: + return this.fontFamilyField14; + case 2: + return this.fontFamilyField10; + } + } + + strProp = this.fontType; + propStr2 = strProp.get(); + byteVal2 = -1; + intVal2 = propStr2.hashCode(); + + switch (intVal2) { + case -1543850116: + intVal2 = (propStr2.equals("Regular") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal2 = 0; + if (!flag) { + break; + } + case -1994163307: + intVal2 = (propStr2.equals("Medium") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal2 = 1; + if (!flag) { + break; + } + case 2076325: + intVal2 = (propStr2.equals("Bold") ? 1 : 0); + + if (intVal2 != 0) { + byteVal2 = 2; + } + } + + intVal2 = byteVal2; + + switch (intVal2) { + case 0: + return this.fontFamilyField4; + case 1: + return this.fontFamilyField13; + case 2: + return this.fontFamilyField3; + } + } + + return this.fontFamilyField16; + } + + strProp = this.font; + flag2 = strProp.equals("Custom"); + + + if (flag2) { + FontFamily fontFam = this.fontFamilyField9; + + if (this.fontFamilyField9 == null) { + strProp = this.font; + strProp.set("Vanilla"); + return this.fontFamilyField16; + } + + fontFam = this.fontFamilyField9; + + + return fontFam; + } else { + return this.fontFamilyField16; + } +} + + public boolean isReadyState22() { + Boolean propFlag = this.hudHotbar.get(); + return propFlag; +} + + private boolean matchesFlag(boolean flag) { + if (flag) { + + if (this.mc.gameSettings.showDebugInfo) { + return false; + } + } + + return true; +} + + public int getIntValue17() { + Integer intVal = this.chatSize.getMinimum(); + return intVal; +} + + public StringProperty getFont() { + return this.font; +} + + public StringProperty getStringPropertyS() { + return this.getFont(); +} + + public static Minecraft applyUpdate2(HUD hUD) { + return hUD.mc; +} + + private String applyInt5(AbstractModule module) { + String nameStr = module.getName(); + StringBuilder sb = new StringBuilder(); + sb = sb.append("("); + ModuleKeybind keybind = module.getKeyBindProperty().get(); + int keyCode = keybind.getKey(); + String textStr2 = Keyboard.getKeyName(keyCode); + sb = sb.append(textStr2); + String textStr = sb.append(")").toString(); + sb = new StringBuilder(); + sb = sb.append(nameStr).append(" "); + return sb.append(textStr).toString(); +} + + private void handleRender2DEvent(Render2DEvent event) { + int scaledWidth; + int scaledHeight; + String textStr; + String textStr2; + StringBuilder sb; + String textStr3; + label17: { + ScaledResolution scaledRes = event.getResolution(); + scaledWidth = scaledRes.getScaledWidthGui(); + scaledHeight = scaledRes.getScaledHeightGui(); + textStr = net.skidunion.security.ProtectionSession.o; + textStr2 = this.computeStringValue(net.skidunion.security.ProtectionSession.c); + sb = new StringBuilder(); + textStr3 = this.novoline.getVersion(); + sb = sb.append(textStr3); + textStr3 = " "; + sb = sb.append(textStr3); + Novoline novolineInst = this.novoline; + boolean flag = novolineInst.isReadyState(); + if (flag) { + textStr3 = "[Beta]"; + break label17; + } + + Novoline novolineInst2 = this.novoline; + flag = novolineInst2.isStateFlag3(); + + textStr3 = flag ? "[Dev]" : "[Public]"; + } + + String textStr4 = sb.append(textStr3).toString(); + sb = new StringBuilder(); + sb = sb.append(textStr); + textStr3 = " ("; + sb = sb.append(textStr3).append(textStr2); + textStr3 = ") - "; + sb = sb.append(textStr3); + String textStr5 = sb.append(textStr4).toString(); + double doubleVal = this.evaluateInt(textStr5) + 2; + this.renderElement(textStr5, scaledWidth - doubleVal, scaledHeight - this.getIntValue18() - 1.5); +} + + public static void applyUpdate2(boolean flag) { + stateFlag9 = flag; +} + + + private Boolean supplyBoolean22() { + boolean flag; + label29: { + label31: { + Boolean propFlag = this.hudName.get(); + flag = propFlag; + if (!flag) { + break label31; + } + + BooleanProperty boolProp = this.showNameSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label31; + } + + StringProperty strProp = this.nameType; + flag = strProp.equals("Watermark"); + + if (flag) { + flag = true; + break label29; + } + } + + flag = false; + } + + return flag; +} + + public int computeFontRendererInt2(FontRenderer fontRenderer) { + StringProperty strProp = this.font; + int intVal = (strProp.equals("Vanilla") ? 1 : 0); + if (intVal != 0) { + net.minecraft.client.gui.FontRenderer font2 = this.mc.fontRendererObj; + intVal = font2.computeInt(); + } else { + intVal = fontRenderer.getHeight(); + } + + return intVal; +} + + private static boolean matchesAbstractModule2(AbstractModule module) { + int intVal = (module.getSmoothAnimation2().getCachedValue2() > 0.0) ? 1 : 0; + + return ((intVal & 1) != 0); +} + + private Boolean supplyBoolean23() { + boolean flag; + label45: { + label47: { + Boolean propFlag = this.hudInformation.get(); + flag = propFlag; + if (!flag) { + break label47; + } + + BooleanProperty boolProp = this.showArmorSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label47; + } + + BooleanProperty boolProp2 = this.showInformationSettings; + propFlag = boolProp2.get(); + flag = propFlag; + + if (!flag) { + break label47; + } + + ListProperty listProp = this.informationElements; + flag = listProp.contains("Armor"); + + if (!flag) { + break label47; + } + + BooleanProperty boolProp3 = this.armorBackground; + propFlag = boolProp3.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label45; + } + } + + flag = false; + } + + return flag; +} + + private Boolean supplyBoolean24() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudModuleList.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showModuleListSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private void renderElement2(Render2DEvent event) { + int keyCode4; + int keyCode5; + int intVal; + label41: { + Integer keyCode = this.keybindsPosX.get(); + keyCode4 = keyCode; + Integer keyCode2 = this.keybindsPosY.get(); + keyCode5 = keyCode2; + intVal = this.applyUpdate2(18); + this.cachedValue8 = keyCode4 + this.getIntValue19() + 37; + List itemList2 = this.getList(); + this.cachedValue12 = keyCode5 + itemList2.size() * (intVal + 3); + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal = keyCode4 - 3; + double doubleVal5 = keyCode5 - 21.5; + double doubleVal6 = this.cachedValue8 - keyCode4 + 4.0; + double doubleVal7 = this.cachedValue12 - keyCode5 + 21.0; + Integer keyCode3 = this.keybindsSmoothness.get(); + double doubleVal8 = keyCode3.intValue(); + Integer keyCode6 = this.keybindsAlpha.get(); + Color awtColor = new Color(0, 0, 0, keyCode6); + roundedTextureShader.drawRoundedRect(doubleVal, doubleVal5, doubleVal6, doubleVal7, 0.0, doubleVal8, awtColor, true); + StringProperty strProp = this.keybindsBarColor; + byte byteVal = (byte)(strProp.equals("White") ? 1 : 0); + + if (byteVal != 0) { + double doubleVal2 = keyCode4 + 1; + double doubleVal9 = keyCode5 - 5.5; + double doubleVal10 = this.cachedValue8 - 3.0; + doubleVal6 = keyCode5 - 4; + ColorTheme colorTheme = ColorTheme.WHITE; + int intVal2 = colorTheme.getStateTicks(); + int color3 = ColorTheme.reAlpha(intVal2, 180); + RenderUtils.drawRect(doubleVal2, doubleVal9, doubleVal10, doubleVal6, color3); + break label41; + } + + byteVal = 0; + + + byte byteVal2 = byteVal; + double doubleVal3 = keyCode4 + 1; + + while (doubleVal3 < this.cachedValue8 - 3.0) { + double doubleVal11 = keyCode5 - 5.5; + double doubleVal12 = doubleVal3 + 0.5; + doubleVal6 = keyCode5 - 4; + long longVal = byteVal2; + int color2 = ColorTheme.getHudColor(longVal); + int color4 = ColorTheme.reAlpha(color2, 180); + RenderUtils.drawRect(doubleVal3, doubleVal11, doubleVal12, doubleVal6, color4); + byteVal2 -= 15; + doubleVal3 += 0.5; + + } + } + + String textStr2 = "Keybinds"; + FontFamily fontFam = FontFamilyWEXICONS.FAMILY; + FontRenderer font2 = fontFam.ofSize(60); + String textStr = "M"; + double doubleVal13 = keyCode4; + double doubleVal14 = keyCode5 - 24.5; + font2.drawElement5(textStr, doubleVal13, doubleVal14, 16777215, true); + doubleVal14 = keyCode4 + 27; + double doubleVal4 = keyCode5; + StringProperty strProp2 = this.font; + this.renderVisual3(21, textStr2, doubleVal14, doubleVal4 - ((strProp2.equals("Vanilla") ? 8.0 : 9.5) + intVal), 16777215); + List itemList = this.getList(); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + AbstractModule mod = (AbstractModule)iter.next(); + this.renderVisual3(18, this.applyInt5(mod), keyCode4, keyCode5, 16777215); + this.renderVisual3(18, this.resolveString2(mod), this.cachedValue8 - this.computeIntInt(18, this.resolveString2(mod)) - 1.0, keyCode5, this.applyUpdate2(mod)); + keyCode5 += intVal + 3; + } +} + + private void handlePotionEffect(PotionEffect potionEffect) { + double doubleVal = potionEffect.doubleState4; + double doubleVal2 = potionEffect.doubleState3; + double doubleVal3 = potionEffect.doubleState - potionEffect.doubleState4; + double doubleVal4 = potionEffect.doubleState2 - potionEffect.doubleState3; + Double propDouble = this.potionRoundness.get(); + double doubleVal5 = propDouble / 2.0; + int color2 = ColorTheme.BLACK.getStateTicks(); + RenderUtils.drawBorderedRoundedRect(doubleVal, doubleVal2, doubleVal3, doubleVal4, doubleVal5, 1.0F, color2, 0); +} + + private Boolean supplyBoolean25() { + boolean flag; + label29: { + label31: { + Boolean propFlag = this.hudName.get(); + flag = propFlag; + if (!flag) { + break label31; + } + + BooleanProperty boolProp = this.showNameSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label31; + } + + StringProperty strProp = this.font; + flag = strProp.equals("Vanilla"); + + if (!flag) { + flag = true; + break label29; + } + } + + flag = false; + } + + return flag; +} + + private Boolean supplyBoolean26() { + boolean flag; + label29: { + label31: { + Boolean propFlag = this.hudModuleList.get(); + flag = propFlag; + if (!flag) { + break label31; + } + + BooleanProperty boolProp = this.showModuleListSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label31; + } + + ListProperty listProp = this.moduleListShaders; + flag = listProp.contains("Glow"); + + if (flag) { + flag = true; + break label29; + } + } + + flag = false; + } + + return flag; +} + + private Boolean supplyBoolean27() { + boolean flag = this.font.equals("Vanilla"); + flag = !flag; + + return flag; +} + + private Boolean supplyBoolean28() { + boolean flag; + label45: { + label47: { + Boolean propFlag = this.hudInformation.get(); + flag = propFlag; + if (!flag) { + break label47; + } + + BooleanProperty boolProp = this.showPotionSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label47; + } + + BooleanProperty boolProp2 = this.showInformationSettings; + propFlag = boolProp2.get(); + flag = propFlag; + + if (!flag) { + break label47; + } + + ListProperty listProp = this.informationElements; + flag = listProp.contains("Potions"); + + if (!flag) { + break label47; + } + + StringProperty strProp = this.potionStyle; + flag = strProp.equals("New"); + + if (flag) { + flag = true; + break label45; + } + } + + flag = false; + } + + return flag; +} + + private String createString(PotionEffect potionEffect) { + String textStr = this.applyUpdate2(potionEffect); + String textStr2 = this.applyInt5(potionEffect); + String textStr3 = this.resolveString4(potionEffect); + StringProperty strProp = this.potionStyle; + String textStr4; + if (strProp.equals("Basic")) { + StringBuilder sb2 = new StringBuilder().append(textStr); + StringBuilder sb3 = sb2.append(" "); + StringBuilder sb4 = sb3.append(textStr2); + StringBuilder sb5 = sb4.append(" "); + textStr4 = sb5.append(textStr3).toString(); + } else { + StringBuilder sb7 = new StringBuilder().append(textStr); + StringBuilder sb8 = sb7.append(" "); + textStr4 = sb8.append(textStr2).toString(); + } + + return textStr4; +} + + private String applyUpdate3(PotionEffect potionEffect) { + StringBuilder sb = new StringBuilder(); + String textStr = this.applyUpdate2(potionEffect); + sb = sb.append(textStr).append(" "); + textStr = this.applyInt5(potionEffect); + sb = sb.append(textStr).append(" "); + textStr = this.resolveString4(potionEffect); + return sb.append(textStr).toString(); +} + + private static void handleAbstractModule2(AbstractModule module) { + module.callbackTask4.run(); +} + + private List getListValue3() { + boolean flag = this.mc.currentScreen instanceof GuiChat; + if (!flag) { + EntityPlayerSP player = this.mc.thePlayer; + ArrayList itemList = new ArrayList<>(player.getActivePotionEffects()); + BooleanProperty boolProp = this.potionLengthSorting; + Object obj = boolProp.get(); + if (!((Boolean) obj)) { + return itemList; + } + + Stream stream2 = itemList.stream(); + Comparator comparator = Comparator.comparingInt((PotionEffect potionEffect3) -> this.evaluateInt(this.createString(potionEffect3))); + Stream stream3 = stream2.sorted(comparator); + Collector collector = Collectors.toList(); + obj = stream3.collect(collector); + + List itemList2 = (List)obj; + Collections.reverse(itemList2); + return itemList2; + } + + BooleanProperty boolProp2 = this.potionLengthSorting; + Boolean propFlag = boolProp2.get(); + flag = propFlag; + + if (flag) { + Stream stream4 = this.potionEffectList.stream(); + Comparator comparator2 = Comparator.comparingInt((PotionEffect potionEffect4) -> this.evaluateInt(this.createString(potionEffect4))); + Stream stream5 = stream4.sorted(comparator2); + Collector collector2 = Collectors.toList(); + return this.resolveList((List) stream5.collect(collector2)); + } else { + return this.potionEffectList; + } +} + + private Boolean supplyBoolean29() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudKeyStrokes.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showKeystrokesSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private boolean isFlagX() { + boolean flag = Q(); + Boolean propFlag = this.hudModuleList.get(); + boolean flag2 = propFlag; + if (!flag2) { + return false; + } + + Boolean propFlag2 = this.modulelistHideOnDebug.get(); + flag2 = this.matchesFlag(propFlag2); + + return flag ? flag2 : flag2; +} + + public void drawElement2(int value, String text, double amount, double offset, int index, boolean flag, boolean enabled) { + HUD hudMod; + + boolean flag2 = this.font.equals("Vanilla"); + if (flag2) { + net.minecraft.client.gui.FontRenderer font2 = this.mc.fontRendererObj; + float floatVal = (float)amount; + float floatVal2 = (float)offset; + font2.resolveInt(text, floatVal, floatVal2, index, flag); + return; + } + + hudMod = this; + + BooleanProperty boolProp = this.fontOutline; + Boolean propFlag = boolProp.get(); + flag2 = propFlag; + + if (flag2) { + FontRenderer font3 = this.resolveFontRenderer(value); + Float propFloat = this.outlineWidth.get(); + font3.drawElement(text, amount, offset, index, propFloat, enabled); + return; + } + + hudMod = this; + + hudMod.resolveFontRenderer(value).drawElement3(text, amount, offset, index, flag, enabled); +} + + public void drawElement3(int value, String text, double amount, double offset) { + byte byteVal = 0; + char[] charArr = text.toCharArray(); + int len = charArr.length; + int intVal = 0; + + while (intVal < len) { + double doubleVal; + label20: { + char ch = charArr[intVal]; + String textStr = String.valueOf(ch); + long longVal = byteVal; + this.renderVisual3(value, textStr, amount, offset, ColorTheme.getHudColor(longVal)); + HUD hudMod = this; + + StringProperty strProp = this.font; + textStr = "Vanilla"; + if (strProp.equals(textStr)) { + net.minecraft.client.gui.FontRenderer font2 = this.mc.fontRendererObj; + doubleVal = font2.setUnicodeFlag(ch); + break label20; + } + + hudMod = this; + + + FontRenderer font3 = hudMod.resolveFontRenderer(value); + doubleVal = font3.evaluateInt2(ch); + } + + amount += doubleVal; + byteVal -= 120; + intVal++; + + } +} + + public void drawElement4(String text, double value, double amount, int index, boolean flag) { + HUD hudMod; + boolean flag2 = this.font.equals("Vanilla"); + if (flag2) { + net.minecraft.client.gui.FontRenderer font2 = this.mc.fontRendererObj; + float floatVal = (float)value; + float floatVal2 = (float)amount; + font2.resolveInt(text, floatVal, floatVal2, index, flag); + return; + } + + hudMod = this; + + BooleanProperty boolProp = this.fontOutline; + Boolean propFlag = boolProp.get(); + flag2 = propFlag; + + if (flag2) { + FontRenderer font3 = this.getA2mO(); + Float propFloat = this.outlineWidth.get(); + float floatVal3 = propFloat; + font3.drawElement5(text, value, amount, index, floatVal3); + return; + } + + hudMod = this; + + FontRenderer font4 = hudMod.getA2mO(); + font4.drawElement5(text, value, amount, index, flag); +} + + public IntProperty getChatAlpha() { + return this.chatAlpha; +} + + public IntProperty getIntProperty6() { + return this.getChatAlpha(); +} + + public double applyUpdate4(String text, int value, char ch) { + HUD hudMod = this; + + StringProperty strProp = this.font; + if (strProp.equals("Vanilla")) { + net.minecraft.client.gui.FontRenderer font2 = this.mc.fontRendererObj; + return font2.setUnicodeFlag(ch); + } + + hudMod = this; + + + FontRenderer font3 = hudMod.getA2mA(text, value); + return font3.evaluateInt2(ch); +} + + private Boolean supplyBoolean30() { + boolean flag; + label29: { + label28: { + label31: { + Boolean propFlag = this.showNotificationSettings.get(); + flag = propFlag; + if (!flag) { + break label31; + } + + StringProperty strProp = this.notificationStyle; + flag = strProp.equals("Basic"); + + if (flag) { + break label28; + } + + StringProperty strProp2 = this.notificationStyle; + flag = strProp2.equals("Old"); + + if (flag) { + break label28; + } + } + + flag = false; + break label29; + } + + flag = true; + } + + return flag; +} + + private Boolean supplyBoolean31() { + boolean flag; + label29: { + label31: { + Boolean propFlag = this.hudName.get(); + flag = propFlag; + if (!flag) { + break label31; + } + + BooleanProperty boolProp = this.showNameSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label31; + } + + StringProperty strProp = this.nameType; + flag = strProp.equals("Watermark"); + + if (flag) { + flag = true; + break label29; + } + } + + flag = false; + } + + return flag; +} + + + @EventTarget + public void onSetting(SettingEvent event) { + boolean flag; + int intVal; + TaskManager taskManager = this.novoline.getTaskManager(); + HUDSupport hUDSupport = new HUDSupport(this, 50, TaskStage.TICK); + taskManager.applyFutureTask(hUDSupport); + String textStr = event.getSettingName(); + String textStr2 = textStr; + boolean flag2 = H(); + byte byteVal = -1; + flag = flag2; + intVal = textStr2.hashCode(); + + switch (intVal) { + case 1059843520: + intVal = (textStr2.equals("HUD_KEYSTROKES_SMOOTHNESS") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 0; + if (flag) { + break; + } + case -1790138802: + intVal = (textStr2.equals("HUD_MODULE_LIST_SORTING") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 1; + if (flag) { + break; + } + case -1815976029: + intVal = (textStr2.equals("HUD_KEYSTROKES_ALPHA") ? 1 : 0); + + if (intVal != 0) { + byteVal = 2; + } + } + + intVal = byteVal; + + switch (intVal) { + case 0: + this.performStep23(); + if (flag) { + break; + } + case 1: + TimerUtil timerUtil = this.timer; + timerUtil.performAction(); + if (flag) { + break; + } + case 2: + List itemList = this.keystrokesButtonList; + Consumer consumer = HUD::handleKeystrokesButton; + itemList.forEach(consumer); + } +} + + public String getStringValue3() { + return this.hotbarStyle.get(); +} + + public BooleanProperty getNotificationShowDelay() { + return this.notificationShowDelay; +} + + public BooleanProperty getBooleanProperty6() { + return this.getNotificationShowDelay(); +} + + private Boolean supplyBoolean32() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudKeyStrokes.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showKeystrokesSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private void applyInt5(Render2DEvent event) { + int intVal; + StringProperty strProp = this.hotbarStyle; + int intVal2 = (strProp.equals("New") ? 1 : 0); + if (intVal2 != 0) { + double doubleVal = 32.0; + ScaledResolution scaledRes = event.getResolution(); + double scaledWidthD = scaledRes.getScaledWidth() / 2 - 137; + ScaledResolution scaledRes2 = event.getResolution(); + double scaledHeightD = scaledRes2.getScaledHeight() - 24; + Minecraft mcClient = this.mc; + double doubleVal2 = 2000 / mcClient.computeInt2(); + double doubleVal3 = scaledWidthD; + byte byteVal = 0; + List itemList = this.hudPotionEntryList; + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + HudPotionEntry hudPotionEntry = (HudPotionEntry)iter.next(); + hudPotionEntry.setCachedValue(doubleVal3 + 6.0); + hudPotionEntry.setCachedValue2(scaledHeightD + 4.5); + InventoryPlayer inventory2 = this.mc.thePlayer.inventory; + int intVal11 = HudPotionEntry.computeIntFromHudPotionEntry(hudPotionEntry); + HudPotionEntry.evaluateDouble(hudPotionEntry, inventory2.applyInt5(intVal11)); + + int intVal3 = HudPotionEntry.computeIntFromHudPotionEntry(hudPotionEntry); + intVal3 = intVal3 == this.mc.thePlayer.inventory.currentItem ? 1 : 0; + + int intVal4; + label126: { + label125: { + intVal4 = intVal3; + if (intVal4 == 0) { + break label125; + } + + double doubleVal4 = hudPotionEntry.getCachedValue3() + 0.00125 * doubleVal2; + HudPotionEntry.evaluateDouble(hudPotionEntry, MathHelper.clamp_double(doubleVal4, 0.0, 1.5)); + + break label126; + } + + double doubleVal5 = hudPotionEntry.getCachedValue3() - 0.00125 * doubleVal2; + HudPotionEntry.evaluateDouble(hudPotionEntry, MathHelper.clamp_double(doubleVal5, 1.0, 999.0)); + } + + long longVal = byteVal; + Color awtColor = new Color(ColorTheme.getHudColor(longVal)); + int intVal12 = intVal4; + if (intVal4 != 0) { + Color awtColor2 = awtColor.brighter(); + intVal12 = awtColor2.getRGB(); + } else { + intVal12 = awtColor.getRGB(); + } + + hudPotionEntry.evaluateDouble(event, intVal12); + byteVal -= 120; + doubleVal3 += doubleVal; + } + + return; + } + + ScaledResolution scaledRes3 = event.getResolution(); + intVal2 = scaledRes3.getScaledWidth() / 2; + + double doubleVal6 = intVal2; + ScaledResolution scaledRes4 = event.getResolution(); + double scaledHeightD2 = scaledRes4.getScaledHeight(); + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal7 = doubleVal6 - 90.5; + double doubleVal14 = scaledHeightD2 - 22.5; + IntProperty intProp = this.hotbarSmoothness; + Integer intVal5 = intProp.get(); + double doubleVal15 = intVal5.intValue(); + IntProperty intProp2 = this.hotbarAlpha; + Integer intVal13 = intProp2.get(); + Color awtColor3 = new Color(0, 0, 0, intVal13); + roundedTextureShader.drawRoundedRect(doubleVal7, doubleVal14, 181.0, 22.5, 0.0, doubleVal15, awtColor3, true); + short shortVal = 0; + int slot = this.mc.thePlayer.inventory.currentItem; + Minecraft mcClient2 = this.mc; + double doubleVal8 = 2000 / mcClient2.computeInt2(); + double doubleVal16 = 20 * slot; + int ticks = this.stateTicks11; + if (this.stateTicks11 != slot) { + int ticks2 = slot - this.stateTicks11; + if (Math.abs(ticks2) > 7) { + this.cachedValue9 = doubleVal16; + } + + this.stateTicks11 = slot; + } + + double doubleVal9; + ticks = (doubleVal9 = this.cachedValue9 - doubleVal16) == 0.0 ? 0 : (doubleVal9 < 0.0 ? -1 : 1); + + label139: { + if (ticks < 0) { + double doubleVal10 = this.cachedValue9 + 0.125 * doubleVal8; + this.cachedValue9 = MathHelper.clamp_double(doubleVal10, 0.0, doubleVal16); + break label139; + } + + if (this.cachedValue9 > doubleVal16) { + double doubleVal11 = this.cachedValue9 - 0.125 * doubleVal8; + this.cachedValue9 = MathHelper.clamp_double(doubleVal11, doubleVal16, 999.0); + } + } + + RoundedTextureShader roundedTextureShader2 = RoundedTextureShader.getInstance(); + double doubleVal12 = doubleVal6 - 90.0 + this.cachedValue9 - 0.5; + doubleVal14 = scaledHeightD2 - 22.5; + intProp = this.hotbarSmoothness; + Integer intVal6 = intProp.get(); + double doubleVal17 = intVal6.intValue(); + intProp2 = this.hotbarAlpha; + Integer intVal14 = intProp2.get(); + awtColor3 = new Color(0, 0, 0, intVal14); + roundedTextureShader2.drawRoundedRect(doubleVal12, doubleVal14, 20.5, 22.5, 0.0, doubleVal17, awtColor3, true); + ticks = 0; + + int intVal7 = ticks; + + while (intVal7 < 9) { + InventoryPlayer inventory3 = this.mc.thePlayer.inventory; + ItemStack stack = inventory3.applyInt5(intVal7); + + if (stack != null) { + float floatVal = (float)(doubleVal6 - 90.0 + 20 * intVal7 + 2.0); + float floatVal2 = (float)(scaledHeightD2 - 20.5); + RenderUtils.drawElement7(stack, floatVal, floatVal2); + + if (stack.stackSize > 1) { + int intVal8; + label84: { + + int intVal9 = stack.stackSize; + String textStr = String.valueOf(intVal9); + int len = textStr.length(); + intVal8 = 0; + intVal = len; + byte byteVal2 = 2; + + if (len == 2) { + intVal8 = 4; + break label84; + } + + intVal = len; + + byteVal2 = 1; + + + if (intVal != byteVal2) { + break label84; + } + + intVal = 9; + + intVal8 = intVal; + } + + GlStateManager.disableDepth(); + int intVal10 = stack.stackSize; + this.drawElement2(18, String.valueOf(intVal10), doubleVal6 - 90.0 + 20 * intVal7 + 4.0 + intVal8, scaledHeightD2 - 10.0, 16777215, true, false); + GlStateManager.enableDepth(); + } + } + + double doubleVal13 = doubleVal6 - 90.0 + 20 * intVal7 + 1.0; + double doubleVal18 = scaledHeightD2 - 2.0; + doubleVal14 = doubleVal6 - 90.0 + 20 * (intVal7 + 1) - 1.0; + double doubleVal19 = scaledHeightD2 - 1.0; + long longVal2 = shortVal; + int color2 = ColorTheme.getHudColor(longVal2); + RenderUtils.drawRect(doubleVal13, doubleVal18, doubleVal14, doubleVal19, color2); + shortVal -= 180; + intVal7++; + + } +} + + public double computeDouble2(int value, char ch) { + HUD hudMod = this; + + StringProperty strProp = this.font; + if (strProp.equals("Vanilla")) { + net.minecraft.client.gui.FontRenderer font2 = this.mc.fontRendererObj; + return font2.setUnicodeFlag(ch); + } + + hudMod = this; + + + FontRenderer font3 = hudMod.resolveFontRenderer(value); + return font3.evaluateInt2(ch); +} + + private Boolean supplyBoolean33() { + boolean flag; + label29: { + label31: { + StringProperty strProp = this.notificationBgColor; + flag = strProp.equals("Black"); + if (!flag) { + break label31; + } + + BooleanProperty boolProp = this.showNotificationSettings; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label31; + } + + StringProperty strProp2 = this.notificationStyle; + flag = strProp2.equals("Basic"); + + if (flag) { + flag = true; + break label29; + } + } + + flag = false; + } + + return flag; +} + + public void drawElement4(int value, String text, double amount, double offset, int index) { + HUD hudMod; + boolean flag = this.font.equals("Vanilla"); + if (flag) { + this.mc.fontRendererObj.resolveInt(text, amount - this.evaluateInt(text) * 0.5, offset, index, true); + return; + } + + hudMod = this; + + BooleanProperty boolProp = this.fontOutline; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + FontRenderer font2 = this.resolveFontRenderer(value); + double doubleVal = amount - this.computeIntInt(value, text) * 0.5; + Float propFloat = this.outlineWidth.get(); + float floatVal = propFloat; + font2.drawElement5(text, doubleVal, offset, index, floatVal); + return; + } + + hudMod = this; + + FontRenderer font3 = hudMod.resolveFontRenderer(value); + double doubleVal2 = amount - this.computeIntInt(value, text) * 0.5; + font3.drawElement5(text, doubleVal2, offset, index, true); +} + + private Boolean supplyBoolean34() { + boolean flag; + label29: { + label31: { + StringProperty strProp = this.notificationBgColor; + flag = strProp.equals("Black"); + if (!flag) { + break label31; + } + + BooleanProperty boolProp = this.showNotificationSettings; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label31; + } + + StringProperty strProp2 = this.notificationStyle; + flag = strProp2.equals("Basic"); + + if (flag) { + flag = true; + break label29; + } + } + + flag = false; + } + + return flag; +} + + private void updateHelper2(Render2DEvent event) { + List itemList = this.keystrokesButtonList; + Consumer consumer = ((java.util.function.Consumer) ((java.util.function.Consumer) (keystrokesButton) -> keystrokesButton.renderVisual2())); + itemList.forEach(consumer); +} + + private static boolean matchesAbstractModule3(AbstractModule module) { + int intVal = (module.getSmoothAnimation2().getCachedValue2() > 0.0) ? 1 : 0; + + return ((intVal & 1) != 0); +} + + public double computeDoubleValue2() { + HUD hudMod = this; + + StringProperty strProp = this.font; + if (strProp.equals("Vanilla")) { + net.minecraft.client.gui.FontRenderer font2 = this.mc.fontRendererObj; + return font2.computeDouble(); + } + + hudMod = this; + + + FontRenderer font3 = hudMod.getA2mO(); + return font3.getStateTicks6(); +} + + private void drawElement2(net.minecraft.client.gui.FontRenderer fontRenderer, String text, double value, double amount, int index, double offset, boolean flag) { + GL11.glPushMatrix(); + GL11.glTranslated(value, amount, 0.0); + GL11.glScaled(offset, offset, 1.0); + GL11.glTranslated(-value, -amount, 0.0); + float floatVal = (float)value; + float floatVal2 = (float)amount; + fontRenderer.resolveInt(text, floatVal, floatVal2, index, flag); + GL11.glPopMatrix(); +} + + public void renderFontRenderer(FontRenderer fontRenderer, String text, double value, double amount, boolean flag, boolean enabled, int index, int count) { + byte byteVal = 0; + char[] charArr = text.toCharArray(); + + for (char ch : charArr) { + String textStr = String.valueOf(ch); + long longVal = byteVal; + int color2 = ColorTheme.evaluateInt3(index, count, longVal); + fontRenderer.drawElement5(textStr, value, amount, color2, flag); + value += fontRenderer.evaluateInt2(ch); + byteVal -= 90; + + } +} + + private Boolean supplyBoolean35() { + boolean flag; + label37: { + label39: { + Boolean propFlag = this.hudName.get(); + flag = propFlag; + if (!flag) { + break label39; + } + + BooleanProperty boolProp = this.showNameSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label39; + } + + StringProperty strProp = this.nameType; + flag = strProp.equals("Watermark"); + + if (!flag) { + break label39; + } + + StringProperty strProp2 = this.watermarkStyle; + flag = strProp2.equals("Basic"); + + if (flag) { + flag = true; + break label37; + } + } + + flag = false; + } + + return flag; +} + + private Boolean supplyBoolean36() { + boolean flag; + label37: { + label39: { + Boolean propFlag = this.hudInformation.get(); + flag = propFlag; + if (!flag) { + break label39; + } + + BooleanProperty boolProp = this.showArmorSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label39; + } + + BooleanProperty boolProp2 = this.showInformationSettings; + propFlag = boolProp2.get(); + flag = propFlag; + + if (!flag) { + break label39; + } + + ListProperty listProp = this.informationElements; + flag = listProp.contains("Armor"); + + if (flag) { + flag = true; + break label37; + } + } + + flag = false; + } + + return flag; +} + + public static IntProperty applyUpdate3(HUD hUD) { + return hUD.keyStrokesSmoothness; +} + + private Boolean supplyBoolean37() { + boolean flag; + label45: { + label47: { + Boolean propFlag = this.hudInformation.get(); + flag = propFlag; + if (!flag) { + break label47; + } + + BooleanProperty boolProp = this.showArmorSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label47; + } + + BooleanProperty boolProp2 = this.showInformationSettings; + propFlag = boolProp2.get(); + flag = propFlag; + + if (!flag) { + break label47; + } + + ListProperty listProp = this.informationElements; + flag = listProp.contains("Armor"); + + if (!flag) { + break label47; + } + + BooleanProperty boolProp3 = this.armorBackground; + propFlag = boolProp3.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label45; + } + } + + flag = false; + } + + return flag; +} + + private FontFamily resolveHelper2(String text) { + int intVal; + int intVal2; + boolean flag = H(); + StringProperty strProp = this.font; + boolean flag2 = strProp.equals("Client"); + if (flag2) { + strProp = this.clientFont; + String propStr = strProp.get(); + byte byteVal = -1; + intVal = propStr.hashCode(); + + switch (intVal) { + case 70808764: + intVal = (propStr.equals("Inter") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 0; + if (flag) { + break; + } + case 82837092: + intVal = (propStr.equals("Volte") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 1; + if (flag) { + break; + } + case -1898676796: + intVal = (propStr.equals("Poppin") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 2; + if (flag) { + break; + } + case 2107684854: + intVal = (propStr.equals("Jetbrains") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 3; + if (flag) { + break; + } + case 1540367136: + intVal = (propStr.equals("San Francisco") ? 1 : 0); + + if (intVal != 0) { + byteVal = 4; + } + } + + intVal = byteVal; + + + label349: { + String textStr; + byte byteVal2; + + label350: { + + label351: { + + label352: { + switch (intVal) { + case 0: + textStr = text; + byteVal2 = -1; + intVal2 = textStr.hashCode(); + switch (intVal2) { + case -1543850116: + intVal2 = (textStr.equals("Regular") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal2 = 0; + if (flag) { + break; + } + case -1994163307: + intVal2 = (textStr.equals("Medium") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal2 = 1; + if (flag) { + break; + } + case 2076325: + intVal2 = (textStr.equals("Bold") ? 1 : 0); + + if (intVal2 != 0) { + byteVal2 = 2; + } + } + + intVal2 = byteVal2; + + switch (intVal2) { + case 0: + return this.fontFamilyField8; + case 1: + return this.fontFamilyField6; + case 2: + return this.fontFamilyField5; + } + case 1: + textStr = text; + byteVal2 = -1; + intVal2 = textStr.hashCode(); + break; + case 2: + break label352; + case 3: + break label351; + case 4: + break label350; + default: + break label349; + } + + switch (intVal2) { + case -1543850116: + intVal2 = (textStr.equals("Regular") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal2 = 0; + if (flag) { + break; + } + case -1994163307: + intVal2 = (textStr.equals("Medium") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal2 = 1; + if (flag) { + break; + } + case 2076325: + intVal2 = (textStr.equals("Bold") ? 1 : 0); + + if (intVal2 != 0) { + byteVal2 = 2; + } + } + + intVal2 = byteVal2; + + switch (intVal2) { + case 0: + return this.fontFamilyField7; + case 1: + return this.fontFamilyField11; + case 2: + return this.fontFamilyField; + } + } + + textStr = text; + byteVal2 = -1; + intVal2 = textStr.hashCode(); + + switch (intVal2) { + case -1543850116: + intVal2 = (textStr.equals("Regular") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal2 = 0; + if (flag) { + break; + } + case -1994163307: + intVal2 = (textStr.equals("Medium") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal2 = 1; + if (flag) { + break; + } + case 2076325: + intVal2 = (textStr.equals("Bold") ? 1 : 0); + + if (intVal2 != 0) { + byteVal2 = 2; + } + } + + intVal2 = byteVal2; + + switch (intVal2) { + case 0: + return this.fontFamilyField2; + case 1: + return this.fontFamilyField17; + case 2: + return this.fontFamilyField12; + } + } + + textStr = text; + byteVal2 = -1; + intVal2 = textStr.hashCode(); + + switch (intVal2) { + case -1543850116: + intVal2 = (textStr.equals("Regular") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal2 = 0; + if (flag) { + break; + } + case -1994163307: + intVal2 = (textStr.equals("Medium") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal2 = 1; + if (flag) { + break; + } + case 2076325: + intVal2 = (textStr.equals("Bold") ? 1 : 0); + + if (intVal2 != 0) { + byteVal2 = 2; + } + } + + intVal2 = byteVal2; + + switch (intVal2) { + case 0: + return this.fontFamilyField15; + case 1: + return this.fontFamilyField14; + case 2: + return this.fontFamilyField10; + } + } + + textStr = text; + byteVal2 = -1; + intVal2 = textStr.hashCode(); + + switch (intVal2) { + case -1543850116: + intVal2 = (textStr.equals("Regular") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal2 = 0; + if (flag) { + break; + } + case -1994163307: + intVal2 = (textStr.equals("Medium") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal2 = 1; + if (flag) { + break; + } + case 2076325: + intVal2 = (textStr.equals("Bold") ? 1 : 0); + + if (intVal2 != 0) { + byteVal2 = 2; + } + } + + intVal2 = byteVal2; + + switch (intVal2) { + case 0: + return this.fontFamilyField4; + case 1: + return this.fontFamilyField13; + case 2: + return this.fontFamilyField3; + } + } + + return this.fontFamilyField16; + } + + strProp = this.font; + flag2 = strProp.equals("Custom"); + + if (flag2) { + FontFamily fontFam = this.fontFamilyField9; + + if (this.fontFamilyField9 == null) { + strProp = this.font; + strProp.set("Vanilla"); + return this.fontFamilyField16; + } + + fontFam = this.fontFamilyField9; + + + return fontFam; + } else { + return this.fontFamilyField16; + } +} + + public void performAction() { + this.abstractModuleList = this.getListW(); +} + + public double computeDouble3(char ch) { + HUD hudMod = this; + StringProperty strProp = this.font; + if (strProp.equals("Vanilla")) { + net.minecraft.client.gui.FontRenderer font2 = this.mc.fontRendererObj; + return font2.setUnicodeFlag(ch); + } + + hudMod = this; + + FontRenderer font3 = hudMod.getA2mO(); + return font3.evaluateInt2(ch); +} + + public int evaluateInt(String text) { + HUD hudMod = this; + StringProperty strProp = this.font; + if (strProp.equals("Vanilla")) { + return this.mc.fontRendererObj.getStringWidth(text); + } + + hudMod = this; + + FontRenderer font2 = hudMod.getA2mO(); + return font2.evaluateInt2(text); +} + + private void evaluateInt(Render2DEvent event) { + cc.novoline.modules.visual.HUD hudMod; + cc.novoline.modules.visual.HUD hudMod2; + int ticks; + GaussianBlurShader gaussianBlurShader; + java.lang.Integer intVal; + label87: { + ConfigManager cfgManager; + + label83: { + hudMod = this; + + if (this.abstractModuleList != null) { + hudMod = this; + + List itemList = this.abstractModuleList; + if (!itemList.isEmpty()) { + hudMod2 = this; + + if (this.mc.thePlayer == null) { + break label83; + } + + ticks = this.mc.thePlayer.ticksExisted; + + if (this.mc.thePlayer.ticksExisted >= 5) { + break label83; + } + } + } + + hudMod = this; + + hudMod.performAction(); + + break label87; + + } + + hudMod2 = this; + + Novoline novolineInst = hudMod2.novoline; + ModuleManager modManager = novolineInst.getModuleManager(); + cfgManager = modManager.getConfigManager(); + + ticks = (cfgManager.c ? 1 : 0); + + if (ticks == 0) { + break label87; + } + + this.performAction(); + Novoline novolineInst2 = this.novoline; + ModuleManager modManager2 = novolineInst2.getModuleManager(); + cfgManager = modManager2.getConfigManager(); + + cfgManager.c = false; + } + + ScaledResolution scaledRes = event.getResolution(); + int scaledHeight = scaledRes.getScaledHeightGui(); + int scaledWidth = scaledRes.getScaledWidthGui(); + int intVal8 = this.getIntValue18(); + IntProperty intProp = this.moduleListXPosition; + Integer intVal2 = intProp.get(); + double doubleVal2 = intVal2.intValue(); + double[] doubleArr = new double[1]; + Integer intVal3 = this.moduleListYPosition.get(); + doubleArr[0] = intVal3.intValue(); + double[] doubleArr2 = doubleArr; + int[] intArr = new int[]{0}; + List itemList2 = this.abstractModuleList; + Stream stream2 = itemList2.stream(); + Predicate predicate = HUD::matchesAbstractModule3; + Stream stream3 = stream2.filter(predicate); + Collector collector = Collectors.toList(); + List itemList3 = (java.util.List) stream3.collect(collector); + int intVal4 = 0; + + while (true) { + if (intVal4 < itemList3.size()) { + AbstractModule abstractModule = (AbstractModule)itemList3.get(intVal4); + StringProperty strProp = this.moduleListAligment; + boolean flag = strProp.equals("Right"); + StringProperty strProp2 = this.moduleListAligment; + byte byteVal = (byte)(strProp2.equals("Left") ? 1 : 0); + + FontRenderer font2 = this.getA2mO(); + String displayName = abstractModule.getFormattedDisplayName(); + int intVal5 = font2.evaluateInt2(displayName) / 2; + byte byteVal2 = byteVal; + + byteVal2 = (byte)(byteVal != 0 ? -1 : 1); + + + abstractModule.doubleField = doubleVal2 - intVal5 * byteVal2; + double doubleVal = abstractModule.getDoubleValue4(); + font2 = this.getA2mO(); + abstractModule.v = doubleVal + font2.getHeight() / 2; + int intVal9 = intVal4; + abstractModule.handleRunnable($lambdaCapture$122(this, abstractModule, doubleArr2, doubleVal2, intArr, flag, byteVal != 0, intVal8, intVal9, itemList3)); + intVal4++; + + continue; + + } + + ListProperty listProp = this.moduleListShaders; + if (listProp.contains("Glow")) { + int intVal10; + Color awtColor; + Runnable runnable; + label46: { + label45: { + gaussianBlurShader = GaussianBlurShader.getGaussianBlurShader(); + IntProperty intProp2 = this.moduleListGlowRadius; + Integer intVal6 = intProp2.get(); + intVal = intVal6; + IntProperty intProp3 = this.moduleListGlowAlpha; + Integer intVal7 = intProp3.get(); + intVal10 = intVal7; + runnable = ((Runnable) (() -> this.handleList(itemList3))); + StringProperty strProp3 = this.moduleListGlowMode; + String textStr = "Background"; + boolean flag2 = strProp3.equals(textStr); + + if (!flag2) { + break label45; + } + + StringProperty strProp4 = this.moduleListGlowType; + textStr = "Shadow"; + flag2 = strProp4.equals(textStr); + + + if (flag2) { + awtColor = Color.BLACK; + break label46; + } + } + + awtColor = null; + } + + gaussianBlurShader.renderVisual(intVal, intVal10, true, runnable, awtColor); + } + break; + } +} + + private Boolean supplyBoolean38() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.showNotificationSettings.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + StringProperty strProp = this.notificationStyle; + flag = strProp.equals("Basic"); + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + public void drawElement4(FontRenderer fontRenderer, String text, double value, double amount, int index) { + label16: { + Boolean propFlag = this.fontOutline.get(); + if (!propFlag) { + break label16; + } + + Float propFloat = this.outlineWidth.get(); + float floatVal = propFloat; + fontRenderer.drawElement5(text, value, amount, index, floatVal); + + + return; + + } + + fontRenderer.drawElement5(text, value, amount, index, true); +} + + public void drawElement4(int value, String text, double amount, double offset, boolean flag) { + byte byteVal = 0; + char[] charArr = text.toCharArray(); + int len = charArr.length; + int intVal = 0; + + while (intVal < len) { + double doubleVal; + label20: { + char ch = charArr[intVal]; + String textStr = String.valueOf(ch); + long longVal = byteVal; + this.drawElement(value, textStr, amount, offset, ColorTheme.getHudColor(longVal), flag); + HUD hudMod = this; + StringProperty strProp = this.font; + textStr = "Vanilla"; + if (strProp.equals(textStr)) { + net.minecraft.client.gui.FontRenderer font2 = this.mc.fontRendererObj; + doubleVal = font2.setUnicodeFlag(ch); + break label20; + } + + hudMod = this; + + FontRenderer font3 = hudMod.resolveFontRenderer(value); + doubleVal = font3.evaluateInt2(ch); + } + + amount += doubleVal; + byteVal -= 120; + intVal++; + + } +} + + private double[] resolveDoubleArray(int value, int index) { + Stream stream2 = this.abstractModuleList.stream(); + Predicate predicate = HUD::matchesAbstractModule2; + Stream stream3 = stream2.filter(predicate); + Collector collector = Collectors.toList(); + List itemList = (java.util.List) stream3.collect(collector); + int intVal = this.evaluateInt(((AbstractModule)itemList.get(0)).getFormattedDisplayName()); + double doubleVal = index; + DoubleProperty doubleProp = this.moduleListPadding; + Double propDouble = doubleProp.get(); + double doubleVal2 = doubleVal - propDouble / 2.0; + double doubleVal3 = this.getIntValue18(); + double doubleVal4 = itemList.size(); + Double propDouble2 = this.moduleListPadding.get(); + double doubleVal5 = doubleVal4 * (doubleVal3 + propDouble2); + double doubleVal6 = 0.0; + double doubleVal12 = 0.0; + double doubleVal13 = 0.0; + double doubleVal7 = 0.0; + StringProperty strProp = this.moduleListAligment; + byte byteVal = (byte)(strProp.equals("Right") ? 1 : 0); + StringProperty strProp2 = this.moduleListSorting; + byte byteVal2 = (byte)(strProp2.equals("Up") ? 1 : 0); + int intVal2 = byteVal; + if (byteVal != 0) { + doubleVal6 = value - intVal - 4; + int intVal3 = byteVal2; + if (byteVal2 != 0) { + doubleVal12 = doubleVal2 - 2.5; + doubleVal13 = value + 4.5; + doubleVal7 = doubleVal2 + doubleVal5 + 1.5; + + return new double[]{doubleVal6, doubleVal12, doubleVal13, doubleVal7}; + + } + + double doubleVal8 = doubleVal2 - doubleVal5 + doubleVal3; + DoubleProperty doubleProp2 = this.moduleListPadding; + Double propDouble3 = doubleProp2.get(); + doubleVal12 = doubleVal8 + propDouble3 - 2.5; + intVal3 = value; + + doubleVal13 = intVal3 + 4.5; + double doubleVal9 = doubleVal2 + doubleVal3; + DoubleProperty doubleProp3 = this.moduleListPadding; + Double propDouble4 = doubleProp3.get(); + doubleVal7 = doubleVal9 + propDouble4 + 1.5; + + return new double[]{doubleVal6, doubleVal12, doubleVal13, doubleVal7}; + + } + + doubleVal6 = value - 4; + intVal2 = byteVal2; + + if (intVal2 != 0) { + doubleVal12 = doubleVal2 - 2.5; + doubleVal13 = value + intVal + 4.5; + doubleVal7 = doubleVal2 + doubleVal5 + 1.5; + + return new double[]{doubleVal6, doubleVal12, doubleVal13, doubleVal7}; + + } + + double doubleVal10 = doubleVal2 - doubleVal5 + doubleVal3; + DoubleProperty doubleProp4 = this.moduleListPadding; + Double propDouble5 = doubleProp4.get(); + doubleVal12 = doubleVal10 + propDouble5 - 2.5; + intVal2 = value + intVal; + + doubleVal13 = intVal2 + 4.5; + double doubleVal11 = doubleVal2 + doubleVal3; + DoubleProperty doubleProp5 = this.moduleListPadding; + Double propDouble6 = doubleProp5.get(); + doubleVal7 = doubleVal11 + propDouble6 + 1.5; + return new double[]{doubleVal6, doubleVal12, doubleVal13, doubleVal7}; +} + + private Boolean supplyBoolean39() { + boolean flag; + label29: { + label31: { + flag = this.hotbarStyle.equals("Basic"); + if (!flag) { + break label31; + } + + BooleanProperty boolProp = this.hudHotbar; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label31; + } + + BooleanProperty boolProp2 = this.showHotbarSettings; + Boolean propFlag2 = boolProp2.get(); + flag = propFlag2; + + if (flag) { + flag = true; + break label29; + } + } + + flag = false; + } + + return flag; +} + + public StringProperty getNotificationStyle() { + return this.notificationStyle; +} + + public StringProperty getStringProperty14() { + return this.getNotificationStyle(); +} + + private Boolean supplyBoolean40() { + boolean flag; + label29: { + label31: { + Boolean propFlag = this.hudModuleList.get(); + flag = propFlag; + if (!flag) { + break label31; + } + + BooleanProperty boolProp = this.showModuleListSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label31; + } + + ListProperty listProp = this.moduleListShaders; + flag = listProp.contains("Glow"); + + if (flag) { + flag = true; + break label29; + } + } + + flag = false; + } + + return flag; +} + + public double getDoubleValue2() { + Double propDouble = this.chatRoundness.get(); + return propDouble; +} + + private Boolean supplyBoolean41() { + boolean flag; + label45: { + label47: { + Boolean propFlag = this.hudInformation.get(); + flag = propFlag; + if (!flag) { + break label47; + } + + BooleanProperty boolProp = this.showArmorSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label47; + } + + BooleanProperty boolProp2 = this.showInformationSettings; + propFlag = boolProp2.get(); + flag = propFlag; + + if (!flag) { + break label47; + } + + ListProperty listProp = this.informationElements; + flag = listProp.contains("Armor"); + + if (!flag) { + break label47; + } + + BooleanProperty boolProp3 = this.armorBackground; + propFlag = boolProp3.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label45; + } + } + + flag = false; + } + + return flag; +} + + private Boolean supplyBoolean42() { + boolean flag; + label29: { + label31: { + Boolean propFlag = this.hudModuleList.get(); + flag = propFlag; + if (!flag) { + break label31; + } + + BooleanProperty boolProp = this.showModuleListSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label31; + } + + StringProperty strProp = this.moduleListBackground; + flag = strProp.equals("None"); + + if (!flag) { + flag = true; + break label29; + } + } + + flag = false; + } + + return flag; +} + + private Boolean supplyBoolean43() { + boolean flag; + label43: { + label42: { + label45: { + Boolean propFlag = this.hudInformation.get(); + flag = propFlag; + if (!flag) { + break label45; + } + + BooleanProperty boolProp = this.showTpsRamSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label45; + } + + BooleanProperty boolProp2 = this.showInformationSettings; + propFlag = boolProp2.get(); + flag = propFlag; + + if (!flag) { + break label45; + } + + ListProperty listProp = this.informationElements; + flag = listProp.contains("TPS"); + + if (flag) { + break label42; + } + + ListProperty listProp2 = this.informationElements; + flag = listProp2.contains("RAM"); + + if (flag) { + break label42; + } + } + + flag = false; + break label43; + } + + flag = true; + } + + return flag; +} + + private Boolean supplyBoolean44() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudKeyStrokes.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showKeystrokesSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private void applyUpdate5(int value, String text, double amount, double offset) { + char[] charArr = text.toCharArray(); + int len = charArr.length; + int intVal = 0; + + while (intVal < len) { + char ch = charArr[intVal]; + String textStr = String.valueOf(ch); + long longVal = this.stateTicks2; + this.drawElement(value, textStr, amount, offset, ColorTheme.getHudColor(longVal), true); + amount += this.computeDouble2(value, ch); + this.stateTicks2 -= 120; + intVal++; + + } +} + + private Boolean supplyBoolean45() { + boolean flag; + label37: { + label39: { + Boolean propFlag = this.hudName.get(); + flag = propFlag; + if (!flag) { + break label39; + } + + BooleanProperty boolProp = this.showNameSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label39; + } + + StringProperty strProp = this.nameType; + flag = strProp.equals("Watermark"); + + if (!flag) { + break label39; + } + + StringProperty strProp2 = this.watermarkStyle; + flag = strProp2.equals("Neverlose"); + + if (flag) { + flag = true; + break label37; + } + } + + flag = false; + } + + return flag; +} + + private static boolean matchesModuleHolder(ModuleHolder moduleHolder) { + boolean flag = Q(); + Object obj = moduleHolder.getModule(); + + ModuleRegistry modEntry = ModuleRegistry.CLICKGUI; + if (obj == modEntry.getModule()) { + return false; + } + + obj = moduleHolder.getModule().getKeyBindProperty().get(); + + + int keyCode = ((ModuleKeybind) obj).getStateTicks(); + return flag ? (keyCode & 1) != 0 : keyCode != 0; +} + + private Boolean supplyBoolean46() { + boolean flag; + label29: { + label31: { + flag = this.hotbarStyle.equals("Basic"); + if (!flag) { + break label31; + } + + BooleanProperty boolProp = this.hudHotbar; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label31; + } + + BooleanProperty boolProp2 = this.showHotbarSettings; + Boolean propFlag2 = boolProp2.get(); + flag = propFlag2; + + if (flag) { + flag = true; + break label29; + } + } + + flag = false; + } + + return flag; +} + + public FontRenderer getA2mA(String text, int value) { + FontFamily fontFam = this.resolveHelper2(text); + return fontFam.ofSize(value); +} + + private Boolean supplyBoolean47() { + boolean flag; + label29: { + label31: { + Boolean propFlag = this.hudName.get(); + flag = propFlag; + if (!flag) { + break label31; + } + + BooleanProperty boolProp = this.showNameSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label31; + } + + StringProperty strProp = this.nameType; + flag = strProp.equals("Basic"); + + if (flag) { + flag = true; + break label29; + } + } + + flag = false; + } + + return flag; +} + + private void updateHelper3(Render2DEvent event) { + Object obj; + double doubleVal; + ScaledResolution scaledRes = event.getResolution(); + ClickGui clickGuiMod = ModuleRegistry.CLICKGUI.getModule(); + int scaledWidth = scaledRes.getScaledWidthGui(); + int scaledHeight = scaledRes.getScaledHeightGui(); + ArrayList itemList = new ArrayList(); + ListProperty listProp = this.informationElements; + boolean flag = listProp.contains("Coordinates"); + if (flag) { + Minecraft mcClient = this.mc; + Entity entity = mcClient.getRenderViewEntity(); + String textStr = "XYZ: %.0f %.0f %.0f"; + Object[] objArr = new Object[3]; + double posX2 = entity.posX; + objArr[0] = posX2; + posX2 = entity.posY; + objArr[1] = posX2; + posX2 = entity.posZ; + objArr[2] = posX2; + String textStr2 = String.format(textStr, objArr); + itemList.add(textStr2); + } + + ListProperty listProp2 = this.informationElements; + flag = listProp2.contains("Ping"); + + if (flag) { + StringBuilder sb2 = new StringBuilder().append("Ping: "); + Novoline novolineInst = this.novoline; + ServerCommandTracker serverCommandTracker = novolineInst.getServerCommandTracker(); + long longVal = serverCommandTracker.getLongValue(); + String textStr3 = sb2.append(longVal).toString(); + itemList.add(textStr3); + } + + ListProperty listProp3 = this.informationElements; + flag = listProp3.contains("BPS"); + + if (flag) { + label57: { + HUD hudMod = this; + if (this.cachedValue10 == 0.0) { + EntityPlayerSP player = this.mc.thePlayer; + doubleVal = player.getDouble8(); + break label57; + } + + hudMod = this; + + doubleVal = hudMod.cachedValue10; + } + + double doubleVal2 = doubleVal; + String textStr4 = "BPS: %.2f"; + Object[] objArr2 = new Object[1]; + double speed = doubleVal2 * 20.0 * this.mc.timer.timerSpeed; + objArr2[0] = speed; + String textStr5 = String.format(textStr4, objArr2); + String textStr6 = textStr5.replace(",", "."); + itemList.add(textStr6); + } + + obj = this.informationElements; + + flag = ((ListProperty)obj).a("FPS"); + + if (flag) { + StringBuilder sb4 = new StringBuilder().append("FPS: "); + Minecraft mcClient2 = this.mc; + int intVal = mcClient2.computeInt2(); + String textStr7 = sb4.append(intVal).toString(); + itemList.add(textStr7); + } + + DoubleProperty doubleProp = this.informationPadding; + obj = doubleProp.get(); + + Double doubleVal3 = (Double)obj; + double doubleVal4 = doubleVal3 - 1.0; + double doubleVal5 = scaledHeight; + StringProperty strProp = this.font; + double doubleVal6 = strProp.equals("Vanilla") ? 2.0 : 1.0; + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + String textStr8 = (String)iter.next(); + doubleVal5 -= this.getIntValue18() + doubleVal4; + String[] stringArr = textStr8.split(":"); + String textStr9 = stringArr[0]; + String textStr10 = stringArr[1]; + StringBuilder sb6 = new StringBuilder().append(textStr9); + this.renderElement(sb6.append(":").toString(), doubleVal6, doubleVal5 + doubleVal4 / 2.0); + double doubleVal7 = doubleVal6 + 3.0 + this.evaluateInt(textStr9); + double doubleVal8 = doubleVal5 + doubleVal4 / 2.0; + ColorTheme colorTheme = ColorTheme.WHITE; + this.drawElement3(textStr10, doubleVal7, doubleVal8, colorTheme.getStateTicks()); + } +} + + private Boolean supplyBoolean48() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.fontOutline.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + StringProperty strProp = this.font; + flag = strProp.equals("Vanilla"); + + if (!flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + public StringProperty getClientFont() { + return this.clientFont; +} + + public StringProperty getStringProperty() { + return this.getClientFont(); +} + + public void drawElement3(String text, double value, double amount, int index) { + HUD hudMod; + boolean flag = this.font.equals("Vanilla"); + if (flag) { + net.minecraft.client.gui.FontRenderer font2 = this.mc.fontRendererObj; + float floatVal = (float)value; + float floatVal2 = (float)amount; + font2.resolveInt(text, floatVal, floatVal2, index, true); + return; + } + + hudMod = this; + + BooleanProperty boolProp = this.fontOutline; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + FontRenderer font3 = this.getA2mO(); + Float propFloat = this.outlineWidth.get(); + float floatVal3 = propFloat; + font3.drawElement5(text, value, amount, index, floatVal3); + return; + } + + hudMod = this; + + FontRenderer font4 = hudMod.getA2mO(); + font4.drawElement5(text, value, amount, index, true); +} + + public void drawElement2(int value, String text, String str, double amount, double offset, int index, boolean flag) { + HUD hudMod; + + boolean flag2 = this.font.equals("Vanilla"); + if (flag2) { + net.minecraft.client.gui.FontRenderer font2 = this.mc.fontRendererObj; + float floatVal = (float)amount; + float floatVal2 = (float)offset; + font2.resolveInt(str, floatVal, floatVal2, index, flag); + return; + } + + hudMod = this; + + BooleanProperty boolProp = this.fontOutline; + Boolean propFlag = boolProp.get(); + flag2 = propFlag; + + if (flag2) { + FontRenderer font3 = this.getA2mA(text, value); + Float propFloat = this.outlineWidth.get(); + float floatVal3 = propFloat; + font3.drawElement5(str, amount, offset, index, floatVal3); + return; + } + + hudMod = this; + + FontRenderer font4 = hudMod.getA2mA(text, value); + font4.drawElement5(str, amount, offset, index, flag); +} + + private Boolean supplyBoolean49() { + boolean flag; + label29: { + label31: { + flag = this.hotbarStyle.equals("Basic"); + if (!flag) { + break label31; + } + + BooleanProperty boolProp = this.hudHotbar; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label31; + } + + BooleanProperty boolProp2 = this.showHotbarSettings; + Boolean propFlag2 = boolProp2.get(); + flag = propFlag2; + + if (flag) { + flag = true; + break label29; + } + } + + flag = false; + } + + return flag; +} + + public static boolean Q() { + boolean flag = H(); + return !flag; +} + + public ColorProperty getColor() { + return this.color; +} + + public ColorProperty getColorProperty4() { + return this.getColor(); +} + + public void drawElement4(FontRenderer fontRenderer, String text, double value, double amount, boolean flag) { + byte byteVal = 0; + char[] charArr = text.toCharArray(); + int len = charArr.length; + int intVal = 0; + + while (intVal < len) { + double doubleVal; + label20: { + char ch = charArr[intVal]; + String textStr = String.valueOf(ch); + long longVal = byteVal; + this.drawElement(fontRenderer, textStr, value, amount, ColorTheme.getHudColor(longVal), flag); + StringProperty strProp = this.font; + textStr = "Vanilla"; + int intVal2 = (strProp.equals(textStr) ? 1 : 0); + if (intVal2 == 0) { + doubleVal = fontRenderer.evaluateInt2(ch); + break label20; + } + + net.minecraft.client.gui.FontRenderer font2 = this.mc.fontRendererObj; + intVal2 = font2.setUnicodeFlag(ch); + + doubleVal = intVal2; + } + + value += doubleVal; + byteVal -= 120; + intVal++; + + } +} + + private Boolean supplyBoolean50() { + boolean flag; + label29: { + label31: { + Boolean propFlag = this.hudModuleList.get(); + flag = propFlag; + if (!flag) { + break label31; + } + + BooleanProperty boolProp = this.showModuleListSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label31; + } + + StringProperty strProp = this.moduleListBackground; + flag = strProp.equals("Bar"); + + if (flag) { + flag = true; + break label29; + } + } + + flag = false; + } + + return flag; +} + + public static Minecraft evaluateInt(HUD hUD) { + return hUD.mc; +} + + private void invokeCallback4(double x, double y, double z) { + double doubleVal = this.cachedValue4; + double doubleVal2 = this.cachedValue16; + int color2 = ColorTheme.BLACK.getStateTicks(); + RenderUtils.drawRoundedRect(x, y, doubleVal, doubleVal2, z, color2); +} + + @EventTarget + public void onRenderGui(RenderGuiEvent event) { + Object obj; + Object obj2; + GuiState guiState; + GuiState guiState2; + boolean flag = Q(); + int intVal108 = (event.getGuiScreen() instanceof GuiChat ? 1 : 0); + if (intVal108 == 0) { + return; + } + + intVal108 = event.getMouseX(); + intVal108 = MovementUtils.evaluateDouble(intVal108); + + int intVal109; + int intVal110; + intVal109 = intVal108; + intVal108 = event.getMouseY(); + intVal110 = MovementUtils.scaleYInt(intVal108); + BooleanProperty boolProp = this.hudInformation; + Boolean propFlag = boolProp.get(); + intVal108 = (propFlag ? 1 : 0); + + if (intVal108 != 0) { + ListProperty listProp = this.informationElements; + intVal108 = (listProp.contains("TPS") ? 1 : 0); + + label752: + if (intVal108 != 0) { + GuiState guiState3 = event.getState(); + GuiState guiState4 = GuiState.CLICK; + if (guiState3 == GuiState.CLICK) { + int intVal; + int intVal2; + label746: { + label767: { + IntProperty intProp = this.tpsXPosition; + Integer intVal3 = intProp.get(); + intVal = intVal3; + IntProperty intProp2 = this.tpsYPosition; + intVal3 = intProp2.get(); + intVal2 = intVal3; + intVal108 = intVal109; + int intVal4 = intVal; + if (intVal109 <= intVal) { + break label767; + } + + intVal108 = intVal109; + intVal4 = intVal + 42; + + if (!flag) { + if (intVal108 > intVal4) { + break label767; + } + + intVal108 = intVal110; + intVal4 = intVal2; + } + + if (intVal108 <= intVal4) { + break label767; + } + + intVal108 = intVal110; + + intVal4 = intVal2 + 47; + + if (intVal108 <= intVal4) { + intVal108 = 1; + break label746; + } + } + + intVal108 = 0; + } + + label725: { + int intVal5 = intVal108; + int intVal6 = intVal5; + + if (intVal5 == 0) { + break label725; + } + + intVal6 = event.getMouseButton(); + + + if (intVal6 == 0) { + this.stateTicks9 = intVal - intVal109; + this.stateTicks15 = intVal2 - intVal110; + this.stateFlag4 = true; + } + } + + break label752; + } + + guiState3 = event.getState(); + guiState4 = GuiState.RENDER; + + if (guiState3 == guiState4) { + int intVal7 = (this.stateFlag4 ? 1 : 0); + if (this.stateFlag4) { + IntProperty intProp3 = this.tpsXPosition; + int ticks = this.stateTicks9 + intVal109; + IntProperty intProp4 = this.tpsXPosition; + Integer intVal8 = intProp4.getMinimum(); + int intVal111 = intVal8; + IntProperty intProp5 = this.tpsXPosition; + Integer intVal9 = intProp5.getMaximum(); + int intVal112 = intVal9; + int intVal10 = MathHelper.clamp_int(ticks, intVal111, intVal112); + Integer intVal11 = intVal10; + intProp3.set(intVal11); + IntProperty intProp6 = this.tpsYPosition; + int ticks2 = this.stateTicks15 + intVal110; + intProp4 = this.tpsYPosition; + Integer intVal12 = intProp4.getMinimum(); + int intVal113 = intVal12; + intProp5 = this.tpsYPosition; + Integer intVal13 = intProp5.getMaximum(); + int intVal114 = intVal13; + int intVal14 = MathHelper.clamp_int(ticks2, intVal113, intVal114); + Integer intVal15 = intVal14; + intProp6.set(intVal15); + } + + IntProperty intProp7 = this.tpsXPosition; + Integer intVal16 = intProp7.get(); + intVal7 = intVal16; + + int intVal17; + int intVal18; + label713: { + label770: { + intVal17 = intVal7; + IntProperty intProp8 = this.tpsYPosition; + Integer intVal19 = intProp8.get(); + intVal18 = intVal19; + intVal108 = intVal109; + int intVal20 = intVal17; + if (intVal109 <= intVal17) { + break label770; + } + + intVal108 = intVal109; + intVal20 = intVal17 + 42; + + if (!flag) { + if (intVal108 > intVal20) { + break label770; + } + + intVal108 = intVal110; + intVal20 = intVal18; + } + + if (intVal108 <= intVal20) { + break label770; + } + + intVal108 = intVal110; + + intVal20 = intVal18 + 47; + + if (intVal108 <= intVal20) { + intVal108 = 1; + break label713; + } + } + + intVal108 = 0; + } + + int intVal21 = intVal108; + intVal108 = intVal21; + + if (intVal21 != 0) { + double doubleVal = MovementUtils.evaluateDouble(true); + float floatVal = intVal17; + float floatVal4 = intVal18; + float floatVal5 = intVal17 + 42; + float floatVal6 = intVal18 + 47; + int color3 = ColorTheme.WHITE.getStateTicks(); + int color2 = ColorTheme.BLACK.getStateTicks(); + int color4 = ColorTheme.reAlpha(color2, 100); + RenderUtils.drawElement5(floatVal, floatVal4, floatVal5, floatVal6, 2.5F, color3, color4); + MovementUtils.unscale(doubleVal); + } + } + } + } + + intVal108 = (this.isStateReady2() ? 1 : 0); + + if (intVal108 != 0) { + StringProperty strProp = this.nameType; + intVal108 = (strProp.equals("Watermark") ? 1 : 0); + + label682: + if (intVal108 != 0) { + double doubleVal2; + double doubleVal26; + label680: { + label774: { + DoubleProperty doubleProp = this.watermarkPosX; + Double propDouble = doubleProp.get(); + doubleVal2 = propDouble; + DoubleProperty doubleProp2 = this.watermarkPosY; + Double propDouble2 = doubleProp2.get(); + doubleVal26 = propDouble2; + if (intVal109 <= doubleVal2) { + break label774; + } + + if (intVal109 >= (doubleVal2 + this.cachedValue4)) { + break label774; + } + + if (intVal110 <= doubleVal26) { + break label774; + } + + if (intVal110 < (doubleVal26 + this.cachedValue16)) { + intVal108 = 1; + break label680; + } + } + + intVal108 = 0; + } + + int intVal22 = intVal108; + obj = event.getState(); + GuiState guiState5 = GuiState.CLICK; + if (obj == GuiState.CLICK) { + intVal108 = event.getMouseButton(); + + if (intVal108 != 0) { + break label682; + } + + intVal108 = intVal22; + + if (intVal22 == 0) { + break label682; + } + + this.cachedValue17 = doubleVal2 - intVal109; + this.cachedValue6 = doubleVal26 - intVal110; + this.stateFlag6 = true; + break label682; + } + + obj = event.getState(); + + guiState5 = GuiState.RENDER; + + if (obj == guiState5) { + intVal108 = (this.stateFlag6 ? 1 : 0); + + if (this.stateFlag6) { + DoubleProperty doubleProp3 = this.watermarkPosX; + double doubleVal3 = this.cachedValue17 + intVal109; + DoubleProperty doubleProp4 = this.watermarkPosX; + Double doubleVal4 = doubleProp4.getMinimum(); + double doubleVal27 = doubleVal4; + DoubleProperty doubleProp5 = this.watermarkPosX; + Double doubleVal5 = doubleProp5.getMaximum(); + double doubleVal28 = doubleVal5; + double doubleVal6 = MathHelper.clamp_double(doubleVal3, doubleVal27, doubleVal28); + Double doubleVal7 = doubleVal6; + doubleProp3.set(doubleVal7); + DoubleProperty doubleProp6 = this.watermarkPosY; + double doubleVal8 = this.cachedValue6 + intVal110; + doubleProp4 = this.watermarkPosY; + Double doubleVal9 = doubleProp4.getMinimum(); + double doubleVal29 = doubleVal9; + doubleProp5 = this.watermarkPosY; + Double doubleVal10 = doubleProp5.getMaximum(); + double doubleVal30 = doubleVal10; + double doubleVal11 = MathHelper.clamp_double(doubleVal8, doubleVal29, doubleVal30); + Double doubleVal12 = doubleVal11; + doubleProp6.set(doubleVal12); + } + + intVal108 = intVal22; + + + if (intVal108 != 0) { + double doubleVal13 = MovementUtils.evaluateDouble(true); + double doubleVal14 = this.cachedValue16 * 0.5; + IntProperty intProp9 = this.watermarkRoundess; + Integer intVal23 = intProp9.get(); + double doubleVal31 = doubleVal14 * (0.08333333333333333 * intVal23.intValue()); + double doubleVal32 = this.cachedValue4; + double doubleVal33 = this.cachedValue16; + StringProperty strProp2 = this.watermarkBackgroundType; + String textStr = "Outlined"; + float floatVal7; + if (strProp2.equals(textStr)) { + Float propFloat = this.watermarkOutlineWidth.get(); + float floatVal8 = propFloat; + floatVal7 = Math.max(2.5F, floatVal8); + } else { + floatVal7 = 2.5F; + } + + int color5 = ColorTheme.getColor(0, 0, 0, 150); + int color6 = ColorTheme.WHITE.getStateTicks(); + RenderUtils.drawBorderedRoundedRect(doubleVal2, doubleVal26, doubleVal32, doubleVal33, doubleVal31, floatVal7, color5, color6); + MovementUtils.unscale(doubleVal13); + } + } + } + } + + BooleanProperty boolProp2 = this.hudInformation; + obj = boolProp2.get(); + + Boolean flag2 = (Boolean)obj; + intVal108 = (flag2 ? 1 : 0); + + if (intVal108 != 0) { + ListProperty listProp2 = this.informationElements; + intVal108 = (listProp2.contains("RAM") ? 1 : 0); + + label631: + if (intVal108 != 0) { + GuiState guiState6 = event.getState(); + GuiState guiState7 = GuiState.CLICK; + if (guiState6 == GuiState.CLICK) { + int intVal24; + int intVal25; + label625: { + label780: { + IntProperty intProp10 = this.ramXPosition; + Integer intVal26 = intProp10.get(); + intVal24 = intVal26; + IntProperty intProp11 = this.ramYPosition; + intVal26 = intProp11.get(); + intVal25 = intVal26; + intVal108 = intVal109; + int intVal27 = intVal24; + if (intVal109 <= intVal24) { + break label780; + } + + intVal108 = intVal109; + intVal27 = intVal24 + 42; + + if (!flag) { + if (intVal108 > intVal27) { + break label780; + } + + intVal108 = intVal110; + intVal27 = intVal25; + } + + if (intVal108 <= intVal27) { + break label780; + } + + intVal108 = intVal110; + + intVal27 = intVal25 + 47; + + if (intVal108 <= intVal27) { + intVal108 = 1; + break label625; + } + } + + intVal108 = 0; + } + + label604: { + int intVal28 = intVal108; + int intVal29 = intVal28; + + if (intVal28 == 0) { + break label604; + } + + intVal29 = event.getMouseButton(); + + + if (intVal29 == 0) { + this.stateTicks14 = intVal24 - intVal109; + this.intState2 = intVal25 - intVal110; + this.stateFlag = true; + } + } + + break label631; + } + + guiState6 = event.getState(); + guiState7 = GuiState.RENDER; + + if (guiState6 == guiState7) { + int intVal30 = (this.stateFlag ? 1 : 0); + if (this.stateFlag) { + IntProperty intProp12 = this.ramXPosition; + int ticks3 = this.stateTicks14 + intVal109; + IntProperty intProp13 = this.ramXPosition; + Integer intVal31 = intProp13.getMinimum(); + int intVal115 = intVal31; + IntProperty intProp14 = this.ramXPosition; + Integer intVal32 = intProp14.getMaximum(); + int intVal116 = intVal32; + int intVal33 = MathHelper.clamp_int(ticks3, intVal115, intVal116); + Integer intVal34 = intVal33; + intProp12.set(intVal34); + IntProperty intProp15 = this.ramYPosition; + int intVal35 = this.intState2 + intVal110; + intProp13 = this.ramYPosition; + Integer intVal36 = intProp13.getMinimum(); + int intVal117 = intVal36; + intProp14 = this.ramYPosition; + Integer intVal37 = intProp14.getMaximum(); + int intVal118 = intVal37; + int intVal38 = MathHelper.clamp_int(intVal35, intVal117, intVal118); + Integer intVal39 = intVal38; + intProp15.set(intVal39); + } + + IntProperty intProp16 = this.ramXPosition; + Integer intVal40 = intProp16.get(); + intVal30 = intVal40; + + int intVal41; + int intVal42; + label592: { + label783: { + intVal41 = intVal30; + IntProperty intProp17 = this.ramYPosition; + Integer intVal43 = intProp17.get(); + intVal42 = intVal43; + intVal108 = intVal109; + int intVal44 = intVal41; + if (intVal109 <= intVal41) { + break label783; + } + + intVal108 = intVal109; + intVal44 = intVal41 + 42; + + if (!flag) { + if (intVal108 > intVal44) { + break label783; + } + + intVal108 = intVal110; + intVal44 = intVal42; + } + + if (intVal108 <= intVal44) { + break label783; + } + + intVal108 = intVal110; + + intVal44 = intVal42 + 47; + + if (intVal108 <= intVal44) { + intVal108 = 1; + break label592; + } + } + + intVal108 = 0; + } + + int intVal45 = intVal108; + intVal108 = intVal45; + + if (intVal45 != 0) { + double doubleVal15 = MovementUtils.evaluateDouble(true); + float floatVal2 = intVal41; + float floatVal9 = intVal42; + float floatVal10 = intVal41 + 42; + float floatVal11 = intVal42 + 47; + ColorTheme colorTheme = ColorTheme.WHITE; + int intVal119 = colorTheme.getStateTicks(); + ColorTheme colorTheme2 = ColorTheme.BLACK; + int intVal46 = colorTheme2.getStateTicks(); + int color7 = ColorTheme.reAlpha(intVal46, 100); + RenderUtils.drawElement5(floatVal2, floatVal9, floatVal10, floatVal11, 2.5F, intVal119, color7); + MovementUtils.unscale(doubleVal15); + } + } + } + } + + intVal108 = (this.isFlagX() ? 1 : 0); + + label564: + if (intVal108 != 0) { + IntProperty intProp18 = this.moduleListXPosition; + Integer intVal47 = intProp18.get(); + int intVal48 = intVal47; + IntProperty intProp19 = this.moduleListYPosition; + intVal47 = intProp19.get(); + int intVal120 = intVal47; + GuiState guiState8 = event.getState(); + GuiState guiState9 = GuiState.CLICK; + if (guiState8 == GuiState.CLICK) { + intVal108 = (this.applyUpdate5(intVal48, intVal120, intVal109, intVal110) ? 1 : 0); + + if (intVal108 == 0) { + break label564; + } + + intVal108 = event.getMouseButton(); + + if (intVal108 != 0) { + break label564; + } + + this.stateTicks6 = intVal48 - intVal109; + this.intValueField = intVal120 - intVal110; + this.stateFlag8 = true; + break label564; + } + + guiState8 = event.getState(); + guiState9 = GuiState.RENDER; + + if (guiState8 == guiState9) { + intVal108 = (this.stateFlag8 ? 1 : 0); + + if (this.stateFlag8) { + IntProperty intProperty = this.moduleListXPosition; + int ticks4 = this.stateTicks6 + intVal109; + IntProperty intProperty2 = this.moduleListXPosition; + Integer intVal49 = intProperty2.getMinimum(); + int intVal121 = intVal49; + IntProperty intProperty3 = this.moduleListXPosition; + Integer intVal50 = intProperty3.getMaximum(); + int intVal122 = intVal50; + int intVal51 = MathHelper.clamp_int(ticks4, intVal121, intVal122); + Integer intVal52 = intVal51; + intProperty.set(intVal52); + IntProperty intProperty4 = this.moduleListYPosition; + int intVal53 = this.intValueField + intVal110; + intProperty2 = this.moduleListYPosition; + Integer intVal54 = intProperty2.getMinimum(); + int intVal123 = intVal54; + intProperty3 = this.moduleListYPosition; + Integer intVal55 = intProperty3.getMaximum(); + int intVal124 = intVal55; + int intVal56 = MathHelper.clamp_int(intVal53, intVal123, intVal124); + Integer intVal57 = intVal56; + intProperty4.set(intVal57); + } + + intVal108 = (this.applyUpdate5(intVal48, intVal120, intVal109, intVal110) ? 1 : 0); + + + if (intVal108 != 0) { + double doubleVal16 = this.resolveDoubleArray(intVal48, intVal120)[0]; + double doubleVal34 = this.resolveDoubleArray(intVal48, intVal120)[1]; + double doubleVal35 = this.resolveDoubleArray(intVal48, intVal120)[2]; + double doubleVal36 = this.resolveDoubleArray(intVal48, intVal120)[3]; + double doubleVal17 = MovementUtils.evaluateDouble(true); + ColorTheme colorTheme3 = ColorTheme.WHITE; + int intVal125 = colorTheme3.getStateTicks(); + ColorTheme colorTheme4 = ColorTheme.BLACK; + int intVal58 = colorTheme4.getStateTicks(); + int color8 = ColorTheme.reAlpha(intVal58, 100); + RenderUtils.drawElement5(doubleVal16, doubleVal34, doubleVal35, doubleVal36, 2.5F, intVal125, color8); + MovementUtils.unscale(doubleVal17); + } + } + } + + intVal108 = (this.isStateReady3() ? 1 : 0); + + label540: + if (intVal108 != 0) { + IntProperty intProperty5 = this.keybindsPosX; + Integer intVal59 = intProperty5.get(); + int intVal60 = intVal59; + IntProperty intProperty6 = this.keybindsPosY; + intVal59 = intProperty6.get(); + int intVal61 = intVal59; + GuiState guiState10 = event.getState(); + GuiState guiState11 = GuiState.CLICK; + if (guiState10 == GuiState.CLICK) { + intVal108 = intVal109; + + if (intVal109 <= intVal60 - 3) { + break label540; + } + + if (intVal109 > (this.cachedValue8 + 1.0)) { + break label540; + } + + if (intVal110 <= (intVal61 - 21.5)) { + break label540; + } + + if (intVal110 > (this.cachedValue12 - 0.5)) { + break label540; + } + + intVal108 = event.getMouseButton(); + + if (intVal108 != 0) { + break label540; + } + + this.stateTicks = intVal60 - intVal109; + this.stateTicks4 = intVal61 - intVal110; + this.stateFlag2 = true; + break label540; + } + + guiState10 = event.getState(); + guiState11 = GuiState.RENDER; + + if (guiState10 == guiState11) { + intVal108 = (this.stateFlag2 ? 1 : 0); + + if (this.stateFlag2) { + IntProperty intProperty7 = this.keybindsPosX; + int ticks5 = this.stateTicks + intVal109; + IntProperty intProperty8 = this.keybindsPosX; + Integer intVal62 = intProperty8.getMinimum(); + int intVal126 = intVal62; + IntProperty intProperty9 = this.keybindsPosX; + Integer intVal63 = intProperty9.getMaximum(); + int intVal127 = intVal63; + int intVal64 = MathHelper.clamp_int(ticks5, intVal126, intVal127); + Integer intVal65 = intVal64; + intProperty7.set(intVal65); + IntProperty intProperty10 = this.keybindsPosY; + int ticks6 = this.stateTicks4 + intVal110; + intProperty8 = this.keybindsPosY; + Integer intVal66 = intProperty8.getMinimum(); + int intVal128 = intVal66; + intProperty9 = this.keybindsPosY; + Integer intVal67 = intProperty9.getMaximum(); + int intVal129 = intVal67; + int intVal68 = MathHelper.clamp_int(ticks6, intVal128, intVal129); + Integer intVal69 = intVal68; + intProperty10.set(intVal69); + } + + intVal108 = intVal109; + + + if (intVal108 > intVal60 - 3) { + if (intVal109 <= (this.cachedValue8 + 1.0)) { + if (intVal110 > (intVal61 - 21.5)) { + if (intVal110 <= (this.cachedValue12 - 0.5)) { + double doubleVal18 = MovementUtils.evaluateDouble(true); + double doubleVal19 = intVal60 - 3; + double doubleVal37 = intVal61 - 21.5; + double doubleVal38 = this.cachedValue8 + 1.0; + double doubleVal39 = this.cachedValue12 - 0.5; + ColorTheme colorTheme5 = ColorTheme.WHITE; + int intVal130 = colorTheme5.getStateTicks(); + ColorTheme colorTheme6 = ColorTheme.BLACK; + int intVal70 = colorTheme6.getStateTicks(); + int color9 = ColorTheme.reAlpha(intVal70, 100); + RenderUtils.drawElement5(doubleVal19, doubleVal37, doubleVal38, doubleVal39, 2.5F, intVal130, color9); + MovementUtils.unscale(doubleVal18); + } + } + } + } + } + } + + intVal108 = (this.isStateReady4() ? 1 : 0); + + label494: + if (intVal108 != 0) { + IntProperty intProperty11 = this.keyStrokesPosX; + Integer intVal71 = intProperty11.get(); + int intVal72 = intVal71; + IntProperty intProperty12 = this.keyStrokesPosY; + intVal71 = intProperty12.get(); + int intVal73 = intVal71; + obj2 = event.getState(); + GuiState guiState12 = GuiState.CLICK; + if (obj2 == GuiState.CLICK) { + intVal108 = intVal109; + + if (intVal109 <= intVal72 - 6) { + break label494; + } + + intVal108 = intVal109; + + if (intVal109 > intVal72 + 84) { + break label494; + } + + intVal108 = intVal110; + + if (intVal110 <= intVal73 - 6) { + break label494; + } + + intVal108 = intVal110; + + if (intVal110 > intVal73 + 84) { + break label494; + } + + intVal108 = event.getMouseButton(); + + if (intVal108 != 0) { + break label494; + } + + this.stateTicks12 = intVal72 - intVal109; + this.stateTicks16 = intVal73 - intVal110; + this.stateFlag5 = true; + break label494; + } + + obj2 = event.getState(); + + guiState12 = GuiState.RENDER; + + if (obj2 == guiState12) { + intVal108 = (this.stateFlag5 ? 1 : 0); + + if (this.stateFlag5) { + IntProperty intProperty13 = this.keyStrokesPosX; + int ticks7 = this.stateTicks12 + intVal109; + IntProperty intProperty14 = this.keyStrokesPosX; + Integer intVal74 = intProperty14.getMinimum(); + int intVal131 = intVal74; + IntProperty intProperty15 = this.keyStrokesPosX; + Integer intVal75 = intProperty15.getMaximum(); + int intVal132 = intVal75; + int intVal76 = MathHelper.clamp_int(ticks7, intVal131, intVal132); + Integer intVal77 = intVal76; + intProperty13.set(intVal77); + IntProperty intProperty16 = this.keyStrokesPosY; + int ticks8 = this.stateTicks16 + intVal110; + intProperty14 = this.keyStrokesPosY; + Integer intVal78 = intProperty14.getMinimum(); + int intVal133 = intVal78; + intProperty15 = this.keyStrokesPosY; + Integer intVal79 = intProperty15.getMaximum(); + int intVal134 = intVal79; + int intVal80 = MathHelper.clamp_int(ticks8, intVal133, intVal134); + Integer intVal81 = intVal80; + intProperty16.set(intVal81); + this.performStep23(); + } + + intVal108 = intVal109; + + + if (intVal108 > intVal72 - 6) { + intVal108 = intVal109; + + if (intVal109 <= intVal72 + 84) { + intVal108 = intVal110; + + if (intVal110 > intVal73 - 6) { + intVal108 = intVal110; + + if (intVal110 <= intVal73 + 84) { + double doubleVal20 = MovementUtils.evaluateDouble(true); + float floatVal3 = intVal72 - 6; + float floatVal12 = intVal73 - 6; + float floatVal13 = intVal72 + 84; + float floatVal14 = intVal73 + 84; + ColorTheme colorTheme7 = ColorTheme.WHITE; + int intVal135 = colorTheme7.getStateTicks(); + ColorTheme colorTheme8 = ColorTheme.BLACK; + int intVal82 = colorTheme8.getStateTicks(); + int color10 = ColorTheme.reAlpha(intVal82, 100); + RenderUtils.drawElement5(floatVal3, floatVal12, floatVal13, floatVal14, 2.5F, intVal135, color10); + MovementUtils.unscale(doubleVal20); + } + } + } + } + } + } + + BooleanProperty boolProp3 = this.hudInformation; + obj2 = boolProp3.get(); + + Boolean flag3 = (Boolean)obj2; + intVal108 = (flag3 ? 1 : 0); + + if (intVal108 != 0) { + ListProperty listProp3 = this.informationElements; + intVal108 = (listProp3.contains("Potions") ? 1 : 0); + + if (intVal108 != 0) { + List itemList = this.getListValue3(); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + PotionEffect potionEffect = (PotionEffect)iter.next(); + double doubleVal21; + intVal108 = (doubleVal21 = intVal109 - potionEffect.doubleState4) == 0.0 ? 0 : (doubleVal21 < 0.0 ? -1 : 1); + + label439: { + label797: { + if (intVal108 <= 0) { + break label797; + } + + if (intVal109 > potionEffect.doubleState) { + break label797; + } + + if (intVal110 <= potionEffect.doubleState3) { + break label797; + } + + if (intVal110 <= potionEffect.doubleState2) { + intVal108 = 1; + break label439; + } + } + + intVal108 = 0; + } + + int intVal83 = intVal108; + IntProperty intProperty17 = this.potionsXPosition; + Integer intVal84 = intProperty17.get(); + int intVal85 = intVal84; + IntProperty intProperty18 = this.potionsYPosition; + intVal84 = intProperty18.get(); + int intVal86 = intVal84; + GuiState guiState13 = event.getState(); + GuiState guiState14 = GuiState.CLICK; + if (guiState13 == GuiState.CLICK) { + if (intVal83 == 0) { + continue; + } + + this.stateTicks13 = intVal85 - intVal109; + this.stateTicks8 = intVal86 - intVal110; + this.stateFlag7 = true; + continue; + } + + guiState13 = event.getState(); + guiState14 = GuiState.RENDER; + + if (guiState13 == guiState14) { + int intVal87 = (this.stateFlag7 ? 1 : 0); + + if (this.stateFlag7) { + IntProperty intProperty19 = this.potionsXPosition; + int ticks9 = this.stateTicks13 + intVal109; + IntProperty intProperty20 = this.potionsXPosition; + Integer intVal88 = intProperty20.getMinimum(); + int intVal136 = intVal88; + IntProperty intProperty21 = this.potionsXPosition; + Integer intVal89 = intProperty21.getMaximum(); + int intVal137 = intVal89; + int intVal90 = MathHelper.clamp_int(ticks9, intVal136, intVal137); + Integer intVal91 = intVal90; + intProperty19.set(intVal91); + IntProperty intProperty22 = this.potionsYPosition; + int ticks10 = this.stateTicks8 + intVal110; + intProperty20 = this.potionsYPosition; + Integer intVal92 = intProperty20.getMinimum(); + int intVal138 = intVal92; + intProperty21 = this.potionsYPosition; + Integer intVal93 = intProperty21.getMaximum(); + int intVal139 = intVal93; + int intVal94 = MathHelper.clamp_int(ticks10, intVal138, intVal139); + Integer intVal95 = intVal94; + intProperty22.set(intVal95); + } + + intVal87 = intVal83; + + + + if (intVal87 == 0) { + continue; + } + + intVal87 = 1; + + + double doubleVal22 = MovementUtils.evaluateDouble((intVal87 != 0)); + double doubleVal23 = potionEffect.doubleState4; + double doubleVal40 = potionEffect.doubleState3; + double doubleVal41 = potionEffect.doubleState - potionEffect.doubleState4; + double doubleVal42 = potionEffect.doubleState2 - potionEffect.doubleState3; + Double propDouble3 = this.potionRoundness.get(); + double doubleVal43 = propDouble3 / 2.0; + int color11 = ColorTheme.getColor(0, 0, 0, 100); + ColorTheme colorTheme9 = ColorTheme.WHITE; + int intVal140 = colorTheme9.getStateTicks(); + RenderUtils.drawBorderedRoundedRect(doubleVal23, doubleVal40, doubleVal41, doubleVal42, doubleVal43, 2.5F, color11, intVal140); + MovementUtils.unscale(doubleVal22); + } + } + } + } + + BooleanProperty boolProp4 = this.hudInformation; + Boolean propFlag2 = boolProp4.get(); + intVal108 = (propFlag2 ? 1 : 0); + + if (intVal108 != 0) { + ListProperty listProp4 = this.informationElements; + intVal108 = (listProp4.contains("Armor") ? 1 : 0); + + if (intVal108 != 0) { + List itemList2 = this.getList2(); + Stream stream2 = itemList2.stream(); + Predicate predicate = Objects::nonNull; + intVal108 = (stream2.anyMatch(predicate) ? 1 : 0); + + label386: + if (intVal108 != 0) { + label384: { + label801: { + if (intVal109 <= this.cachedValue13) { + break label801; + } + + if (intVal109 > this.cachedValue3) { + break label801; + } + + if (intVal110 <= this.cachedValue) { + break label801; + } + + if (intVal110 <= this.cachedValue7) { + intVal108 = 1; + break label384; + } + } + + intVal108 = 0; + } + + int intVal96 = intVal108; + IntProperty intProperty23 = this.armorXPosition; + Integer intVal97 = intProperty23.get(); + int intVal98 = intVal97; + IntProperty intProperty24 = this.armorYPosition; + intVal97 = intProperty24.get(); + int intVal99 = intVal97; + guiState = event.getState(); + guiState2 = GuiState.CLICK; + if (guiState == GuiState.CLICK) { + intVal108 = intVal96; + + if (intVal96 == 0) { + break label386; + } + + this.stateTicks10 = intVal98 - intVal109; + this.stateTicks3 = intVal99 - intVal110; + this.stateFlag3 = true; + break label386; + } + + guiState = event.getState(); + guiState2 = GuiState.RENDER; + + if (guiState == guiState2) { + intVal108 = (this.stateFlag3 ? 1 : 0); + + if (this.stateFlag3) { + IntProperty intProperty25 = this.armorXPosition; + int ticks11 = this.stateTicks10 + intVal109; + IntProperty intProperty26 = this.armorXPosition; + Integer intVal100 = intProperty26.getMinimum(); + int intVal141 = intVal100; + IntProperty intProperty27 = this.armorXPosition; + Integer intVal101 = intProperty27.getMaximum(); + int intVal142 = intVal101; + int intVal102 = MathHelper.clamp_int(ticks11, intVal141, intVal142); + Integer intVal103 = intVal102; + intProperty25.set(intVal103); + IntProperty intProperty28 = this.armorYPosition; + int ticks12 = this.stateTicks3 + intVal110; + intProperty26 = this.armorYPosition; + Integer intVal104 = intProperty26.getMinimum(); + int intVal143 = intVal104; + intProperty27 = this.armorYPosition; + Integer intVal105 = intProperty27.getMaximum(); + int intVal144 = intVal105; + int intVal106 = MathHelper.clamp_int(ticks12, intVal143, intVal144); + Integer intVal107 = intVal106; + intProperty28.set(intVal107); + } + + intVal108 = intVal96; + + + if (intVal108 != 0) { + double doubleVal24 = MovementUtils.evaluateDouble(true); + double doubleVal25 = this.cachedValue13; + double doubleVal44 = this.cachedValue; + double doubleVal45 = this.cachedValue3 - this.cachedValue13; + double doubleVal46 = this.cachedValue7 - this.cachedValue; + DoubleProperty doubleProp7 = this.armorBackgroundRoundness; + Double propDouble4 = doubleProp7.get(); + double doubleVal47 = propDouble4 / 2.0; + int color12 = ColorTheme.getColor(0, 0, 0, 100); + ColorTheme colorTheme10 = ColorTheme.WHITE; + int intVal145 = colorTheme10.getStateTicks(); + RenderUtils.drawBorderedRoundedRect(doubleVal25, doubleVal44, doubleVal45, doubleVal46, doubleVal47, 2.5F, color12, intVal145); + MovementUtils.unscale(doubleVal24); + } + } + } + } + } + + guiState = event.getState(); + guiState2 = GuiState.RELEASE; + + intVal108 = (guiState.equals(guiState2) ? 1 : 0); + + + if (intVal108 == 0) { + return; + } + + intVal108 = event.getMouseButton(); + + + if (intVal108 == 0) { + this.stateFlag8 = false; + this.stateFlag5 = false; + this.stateFlag6 = false; + this.stateFlag2 = false; + this.stateFlag4 = false; + this.stateFlag = false; + this.stateFlag7 = false; + this.stateFlag3 = false; + } +} + + private void invokeCallback5(String text, double value, double amount, int index) { + HUD hudMod = this; + + StringProperty strProp = this.font; + if (strProp.equals("Vanilla")) { + double doubleVal = value + 0.5; + Double propDouble = this.moduleListNameHeight.get(); + this.drawElement4(text, doubleVal, amount + propDouble, index, false); + return; + } + + hudMod = this; + + + DoubleProperty doubleProp = this.moduleListNameHeight; + Double propDouble2 = doubleProp.get(); + hudMod.drawElement4(text, value, amount + propDouble2, index, false); +} + + public void drawElement2(FontRenderer fontRenderer, String text, double value, double amount, boolean flag, boolean enabled, int index) { + int intVal = 0; + char[] charArr = text.toCharArray(); + int len = charArr.length; + int intVal2 = 0; + + while (intVal2 < len) { + double doubleVal; + label20: { + char ch = charArr[intVal2]; + String textStr = String.valueOf(ch); + long longVal = intVal; + this.drawElement(fontRenderer, textStr, value, amount, ColorTheme.getHudColor(longVal), flag); + StringProperty strProp = this.font; + textStr = "Vanilla"; + int intVal3 = (strProp.equals(textStr) ? 1 : 0); + if (intVal3 == 0) { + doubleVal = fontRenderer.evaluateInt2(ch); + break label20; + } + + net.minecraft.client.gui.FontRenderer font2 = this.mc.fontRendererObj; + intVal3 = font2.setUnicodeFlag(ch); + + doubleVal = intVal3; + } + + value += doubleVal; + intVal -= index; + intVal2++; + + } +} + + public int getIntValue18() { + HUD hudMod = this; + StringProperty strProp = this.font; + if (strProp.equals("Vanilla")) { + net.minecraft.client.gui.FontRenderer font2 = this.mc.fontRendererObj; + return font2.computeInt(); + } + + hudMod = this; + + FontRenderer font3 = hudMod.getA2mO(); + return font3.getHeight(); +} + + private boolean isStateReady3() { + boolean flag = H(); + Boolean propFlag = this.hudKeybinds.get(); + boolean flag2 = propFlag; + if (!flag2) { + return false; + } + + Boolean propFlag2 = this.keybindsHideOnDebug.get(); + flag2 = this.matchesFlag(propFlag2); + + return !flag ? flag2 : flag2; +} + + private Boolean supplyBoolean51() { + boolean flag; + label53: { + label55: { + Boolean propFlag = this.hudInformation.get(); + flag = propFlag; + if (!flag) { + break label55; + } + + BooleanProperty boolProp = this.showPotionSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label55; + } + + BooleanProperty boolProp2 = this.showInformationSettings; + propFlag = boolProp2.get(); + flag = propFlag; + + if (!flag) { + break label55; + } + + ListProperty listProp = this.informationElements; + flag = listProp.contains("Potions"); + + if (!flag) { + break label55; + } + + StringProperty strProp = this.potionStyle; + flag = strProp.equals("New"); + + if (!flag) { + break label55; + } + + BooleanProperty boolProp3 = this.potionBackground; + propFlag = boolProp3.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label53; + } + } + + flag = false; + } + + return flag; +} + + public int getIntValue4() { + Integer intVal = this.chatSmoothness.get(); + return intVal; +} + + private Boolean supplyBoolean52() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudModuleList.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showModuleListSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private Boolean supplyBoolean53() { + boolean flag; + label37: { + label39: { + Boolean propFlag = this.hudInformation.get(); + flag = propFlag; + if (!flag) { + break label39; + } + + BooleanProperty boolProp = this.showPotionSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label39; + } + + BooleanProperty boolProp2 = this.showInformationSettings; + propFlag = boolProp2.get(); + flag = propFlag; + + if (!flag) { + break label39; + } + + ListProperty listProp = this.informationElements; + flag = listProp.contains("Potions"); + + if (flag) { + flag = true; + break label37; + } + } + + flag = false; + } + + return flag; +} + + private List getList2() { + ItemStack[] stackArr = this.mc.thePlayer.inventory.armorInventory; + byte byteVal = (byte)(this.mc.currentScreen instanceof GuiChat ? 1 : 0); + if (byteVal != 0) { + return this.itemStackList; + } + + byteVal = 5; + + ItemStack[] stackArr2 = new ItemStack[byteVal]; + EntityPlayerSP player = this.mc.thePlayer; + stackArr2[0] = player.getHeldItem(); + stackArr2[1] = stackArr[0]; + stackArr2[2] = stackArr[1]; + stackArr2[3] = stackArr[2]; + stackArr2[4] = stackArr[3]; + return Lists.newArrayList(stackArr2); +} + + private String resolveString2(AbstractModule module) { + return module.isEnabled() ? "[ON]" : "[OFF]"; +} + + public static IntProperty createString(HUD hUD) { + return hUD.keyStrokesAlpha; +} + + public StringProperty getNotificationFont() { + return this.notificationFont; +} + + public StringProperty getStringProperty15() { + return this.getNotificationFont(); +} + + private Boolean supplyBoolean54() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudKeybinds.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showKeybindsSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private Boolean supplyBoolean55() { + boolean flag; + label53: { + label55: { + Boolean propFlag = this.hudInformation.get(); + flag = propFlag; + if (!flag) { + break label55; + } + + BooleanProperty boolProp = this.showPotionSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label55; + } + + BooleanProperty boolProp2 = this.showInformationSettings; + propFlag = boolProp2.get(); + flag = propFlag; + + if (!flag) { + break label55; + } + + ListProperty listProp = this.informationElements; + flag = listProp.contains("Potions"); + + if (!flag) { + break label55; + } + + StringProperty strProp = this.potionStyle; + flag = strProp.equals("New"); + + if (!flag) { + break label55; + } + + BooleanProperty boolProp3 = this.potionBackground; + propFlag = boolProp3.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label53; + } + } + + flag = false; + } + + return flag; +} + + private void renderElement3(Render2DEvent event) { + FontRenderer font2 = FontFamilySF_BOLD.FAMILY.ofSize(17); + ModuleRegistry modEntry = ModuleRegistry.CLICKGUI; + ClickGui clickGuiMod = modEntry.getModule(); + double doubleVal3 = clickGuiMod.getCachedValue2(); + IntProperty intProp = this.tpsXPosition; + Integer intVal = intProp.get(); + int intVal2 = intVal; + IntProperty intProp2 = this.tpsYPosition; + Integer intVal3 = intProp2.get(); + int intVal5 = intVal3; + double doubleVal4 = 42.0; + double doubleVal5 = 47.0; + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal6 = intVal2; + double doubleVal7 = intVal5; + Integer intVal4 = this.tprRamSmoothness.get(); + double doubleVal8 = intVal4.intValue(); + Integer intVal6 = this.tpsRamAlpha.get(); + Color awtColor = new Color(0, 0, 0, intVal6); + roundedTextureShader.applyUpdate3(doubleVal6, doubleVal7, doubleVal4, doubleVal5, doubleVal8, awtColor, true); + double doubleVal = intVal2 + doubleVal4 / 2.0 + 0.25; + doubleVal6 = intVal5 + 18; + int color2 = ColorTheme.getColor(0, 0, 0, 50); + RenderUtils.drawElement6(doubleVal, doubleVal6, 0.0, 360.0, 13.25, 4.5F, color2); + GaussianBlurShader gaussianBlurShader = GaussianBlurShader.getGaussianBlurShader(); + Runnable runnable = ((java.lang.Runnable) (() -> HUD.invokeCallback7(intVal2, doubleVal4, intVal5, doubleVal3))); + gaussianBlurShader.renderVisual(8, 280, true, runnable, null); + double doubleVal2 = intVal2 + doubleVal4 / 2.0 + 0.25; + doubleVal6 = intVal5 + 18; + double doubleVal9 = 18.0 * doubleVal3; + RenderUtils.drawElement5(doubleVal2, doubleVal6, 0.0, doubleVal9, 13.25, 4.5F, 22L); + String textStr = "TPS"; + doubleVal7 = intVal2 + doubleVal4 / 2.0; + doubleVal9 = intVal5 + 16; + font2.drawCenteredString(textStr, doubleVal7, doubleVal9, 16777215, true); + StringBuilder sb = new StringBuilder(); + doubleVal6 = 5.0 * doubleVal3; + doubleVal6 = MathHelper.resolveInt5(doubleVal6, 1); + StringBuilder sb2 = sb.append(doubleVal6); + String textStr2 = sb2.append("%").toString(); + doubleVal7 = intVal2 + doubleVal4 / 2.0; + doubleVal9 = intVal5 + 37.5; + font2.drawCenteredString(textStr2, doubleVal7, doubleVal9, 16777215, true); +} + + public ColorProperty getFadeEndColor() { + return this.fadeEndColor; +} + + public ColorProperty getColorPropertyP() { + return this.getFadeEndColor(); +} + + private void applyUpdate2(Render2DEvent event) { + Object obj; + java.lang.String propStr; + java.lang.StringBuilder sb; + java.lang.String textStr; + net.minecraft.client.Minecraft mcClient; + cc.novoline.modules.visual.HUD hudMod; + java.lang.String textStr2; + cc.novoline.modules.visual.HUD hudMod2; + IntProperty intProp = this.nameFontSize; + Integer intVal = intProp.get(); + int intVal17 = intVal; + StringProperty strProp = this.nameType; + boolean flag2 = strProp.equals("Watermark"); + if (flag2) { + label238: { + Object obj2 = this.watermarkStyle; + if (((StringProperty)obj2).b("Basic")) { + StringProperty strProp2 = this.nameClientName; + propStr = strProp2.get(); + break label238; + } + + StringProperty strProp3 = this.nameClientName; + obj2 = strProp3.get(); + + String textStr3 = (String)obj2; + propStr = textStr3.toUpperCase(); + } + + String textStr12 = propStr; + String textStr13 = ""; + ListProperty listProp = this.watermarkAddons; + boolean flag3 = listProp.contains("Version"); + if (flag3) { + StringBuilder sb3 = new StringBuilder().append(textStr13); + EnumChatFormatting enumChatFormatting = EnumChatFormatting.DARK_GRAY; + StringBuilder sb4 = sb3.append(enumChatFormatting); + StringBuilder sb5 = sb4.append(" | "); + EnumChatFormatting enumChatFormatting2 = EnumChatFormatting.RESET; + StringBuilder sb6 = sb5.append(enumChatFormatting2); + Novoline novolineInst = this.novoline; + String textStr4 = novolineInst.getVersion(); + textStr13 = sb6.append(textStr4).toString(); + } + + ListProperty listProp2 = this.watermarkAddons; + flag3 = listProp2.contains("Username"); + + if (flag3) { + StringBuilder sb8 = new StringBuilder().append(textStr13); + EnumChatFormatting enumChatFormatting3 = EnumChatFormatting.DARK_GRAY; + StringBuilder sb9 = sb8.append(enumChatFormatting3); + StringBuilder sb10 = sb9.append(" | "); + EnumChatFormatting enumChatFormatting4 = EnumChatFormatting.RESET; + StringBuilder sb11 = sb10.append(enumChatFormatting4); + String textStr5 = net.skidunion.security.ProtectionSession.o; + textStr13 = sb11.append(textStr5).toString(); + } + + ListProperty listProp3 = this.watermarkAddons; + flag3 = listProp3.contains("Ping"); + + if (flag3) { + StringBuilder sb13 = new StringBuilder().append(textStr13); + EnumChatFormatting enumChatFormatting5 = EnumChatFormatting.DARK_GRAY; + StringBuilder sb14 = sb13.append(enumChatFormatting5); + StringBuilder sb15 = sb14.append(" | "); + EnumChatFormatting enumChatFormatting6 = EnumChatFormatting.RESET; + StringBuilder sb16 = sb15.append(enumChatFormatting6); + Novoline novolineInst2 = this.novoline; + ServerCommandTracker serverCommandTracker = novolineInst2.getServerCommandTracker(); + long longVal = serverCommandTracker.getLongValue(); + StringBuilder sb17 = sb16.append(longVal); + textStr13 = sb17.append(" Ping").toString(); + } + + ListProperty listProp4 = this.watermarkAddons; + flag3 = listProp4.contains("FPS"); + + if (flag3) { + StringBuilder sb19 = new StringBuilder().append(textStr13); + EnumChatFormatting enumChatFormatting7 = EnumChatFormatting.DARK_GRAY; + StringBuilder sb2 = sb19.append(enumChatFormatting7); + StringBuilder sb7 = sb2.append(" | "); + EnumChatFormatting enumChatFormatting8 = EnumChatFormatting.RESET; + StringBuilder sb12 = sb7.append(enumChatFormatting8); + Minecraft mcClient2 = this.mc; + int intVal2 = mcClient2.computeInt2(); + StringBuilder sb18 = sb12.append(intVal2); + textStr13 = sb18.append(" FPS").toString(); + } + + ListProperty listProp5 = this.watermarkAddons; + flag3 = listProp5.contains("Time"); + + if (flag3) { + StringBuilder sb20 = new StringBuilder().append(textStr13); + EnumChatFormatting enumChatFormatting9 = EnumChatFormatting.DARK_GRAY; + StringBuilder sb21 = sb20.append(enumChatFormatting9); + StringBuilder sb22 = sb21.append(" | "); + EnumChatFormatting enumChatFormatting10 = EnumChatFormatting.RESET; + StringBuilder sb23 = sb22.append(enumChatFormatting10); + String textStr6 = this.getString(); + textStr13 = sb23.append(textStr6).toString(); + } + + obj = this.watermarkAddons; + + flag3 = ((ListProperty)obj).a("Server"); + + if (flag3) { + label217: { + + StringBuilder sb24 = new StringBuilder().append(textStr13); + EnumChatFormatting enumChatFormatting11 = EnumChatFormatting.DARK_GRAY; + StringBuilder sb25 = sb24.append(enumChatFormatting11); + StringBuilder sb26 = sb25.append(" | "); + EnumChatFormatting enumChatFormatting12 = EnumChatFormatting.RESET; + sb = sb26.append(enumChatFormatting12); + boolean flag4 = ServerUtils.isHypixel(); + + if (flag4) { + textStr = "mc.hypixel.net"; + break label217; + } + + mcClient = this.mc; + + flag4 = mcClient.evaluateCondition6(); + + + if (flag4) { + textStr = "singleplayer"; + break label217; + } + + mcClient = this.mc; + + String textStr7 = mcClient.getCurrentServerData().serverIP; + textStr = textStr7.toLowerCase(); + } + + textStr13 = sb.append(textStr).toString(); + } + + DoubleProperty doubleProp = this.watermarkPosX; + obj = doubleProp.get(); + + label203: { + Double doubleVal = (Double)obj; + double doubleVal8 = doubleVal; + DoubleProperty doubleProp2 = this.watermarkPosY; + Double propDouble = doubleProp2.get(); + double doubleVal9 = propDouble; + StringProperty strProp4 = this.watermarkStyle; + boolean flag5 = strProp4.equals("Basic"); + if (flag5) { + StringProperty strProp5 = this.watermarkBackgroundType; + double doubleVal2; + if (!strProp5.equals("Bar")) { + IntProperty intProp2 = this.watermarkRoundess; + Integer intVal3 = intProp2.get(); + doubleVal2 = 0.08333333333333333 * intVal3.intValue(); + } else { + doubleVal2 = 0.0; + } + + double doubleVal3; + double doubleVal10; + label253: { + doubleVal3 = 4.0 + doubleVal2; + StringBuilder sb35 = new StringBuilder().append(textStr12); + this.cachedValue4 = this.computeIntInt(intVal17, sb35.append(textStr13).toString()) + doubleVal3 * 2.0; + this.cachedValue16 = this.applyUpdate2(intVal17) + doubleVal3 * 2.0; + double doubleVal4 = this.cachedValue16 * 0.5; + IntProperty intProp3 = this.watermarkRoundess; + Integer intVal4 = intProp3.get(); + doubleVal10 = doubleVal4 * (0.08333333333333333 * intVal4.intValue()); + IntProperty intProp4 = this.watermarkAlpha; + Integer intVal5 = intProp4.get(); + int intVal18 = intVal5; + int color2 = ColorTheme.getColor(0, 0, 0, intVal18); + StringProperty strProp6 = this.watermarkBackgroundType; + boolean flag6 = strProp6.equals("Bar"); + if (flag6) { + double doubleVal11 = this.cachedValue4; + double doubleVal12 = this.cachedValue16; + ListProperty listProp6 = this.watermarkShaders; + GaussianBlurShader gaussianBlurShader3; + if (listProp6.contains("Glow")) { + gaussianBlurShader3 = GaussianBlurShader.getGaussianBlurShader(); + } else { + gaussianBlurShader3 = null; + } + + IntProperty intProp5 = this.nameGlowRadius; + Integer intVal6 = intProp5.get(); + int intVal19 = intVal6; + Integer intVal20 = this.nameGlowAlpha.get(); + RenderUtils.drawElement8(doubleVal8, doubleVal9, doubleVal11, doubleVal12, color2, 6, gaussianBlurShader3, intVal19, intVal20); + break label253; + } + + StringProperty strProp7 = this.watermarkBackgroundType; + flag6 = strProp7.equals("Basic"); + + if (flag6) { + double doubleVal13 = this.cachedValue4; + double doubleVal14 = this.cachedValue16; + RenderUtils.drawRoundedRect(doubleVal8, doubleVal9, doubleVal13, doubleVal14, doubleVal10, color2); + break label253; + } + + StringProperty strProp8 = this.watermarkBackgroundType; + flag6 = strProp8.equals("Outlined"); + + if (flag6) { + double doubleVal15 = this.cachedValue4; + double doubleVal16 = this.cachedValue16; + Float propFloat = this.watermarkOutlineWidth.get(); + float floatVal = propFloat; + ListProperty listProp7 = this.watermarkShaders; + GaussianBlurShader gaussianBlurShader4; + if (listProp7.contains("Glow")) { + gaussianBlurShader4 = GaussianBlurShader.getGaussianBlurShader(); + } else { + gaussianBlurShader4 = null; + } + + IntProperty intProp6 = this.nameGlowRadius; + Integer intVal7 = intProp6.get(); + int intVal21 = intVal7; + Integer intVal22 = this.nameGlowAlpha.get(); + RenderUtils.renderVisual6(doubleVal8, doubleVal9, doubleVal15, doubleVal16, doubleVal10, floatVal, color2, 6, gaussianBlurShader4, intVal21, intVal22); + } + } + + double doubleVal17 = doubleVal8; + double doubleVal18 = doubleVal9; + this.runnableField2 = $lambdaCapture$128(this, doubleVal17, doubleVal18, doubleVal10); + doubleVal8 += doubleVal3; + doubleVal9 += doubleVal3 + 0.5; + StringBuilder sb27 = new StringBuilder().append(textStr12); + this.renderVisual3(intVal17, sb27.append(textStr13).toString(), doubleVal8, doubleVal9, 16777215); + break label203; + } + + StringProperty strProp9 = this.watermarkStyle; + flag5 = strProp9.equals("Neverlose"); + + label180: + if (flag5) { + String textStr8 = "Bold"; + String textStr9 = "Medium"; + FontRenderer font3 = this.getA2mA(textStr8, intVal17); + FontRenderer font2 = this.getA2mA(textStr9, intVal17 - 4); + IntProperty intProp7 = this.watermarkAlpha; + Integer intVal23 = intProp7.get(); + Color awtColor = new Color(0, 0, 0, intVal23); + IntProperty intProp8 = this.watermarkRoundess; + Integer intVal8 = intProp8.get(); + double doubleVal5 = 3.0 + 0.08333333333333333 * intVal8.intValue(); + this.cachedValue4 = this.applyUpdate4(textStr8, intVal17, textStr12) + this.applyUpdate4(textStr9, intVal17 - 4, textStr13) + doubleVal5 * 2.0; + this.cachedValue16 = this.applyUpdate2(intVal17) + doubleVal5 * 2.0; + double doubleVal6 = this.cachedValue16; + intProp8 = this.watermarkRoundess; + Integer intVal9 = intProp8.get(); + double doubleVal19 = doubleVal6 * (0.08333333333333333 * intVal9.intValue()); + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal20 = this.cachedValue4; + double doubleVal21 = this.cachedValue16; + IntProperty intProp9 = this.watermarkSmoothness; + Integer intVal10 = intProp9.get(); + double doubleVal22 = intVal10.intValue(); + roundedTextureShader.drawRoundedRect(doubleVal8, doubleVal9, doubleVal20, doubleVal21, doubleVal19, doubleVal22, awtColor, true); + double doubleVal23 = doubleVal8 + doubleVal5; + double doubleVal24 = doubleVal9 + (doubleVal5 + 0.5); + int color3 = ColorTheme.evaluateInt3(225, 225, 225); + int color4 = ColorTheme.evaluateInt3(210, 210, 210); + this.drawElement(font2, textStr13, doubleVal23 + this.applyUpdate4(textStr8, intVal17, textStr12), doubleVal24 + this.applyUpdate2(intVal17) / 2 - this.applyUpdate2(intVal17 - 4) / 2, color3, true); + double doubleVal25 = doubleVal23; + double doubleVal26 = doubleVal24; + this.runnableField = ((Runnable) (() -> { this.drawElement4(font3, textStr12, doubleVal25, doubleVal26, this.watermarkNameEffect.equals("None")); })); + StringProperty strProp10 = this.watermarkNameEffect; + boolean flag7 = strProp10.equals("Glow"); + if (flag7) { + intProp = this.nameGlowAlpha; + Integer intVal11 = intProp.get(); + int intVal24 = (int)(1.5686274509803921 * intVal11.intValue()); + GaussianBlurShader gaussianBlurShader = GaussianBlurShader.getGaussianBlurShader(); + intProp = this.nameGlowRadius; + Integer intVal12 = intProp.get(); + int intVal13 = intVal12; + Runnable runnable = this.runnableField; + gaussianBlurShader.renderVisual(intVal13, intVal24, true, runnable, null); + } + + StringProperty strProp11 = this.watermarkNameEffect; + flag7 = strProp11.equals("Glitch"); + + if (flag7) { + this.stencilBlurPassField.renderRunnable(((Runnable) (() -> { this.drawElement(font3, textStr12, doubleVal25, doubleVal26, color4, false); }))); + break label180; + } + + hudMod = this; + + StringProperty strProp12 = this.watermarkNameColor; + flag7 = strProp12.equals("White"); + + if (flag7) { + StringProperty strProp13 = this.watermarkNameEffect; + this.drawElement(font3, textStr12, doubleVal23, doubleVal24, color4, strProp13.equals("None")); + break label180; + } + + hudMod = this; + + hudMod.runnableField.run(); + } + } + + return; + } + + StringProperty strProp14 = this.nameType; + flag2 = strProp14.equals("Old"); + + if (flag2) { + StringProperty strProp15 = this.nameClientName; + String propStr3 = strProp15.get(); + BooleanProperty boolProp = this.showTime; + Boolean propFlag = boolProp.get(); + String textStr10; + if (propFlag) { + StringBuilder sb28 = new StringBuilder(); + EnumChatFormatting enumChatFormatting13 = EnumChatFormatting.GRAY; + StringBuilder sb29 = sb28.append(enumChatFormatting13); + StringBuilder sb30 = sb29.append("["); + EnumChatFormatting enumChatFormatting14 = EnumChatFormatting.RESET; + StringBuilder sb31 = sb30.append(enumChatFormatting14); + String textStr11 = this.getString(); + StringBuilder sb32 = sb31.append(textStr11); + EnumChatFormatting enumChatFormatting15 = EnumChatFormatting.GRAY; + StringBuilder sb33 = sb32.append(enumChatFormatting15); + textStr10 = sb33.append("]").toString(); + } else { + textStr10 = ""; + } + + String textStr14; + label155: { + textStr14 = textStr10; + HUD hudMod3 = this; + + BooleanProperty boolProp2 = this.showVersion; + propFlag = boolProp2.get(); + if (!propFlag) { + textStr2 = ""; + break label155; + } + + hudMod3 = this; + + + Novoline novolineInst3 = hudMod3.novoline; + textStr2 = novolineInst3.getVersion(); + } + + String textStr15 = textStr2; + double doubleVal27 = 3.0; + double doubleVal28 = 4.0; + HUD hudMod4 = this; + StringProperty strProp16 = this.font; + if (strProp16.equals("Vanilla")) { + DoubleProperty doubleProp3 = this.nameScale; + Double propDouble2 = doubleProp3.get(); + double doubleVal29 = propDouble2; + GL11.glPushMatrix(); + GL11.glTranslated(doubleVal27, doubleVal28, 0.0); + GL11.glScaled(doubleVal29, doubleVal29, doubleVal29); + GL11.glTranslated(-doubleVal27, -doubleVal28, 0.0); + } + + String textStr16 = propStr3.substring(0, 1); + this.renderVisual3(intVal17, textStr16, doubleVal27, doubleVal28, ColorTheme.getHudColor(0L)); + textStr16 = propStr3.substring(1); + this.renderVisual3(intVal17, textStr16, doubleVal27 + this.computeDouble2(intVal17, propStr3.toCharArray()[0]), doubleVal28, 16777215); + this.renderVisual3(intVal17, textStr15, doubleVal27 + 3.0 + this.computeIntInt(intVal17, propStr3), doubleVal28, 14540253); + hudMod4 = this; + + byte byteVal = (byte)(textStr15.isEmpty() ? 1 : 0); + byteVal = (byte)(byteVal != 0 ? 3 : 5); + + double doubleVal7 = doubleVal27 + byteVal; + StringBuilder sb34 = new StringBuilder().append(propStr3); + hudMod4.renderVisual3(intVal17, textStr14, doubleVal7 + this.computeIntInt(intVal17, sb34.append(textStr15).toString()), doubleVal28, 14540253); + StringProperty strProp17 = this.font; + if (strProp17.equals("Vanilla")) { + GL11.glPopMatrix(); + } + + return; + } + + hudMod2 = this; + + StringProperty strProp18 = this.nameType; + flag2 = strProp18.equals("Basic"); + + if (!flag2) { + return; + } + + hudMod2 = this; + + Novoline novolineInst4 = hudMod2.novoline; + String textStr17 = novolineInst4.getVersion(); + String textStr18 = this.getString(); + StringProperty strProp19 = this.nameClientName; + String propStr2 = strProp19.get(); + this.applyUpdate5(propStr2, textStr17, textStr18, intVal17); + BooleanProperty boolProp3 = this.nameGlow; + Boolean propFlag2 = boolProp3.get(); + if (propFlag2) { + GaussianBlurShader gaussianBlurShader2 = GaussianBlurShader.getGaussianBlurShader(); + intProp = this.nameGlowRadius; + Integer intVal14 = intProp.get(); + int intVal15 = intVal14; + IntProperty intProp10 = this.nameGlowAlpha; + Integer intVal16 = intProp10.get(); + int intVal25 = intVal16; + Runnable runnable2 = ((Runnable) (() -> { this.applyUpdate5(propStr2, textStr17, textStr18, intVal17); })); + gaussianBlurShader2.renderVisual(intVal15, intVal25, true, runnable2, null); + } +} + + private void applyUpdate5(String text, String str, String value, int index) { + cc.novoline.modules.visual.HUD hudMod; + cc.novoline.modules.visual.HUD hudMod2; + boolean flag; + label96: { + boolean flag3 = H(); + this.stateTicks2 = 0; + flag = flag3; + Object obj = this.font; + if (!((StringProperty)obj).b("Vanilla")) { + break label96; + } + + DoubleProperty doubleProp = this.nameScale; + obj = doubleProp.get(); + + double doubleVal3; + double doubleVal4; + label97: { + Double doubleVal = (Double)obj; + double doubleVal5 = doubleVal; + doubleVal3 = 3.0 + doubleVal5; + doubleVal4 = 3.0 + doubleVal5; + GL11.glPushMatrix(); + GL11.glTranslated(doubleVal3, doubleVal4, 0.0); + GL11.glScaled(doubleVal5, doubleVal5, doubleVal5); + GL11.glTranslated(-doubleVal3, -doubleVal4, 0.0); + this.applyUpdate4(text, doubleVal3, doubleVal4); + GL11.glScaled(0.5, 0.5, 0.5); + BooleanProperty boolProp = this.showVersion; + Boolean propFlag = boolProp.get(); + flag3 = propFlag; + if (flag3) { + this.applyUpdate4(str, (doubleVal3 + this.evaluateInt(text) + 1.0) * 2.0, (doubleVal4 - 1.0) * 2.0); + break label97; + } + + BooleanProperty boolProp2 = this.showTime; + propFlag = boolProp2.get(); + flag3 = propFlag; + + if (flag3) { + this.applyUpdate4(value, (doubleVal3 + this.evaluateInt(text) + 1.0) * 2.0, (doubleVal4 - 1.0) * 2.0); + } + } + + BooleanProperty boolProp3 = this.showVersion; + Boolean propFlag2 = boolProp3.get(); + flag3 = propFlag2; + + label75: { + label98: { + if (!flag3) { + break label75; + } + + hudMod = this; + if (!flag) { + break label98; + } + + BooleanProperty boolProp4 = this.showTime; + Boolean propFlag3 = boolProp4.get(); + flag3 = propFlag3; + + if (!flag3) { + break label75; + } + + hudMod = this; + } + + hudMod.applyUpdate4(value, (doubleVal3 + this.evaluateInt(text) + 1.0) * 2.0, (doubleVal4 + this.getIntValue18() * 0.5 - 0.5) * 2.0); + } + + GL11.glScaled(2.0, 2.0, 2.0); + GL11.glPopMatrix(); + if (flag) { + return; + } + } + + double doubleVal2; + int intVal; + boolean flag2; + label100: { + doubleVal2 = 1.5 - 0.06818181818181818 * (40 - index); + this.applyUpdate5(index, text, 3.0, doubleVal2 + this.applyUpdate2(index) * 0.5 - 3.0); + intVal = index - 12; + BooleanProperty boolProp5 = this.showVersion; + Boolean propFlag4 = boolProp5.get(); + flag2 = propFlag4; + if (flag2) { + this.applyUpdate5(intVal, str, 4 + this.computeIntInt(index, text) + 1.0, 4.0); + break label100; + } + + BooleanProperty boolProp6 = this.showTime; + propFlag4 = boolProp6.get(); + flag2 = propFlag4; + + if (flag2) { + this.applyUpdate5(intVal, value, 4 + this.computeIntInt(index, text) + 1.0, 4.0); + } + } + + BooleanProperty boolProp7 = this.showVersion; + Boolean propFlag5 = boolProp7.get(); + flag2 = propFlag5; + + label101: { + if (!flag2) { + return; + } + + hudMod2 = this; + if (!flag) { + break label101; + } + + BooleanProperty boolProp8 = this.showTime; + Boolean propFlag6 = boolProp8.get(); + flag2 = propFlag6; + + if (!flag2) { + return; + } + + hudMod2 = this; + } + + hudMod2.applyUpdate5(intVal, value, 4 + this.computeIntInt(index, text) + 1.0, doubleVal2 + 4.0 + this.applyUpdate2(index) * 0.5); +} + + + + public FontRenderer resolveFontRenderer(int value) { + FontFamily fontFam = this.getFontFamily(); + return fontFam.ofSize(value); +} + + @EventTarget + public void onKeyPress(KeyPressEvent event) { + Iterator iter = this.keystrokesButtonList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + KeystrokesButton keystrokesButton = (KeystrokesButton)iter.next(); + KeystrokesButton keystrokesButton2 = keystrokesButton; + KeyBinding keyBinding = keystrokesButton.getKeyBindingField(); + if (keyBinding.getKeyCode() != event.getKey()) { + continue; + } + + keystrokesButton2 = keystrokesButton; + + keystrokesButton2.performAction(); + } +} + + public static FontFamily resolveFontFamily2(HUD hUD) { + return hUD.fontFamilyField10; +} + + private Boolean supplyBoolean56() { + boolean flag; + label45: { + label47: { + Boolean propFlag = this.hudInformation.get(); + flag = propFlag; + if (!flag) { + break label47; + } + + BooleanProperty boolProp = this.showPotionSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label47; + } + + BooleanProperty boolProp2 = this.showInformationSettings; + propFlag = boolProp2.get(); + flag = propFlag; + + if (!flag) { + break label47; + } + + ListProperty listProp = this.informationElements; + flag = listProp.contains("Potions"); + + if (!flag) { + break label47; + } + + StringProperty strProp = this.potionStyle; + flag = strProp.equals("New"); + + if (flag) { + flag = true; + break label45; + } + } + + flag = false; + } + + return flag; +} + + private boolean isStateReady4() { + boolean flag = H(); + Boolean propFlag = this.hudKeyStrokes.get(); + boolean flag2 = propFlag; + if (!flag2) { + return false; + } + + Boolean propFlag2 = this.keystrokesHideOnDebug.get(); + flag2 = this.matchesFlag(propFlag2); + + return !flag ? flag2 : flag2; +} + + public void applyInt5(double value) { + this.cachedValue10 = this.novoline.isStateFlag3() ? 0.0 : value; +} + + public void createString(String text) { + try { + Font font2 = Font.createFont(0, new FileInputStream(text)); + this.fontFamilyField9 = CachedFontFamily.resolveFontFamily(null, font2); + Path filePath = Paths.get(this.cachedText); + LinkOption[] linkOptionArr = new LinkOption[0]; + if (!Files.exists(filePath, linkOptionArr)) { + FileAttribute[] fileAttributeArr = new FileAttribute[0]; + Files.createFile(filePath, fileAttributeArr); + } + + byte[] byteArr = text.getBytes(); + OpenOption[] openOptionArr = new OpenOption[]{StandardOpenOption.TRUNCATE_EXISTING}; + Files.write(filePath, byteArr, openOptionArr); + } catch (FontFormatException | IOException ex) { + } +} + + private Boolean supplyBoolean57() { + boolean flag; + label43: { + label42: { + label45: { + Boolean propFlag = this.hudName.get(); + flag = propFlag; + if (!flag) { + break label45; + } + + BooleanProperty boolProp = this.showNameSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label45; + } + + BooleanProperty boolProp2 = this.showTime; + propFlag = boolProp2.get(); + flag = propFlag; + + if (!flag) { + break label45; + } + + StringProperty strProp = this.nameType; + flag = strProp.equals("Watermark"); + + if (!flag) { + break label42; + } + + ListProperty listProp = this.watermarkAddons; + flag = listProp.contains("Time"); + + if (flag) { + break label42; + } + } + + flag = false; + break label43; + } + + flag = true; + } + + return flag; +} + + private Boolean supplyBoolean58() { + boolean flag; + label43: { + label42: { + label45: { + Boolean propFlag = this.hudInformation.get(); + flag = propFlag; + if (!flag) { + break label45; + } + + BooleanProperty boolProp = this.showTpsRamSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label45; + } + + BooleanProperty boolProp2 = this.showInformationSettings; + propFlag = boolProp2.get(); + flag = propFlag; + + if (!flag) { + break label45; + } + + ListProperty listProp = this.informationElements; + flag = listProp.contains("TPS"); + + if (flag) { + break label42; + } + + ListProperty listProp2 = this.informationElements; + flag = listProp2.contains("RAM"); + + if (flag) { + break label42; + } + } + + flag = false; + break label43; + } + + flag = true; + } + + return flag; +} + + private Boolean supplyBoolean59() { + boolean flag; + label29: { + label31: { + Boolean propFlag = this.hudName.get(); + flag = propFlag; + if (!flag) { + break label31; + } + + BooleanProperty boolProp = this.showNameSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label31; + } + + StringProperty strProp = this.nameType; + flag = strProp.equals("Watermark"); + + if (!flag) { + flag = true; + break label29; + } + } + + flag = false; + } + + return flag; +} + + private Boolean supplyBoolean60() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudModuleList.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showModuleListSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + @Override + public void onEnable() { + this.stencilBlurPassField2 = new StencilBlurPass(); + this.stencilBlurPassField = new StencilBlurPass(); + TaskManager taskManager = this.novoline.getTaskManager(); + taskManager.applyFutureTask(new HUDTask(this, 60, TaskStage.TICK)); +} + + private List resolveList(List list) { + Collections.reverse(list); + return list; +} + + private Boolean supplyBoolean61() { + boolean flag = this.font.equals("Vanilla"); + flag = !flag; + + return flag; +} + + public String computeStringValue(String text) { + StringBuilder sb = new StringBuilder(); + int intVal = 0; + + while (true) { + if (intVal < 4 - text.length()) { + sb.append("0"); + intVal++; + + continue; + } + + sb.append(text); + break; + } + + return sb.toString(); +} + + private void applyUpdate4(String text, double value, double amount) { + char[] charArr = text.toCharArray(); + int len = charArr.length; + int intVal = 0; + + while (intVal < len) { + char ch = charArr[intVal]; + net.minecraft.client.gui.FontRenderer font2 = this.mc.fontRendererObj; + String textStr = String.valueOf(ch); + long longVal = this.stateTicks2; + font2.resolveInt(textStr, value, amount, ColorTheme.getHudColor(longVal), true); + net.minecraft.client.gui.FontRenderer font3 = this.mc.fontRendererObj; + value += font3.setUnicodeFlag(ch); + this.stateTicks2 -= 120; + intVal++; + + } +} + + + private Boolean supplyBoolean62() { + boolean flag; + label37: { + label39: { + Boolean propFlag = this.hudInformation.get(); + flag = propFlag; + if (!flag) { + break label39; + } + + BooleanProperty boolProp = this.showPotionSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label39; + } + + BooleanProperty boolProp2 = this.showInformationSettings; + propFlag = boolProp2.get(); + flag = propFlag; + + if (!flag) { + break label39; + } + + ListProperty listProp = this.informationElements; + flag = listProp.contains("Potions"); + + if (flag) { + flag = true; + break label37; + } + } + + flag = false; + } + + return flag; +} + + public ColorProperty getFadeBeginColor() { + return this.fadeBeginColor; +} + + public ColorProperty getColorProperty5() { + return this.getFadeBeginColor(); +} + + private int getIntValue19() { + List itemList = this.getList(); + Stream stream2 = itemList.stream(); + Comparator comparator = Comparator.comparingInt((AbstractModule abstractModule) -> this.computeIntInt(18, this.applyInt5(abstractModule))); + Optional optional = stream2.max(comparator); + return this.computeIntInt(18, this.applyInt5((AbstractModule)optional.get())); +} + + private void applyUpdate4(PotionEffect potionEffect, double value, double amount) { + Potion potion = Potion.potionTypes[potionEffect.getPotionID2()]; + int intVal = (potion.evaluateCondition() ? 1 : 0); + if (intVal == 0) { + return; + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + intVal = potion.getStatusIconIndex(); + + int intVal2 = intVal; + Minecraft mcClient = this.mc; + TextureManager texManager = mcClient.getTextureManager(); + ResourceLocation resLoc = InventoryEffectRenderer.inventoryBackground; + texManager.renderStep(resLoc); + Gui.applyDouble3(value, amount, intVal2 % 8 * 18, 198 + intVal2 / 8 * 18, 18, 18); +} + + private Boolean supplyBoolean63() { + boolean flag; + label36: { + label35: { + label38: { + Boolean propFlag = this.hudInformation.get(); + flag = propFlag; + if (!flag) { + break label38; + } + + BooleanProperty boolProp = this.showInformationSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label38; + } + + ListProperty listProp = this.informationElements; + flag = listProp.contains("TPS"); + + if (flag) { + break label35; + } + + ListProperty listProp2 = this.informationElements; + flag = listProp2.contains("RAM"); + + if (flag) { + break label35; + } + } + + flag = false; + break label36; + } + + flag = true; + } + + return flag; +} + + private void lambdaImpl$new$0(String text) { + Minecraft mcClient = this.mc; + mcClient.displayGuiScreen(new GuiFontSelector()); +} + + public FontFamily getFontFamilyField9() { + return this.fontFamilyField9; +} + + private Boolean supplyBoolean64() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudModuleList.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showModuleListSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private Boolean supplyBoolean65() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudName.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showNameSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + public void drawElement(FontRenderer fontRenderer, String text, double value, double amount, int index, boolean flag) { + boolean flag2 = this.font.equals("Vanilla"); + if (flag2) { + this.mc.fontRendererObj.resolveInt(text, value, amount, index, flag); + return; + } + + BooleanProperty boolProp = this.fontOutline; + Boolean propFlag = boolProp.get(); + flag2 = propFlag; + + if (flag2) { + Float propFloat = this.outlineWidth.get(); + float floatVal = propFloat; + fontRenderer.drawElement5(text, value, amount, index, floatVal); + return; + } + + fontRenderer.drawElement5(text, value, amount, index, flag); +} + + private Boolean supplyBoolean66() { + boolean flag; + label37: { + label39: { + Boolean propFlag = this.hudName.get(); + flag = propFlag; + if (!flag) { + break label39; + } + + BooleanProperty boolProp = this.showNameSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label39; + } + + StringProperty strProp = this.nameType; + flag = strProp.equals("Watermark"); + + if (!flag) { + break label39; + } + + StringProperty strProp2 = this.watermarkStyle; + flag = strProp2.equals("Neverlose"); + + if (flag) { + flag = true; + break label37; + } + } + + flag = false; + } + + return flag; +} + + private Boolean supplyBoolean67() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudModuleList.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showModuleListSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private String applyInt5(PotionEffect potionEffect) { + int intVal = potionEffect.getAmplifier2() + 1; + return StringScrambler.createString(intVal); +} + + private Boolean supplyBoolean68() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudHotbar.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showHotbarSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private long queryLong(long time) { + return time / 1024L / 1024L; +} + + private static void handleAbstractModule3(AbstractModule module) { + module.callbackTask6.run(); +} + + private void createString(Render2DEvent event) { + double doubleVal; + int intVal; + cc.novoline.modules.visual.HUD hudMod; + ScaledResolution scaledRes = event.getResolution(); + IntProperty intProp = this.potionsXPosition; + Integer intVal2 = intProp.get(); + int intVal3 = intVal2; + intProp = this.potionsYPosition; + Integer intVal4 = intProp.get(); + int intVal5 = intVal4; + double doubleVal10 = intVal3; + double doubleVal11 = intVal5; + short shortVal = 0; + int intVal6 = intVal3; + intVal6 = intVal3 >= scaledRes.getScaledWidthGui() / 2 ? 1 : 0; + + int intVal7 = intVal6; + int intVal8 = intVal5; + intVal8 = intVal5 >= scaledRes.getScaledHeightGui() / 2 ? 1 : 0; + + int intVal9; + StringProperty strProp; + byte byteVal; + int intVal10; + label148: { + intVal9 = intVal8; + strProp = this.potionStyle; + BooleanProperty boolProp = this.potionBackground; + Boolean propFlag = boolProp.get(); + byteVal = (byte)(propFlag ? 1 : 0); + intVal10 = this.getIntValue18(); + int intVal11 = (strProp.equals("Basic") ? 1 : 0); + if (intVal11 != 0) { + double doubleVal2 = intVal10; + DoubleProperty doubleProp = this.informationPadding; + Double propDouble = doubleProp.get(); + doubleVal = doubleVal2 + propDouble; + break label148; + } + + intVal11 = intVal10 * 2; + + byte byteVal2 = byteVal; + byteVal2 = (byte)(byteVal != 0 ? 12 : 6); + + double doubleVal3 = intVal11 + byteVal2; + IntProperty intProp2 = this.potionSmoothness; + Integer intVal12 = intProp2.get(); + doubleVal = doubleVal3 + intVal12.intValue() / 1.75; + } + + double doubleVal4 = doubleVal; + List itemList = this.getListValue3(); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + label150: { + PotionEffect potionEffect = (PotionEffect)iter.next(); + String textStr = this.applyUpdate2(potionEffect); + String textStr2 = this.applyInt5(potionEffect); + String textStr3 = this.resolveString4(potionEffect); + StringBuilder sb = new StringBuilder(); + String textStr4 = StringScrambler.createString(textStr); + StringBuilder sb2 = sb.append(textStr4); + textStr4 = " \u00a77"; + StringBuilder sb3 = sb2.append(textStr4); + StringBuilder sb4 = sb3.append(textStr2); + textStr4 = " "; + StringBuilder sb5 = sb4.append(textStr4); + String textStr5 = sb5.append(textStr3).toString(); + long longVal = shortVal; + int color2 = ColorTheme.getHudColor(longVal); + textStr4 = "Basic"; + if (strProp.equals(textStr4)) { + this.drawElement3(textStr5, intVal7 != 0 ? doubleVal10 - this.evaluateInt(textStr5) : doubleVal10, doubleVal11, color2); + potionEffect.doubleState3 = doubleVal11 - 2.0; + potionEffect.doubleState2 = doubleVal11 + intVal10 + 1.0; + if (intVal7 != 0) { + potionEffect.doubleState4 = doubleVal10 - this.evaluateInt(textStr5) - 2.5; + potionEffect.doubleState = doubleVal10 + 2.5; + break label150; + } + + potionEffect.doubleState4 = doubleVal10 - 2.0; + potionEffect.doubleState = doubleVal10 + this.evaluateInt(textStr5) + 2.5; + + break label150; + } + + String textStr6; + byte byteVal3; + label152: { + StringBuilder sb7 = new StringBuilder().append(textStr); + textStr4 = " \u00a77"; + StringBuilder sb8 = sb7.append(textStr4); + textStr6 = sb8.append(textStr2).toString(); + BooleanProperty boolProp2 = this.potionIcon; + Boolean propFlag2 = boolProp2.get(); + byteVal3 = (byte)(propFlag2 ? 1 : 0); + potionEffect.doubleState3 = doubleVal11 - 3.0; + potionEffect.doubleState2 = doubleVal11 + intVal10 * 2 + 3.0; + if (intVal7 != 0) { + potionEffect.doubleState4 = doubleVal10 - this.evaluateInt(textStr6) - 6.5; + byte byteVal5 = (byte)(byteVal3 != 0 ? 20 : 0); + + potionEffect.doubleState = doubleVal10 + byteVal5; + break label152; + } + + potionEffect.doubleState4 = doubleVal10 - 2.0; + + double doubleVal5 = doubleVal10; + double doubleVal6 = this.evaluateInt(textStr6); + doubleVal5 = doubleVal10 + doubleVal6; + doubleVal6 = byteVal3 != 0 ? 23.0 : 2.5; + + potionEffect.doubleState = doubleVal5 + doubleVal6; + } + + byte byteVal4 = byteVal; + + if (byteVal != 0) { + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal7 = potionEffect.doubleState4; + double doubleVal12 = potionEffect.doubleState3; + double doubleVal13 = potionEffect.doubleState - potionEffect.doubleState4; + double doubleVal14 = potionEffect.doubleState2 - potionEffect.doubleState3; + Double propDouble2 = this.potionRoundness.get(); + double doubleVal15 = propDouble2; + Integer intVal13 = this.potionSmoothness.get(); + double doubleVal16 = intVal13.intValue(); + Integer intVal14 = this.potionAlpha.get(); + Color awtColor = new Color(0, 0, 0, intVal14); + roundedTextureShader.drawRoundedRect(doubleVal7, doubleVal12, doubleVal13, doubleVal14, doubleVal15, doubleVal16, awtColor, true); + } + + byteVal4 = byteVal3; + + + if (byteVal4 != 0) { + this.applyUpdate4(potionEffect, doubleVal10, doubleVal11 + intVal10 - 8.5); + } + + label110: { + intVal = intVal7; + + if (intVal7 != 0) { + intVal = -4; + break label110; + } + + intVal = byteVal3; + + + intVal = intVal != 0 ? 20 : 0; + } + + double doubleVal17; + label103: { + double doubleVal8 = doubleVal10 + intVal; + hudMod = this; + textStr4 = textStr6; + double doubleVal18 = intVal7 != 0 ? doubleVal8 - this.evaluateInt(textStr6) : doubleVal8; + double doubleVal9 = doubleVal11; + this.drawElement3(textStr6, doubleVal18, doubleVal11, color2); + hudMod = this; + StringBuilder sb10 = new StringBuilder().append("\u00a77"); + textStr4 = sb10.append(textStr3).toString(); + if (intVal7 == 0) { + doubleVal17 = doubleVal8; + break label103; + } + + doubleVal18 = doubleVal8; + doubleVal9 = this.evaluateInt(textStr3); + + doubleVal17 = doubleVal18 - doubleVal9; + } + + hudMod.drawElement3(textStr4, doubleVal17, doubleVal11 + intVal10 + 1.5, color2); + } + + label97: { + if (intVal9 != 0) { + doubleVal11 -= doubleVal4; + break label97; + } + + doubleVal11 += doubleVal4; + } + + shortVal -= 180; + } +} + + private Boolean supplyBoolean69() { + boolean flag; + label45: { + label47: { + Boolean propFlag = this.hudModuleList.get(); + flag = propFlag; + if (!flag) { + break label47; + } + + BooleanProperty boolProp = this.showModuleListSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label47; + } + + ListProperty listProp = this.moduleListShaders; + flag = listProp.contains("Glow"); + + if (!flag) { + break label47; + } + + StringProperty strProp = this.moduleListGlowMode; + flag = strProp.equals("Font"); + + if (flag) { + break label47; + } + + StringProperty strProp2 = this.moduleListBackground; + flag = strProp2.equals("Stripe"); + + if (!flag) { + flag = true; + break label45; + } + } + + flag = false; + } + + return flag; +} + + private static void invokeCallback6(int value, double amount, int index, long time, long delay) { + double doubleVal = value + amount / 2.0 + 0.25; + double doubleVal2 = index + 18; + double doubleVal3 = 360.0 / time * delay; + RenderUtils.drawElement5(doubleVal, doubleVal2, 0.0, doubleVal3, 13.25, 4.5F, 22L); +} + + private boolean applyUpdate5(int value, int index, int count, int amount) { + double doubleVal = this.resolveDoubleArray(value, index)[0]; + double doubleVal2 = this.resolveDoubleArray(value, index)[1]; + double doubleVal3 = this.resolveDoubleArray(value, index)[2]; + double doubleVal4 = this.resolveDoubleArray(value, index)[3]; + if (count < doubleVal) { + return false; + } + + if (count >= doubleVal3) { + return false; + } + + if (amount < doubleVal2) { + return false; + } + + return amount < doubleVal4; +} + + public IntProperty getNotificationAlpha() { + return this.notificationAlpha; +} + + public IntProperty getIntProperty7() { + return this.getNotificationAlpha(); +} + + private Boolean supplyBoolean70() { + boolean flag; + label45: { + label47: { + Boolean propFlag = this.hudName.get(); + flag = propFlag; + if (!flag) { + break label47; + } + + BooleanProperty boolProp = this.showNameSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label47; + } + + StringProperty strProp = this.nameType; + flag = strProp.equals("Watermark"); + + if (!flag) { + break label47; + } + + StringProperty strProp2 = this.watermarkStyle; + flag = strProp2.equals("Neverlose"); + + if (!flag) { + break label47; + } + + StringProperty strProp3 = this.watermarkNameEffect; + flag = strProp3.equals("Glitch"); + + if (!flag) { + flag = true; + break label45; + } + } + + flag = false; + } + + return flag; +} + + private static void invokeCallback7(int value, double amount, int index, double offset) { + double doubleVal = value + amount / 2.0 + 0.25; + double doubleVal2 = index + 18; + double doubleVal3 = 18.0 * offset; + RenderUtils.drawElement5(doubleVal, doubleVal2, 0.0, doubleVal3, 13.25, 4.5F, 22L); +} + + public StringProperty getModuleListSuffixes() { + return this.moduleListSuffixes; +} + + public StringProperty getStringProperty16() { + return this.getModuleListSuffixes(); +} + + private Boolean supplyBoolean71() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudName.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showNameSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private Boolean supplyBoolean72() { + boolean flag; + label82: { + label81: { + label84: { + Boolean propFlag = this.hudName.get(); + flag = propFlag; + if (!flag) { + break label84; + } + + BooleanProperty boolProp = this.showNameSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label84; + } + + StringProperty strProp = this.nameType; + flag = strProp.equals("Basic"); + + if (flag) { + BooleanProperty boolProp2 = this.nameGlow; + propFlag = boolProp2.get(); + flag = propFlag; + + if (flag) { + break label81; + } + } + + StringProperty strProp2 = this.nameType; + flag = strProp2.equals("Watermark"); + + if (!flag) { + break label84; + } + + StringProperty strProp3 = this.watermarkStyle; + flag = strProp3.equals("Basic"); + + if (flag) { + ListProperty listProp = this.watermarkShaders; + String textStr = "Glow"; + flag = listProp.contains(textStr); + + if (flag) { + StringProperty strProp4 = this.watermarkBackgroundType; + textStr = "Bar"; + flag = strProp4.equals(textStr); + + if (flag) { + break label81; + } + + StringProperty strProp5 = this.watermarkBackgroundType; + textStr = "Outlined"; + flag = strProp5.equals(textStr); + + if (flag) { + break label81; + } + } + } + + StringProperty strProp6 = this.watermarkStyle; + flag = strProp6.equals("Neverlose"); + + if (!flag) { + break label84; + } + + StringProperty strProp7 = this.watermarkNameEffect; + flag = strProp7.equals("Glow"); + + if (flag) { + break label81; + } + } + + flag = false; + break label82; + } + + flag = true; + } + + return flag; +} + + private Boolean supplyBoolean73() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudKeybinds.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showKeybindsSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + public void performStep23() { + List itemList = this.keystrokesButtonList; + itemList.clear(); + IntProperty intProp = this.keyStrokesPosX; + Integer intVal = intProp.get(); + int intVal2 = intVal; + IntProperty intProp2 = this.keyStrokesPosY; + Integer intVal3 = intProp2.get(); + int intVal4 = intVal3; + Integer keyCode = this.keyStrokesSmoothness.get(); + double doubleVal = 1 + keyCode; + itemList = this.keystrokesButtonList; + KeystrokesButton keystrokesButton = new KeystrokesButton(this, this.mc.gameSettings.bj, intVal2 + this.cachedValue11, intVal4 - doubleVal, this.cachedValue11, this.cachedValue2); + itemList.add(keystrokesButton); + itemList = this.keystrokesButtonList; + KeystrokesButton keystrokesButton2 = new KeystrokesButton(this, this.mc.gameSettings.B, intVal2 - doubleVal, intVal4 + this.cachedValue2, this.cachedValue11, this.cachedValue2); + itemList.add(keystrokesButton2); + itemList = this.keystrokesButtonList; + KeystrokesButton keystrokesButton3 = new KeystrokesButton(this, this.mc.gameSettings.b4, intVal2 + this.cachedValue11, intVal4 + this.cachedValue2, this.cachedValue11, this.cachedValue2); + itemList.add(keystrokesButton3); + itemList = this.keystrokesButtonList; + KeystrokesButton keystrokesButton4 = new KeystrokesButton(this, this.mc.gameSettings.b6, intVal2 + this.cachedValue11 * 2.0 + doubleVal, intVal4 + this.cachedValue2, this.cachedValue11, this.cachedValue2); + itemList.add(keystrokesButton4); + itemList = this.keystrokesButtonList; + KeystrokesButton keystrokesButton5 = new KeystrokesButton(this, "LMB", intVal2 + this.cachedValue11 / 2.0 - 2.0 - doubleVal / 2.0, intVal4 + this.cachedValue2 * 2.0 + doubleVal, this.cachedValue5, this.cachedValue2); + itemList.add(keystrokesButton5); + itemList = this.keystrokesButtonList; + KeystrokesButton keystrokesButton6 = new KeystrokesButton(this, "RMB", intVal2 + this.cachedValue11 * 1.5 + doubleVal / 2.0, intVal4 + this.cachedValue2 * 2.0 + doubleVal, this.cachedValue5, this.cachedValue2); + itemList.add(keystrokesButton6); +} + + public static DoubleProperty applyInt5(HUD hUD) { + return hUD.keyStrokesRadius; +} + + @EventTarget + private void onRender2D(Render2DEvent event) { + double doubleVal = MovementUtils.evaluateDouble(true); + boolean flag2 = this.isStateReady2(); + if (flag2) { + this.applyUpdate2(event); + } + + BooleanProperty boolProp = this.hudInformation; + Boolean propFlag = boolProp.get(); + flag2 = propFlag; + + if (flag2) { + this.updateHelper3(event); + } + + BooleanProperty boolProp2 = this.hudInformation; + Boolean propFlag2 = boolProp2.get(); + flag2 = propFlag2; + + if (flag2) { + ListProperty listProp = this.informationElements; + flag2 = listProp.contains("Potions"); + + if (flag2) { + this.createString(event); + } + } + + BooleanProperty boolProp3 = this.hudInformation; + Boolean propFlag3 = boolProp3.get(); + flag2 = propFlag3; + + if (flag2) { + ListProperty listProp2 = this.informationElements; + flag2 = listProp2.contains("Armor"); + + if (flag2) { + this.resolveHelper2(event); + } + } + + BooleanProperty boolProp4 = this.hudInformation; + Boolean propFlag4 = boolProp4.get(); + flag2 = propFlag4; + + if (flag2) { + ListProperty listProp3 = this.informationElements; + flag2 = listProp3.contains("UserInfo"); + + if (flag2) { + this.handleRender2DEvent(event); + } + } + + flag2 = this.isStateReady3(); + + + if (flag2) { + this.renderElement2(event); + } + + flag2 = this.isStateReady4(); + + + if (flag2) { + this.updateHelper2(event); + } + + BooleanProperty boolProp5 = this.hudInformation; + Boolean propFlag5 = boolProp5.get(); + flag2 = propFlag5; + + if (flag2) { + ListProperty listProp4 = this.informationElements; + flag2 = listProp4.contains("TPS"); + + if (flag2) { + this.renderElement3(event); + } + } + + BooleanProperty boolProp6 = this.hudInformation; + Boolean propFlag6 = boolProp6.get(); + flag2 = propFlag6; + + if (flag2) { + ListProperty listProp5 = this.informationElements; + flag2 = listProp5.contains("RAM"); + + if (flag2) { + this.resolveHelper(event); + } + } + + MovementUtils.unscale(doubleVal); + BooleanProperty boolProp7 = this.hudHotbar; + Boolean propFlag7 = boolProp7.get(); + flag2 = propFlag7; + + + if (flag2) { + this.applyInt5(event); + } + + flag2 = this.isFlagX(); + + + + if (!flag2) { + return; + } + + flag2 = true; + + + MovementUtils.evaluateDouble(flag2); + this.evaluateInt(event); + MovementUtils.unscale(doubleVal); +} + + public List getListValue4() { + return this.abstractModuleList; +} + + private Boolean supplyBoolean74() { + boolean flag; + label45: { + label47: { + Boolean propFlag = this.hudName.get(); + flag = propFlag; + if (!flag) { + break label47; + } + + BooleanProperty boolProp = this.showNameSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label47; + } + + StringProperty strProp = this.nameType; + flag = strProp.equals("Watermark"); + + if (!flag) { + break label47; + } + + StringProperty strProp2 = this.watermarkStyle; + flag = strProp2.equals("Basic"); + + if (!flag) { + break label47; + } + + StringProperty strProp3 = this.watermarkBackgroundType; + flag = strProp3.equals("Outlined"); + + if (flag) { + flag = true; + break label45; + } + } + + flag = false; + } + + return flag; +} + + private Boolean supplyBoolean75() { + boolean flag; + label29: { + label31: { + Boolean propFlag = this.hudModuleList.get(); + flag = propFlag; + if (!flag) { + break label31; + } + + BooleanProperty boolProp = this.showModuleListSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label31; + } + + StringProperty strProp = this.moduleListBackground; + flag = strProp.equals("None"); + + if (!flag) { + flag = true; + break label29; + } + } + + flag = false; + } + + return flag; +} + + public void drawElement2(FontRenderer fontRenderer, String text, double value, double amount, int index, boolean flag, boolean enabled) { + boolean flag2 = this.font.equals("Vanilla"); + if (flag2) { + this.mc.fontRendererObj.resolveInt(text, value, amount, index, flag); + return; + } + + BooleanProperty boolProp = this.fontOutline; + Boolean propFlag = boolProp.get(); + flag2 = propFlag; + + if (flag2) { + Float propFloat = this.outlineWidth.get(); + fontRenderer.drawElement(text, value, amount, index, propFloat, enabled); + return; + } + + fontRenderer.drawElement3(text, value, amount, index, flag, enabled); +} + + private Boolean supplyBoolean76() { + boolean flag; + label82: { + label81: { + label84: { + Boolean propFlag = this.hudName.get(); + flag = propFlag; + if (!flag) { + break label84; + } + + BooleanProperty boolProp = this.showNameSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label84; + } + + StringProperty strProp = this.nameType; + flag = strProp.equals("Basic"); + + if (flag) { + BooleanProperty boolProp2 = this.nameGlow; + propFlag = boolProp2.get(); + flag = propFlag; + + if (flag) { + break label81; + } + } + + StringProperty strProp2 = this.nameType; + flag = strProp2.equals("Watermark"); + + if (!flag) { + break label84; + } + + StringProperty strProp3 = this.watermarkStyle; + flag = strProp3.equals("Basic"); + + if (flag) { + ListProperty listProp = this.watermarkShaders; + String textStr = "Glow"; + flag = listProp.contains(textStr); + + if (flag) { + StringProperty strProp4 = this.watermarkBackgroundType; + textStr = "Bar"; + flag = strProp4.equals(textStr); + + if (flag) { + break label81; + } + + StringProperty strProp5 = this.watermarkBackgroundType; + textStr = "Outlined"; + flag = strProp5.equals(textStr); + + if (flag) { + break label81; + } + } + } + + StringProperty strProp6 = this.watermarkStyle; + flag = strProp6.equals("Neverlose"); + + if (!flag) { + break label84; + } + + StringProperty strProp7 = this.watermarkNameEffect; + flag = strProp7.equals("Glow"); + + if (flag) { + break label81; + } + } + + flag = false; + break label82; + } + + flag = true; + } + + return flag; +} + + public double computeDouble4(FontRenderer fontRenderer, char ch) { + StringProperty strProp = this.font; + int intVal = (strProp.equals("Vanilla") ? 1 : 0); + if (intVal == 0) { + return fontRenderer.evaluateInt2(ch); + } + + net.minecraft.client.gui.FontRenderer font2 = this.mc.fontRendererObj; + intVal = font2.setUnicodeFlag(ch); + + return intVal; +} + + public FontRenderer resolveHelper(String text) { + FontFamily fontFam = this.resolveHelper2(text); + Integer intVal = this.fontSize.get(); + int intVal2 = intVal; + return fontFam.ofSize(intVal2); +} + + @EventTarget + public void handleMiddleClickEvent(MiddleClickEvent event) { + Iterator iter = this.keystrokesButtonList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + KeystrokesButton keystrokesButton; + label46: { + keystrokesButton = (KeystrokesButton)iter.next(); + KeyBinding keyBinding = keystrokesButton.getKeyBindingField(); + int keyCode = keyBinding.getKeyCode(); + byte byteVal = -100; + if (keyCode == -100) { + keyCode = event.getStateTicks(); + + if (keyCode == 0) { + break label46; + } + } + + KeyBinding keyBinding2 = keystrokesButton.getKeyBindingField(); + keyCode = keyBinding2.getKeyCode(); + + byteVal = -99; + + if (keyCode != byteVal) { + continue; + } + + keyCode = event.getStateTicks(); + byteVal = 1; + + if (keyCode != byteVal) { + continue; + } + } + + keystrokesButton.performAction(); + } +} + + private Boolean supplyBoolean77() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudKeybinds.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showKeybindsSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + public int computeIntInt(int value, String text) { + HUD hudMod = this; + StringProperty strProp = this.font; + if (strProp.equals("Vanilla")) { + return this.mc.fontRendererObj.getStringWidth(text); + } + + hudMod = this; + + FontRenderer font2 = hudMod.resolveFontRenderer(value); + return font2.evaluateInt2(text); +} + + private void resolveHelper2(Render2DEvent event) { + int intVal; + net.minecraft.item.ItemStack stack; + IntProperty intProp = this.armorXPosition; + Integer intVal2 = intProp.get(); + int intVal3 = intVal2; + intProp = this.armorYPosition; + Integer intVal4 = intProp.get(); + int intVal5 = intVal4; + boolean flag = Q(); + List itemList2 = this.getList2(); + Stream stream2 = itemList2.stream(); + Predicate predicate = Objects::nonNull; + Stream stream3 = stream2.filter(predicate); + Collector collector = Collectors.toList(); + List itemList = (java.util.List) stream3.collect(collector); + boolean flag2 = flag; + Integer intVal6 = this.armorBackgroundAlpha.get(); + this.applyFlag(true, new Color(0, 0, 0, intVal6)); + short shortVal = 0; + Iterator iter = itemList.iterator(); + + do { + if (!iter.hasNext()) { + break; + } + + int color2; + String textStr; + label42: { + ItemStack stack2 = (ItemStack)iter.next(); + long longVal = shortVal; + color2 = ColorTheme.getHudColor(longVal); + float floatVal = intVal3; + float floatVal2 = intVal5; + RenderUtils.drawElement7(stack2, floatVal, floatVal2); + textStr = this.resolveString3(stack2); + FontFamily fontFam = this.fontFamilyField3; + FontRenderer font2 = fontFam.ofSize(11); + double doubleVal5 = intVal3 + 7.5; + this.drawElement4(font2, textStr, doubleVal5 - font2.evaluateInt2(textStr) / 2, intVal5 + 18.5, color2); + stack = stack2; + + if (stack2.isStackable()) { + stack = stack2; + + if (stack2.stackSize > 1) { + intVal = 64; + break label42; + } + } + + stack = stack2; + + intVal = stack.getMaxDamage(); + } + + double doubleVal = 15.0 / intVal; + double doubleVal2 = doubleVal * Integer.parseInt(textStr); + BooleanProperty boolProp = this.armorBackground; + Boolean propFlag = boolProp.get(); + boolean flag3 = propFlag; + + if (flag3) { + double doubleVal3 = intVal3 + 0.5; + double doubleVal6 = intVal5 + 23; + double doubleVal7 = intVal3 + 15.5; + double doubleVal8 = intVal5 + 24; + int color3 = ColorTheme.BLACK.getStateTicks(); + RenderUtils.drawRect(doubleVal3, doubleVal6, doubleVal7, doubleVal8, color3); + double doubleVal4 = intVal3 + 0.5; + double doubleVal9 = intVal5 + 23; + double doubleVal10 = intVal3 + 0.5 + doubleVal2; + doubleVal8 = intVal5 + 24; + RenderUtils.drawRect(doubleVal4, doubleVal9, doubleVal10, doubleVal8, color2); + } + + StringProperty strProp = this.armorAlign; + flag3 = strProp.equals("Horizontal"); + + + label31: { + if (flag3) { + intVal3 += 17; + + break label31; + + } + + intVal5 += 26; + } + + shortVal -= 240; + } while (!flag2); +} + + private String resolveString3(ItemStack stack) { + int intVal; + label35: { + int intVal4 = (stack.isStackable() ? 1 : 0); + int intVal5; + if (intVal4 != 0) { + intVal4 = stack.stackSize; + intVal5 = 1; + + if (stack.stackSize > 1) { + intVal = stack.stackSize; + break label35; + } + } + + intVal4 = stack.getMaxDamage(); + intVal5 = stack.getItemDamage(); + + intVal4 -= intVal5; + + int intVal2 = intVal4; + int intVal3 = intVal2; + if (intVal2 < 0) { + intVal = 1; + break label35; + } + + intVal3 = intVal2; + + intVal = intVal3; + } + + return Integer.toString(intVal); +} + + private String resolveString4(PotionEffect potionEffect) { + return Potion.getDurationString(potionEffect); +} + + private List getListW() { + ClickGui clickGuiMod = ModuleRegistry.CLICKGUI.getModule(); + ModuleManager modManager = this.moduleManager; + ObjectCollection objectCollection = modManager.getModules().values(); + Stream stream2 = objectCollection.stream(); + Function mapper = ((java.util.function.Function) ModuleHolder::getModule); + Stream stream3 = stream2.map(mapper); + Predicate predicate = ((java.util.function.Predicate) ((value0) -> HUD.invokeCallback(clickGuiMod, value0))); + Stream stream4 = stream3.filter(predicate); + Comparator comparator = Comparator.comparing((AbstractModule abstractModule) -> (this.evaluateInt(abstractModule.getFormattedDisplayName()))); + Stream stream5 = stream4.sorted(comparator); + Collector collector = Collectors.toList(); + List itemList = (java.util.List) stream5.collect(collector); + Collections.reverse(itemList); + return itemList; +} + + + private void applyFlag(boolean flag, Color color2) { + label40: { + int intVal; + List itemList; + HUD hudMod; + Integer intVal2 = this.armorXPosition.get(); + int intVal3 = intVal2; + IntProperty intProp = this.armorYPosition; + Integer intVal4 = intProp.get(); + intVal = intVal4; + List itemList2 = this.getList2(); + Stream stream2 = itemList2.stream(); + Predicate predicate = Objects::nonNull; + Stream stream3 = stream2.filter(predicate); + Collector collector = Collectors.toList(); + itemList = (java.util.List) stream3.collect(collector); + boolean empty = itemList.isEmpty(); + if (empty) { + return; + } + + hudMod = this; + + StringProperty strProp = this.armorAlign; + empty = strProp.equals("Horizontal"); + + if (empty) { + this.cachedValue13 = intVal3 - 3; + this.cachedValue = intVal - 0.5; + this.cachedValue3 = intVal3 + 17 * itemList.size() + 1.5; + this.cachedValue7 = intVal + 27; + break label40; + } + + this.cachedValue13 = intVal3 - 2.5; + this.cachedValue = intVal - 0.5; + this.cachedValue3 = intVal3 + 18.5; + hudMod = this; + + hudMod.cachedValue7 = intVal + 26 * itemList.size() + 1.5; + } + + BooleanProperty boolProp = this.armorBackground; + Boolean propFlag = boolProp.get(); + boolean flag3 = propFlag; + + if (!flag3) { + return; + } + + flag3 = flag; + + + if (flag3) { + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal = this.cachedValue13; + double doubleVal3 = this.cachedValue; + double doubleVal4 = this.cachedValue3 - this.cachedValue13; + double doubleVal5 = this.cachedValue7 - this.cachedValue; + Double propDouble = this.armorBackgroundRoundness.get(); + double doubleVal6 = propDouble; + Integer intVal5 = this.armorBackgroundSmoothness.get(); + double doubleVal7 = intVal5.intValue(); + roundedTextureShader.drawRoundedRect(doubleVal, doubleVal3, doubleVal4, doubleVal5, doubleVal6, doubleVal7, color2, true); + return; + } + + double doubleVal2 = this.cachedValue13; + double doubleVal8 = this.cachedValue; + double doubleVal9 = this.cachedValue3 - this.cachedValue13; + double doubleVal10 = this.cachedValue7 - this.cachedValue; + DoubleProperty doubleProp = this.armorBackgroundRoundness; + Double propDouble2 = doubleProp.get(); + double doubleVal11 = propDouble2 / 2.0; + int color3 = color2.getRGB(); + RenderUtils.drawBorderedRoundedRect(doubleVal2, doubleVal8, doubleVal9, doubleVal10, doubleVal11, 1.0F, color3, 0); +} + + public static FloatProperty getShadowOffset() { + return shadowOffset; +} + + public int applyUpdate2(int value) { + HUD hudMod = this; + + StringProperty strProp = this.font; + if (strProp.equals("Vanilla")) { + net.minecraft.client.gui.FontRenderer font2 = this.mc.fontRendererObj; + return font2.computeInt(); + } + + hudMod = this; + + + FontRenderer font3 = hudMod.resolveFontRenderer(value); + return font3.getHeight(); +} + + public void drawElement(int value, String text, double amount, double offset, int index, boolean flag) { + HUD hudMod; + + boolean flag2 = this.font.equals("Vanilla"); + if (flag2) { + net.minecraft.client.gui.FontRenderer font2 = this.mc.fontRendererObj; + float floatVal = (float)amount; + float floatVal2 = (float)offset; + font2.resolveInt(text, floatVal, floatVal2, index, flag); + return; + } + + hudMod = this; + + BooleanProperty boolProp = this.fontOutline; + Boolean propFlag = boolProp.get(); + flag2 = propFlag; + + if (flag2) { + FontRenderer font3 = this.resolveFontRenderer(value); + Float propFloat = this.outlineWidth.get(); + float floatVal3 = propFloat; + font3.drawElement5(text, amount, offset, index, floatVal3); + return; + } + + hudMod = this; + + FontRenderer font4 = hudMod.resolveFontRenderer(value); + font4.drawElement5(text, amount, offset, index, flag); +} + + public StringProperty getInventoryAnimation() { + return this.inventoryAnimation; +} + + public StringProperty getStringProperty17() { + return this.getInventoryAnimation(); +} + + private Boolean supplyBoolean78() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudKeyStrokes.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showKeystrokesSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private Boolean supplyBoolean79() { + boolean flag = this.colorEffect.equals("Fade"); + flag = !flag; + + return flag; +} + + public void renderElement4(int value, String text, String str, double amount, double offset, int index, boolean flag) { + HUD hudMod; + boolean flag2 = this.font.equals("Vanilla"); + if (flag2) { + net.minecraft.client.gui.FontRenderer font2 = this.mc.fontRendererObj; + double doubleVal = amount - this.evaluateInt(str) * 0.5; + font2.updateState2(str, doubleVal, offset, index, flag); + return; + } + + hudMod = this; + + BooleanProperty boolProp = this.fontOutline; + Boolean propFlag = boolProp.get(); + flag2 = propFlag; + + if (flag2) { + FontRenderer font3 = this.getA2mA(text, value); + double doubleVal2 = amount - this.applyUpdate4(text, value, str) / 2; + Float propFloat = this.outlineWidth.get(); + float floatVal = propFloat; + font3.drawElement5(str, doubleVal2, offset, index, floatVal); + return; + } + + hudMod = this; + + FontRenderer font4 = hudMod.getA2mA(text, value); + double doubleVal3 = amount - this.applyUpdate4(text, value, str) / 2; + font4.drawElement5(str, doubleVal3, offset, index, flag); +} + + private Boolean supplyBoolean80() { + boolean flag; + label29: { + label31: { + Boolean propFlag = this.hudInformation.get(); + flag = propFlag; + if (!flag) { + break label31; + } + + BooleanProperty boolProp = this.showInformationSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label31; + } + + ListProperty listProp = this.informationElements; + flag = listProp.contains("Potions"); + + if (flag) { + flag = true; + break label29; + } + } + + flag = false; + } + + return flag; +} + + @EventTarget + public void handleModuleStateEvent(ModuleStateEvent event) { + this.performAction(); +} + + public FontRenderer getA2mO() { + FontFamily fontFam = this.getFontFamily(); + Integer intVal = this.fontSize.get(); + int intVal2 = intVal; + return fontFam.ofSize(intVal2); +} + + public IntProperty getChatHeight() { + return this.chatHeight; +} + + public IntProperty getIntProperty8() { + return this.getChatHeight(); +} + + private Boolean supplyBoolean81() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudName.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showNameSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private Boolean supplyBoolean82() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudModuleList.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showModuleListSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private int computeIntValue() { + EntityPlayerSP player = this.mc.thePlayer; + ArrayList itemList = new ArrayList<>(player.getActivePotionEffects()); + Stream stream2 = itemList.stream(); + Comparator comparator = Comparator.comparingInt((PotionEffect potionEffect2) -> this.computeIntInt(19, this.applyUpdate3(potionEffect2))); + Optional optional = stream2.max(comparator); + PotionEffect potionEffect = (PotionEffect)optional.get(); + StringProperty strProp = this.potionStyle; + int intVal = (strProp.equals("Basic") ? 1 : 0); + if (intVal != 0) { + return this.computeIntInt(19, this.applyUpdate3(potionEffect)); + } + + StringBuilder sb = new StringBuilder(); + String textStr = this.applyUpdate2(potionEffect); + StringBuilder sb2 = sb.append(textStr); + StringBuilder sb3 = sb2.append(" "); + String textStr2 = this.applyInt5(potionEffect); + intVal = this.computeIntInt(19, sb3.append(textStr2).toString()); + + BooleanProperty boolProp = this.potionIcon; + Boolean propFlag = boolProp.get(); + byte byteVal = (byte)(propFlag ? 1 : 0); + byteVal = (byte)(byteVal != 0 ? 20 : 0); + + return intVal + byteVal; +} + + private Boolean supplyBoolean83() { + boolean flag; + label21: { + label23: { + Boolean propFlag = this.hudModuleList.get(); + flag = propFlag; + if (!flag) { + break label23; + } + + BooleanProperty boolProp = this.showModuleListSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + public void renderVisual3(int value, String text, double amount, double offset, int index) { + HUD hudMod; + boolean flag = this.font.equals("Vanilla"); + if (flag) { + this.mc.fontRendererObj.resolveInt(text, amount, offset, index, true); + return; + } + + hudMod = this; + + BooleanProperty boolProp = this.fontOutline; + Boolean propFlag = boolProp.get(); + flag = propFlag; + + if (flag) { + FontRenderer font2 = this.resolveFontRenderer(value); + Float propFloat = this.outlineWidth.get(); + float floatVal = propFloat; + font2.drawElement5(text, amount, offset, index, floatVal); + return; + } + + hudMod = this; + + FontRenderer font3 = hudMod.resolveFontRenderer(value); + font3.drawElement5(text, amount, offset, index, true); +} + + private Boolean supplyBoolean84() { + boolean flag; + label29: { + label28: { + label31: { + Boolean propFlag = this.showNotificationSettings.get(); + flag = propFlag; + if (!flag) { + break label31; + } + + StringProperty strProp = this.notificationStyle; + flag = strProp.equals("Basic"); + + if (flag) { + break label28; + } + + StringProperty strProp2 = this.notificationStyle; + flag = strProp2.equals("Old"); + + if (flag) { + break label28; + } + } + + flag = false; + break label29; + } + + flag = true; + } + + return flag; +} + + private Boolean supplyBoolean85() { + boolean flag; + label43: { + label42: { + label45: { + Boolean propFlag = this.hudInformation.get(); + flag = propFlag; + if (!flag) { + break label45; + } + + BooleanProperty boolProp = this.showTpsRamSettings; + propFlag = boolProp.get(); + flag = propFlag; + + if (!flag) { + break label45; + } + + BooleanProperty boolProp2 = this.showInformationSettings; + propFlag = boolProp2.get(); + flag = propFlag; + + if (!flag) { + break label45; + } + + ListProperty listProp = this.informationElements; + flag = listProp.contains("TPS"); + + if (flag) { + break label42; + } + + ListProperty listProp2 = this.informationElements; + flag = listProp2.contains("RAM"); + + if (flag) { + break label42; + } + } + + flag = false; + break label43; + } + + flag = true; + } + + return flag; +} + + private static java.lang.Runnable $lambdaCapture$115(cc.novoline.modules.visual.HUD captured0, java.lang.String captured1, double captured2, double captured3, int captured4) { return () -> captured0.invokeCallback5(captured1, captured2, captured3, captured4); } + + private static Runnable $lambdaCapture$114(double x, double width, double y, double height, int color, double left, double right, int mode, int alpha) { + return () -> HUD.invokeCallback2(x, width, y, height, color, left, right, mode, alpha); +} + + private static Runnable $lambdaCapture$122(HUD hud, AbstractModule module, double[] positions, double width, int[] indices, boolean left, boolean right, int mode, int index, List modules) { + return () -> hud.invokeCallback3(module, positions, width, indices, left, right, mode, index, modules); +} + + private static Runnable $lambdaCapture$128(HUD hud, double x, double y, double width) { + return () -> hud.invokeCallback4(x, y, width); +} + + + public int getHudStringWidth(String text) { return this.evaluateInt(text); } + public int getHudStringWidth(int size, String text) { return this.computeIntInt(size, text); } + + public cc.novoline.modules.configurations.property.object.IntProperty getKeyStrokesSmoothness() { return this.keyStrokesSmoothness; } + public cc.novoline.modules.configurations.property.object.IntProperty getKeyStrokesAlpha() { return this.keyStrokesAlpha; } + public cc.novoline.utils.fonts.api.FontFamily getFontFamilyField10() { return this.fontFamilyField10; } + public cc.novoline.modules.configurations.property.object.DoubleProperty getKeyStrokesRadius() { return this.keyStrokesRadius; } + + public cc.novoline.utils.fonts.api.FontRenderer getHudFont(int size) { return this.resolveFontRenderer(size); } +} diff --git a/src/main/java/cc/novoline/modules/visual/HypixelStats.java b/src/main/java/cc/novoline/modules/visual/HypixelStats.java new file mode 100644 index 0000000..06e273b --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/HypixelStats.java @@ -0,0 +1,939 @@ +package cc.novoline.modules.visual; + + +import net.minecraft.client.gui.Gui; +import cc.novoline.events.type.GuiState; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.HypixelLobbyType; +import cc.novoline.utils.MovementUtils; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.ServerUtils; +import cc.novoline.utils.StencilUtil; +import cc.novoline.utils.StringScrambler; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.render.HypixelStatRow; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.shader.RoundedTextureShader; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.LoadWorldEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.events.events.RenderGuiEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.IntProperty; +import com.mojang.authlib.GameProfile; +import cc.novoline.modules.ModuleRegistry; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Toolkit; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ForkJoinPool; +import java.util.function.Predicate; +import java.util.stream.Stream; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.network.play.server.S00PacketKeepAlive; +import net.minecraft.util.MathHelper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiIngame; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.DefaultPlayerSkin; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.io.IOUtils; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.json.JSONObject; +import org.lwjgl.opengl.GL11; + +public class HypixelStats extends AbstractModule { + private String cachedText; + private TimerUtil timer; + private String cachedText2; + private int[] intArray; + private List hypixelStatRowList; + private int stateTicks; + private List stringList; + private double cachedValue; + private String cachedText3; + private String cachedText4; + private int stateTicks2; + private int stateTicks3; + private int stateTicks4; + private String cachedText5; + private String cachedText6; + private boolean stateFlag; + private String cachedText7; + private String cachedText8; + private double cachedValue2; + private String cachedText9; + @Property("y-position") + private IntProperty yPosition; + private String cachedText10; + private String cachedText11; + private String cachedText12; + @Property("alpha") + private IntProperty alpha; + @Property("x-position") + private IntProperty xPosition; + private Dimension dimensionField; + @Property("smoothness") + private IntProperty smoothness; + + private int getIntValue20() { + HUD hudMod = ModuleRegistry.HUD.getModule(); + return hudMod.applyUpdate2(19); +} + + private int computeIntValue(String text) { + HUD hudMod = ModuleRegistry.HUD.getModule(); + return hudMod.getHudStringWidth(19, text); +} + + @EventTarget + public void onRender2D(Render2DEvent event) { + double doubleVal; + cc.novoline.modules.visual.HypixelStats hypixelStats; + double doubleVal2 = MovementUtils.evaluateDouble(true); + Integer intVal = this.xPosition.get(); + int intVal2 = intVal; + IntProperty intProp = this.yPosition; + Integer intVal3 = intProp.get(); + int intVal4 = intVal3; + int intVal5 = this.computeIntValue2(); + int intVal15 = (this.isStateReady2() ? 1 : 0); + intVal15 = intVal15 != 0 ? 125 : 80; + + this.cachedValue = intVal5 + intVal15; + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal3 = intVal2 - 2; + double doubleVal10 = intVal4 - 22; + double doubleVal11 = this.cachedValue + 4.0; + IntProperty intProp2 = this.smoothness; + Integer intVal6 = intProp2.get(); + double doubleVal12 = 20.0 - 0.625 * intVal6.intValue(); + intProp2 = this.smoothness; + Integer intVal7 = intProp2.get(); + double doubleVal13 = intVal7.intValue(); + IntProperty intProp3 = this.alpha; + Integer intVal8 = intProp3.get(); + Color awtColor = new Color(0, 0, 0, intVal8 + 30); + roundedTextureShader.drawRoundedRect(doubleVal3, doubleVal10, doubleVal11, doubleVal12, 0.0, doubleVal13, awtColor, true); + String textStr = "Players"; + double doubleVal14 = intVal2 + 4; + doubleVal11 = intVal4 - 16.5; + IntProperty intProp4 = this.smoothness; + Integer intVal9 = intProp4.get(); + this.handleString(textStr, doubleVal14, doubleVal11 - 0.25 * intVal9.intValue()); + String textStr2 = "SKD"; + double doubleVal15 = intVal2 + this.computeIntValue2() + 35; + doubleVal11 = intVal4 - 16.5; + intProp4 = this.smoothness; + Integer intVal10 = intProp4.get(); + this.updateHelper2(textStr2, doubleVal15, doubleVal11 - 0.25 * intVal10.intValue()); + String textStr3 = "TKD"; + double doubleVal16 = intVal2 + this.computeIntValue2() + 68; + doubleVal11 = intVal4 - 16.5; + intProp4 = this.smoothness; + Integer intVal11 = intProp4.get(); + this.updateHelper2(textStr3, doubleVal16, doubleVal11 - 0.25 * intVal11.intValue()); + HypixelStats hypixelStats2 = this; + if (this.isStateReady2()) { + String textStr4 = "Stars"; + double doubleVal17 = intVal2 + this.computeIntValue2() + 106; + doubleVal11 = intVal4 - 16.5; + intProp4 = this.smoothness; + Integer intVal12 = intProp4.get(); + this.updateHelper2(textStr4, doubleVal17, doubleVal11 - 0.25 * intVal12.intValue()); + } + + hypixelStats2 = this; + + label94: { + List itemList = this.hypixelStatRowList; + int intVal13 = (itemList.isEmpty() ? 1 : 0); + if (intVal13 != 0) { + doubleVal = 20.0; + break label94; + } + + intVal13 = this.getIntValue20(); + + double doubleVal4 = intVal13 * 1.25; + List itemList2 = this.hypixelStatRowList; + doubleVal = doubleVal4 * itemList2.size(); + } + + label100: { + hypixelStats2.cachedValue2 = doubleVal; + RoundedTextureShader roundedTextureShader2 = RoundedTextureShader.getInstance(); + double doubleVal5 = intVal2 - 2; + double doubleVal18 = intVal4 - 2; + doubleVal11 = this.cachedValue + 4.0; + doubleVal12 = this.cachedValue2 + 2.0; + intProp2 = this.smoothness; + Integer intVal14 = intProp2.get(); + double doubleVal19 = intVal14.intValue(); + intProp3 = this.alpha; + Integer intVal16 = intProp3.get(); + awtColor = new Color(0, 0, 0, intVal16); + roundedTextureShader2.drawRoundedRect(doubleVal5, doubleVal18, doubleVal11, doubleVal12, 0.0, doubleVal19, awtColor, true); + double doubleVal20 = intVal4; + List itemList3 = this.hypixelStatRowList; + if (itemList3.isEmpty()) { + this.updateHelper2("Retrieving Data...", intVal2 + this.cachedValue / 2.0, intVal4 + this.cachedValue2 / 2.0 - 6.0); + break label100; + } + + itemList3 = this.hypixelStatRowList; + + Iterator iter = itemList3.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + HypixelStatRow hypixelStatRow = (HypixelStatRow)iter.next(); + this.handleString(hypixelStatRow.getCachedText(), intVal2 + 11, doubleVal20); + double doubleVal6 = hypixelStatRow.getCachedValue2(); + intVal15 = hypixelStatRow.getStateTicks2(); + double doubleVal7 = doubleVal6 / Math.max(1, intVal15); + hypixelStats = this; + + String textStr5 = doubleVal7 > 9.0 ? "%.1f" : "%.2f"; + Object[] objArr = new Object[1]; + objArr[0] = doubleVal7; + String textStr6 = String.format(textStr5, objArr); + this.handleString(textStr6.replace(",", "."), intVal2 + this.computeIntValue2() + 25, doubleVal20); + double doubleVal8 = hypixelStatRow.getCachedValue(); + intVal15 = hypixelStatRow.getStateTicks3(); + double doubleVal9 = doubleVal8 / Math.max(1, intVal15); + String textStr7 = doubleVal9 > 9.0 ? "%.1f" : "%.2f"; + Object[] objArr2 = new Object[1]; + objArr2[0] = doubleVal9; + String textStr8 = String.format(textStr7, objArr2); + this.handleString(textStr8.replace(",", "."), intVal2 + this.computeIntValue2() + 58, doubleVal20); + HypixelStats hypixelStats3 = this; + if (this.isStateReady2()) { + int ticks = hypixelStatRow.getStateTicks(); + this.updateHelper2(String.valueOf(ticks), intVal2 + this.computeIntValue2() + 106, doubleVal20); + } + + hypixelStats3 = this; + + hypixelStats3.renderHypixelStatRow(hypixelStatRow, intVal2 + 0.5, doubleVal20 - 0.5, 8, 8, false); + doubleVal20 += this.getIntValue20() * 1.25; + } + + hypixelStats = this; + + int ticks2 = hypixelStats.mc.thePlayer.ticksExisted; + if (hypixelStats.mc.thePlayer.ticksExisted <= 20) { + break label100; + } + + HypixelLobbyType lobbyType = HypixelLobbyType.LOBBY; + ticks2 = (ServerUtils.serverIs(lobbyType) ? 1 : 0); + + label64: { + if (ticks2 == 0) { + if (ServerUtils.getIntValue() <= 20) { + break label64; + } + } + + List itemList4 = this.hypixelStatRowList; + Predicate predicate = (HypixelStatRow hypixelStatRow2) -> this.evaluateFlag8(hypixelStatRow2.getCachedText()); + itemList4.removeIf(predicate); + } + } + + MovementUtils.unscale(doubleVal2); +} + + private boolean isStateReady2() { + boolean flag2 = ServerUtils.serverIs(HypixelLobbyType.UHC); + + if (!flag2) { + GuiIngame guiIngame = this.mc.ingameGUI; + ScoreObjective scoreObjective = guiIngame.obtainScoreObjective(); + if (scoreObjective == null) { + return false; + } + + GuiIngame guiIngame2 = this.mc.ingameGUI; + scoreObjective = guiIngame2.obtainScoreObjective(); + + String textStr = scoreObjective.getDisplayName(); + String textStr2 = StringScrambler.createString(textStr); + boolean flag3 = textStr2.contains("UHC"); + + if (!flag3) { + return false; + } + } + + flag2 = true; + + + return flag2; +} + + private void invokeCallback(JSONObject jSONObject, Throwable throwable) { + java.lang.String textStr; + int intVal; + int intVal2; + int intVal3; + int intVal4; + int intVal5; + int intVal6; + JSONObject jSONObject2; + String textStr2; + + textStr2 = this.cachedText8; + boolean flag = jSONObject.getBoolean(textStr2); + + if (!flag) { + return; + } + + jSONObject2 = jSONObject; + textStr2 = this.cachedText2; + + flag = jSONObject.isNull(textStr2); + + + if (flag) { + return; + } + + jSONObject2 = jSONObject; + textStr2 = this.cachedText2; + + JSONObject jSONObject3 = jSONObject2.getJSONObject(textStr2); + JSONObject jSONObject4 = jSONObject3; + String textStr3 = this.cachedText7; + + if (jSONObject3.isNull(textStr3)) { + return; + } + + jSONObject4 = jSONObject3; + textStr3 = this.cachedText7; + + + JSONObject jSONObject5; + label103: { + jSONObject5 = jSONObject4.getJSONObject(textStr3); + boolean flag2 = this.isStateReady2(); + + if (flag2) { + textStr = this.cachedText; + break label103; + } + + HypixelLobbyType lobbyType = HypixelLobbyType.SG; + flag2 = ServerUtils.serverIs(lobbyType); + + + textStr = flag2 ? this.cachedText10 : this.cachedText4; + } + + String textStr4 = textStr; + textStr2 = this.cachedText12; + String textStr5 = jSONObject3.getString(textStr2); + int intVal9 = 0; + int intVal10 = 0; + int intVal11 = 0; + int intVal12 = 0; + int intVal13 = 1; + boolean flag3 = jSONObject5.isNull(textStr4); + + if (!flag3) { + JSONObject jSONObject6; + label93: { + jSONObject6 = jSONObject5.getJSONObject(textStr4); + JSONObject jSONObject7 = jSONObject6; + String textStr6 = this.cachedText11; + + if (jSONObject6.isNull(textStr6)) { + intVal = 0; + break label93; + } + + jSONObject7 = jSONObject6; + textStr6 = this.cachedText11; + + + intVal = jSONObject7.getInt(textStr6); + } + + label87: { + intVal9 = intVal; + JSONObject jSONObject8 = jSONObject6; + String textStr7 = this.cachedText6; + + if (jSONObject6.isNull(textStr7)) { + intVal2 = 0; + break label87; + } + + jSONObject8 = jSONObject6; + textStr7 = this.cachedText6; + + + intVal2 = jSONObject8.getInt(textStr7); + } + + label81: { + intVal10 = intVal2; + JSONObject jSONObject9 = jSONObject6; + String textStr8 = this.cachedText3; + + if (jSONObject6.isNull(textStr8)) { + intVal3 = 0; + break label81; + } + + jSONObject9 = jSONObject6; + textStr8 = this.cachedText3; + + + intVal3 = jSONObject9.getInt(textStr8); + } + + label75: { + intVal11 = intVal3; + JSONObject jSONObject10 = jSONObject6; + String textStr9 = this.cachedText9; + + if (jSONObject6.isNull(textStr9)) { + intVal4 = 0; + break label75; + } + + jSONObject10 = jSONObject6; + textStr9 = this.cachedText9; + + + intVal4 = jSONObject10.getInt(textStr9); + } + + label69: { + intVal12 = intVal4; + JSONObject jSONObject11 = jSONObject6; + String textStr10 = this.cachedText5; + + if (jSONObject6.isNull(textStr10)) { + intVal5 = 0; + break label69; + } + + jSONObject11 = jSONObject6; + textStr10 = this.cachedText5; + + + intVal5 = jSONObject11.getInt(textStr10); + } + + label63: { + int intVal7 = intVal5; + int intVal8 = intVal7; + + if (intVal7 == 0) { + intVal6 = 1; + break label63; + } + + intVal8 = this.computeIntFromInt(intVal7); + + + intVal6 = Math.min(intVal8, 15); + } + + intVal13 = intVal6; + } + + List itemList = this.hypixelStatRowList; + HypixelStatRow hypixelStatRow = HypixelStatRow.resolveHypixelStatRow(textStr5, intVal9, intVal10, intVal11, intVal12, intVal13); + itemList.add(hypixelStatRow); + +} + + private void updateHelper2(String text, double value, double amount) { + HUD hudMod = ModuleRegistry.HUD.getModule(); + hudMod.drawElement4(19, text, value, amount, 16777215); +} + + @EventTarget + public void onRenderGui(RenderGuiEvent event) { + int intVal14 = (event.getGuiScreen() instanceof GuiChat ? 1 : 0); + if (intVal14 == 0) { + return; + } + + intVal14 = event.getMouseX(); + intVal14 = MovementUtils.evaluateDouble(intVal14); + + int intVal = intVal14; + intVal14 = event.getMouseY(); + int intVal15 = MovementUtils.scaleYInt(intVal14); + IntProperty intProp = this.xPosition; + Integer intVal2 = intProp.get(); + int intVal3 = intVal2; + IntProperty intProp2 = this.yPosition; + intVal2 = intProp2.get(); + int intVal4 = intVal2; + GuiState guiState = event.getState(); + GuiState guiState2 = GuiState.CLICK; + if (guiState == GuiState.CLICK) { + int intVal5 = (this.matchesInt(intVal, intVal15) ? 1 : 0); + + if (intVal5 == 0) { + return; + } + + intVal5 = event.getMouseButton(); + + + if (intVal5 != 0) { + return; + } + + this.stateTicks4 = intVal3 - intVal; + this.stateTicks = intVal4 - intVal15; + this.stateFlag = true; + return; + } + + guiState = event.getState(); + guiState2 = GuiState.RENDER; + + if (guiState == guiState2) { + boolean flag2 = this.stateFlag; + + if (this.stateFlag) { + IntProperty intProp3 = this.xPosition; + int ticks = this.stateTicks4 + intVal; + IntProperty intProp4 = this.xPosition; + Integer intVal6 = intProp4.getMinimum(); + int intVal16 = intVal6; + IntProperty intProp5 = this.xPosition; + Integer intVal7 = intProp5.getMaximum(); + int intVal17 = intVal7; + int intVal8 = MathHelper.clamp_int(ticks, intVal16, intVal17); + Integer intVal9 = intVal8; + intProp3.set(intVal9); + IntProperty intProp6 = this.yPosition; + int ticks2 = this.stateTicks + intVal15; + intProp4 = this.yPosition; + Integer intVal10 = intProp4.getMinimum(); + int intVal18 = intVal10; + intProp5 = this.yPosition; + Integer intVal11 = intProp5.getMaximum(); + int intVal19 = intVal11; + int intVal12 = MathHelper.clamp_int(ticks2, intVal18, intVal19); + Integer intVal13 = intVal12; + intProp6.set(intVal13); + } + + flag2 = this.matchesInt(intVal, intVal15); + + + + if (!flag2) { + return; + } + + flag2 = true; + + + double doubleVal = MovementUtils.evaluateDouble(flag2); + double doubleVal2 = intVal3 - 2; + double doubleVal3 = intVal4 - 22; + double doubleVal4 = intVal3 + this.cachedValue + 4.0; + double doubleVal5 = intVal4 + this.cachedValue2 + 2.0; + int color2 = ColorTheme.WHITE.getRGB(); + int color = ColorTheme.BLACK.getRGB(); + int color3 = ColorTheme.reAlpha(color, 100); + RenderUtils.drawBorderedRect(doubleVal2, doubleVal3, doubleVal4, doubleVal5, 2.5F, color2, color3); + MovementUtils.unscale(doubleVal); + return; + } + + guiState = event.getState(); + guiState2 = GuiState.RELEASE; + + if (guiState == guiState2) { + this.stateFlag = false; + } +} + + private void renderHypixelStatRow(HypixelStatRow hypixelStatRow, double value, double amount, int index, int count, boolean flag) { + TextureManager texManager; + ResourceLocation resLoc; + label26: { + NetHandlerPlayClient netHandler = this.mc.getNetHandler(); + String textStr = hypixelStatRow.getCachedText(); + NetworkPlayerInfo networkPlayerInfo = netHandler.getPlayerInfo(textStr); + Minecraft mcClient = this.mc; + texManager = mcClient.getTextureManager(); + NetworkPlayerInfo networkPlayerInfo2 = networkPlayerInfo; + + if (networkPlayerInfo == null) { + resLoc = DefaultPlayerSkin.TEXTURE_STEVE; + break label26; + } + + networkPlayerInfo2 = networkPlayerInfo; + + + resLoc = networkPlayerInfo2.getLocationSkin(); + } + + texManager.bindTexture(resLoc); + boolean flag3 = flag; + if (flag) { + StencilUtil.initStencilToWrite(false); + double doubleVal = value + index / 2; + double doubleVal2 = amount + count / 2; + double doubleVal3 = index; + int color = ColorTheme.BLACK.getRGB(); + RenderUtils.renderVisual5(doubleVal, doubleVal2, doubleVal3, color); + StencilUtil.readStencilBuffer(true); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + + Gui.renderStep(value, amount, 8.0F, 8.0F, 8, 8, index, count, 64.0F, 64.0F); + flag3 = flag; + + if (flag3) { + StencilUtil.uninitStencilBuffer(); + } +} + + private CompletableFuture resolveCompletableFuture(String text, String str) { + return CompletableFuture.supplyAsync(((java.util.function.Supplier) () -> HypixelStats.lambdaImpl$doRequest$0(text, str)), ForkJoinPool.commonPool()); +} + + public HypixelStats(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.dimensionField = Toolkit.getDefaultToolkit().getScreenSize(); + this.stateTicks2 = (int)(this.dimensionField.getWidth() / 2.0); + this.stateTicks3 = (int)(this.dimensionField.getHeight() / 2.0); + IntProperty intProp = IntProperty.of(8); + Integer intVal3 = 0; + IntProperty intProp2 = intProp.minimum(intVal3); + this.smoothness = intProp2.maximum(16); + IntProperty intProp3 = IntProperty.of(200); + IntProperty intProp4 = intProp3.minimum(1); + int ticks = this.stateTicks2; + Integer intVal = ticks; + this.xPosition = intProp4.maximum(intVal); + IntProperty intProp5 = IntProperty.of(300); + intVal = 1; + IntProperty intProp6 = intProp5.minimum(intVal); + int ticks2 = this.stateTicks3; + Integer intVal2 = ticks2; + this.yPosition = intProp6.maximum(intVal2); + IntProperty intProp7 = IntProperty.of(150); + intVal2 = 100; + IntProperty intProp8 = intProp7.minimum(intVal2); + intVal2 = 180; + this.alpha = intProp8.maximum(intVal2); + this.timer = new TimerUtil(); + this.intArray = new int[]{10, 50, 150, 250, 500, 750, 1000, 2500, 5000}; + this.hypixelStatRowList = new ArrayList<>(); + this.stringList = new ArrayList<>(); + this.cachedText8 = "success"; + this.cachedText12 = "displayname"; + this.cachedText2 = "player"; + this.cachedText7 = "stats"; + this.cachedText = "UHC"; + this.cachedText10 = "HungerGames"; + this.cachedText4 = "SkyWars"; + this.cachedText11 = "kills_solo"; + this.cachedText3 = "kills_team"; + this.cachedText6 = "deaths_solo"; + this.cachedText9 = "deaths_team"; + this.cachedText5 = "score"; + Setting setting = new Setting("HYPIXEL_STATS_ALPHA", "Alpha", SettingType.SLIDER, this, this.alpha, 5.0); + SettingManager.register(setting); + setting = new Setting("HYPIXEL_STATS_SMOOTHNESS", "Smoothness", SettingType.SLIDER, this, this.smoothness, 1.0); + SettingManager.register(setting); +} + + + @EventTarget + public void onPacket(PacketEvent event) { + cc.novoline.modules.visual.HypixelStats hypixelStats; + PacketEvent packetEvent = event; + if (event.getState() != State.INCOMING) { + return; + } + + packetEvent = event; + + if (packetEvent.getPacket() instanceof S00PacketKeepAlive) { + ModuleRegistry modEntry = ModuleRegistry.CLICKGUI; + ClickGui clickGuiMod = modEntry.getModule(); + String textStr = clickGuiMod.getCachedText2(); + if (!textStr.isEmpty()) { + GuiIngame guiIngame = this.mc.ingameGUI; + List itemList = guiIngame.getTabList().obtainList(); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + NetworkPlayerInfo networkPlayerInfo = (NetworkPlayerInfo)iter.next(); + String nameStr = networkPlayerInfo.getGameProfile().getName(); + boolean flag = this.evaluateFlag7(nameStr); + if (!flag) { + continue; + } + + List itemList2 = this.stringList; + flag = itemList2.contains(nameStr); + + if (flag) { + continue; + } + + hypixelStats = this; + + TimerUtil timerUtil = this.timer; + flag = timerUtil.delay(50L); + + if (!flag) { + continue; + } + + hypixelStats = this; + + GameProfile gameProfile = networkPlayerInfo.getGameProfile(); + CompletableFuture completableFuture = hypixelStats.resolveCompletableFuture(textStr, gameProfile.getId().toString()); + completableFuture.whenCompleteAsync(((java.util.function.BiConsumer) this::invokeCallback)); + List itemList3 = this.stringList; + itemList3.add(nameStr); + TimerUtil timerUtil2 = this.timer; + timerUtil2.reset(); + } + } + } +} + + private void handleString(String text, double value, double amount) { + HUD hudMod = ModuleRegistry.HUD.getModule(); + hudMod.renderVisual3(19, text, value, amount, 16777215); +} + + + private int computeIntValue2() { + HypixelStats hypixelStats = this; + List itemList = this.hypixelStatRowList; + if (itemList.isEmpty()) { + return this.computeIntValue("Retrieving Data...") + 4; + } + + hypixelStats = this; + + Stream stream2 = this.hypixelStatRowList.stream(); + Comparator comparator = Comparator.comparingInt((HypixelStatRow hypixelStatRow) -> this.computeIntValue(hypixelStatRow.getCachedText())); + Optional optional = stream2.max(comparator); + return hypixelStats.computeIntValue(((HypixelStatRow)optional.get()).getCachedText()); +} + + @EventTarget + public void onLoadWorld(LoadWorldEvent event) { + List itemList = this.hypixelStatRowList; + itemList.clear(); + itemList = this.stringList; + itemList.clear(); +} + + + private boolean matchesInt(int value, int index) { + int intVal5 = value; + IntProperty intProp = this.xPosition; + Integer intVal = intProp.get(); + if (value < intVal - 2) { + return false; + } + + double doubleVal = value; + intProp = this.xPosition; + Integer intVal2 = intProp.get(); + if (doubleVal > (intVal2.intValue() + this.cachedValue + 4.0)) { + return false; + } + + intVal5 = index; + + IntProperty intProp2 = this.yPosition; + Integer intVal3 = intProp2.get(); + if (intVal5 < intVal3 - 22) { + return false; + } + + double doubleVal2 = index; + intProp2 = this.yPosition; + Integer intVal4 = intProp2.get(); + return doubleVal2 <= (intVal4.intValue() + this.cachedValue2 + 2.0); +} + + private static JSONObject lambdaImpl$doRequest$0(String text, String str) { + String textStr = ""; + CloseableHttpClient closeableHttpClient = HttpClients.createDefault(); + StringBuilder sb = new StringBuilder(); + sb = sb.append("https://api.hypixel.net/player?key=").append(text); + sb = sb.append("&uuid="); + HttpGet httpGet = new HttpGet(sb.append(str).toString()); + httpGet.setHeader("xf-api-key", text); + httpGet.setHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"); + CloseableHttpResponse closeableHttpResponse = null; + + try { + closeableHttpResponse = closeableHttpClient.execute(httpGet); + } catch (IOException ex) { + ex.printStackTrace(); + } + + String textStr2 = null; + + try { + InputStream inputStream = closeableHttpResponse.getEntity().getContent(); + Charset charset = StandardCharsets.UTF_8; + textStr2 = IOUtils.toString(inputStream, charset); + } catch (IOException ex2) { + ex2.printStackTrace(); + } + + return new JSONObject(textStr2); +} + + private boolean evaluateFlag7(String text) { + boolean flag2 = HUD.Q(); + Iterator iter = this.hypixelStatRowList.iterator(); + boolean flag = flag2; + + while (true) { + if (iter.hasNext()) { + HypixelStatRow hypixelStatRow = (HypixelStatRow)iter.next(); + flag2 = hypixelStatRow.getCachedText().equals(text); + if (flag) { + break; + } + + if (flag2) { + return false; + } + + continue; + } + + flag2 = true; + break; + } + + return flag2; +} + + private int computeIntFromInt(int value) { + int intVal = 1; + int intVal4 = (HUD.H() ? 1 : 0); + int[] intArr = this.intArray; + int len = intArr.length; + int intVal2 = 0; + boolean flag = (intVal4 != 0); + + int intVal5; + while (true) { + label24: + if (intVal2 < len) { + int intVal3 = intArr[intVal2]; + intVal4 = value; + intVal5 = intVal3; + if (!flag) { + break; + } + + if (flag) { + if (value < intVal3 && flag) { + break label24; + } + + intVal4 = value; + intVal5 = intVal3; + } + + value = intVal4 - intVal5; + intVal++; + intVal2++; + if (flag) { + continue; + } + } + + intVal4 = intVal; + intVal5 = value / 3000; + break; + } + + return intVal4 + intVal5; +} + + private boolean evaluateFlag8(String text) { + boolean flag2 = HUD.H(); + NetHandlerPlayClient netHandler = this.mc.getNetHandler(); + Collection collection = netHandler.getPlayerInfoMap(); + Iterator iter = collection.iterator(); + boolean flag = flag2; + + while (true) { + if (iter.hasNext()) { + NetworkPlayerInfo networkPlayerInfo = (NetworkPlayerInfo)iter.next(); + flag2 = networkPlayerInfo.getGameProfile().getName().equals(text); + if (!flag) { + break; + } + + if (flag2) { + return false; + } + + continue; + } + + flag2 = true; + break; + } + + return flag2; +} + + +} diff --git a/src/main/java/cc/novoline/modules/visual/ItemESP.java b/src/main/java/cc/novoline/modules/visual/ItemESP.java new file mode 100644 index 0000000..3a89fe7 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/ItemESP.java @@ -0,0 +1,1042 @@ +package cc.novoline.modules.visual; + + +import org.lwjgl.util.glu.GLU; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.MovementUtils; +import cc.novoline.utils.RenderUtils; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.player.AutoArmor; +import cc.novoline.modules.ModuleRegistry; +import java.awt.Color; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import javax.vecmath.Vector3d; +import javax.vecmath.Vector4d; +import net.minecraft.item.ItemIronSword; +import net.minecraft.item.ItemIronAxe; +import net.minecraft.item.ItemImpl; +import net.minecraft.item.ItemIronShovel; +import net.minecraft.item.ItemIronPickaxe; +import net.minecraft.item.ItemGoldenApple; +import cc.novoline.modules.ModuleManager; +import cc.novoline.modules.player.ChestStealerSupport; +import net.minecraft.client.renderer.entity.RenderItemSupport; + +import net.minecraft.util.MathHelper; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms$TransformType; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.resources.model.IBakedModel; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.Slot; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemSkull; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumChatFormatting; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.GL11; + +public final class ItemESP extends AbstractModule { + private final FloatBuffer floatBufferField; + private final FloatBuffer floatBufferField2; + @Property("needed-only") + private final BooleanProperty neededOnly; + private final FloatBuffer floatBufferField3; + private final IntBuffer intBufferField; + @Property("names") + private final BooleanProperty names; + + private boolean applyInt5(EntityItem entityItem) { + net.minecraft.inventory.Slot slot; + int slot15; + int slot16; + int slot17; + int slot18; + boolean flag; + int intVal; + flag = HUD.Q(); + ItemStack stack = entityItem.getEntityItem(); + intVal = (stack.getItem() instanceof ItemArmor ? 1 : 0); + label354: { + label352: + if (!(intVal != 0)) { + ItemStack stack2 = entityItem.getEntityItem(); + Item item = stack2.getItem(); + if (item == Items.skull) { + String displayName = entityItem.getEntityItem().getDisplayName(); + String textStr4 = "Zombie Head"; + intVal = (displayName.equalsIgnoreCase(textStr4) ? 1 : 0); + + if (!(intVal != 0)) { + String displayName2 = entityItem.getEntityItem().getDisplayName(); + textStr4 = "Creeper Head"; + intVal = (displayName2.equalsIgnoreCase(textStr4) ? 1 : 0); + + if (!(intVal != 0)) { + String displayName3 = entityItem.getEntityItem().getDisplayName(); + textStr4 = "Skeleton Skull"; + intVal = (displayName3.equalsIgnoreCase(textStr4) ? 1 : 0); + + if (!(intVal != 0)) { + String displayName4 = entityItem.getEntityItem().getDisplayName(); + textStr4 = "Wither Skeleton Skull"; + intVal = (displayName4.equalsIgnoreCase(textStr4) ? 1 : 0); + + if (!(intVal != 0)) { + String displayName5 = entityItem.getEntityItem().getDisplayName(); + StringBuilder sb2 = new StringBuilder().append(EnumChatFormatting.GREEN); + textStr4 = sb2.append("Frog's Hat").toString(); + intVal = (displayName5.equalsIgnoreCase(textStr4) ? 1 : 0); + + if (!(intVal != 0)) { + break label352; + } + } + } + } + } + } + + ItemStack stack3 = entityItem.getEntityItem(); + item = stack3.getItem(); + + intVal = (item instanceof ItemGoldenApple ? 1 : 0); + + if (!(intVal != 0)) { + intVal = (false ? 1 : 0); + break label354; + } + } + + intVal = (true ? 1 : 0); + } + + boolean flag2 = (intVal != 0); + ItemStack stack4 = entityItem.getEntityItem(); + boolean flag3 = stack4.getItem() instanceof ItemArmor; + + if (flag3) { + ModuleRegistry modEntry = ModuleRegistry.AUTOARMOR; + AutoArmor autoArmor = modEntry.getModule(); + int intVal2 = 1; + + label359: { + while (true) { + if (intVal2 < 5) { + String textStr = ""; + intVal = intVal2; + + label361: { + + + switch (intVal2) { + case 1: + textStr = "helmet"; + if (!flag) { + break; + } + case 2: + textStr = "chestplate"; + if (!flag) { + break; + } + case 3: + textStr = "leggings"; + if (!flag) { + break; + } + case 4: + textStr = "boots"; + } + + EntityPlayerSP player = this.mc.thePlayer; + int intVal3 = 4 + intVal2; + slot = player.getSlotFromPlayerContainer(intVal3); + + intVal = (slot.getHasStack() ? 1 : 0); + + + if (intVal == 0) { + break label361; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + int intVal4 = 4 + intVal2; + slot = player2.getSlotFromPlayerContainer(intVal4); + + ItemStack stack5 = slot.getStack(); + + Item item2 = stack5.getItem(); + String textStr2 = item2.getUnlocalizedName(); + if (textStr2.contains(textStr)) { + ItemStack stack6 = entityItem.getEntityItem(); + Item item3 = stack6.getItem(); + String textStr3 = item3.getUnlocalizedName(); + intVal = (textStr3.contains(textStr) ? 1 : 0); + + if (intVal != 0) { + float floatVal = this.applyInt5(entityItem.getEntityItem()); + EntityPlayerSP player3 = this.mc.thePlayer; + int intVal9 = 4 + intVal2; + Slot slot2 = player3.getSlotFromPlayerContainer(intVal9); + float floatVal2; + intVal = (byte)((floatVal2 = floatVal - this.applyInt5(slot2.getStack())) == 0.0F ? 0 : (floatVal2 < 0.0F ? -1 : 1)); + break label359; + } + } + } + + intVal2++; + + continue; + } + + intVal = (this.checkItemStack3(entityItem.getEntityItem()) ? 1 : 0); + break; + } + + intVal = intVal == 0 ? 1 : 0; + + return ((intVal & 1) != 0); + } + + intVal = (byte)(intVal > 0 ? 1 : 0); + + return ((intVal & 1) != 0); + } + + ItemStack stack7 = entityItem.getEntityItem(); + flag3 = stack7.getItem() instanceof ItemIronSword; + + + if (flag3) { + int intVal5 = 9; + + label365: { + while (true) { + if (intVal5 < 45) { + EntityPlayerSP player4 = this.mc.thePlayer; + Slot slot3 = player4.getSlotFromPlayerContainer(intVal5); + slot15 = (slot3.getHasStack() ? 1 : 0); + + label367: { + if (slot15 == 0) { + break label367; + } + + EntityPlayerSP player5 = this.mc.thePlayer; + Slot slot4 = player5.getSlotFromPlayerContainer(intVal5); + ItemStack stack8 = slot4.getStack(); + slot15 = (stack8.getItem() instanceof ItemIronSword ? 1 : 0); + + if (slot15 != 0) { + float floatVal3 = this.computeFloat(entityItem.getEntityItem()); + EntityPlayerSP player6 = this.mc.thePlayer; + Slot slot5 = player6.getSlotFromPlayerContainer(intVal5); + float floatVal4; + slot15 = (byte)((floatVal4 = floatVal3 - this.computeFloat(slot5.getStack())) == 0.0F ? 0 : (floatVal4 < 0.0F ? -1 : 1)); + break label365; + } + } + + intVal5++; + continue; + } + + slot15 = (this.checkItemStack3(entityItem.getEntityItem()) ? 1 : 0); + break; + } + + slot15 = (byte)(slot15 == 0 ? 1 : 0); + + return ((slot15 & 1) != 0); + } + + slot15 = (byte)(slot15 > 0 ? 1 : 0); + + return ((slot15 & 1) != 0); + } + + ItemStack stack9 = entityItem.getEntityItem(); + flag3 = stack9.getItem() instanceof ItemIronPickaxe; + + if (flag3) { + int intVal6 = 9; + + label369: { + while (true) { + if (intVal6 < 45) { + EntityPlayerSP player7 = this.mc.thePlayer; + Slot slot6 = player7.getSlotFromPlayerContainer(intVal6); + slot16 = (slot6.getHasStack() ? 1 : 0); + + label371: { + if (slot16 == 0) { + break label371; + } + + EntityPlayerSP player8 = this.mc.thePlayer; + Slot slot7 = player8.getSlotFromPlayerContainer(intVal6); + ItemStack stack10 = slot7.getStack(); + slot16 = (stack10.getItem() instanceof ItemIronPickaxe ? 1 : 0); + + if (slot16 != 0) { + float floatVal5 = this.computeFloatFromItemStack2(entityItem.getEntityItem()); + EntityPlayerSP player9 = this.mc.thePlayer; + Slot slot8 = player9.getSlotFromPlayerContainer(intVal6); + float floatVal6; + slot16 = (byte)((floatVal6 = floatVal5 - this.computeFloatFromItemStack2(slot8.getStack())) == 0.0F ? 0 : (floatVal6 < 0.0F ? -1 : 1)); + break label369; + } + } + + intVal6++; + continue; + } + + slot16 = (this.checkItemStack3(entityItem.getEntityItem()) ? 1 : 0); + break; + } + + slot16 = (byte)(slot16 == 0 ? 1 : 0); + + return ((slot16 & 1) != 0); + } + + slot16 = (byte)(slot16 > 0 ? 1 : 0); + + return ((slot16 & 1) != 0); + } + + ItemStack stack11 = entityItem.getEntityItem(); + flag3 = stack11.getItem() instanceof ItemIronShovel; + + if (flag3) { + int intVal7 = 9; + + label373: { + while (true) { + if (intVal7 < 45) { + EntityPlayerSP player10 = this.mc.thePlayer; + Slot slot9 = player10.getSlotFromPlayerContainer(intVal7); + slot17 = (slot9.getHasStack() ? 1 : 0); + + label375: { + if (slot17 == 0) { + break label375; + } + + EntityPlayerSP player11 = this.mc.thePlayer; + Slot slot10 = player11.getSlotFromPlayerContainer(intVal7); + ItemStack stack12 = slot10.getStack(); + slot17 = (stack12.getItem() instanceof ItemIronShovel ? 1 : 0); + + if (slot17 != 0) { + float floatVal7 = this.computeFloatFromItemStack2(entityItem.getEntityItem()); + EntityPlayerSP player12 = this.mc.thePlayer; + Slot slot11 = player12.getSlotFromPlayerContainer(intVal7); + float floatVal8; + slot17 = (byte)((floatVal8 = floatVal7 - this.computeFloatFromItemStack2(slot11.getStack())) == 0.0F ? 0 : (floatVal8 < 0.0F ? -1 : 1)); + break label373; + } + } + + intVal7++; + continue; + } + + slot17 = (this.checkItemStack3(entityItem.getEntityItem()) ? 1 : 0); + break; + } + + slot17 = (byte)(slot17 == 0 ? 1 : 0); + + return ((slot17 & 1) != 0); + } + + slot17 = (byte)(slot17 > 0 ? 1 : 0); + + return ((slot17 & 1) != 0); + } + + ItemStack stack13 = entityItem.getEntityItem(); + flag3 = stack13.getItem() instanceof ItemIronAxe; + + + if (flag3) { + int intVal8 = 9; + + label377: { + while (true) { + if (intVal8 < 45) { + EntityPlayerSP player13 = this.mc.thePlayer; + Slot slot12 = player13.getSlotFromPlayerContainer(intVal8); + slot18 = (slot12.getHasStack() ? 1 : 0); + + label379: { + if (slot18 == 0) { + break label379; + } + + EntityPlayerSP player14 = this.mc.thePlayer; + Slot slot13 = player14.getSlotFromPlayerContainer(intVal8); + ItemStack stack14 = slot13.getStack(); + slot18 = (stack14.getItem() instanceof ItemIronAxe ? 1 : 0); + + if (slot18 != 0) { + float floatVal9 = this.computeFloatFromItemStack2(entityItem.getEntityItem()); + EntityPlayerSP player15 = this.mc.thePlayer; + Slot slot14 = player15.getSlotFromPlayerContainer(intVal8); + float floatVal10; + slot18 = (byte)((floatVal10 = floatVal9 - this.computeFloatFromItemStack2(slot14.getStack())) == 0.0F ? 0 : (floatVal10 < 0.0F ? -1 : 1)); + break label377; + } + } + + intVal8++; + continue; + } + + slot18 = (this.checkItemStack3(entityItem.getEntityItem()) ? 1 : 0); + break; + } + + slot18 = (byte)(slot18 == 0 ? 1 : 0); + + return ((slot18 & 1) != 0); + } + + slot18 = (byte)(slot18 > 0 ? 1 : 0); + + return ((slot18 & 1) != 0); + } + + flag3 = flag2; + + + return flag3; +} + + + private float computeFloatFromItemStack2(@NonNull ItemStack stack) { + Item item = stack.getItem(); + Item item2 = item; + if (!(item instanceof ItemImpl)) { + return 0.0F; + } + + item2 = item; + + float floatVal; + label64: { + String textStr = item2.getUnlocalizedName(); + ItemImpl itemImpl = (ItemImpl)item; + boolean flag = item instanceof ItemIronPickaxe; + if (flag) { + floatVal = itemImpl.getStrVsBlock(stack, Blocks.stone); + + String lowerStr = textStr.toLowerCase(); + if (!lowerStr.contains("gold")) { + break label64; + } + + floatVal -= 5.0F; + break label64; + } + + flag = item instanceof ItemIronShovel; + + if (flag) { + floatVal = itemImpl.getStrVsBlock(stack, Blocks.dirt); + + String lowerStr2 = textStr.toLowerCase(); + if (!lowerStr2.contains("gold")) { + break label64; + } + + floatVal -= 5.0F; + break label64; + } + + flag = item instanceof ItemIronAxe; + + if (!flag) { + return 1.0F; + } + + floatVal = itemImpl.getStrVsBlock(stack, Blocks.log); + + String lowerStr3 = textStr.toLowerCase(); + if (lowerStr3.contains("gold")) { + floatVal -= 5.0F; + + } + } + + double doubleVal = floatVal; + int intVal = Enchantment.efficiency.effectId; + floatVal = (float)(doubleVal + ChestStealerSupport.getEnchantmentLevel(intVal, stack) * 0.0075); + double doubleVal2 = floatVal; + intVal = Enchantment.unbreaking.effectId; + return (float)(doubleVal2 + ChestStealerSupport.getEnchantmentLevel(intVal, stack) / 100.0); +} + + + private Color resolveColor(EntityItem entityItem) { + String displayName = entityItem.getEntityItem().getDisplayName(); + StringBuilder sb = new StringBuilder(); + EnumChatFormatting enumChatFormatting = EnumChatFormatting.GOLD; + sb = sb.append(enumChatFormatting); + String textStr = sb.append("Excalibur").toString(); + boolean flag2 = displayName.equalsIgnoreCase(textStr); + if (flag2) { + return new Color(255, 255, 255); + } + + flag2 = displayName.equalsIgnoreCase("aDragon Sword"); + + if (flag2) { + return new Color(255, 255, 255); + } + + sb = new StringBuilder(); + enumChatFormatting = EnumChatFormatting.GREEN; + sb = sb.append(enumChatFormatting); + String textStr2 = sb.append("Cornucopia").toString(); + flag2 = displayName.equalsIgnoreCase(textStr2); + + if (flag2) { + return new Color(255, 255, 255); + } + + sb = new StringBuilder(); + enumChatFormatting = EnumChatFormatting.RED; + sb = sb.append(enumChatFormatting); + String textStr3 = sb.append("Bloodlust").toString(); + flag2 = displayName.equalsIgnoreCase(textStr3); + + if (flag2) { + return new Color(255, 255, 255); + } + + sb = new StringBuilder(); + enumChatFormatting = EnumChatFormatting.RED; + sb = sb.append(enumChatFormatting); + String textStr4 = sb.append("Artemis' Bow").toString(); + flag2 = displayName.equalsIgnoreCase(textStr4); + + if (flag2) { + return new Color(255, 255, 255); + } + + sb = new StringBuilder(); + enumChatFormatting = EnumChatFormatting.GREEN; + sb = sb.append(enumChatFormatting); + String textStr5 = sb.append("Miner's Blessing").toString(); + flag2 = displayName.equalsIgnoreCase(textStr5); + + if (flag2) { + return new Color(255, 255, 255); + } + + sb = new StringBuilder(); + enumChatFormatting = EnumChatFormatting.GOLD; + sb = sb.append(enumChatFormatting); + String textStr6 = sb.append("Axe of Perun").toString(); + flag2 = displayName.equalsIgnoreCase(textStr6); + + if (flag2) { + return new Color(255, 255, 255); + } + + sb = new StringBuilder(); + enumChatFormatting = EnumChatFormatting.GOLD; + sb = sb.append(enumChatFormatting); + String textStr7 = sb.append("Cornucopia").toString(); + flag2 = displayName.equalsIgnoreCase(textStr7); + + + if (flag2) { + return new Color(255, 255, 255); + } + + flag2 = this.applyInt5(entityItem); + + + if (!flag2) { + return new Color(255, 255, 255); + } + + ItemStack stack = entityItem.getEntityItem(); + flag2 = stack.getItem() instanceof ItemArmor; + + if (flag2) { + return new Color(75, 189, 193); + } + + ItemStack stack2 = entityItem.getEntityItem(); + flag2 = stack2.getItem() instanceof ItemGoldenApple; + + if (flag2) { + return new Color(255, 199, 71); + } + + ItemStack stack3 = entityItem.getEntityItem(); + flag2 = stack3.getItem() instanceof ItemSkull; + + if (flag2) { + flag2 = this.applyInt5(entityItem); + + if (flag2) { + return new Color(255, 199, 71); + } + } + + ItemStack stack4 = entityItem.getEntityItem(); + flag2 = stack4.getItem() instanceof ItemIronSword; + + if (flag2) { + return new Color(255, 117, 117); + } + + ItemStack stack5 = entityItem.getEntityItem(); + flag2 = stack5.getItem() instanceof ItemIronPickaxe; + + if (flag2) { + return new Color(130, 219, 82); + } + + ItemStack stack6 = entityItem.getEntityItem(); + flag2 = stack6.getItem() instanceof ItemIronShovel; + + if (flag2) { + return new Color(130, 219, 82); + } + + ItemStack stack7 = entityItem.getEntityItem(); + flag2 = stack7.getItem() instanceof ItemIronAxe; + + return flag2 ? new Color(130, 219, 82) : new Color(255, 255, 255); +} + + @EventTarget + public void onRender2D(Render2DEvent event) { + List itemList = this.mc.theWorld.obtainList3(); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + return; + } + + Object obj = iter.next(); + + while (true) { + Entity entity = (Entity)obj; + label110: + if (entity instanceof EntityItem) { + Minecraft mcClient = this.mc; + RenderItem renderItem = mcClient.getRenderItem(); + RenderItemSupport renderItemSupport = renderItem.obtainRenderItemSupport(); + EntityItem entityItem = (EntityItem)entity; + IBakedModel iBakedModel = renderItemSupport.resolveBakedModel(entityItem.getEntityItem()); + EntityItem entityItem2 = (EntityItem)entity; + float partialTicks = (entityItem2.getAge() + event.getPartialTicks()) / 10.0F + ((EntityItem)entity).hoverStart; + float floatVal = MathHelper.sin(partialTicks) * 0.1F + 0.1F; + float floatVal2 = iBakedModel.getItemCameraTransforms().getTransform(ItemCameraTransforms$TransformType.GROUND).scale.y; + double posX2 = entity.posX; + double posX3 = entity.lastTickPosX; + double doubleVal14 = event.getPartialTicks(); + double doubleVal = RenderUtils.interpolate(posX2, posX3, doubleVal14); + double posY2 = entity.posY + floatVal; + double posY3 = entity.lastTickPosY + floatVal; + doubleVal14 = event.getPartialTicks(); + double posY4 = RenderUtils.interpolate(posY2, posY3, doubleVal14); + double posZ2 = entity.posZ; + double posZ3 = entity.lastTickPosZ; + doubleVal14 = event.getPartialTicks(); + double doubleVal2 = RenderUtils.interpolate(posZ2, posZ3, doubleVal14); + double doubleVal3 = entity.width / 1.4; + double doubleVal4 = entity.height + 0.2; + AxisAlignedBB boundingBox = new AxisAlignedBB(doubleVal - doubleVal3, posY4, doubleVal2 - doubleVal3, doubleVal + doubleVal3, posY4 + doubleVal4, doubleVal2 + doubleVal3); + Vector3d[] vector3dArr = new Vector3d[]{ + new Vector3d(boundingBox.minX, boundingBox.minY, boundingBox.minZ), + new Vector3d(boundingBox.minX, boundingBox.maxY, boundingBox.minZ), + new Vector3d(boundingBox.maxX, boundingBox.minY, boundingBox.minZ), + new Vector3d(boundingBox.maxX, boundingBox.maxY, boundingBox.minZ), + new Vector3d(boundingBox.minX, boundingBox.minY, boundingBox.maxZ), + new Vector3d(boundingBox.minX, boundingBox.maxY, boundingBox.maxZ), + new Vector3d(boundingBox.maxX, boundingBox.minY, boundingBox.maxZ), + new Vector3d(boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ) + }; + List itemList2 = Arrays.asList(vector3dArr); + this.mc.entityRenderer.renderStep(event.getPartialTicks(), 0); + Vector4d vector4d = null; + Iterator iter2 = itemList2.iterator(); + + while (true) { + if (!iter2.hasNext()) { + break; + } + + Vector3d vector3d = (Vector3d)iter2.next(); + ScaledResolution scaledRes = event.getResolution(); + doubleVal14 = vector3d.x; + Minecraft mcClient2 = this.mc; + doubleVal14 -= mcClient2.getRenderManager().viewerPosX; + double doubleVal5 = vector3d.y; + Minecraft mcClient3 = this.mc; + double doubleVal15 = doubleVal5 - mcClient3.getRenderManager().viewerPosY; + double doubleVal6 = vector3d.z; + Minecraft mcClient4 = this.mc; + vector3d = this.resolveVector3d(scaledRes, doubleVal14, doubleVal15, doubleVal6 - mcClient4.getRenderManager().viewerPosZ); + obj = vector3d; + + + if (vector3d == null) { + continue; + } + + obj = vector3d; + + + if (((Vector3d)obj).z < 0.0) { + continue; + } + + if (vector3d.z < 1.0) { + Vector4d vector4d2 = vector4d; + if (vector4d == null) { + vector4d = new Vector4d(vector3d.x, vector3d.y, vector3d.z, 0.0); + } + + double doubleVal7 = vector3d.x; + doubleVal14 = vector4d.x; + vector4d.x = Math.min(doubleVal7, doubleVal14); + double doubleVal8 = vector3d.y; + doubleVal14 = vector4d.y; + vector4d.y = Math.min(doubleVal8, doubleVal14); + double doubleVal9 = vector3d.x; + doubleVal14 = vector4d.z; + vector4d.z = Math.max(doubleVal9, doubleVal14); + vector4d2 = vector4d; + + double doubleVal10 = vector3d.y; + doubleVal14 = vector4d.w; + vector4d2.w = Math.max(doubleVal10, doubleVal14); + } + } + + this.mc.entityRenderer.renderStep7(); + Object obj2 = vector4d; + if (vector4d == null) { + break label110; + } + + BooleanProperty boolProp = this.neededOnly; + obj2 = boolProp.get(); + + label81: { + Boolean flag2 = (Boolean)obj2; + boolean flag3 = flag2; + + if (!flag3) { + break label81; + } + + flag3 = this.applyInt5((EntityItem)entity); + + + if (!flag3) { + break label110; + } + } + + double doubleVal11 = vector4d.x; + double doubleVal16 = vector4d.y; + double doubleVal17 = vector4d.z; + double doubleVal18 = vector4d.w; + double doubleVal19 = this.applyInt5((EntityItem)entity) ? 4.0 : 3.0; + Color awtColor3 = Color.BLACK; + RenderUtils.drawElement(doubleVal11, doubleVal16, doubleVal17, doubleVal18, doubleVal19, awtColor3); + doubleVal19 = this.applyInt5((EntityItem)entity) ? 2.0 : 1.0; + awtColor3 = this.resolveColor((EntityItem)entity); + RenderUtils.drawElement(doubleVal11, doubleVal16, doubleVal17, doubleVal18, doubleVal19, awtColor3); + BooleanProperty boolProp2 = this.names; + Boolean propFlag = boolProp2.get(); + if (propFlag) { + float floatVal3; + label71: { + label70: { + label69: { + floatVal3 = 1.0F; + + switch (this.mc.gameSettings.guiScale) { + case 0: + floatVal3 = 0.5F; + break; + case 1: + break label69; + case 2: + default: + break label71; + case 3: + break label70; + } + + + + break label71; + + } + + floatVal3 = 2.0F; + + break label71; + + } + + floatVal3 = 0.6666667F; + } + + double[] doubleArr = MovementUtils.scaleCoords(doubleVal11, doubleVal16); + double[] doubleArr2 = MovementUtils.scaleCoords(doubleVal17, doubleVal18); + double[] doubleArr3 = new double[]{doubleArr[0] * 2.0, doubleArr[1] * 2.0, doubleArr2[0] * 2.0, doubleArr2[1] * 2.0}; + GL11.glPushMatrix(); + GL11.glScalef(0.5F * floatVal3, 0.5F * floatVal3, 0.5F * floatVal3); + double doubleVal12 = doubleArr3[2] - doubleArr3[0]; + double doubleVal13 = Math.abs(doubleVal12); + FontRenderer font = this.mc.crackFontRenderer; + float floatVal4 = font.getFontHeight() * 2; + FontRenderer font2 = this.mc.crackFontRenderer; + float floatVal5 = floatVal4 - font2.getFontHeight() / 2; + FontRenderer font3 = this.mc.crackFontRenderer; + EntityItem entityItem3 = (EntityItem)entity; + String displayName = entityItem3.getEntityItem().getDisplayName(); + doubleVal14 = doubleArr3[0] + doubleVal13 / 2.0; + FontRenderer font4 = this.mc.crackFontRenderer; + EntityItem entityItem4 = (EntityItem)entity; + String displayName2 = entityItem4.getEntityItem().getDisplayName(); + float floatVal6 = (float)(doubleVal14 - font4.getStringWidth(displayName2) / 2); + float floatVal7 = (float)doubleArr2[1] * 2.0F + floatVal5; + Color awtColor = this.resolveColor((EntityItem)entity); + Color awtColor2 = awtColor.brighter(); + int color = awtColor2.getRGB(); + font3.drawStringWithShadow(displayName, floatVal6, floatVal7, color); + GL11.glPopMatrix(); + } + } + + break; + } + } +} + + private float applyInt5(@NonNull ItemStack stack) { + float floatVal = 0.0F; + Item item = stack.getItem(); + if (!(item instanceof ItemArmor)) { + return floatVal; + } + + item = stack.getItem(); + + ItemArmor armorItem = (ItemArmor)item; + double doubleVal = floatVal; + double doubleVal7 = armorItem.damageReduceAmount; + int intVal6 = 100 - armorItem.damageReduceAmount; + int intVal7 = Enchantment.protection.effectId; + floatVal = (float)(doubleVal + (doubleVal7 + intVal6 * ChestStealerSupport.getEnchantmentLevel(intVal7, stack) * 0.0075)); + double doubleVal2 = floatVal; + int intVal = Enchantment.blastProtection.effectId; + floatVal = (float)(doubleVal2 + ChestStealerSupport.getEnchantmentLevel(intVal, stack) / 100.0); + double doubleVal3 = floatVal; + int intVal2 = Enchantment.fireProtection.effectId; + floatVal = (float)(doubleVal3 + ChestStealerSupport.getEnchantmentLevel(intVal2, stack) / 100.0); + double doubleVal4 = floatVal; + int intVal3 = Enchantment.thorns.effectId; + floatVal = (float)(doubleVal4 + ChestStealerSupport.getEnchantmentLevel(intVal3, stack) / 100.0); + double doubleVal5 = floatVal; + int intVal4 = Enchantment.unbreaking.effectId; + floatVal = (float)(doubleVal5 + ChestStealerSupport.getEnchantmentLevel(intVal4, stack) / 50.0); + double doubleVal6 = floatVal; + int intVal5 = Enchantment.projectileProtection.effectId; + return (float)(doubleVal6 + ChestStealerSupport.getEnchantmentLevel(intVal5, stack) / 100.0); +} + + private boolean checkItemStack3(ItemStack stack) { + boolean flag2 = HUD.H(); + int intVal = 0; + boolean flag = flag2; + + while (true) { + if (intVal < 3) { + ItemStack stack2 = this.mc.thePlayer.inventory.armorInventory[intVal]; + if (flag) { + label44: { + if (flag) { + if (stack2 == null) { + break label44; + } + + stack2 = this.mc.thePlayer.inventory.armorInventory[intVal]; + } + + Item item = stack2.getItem(); + if (item == stack.getItem()) { + return true; + } + } + + intVal++; + if (flag) { + continue; + } + + intVal = 9; + if (intVal >= 45) { + break; + } + } else { + ItemStack stack3 = stack2; + if (flag) { + Item item2 = stack.getItem(); + if (item2 == stack3.getItem()) { + return true; + } + + intVal++; + } + + if (intVal >= 45) { + break; + } + } + } else { + intVal = 9; + if (intVal >= 45) { + break; + } + } + + while (true) { + EntityPlayerSP player = this.mc.thePlayer; + Slot slot = player.getSlotFromPlayerContainer(intVal); + ItemStack stack4; + if (flag) { + flag2 = slot.getHasStack(); + + if (!flag2) { + if (++intVal >= 45) { + return false; + } + continue; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + Slot slot2 = player2.getSlotFromPlayerContainer(intVal); + stack4 = slot2.getStack(); + } else { + stack4 = slot.getStack(); + } + + ItemStack stack5 = stack4; + if (flag) { + Item item3 = stack.getItem(); + if (item3 == stack5.getItem()) { + return true; + } + + intVal++; + } + + if (intVal >= 45) { + return false; + } + } + } + + return false; +} + + private float computeFloat(@NonNull ItemStack stack) { + float floatVal; + label17: { + floatVal = 0.0F; + Item item = stack.getItem(); + boolean flag = item instanceof ItemImpl; + if (flag) { + floatVal += ((ItemImpl)item).getDamageVsEntity3(); + break label17; + } + + flag = item instanceof ItemIronSword; + + if (flag) { + floatVal += ((ItemIronSword)item).getAttackDamage(); + } + } + + float floatVal2 = ChestStealerSupport.getEnchantmentLevel(Enchantment.sharpness.effectId, stack) * 1.25F; + int intVal = Enchantment.fireAspect.effectId; + return floatVal + (floatVal2 + ChestStealerSupport.getEnchantmentLevel(intVal, stack) * 0.01F); +} + + private Vector3d resolveVector3d(ScaledResolution scaledResolution, double value, double amount, double offset) { + GL11.glGetFloat(2982, this.floatBufferField); + GL11.glGetFloat(2983, this.floatBufferField3); + GL11.glGetInteger(2978, this.intBufferField); + if (GLU.gluProject((float)value, (float)amount, (float)offset, this.floatBufferField, this.floatBufferField3, this.intBufferField, this.floatBufferField2)) { + float floatVal = this.floatBufferField2.get(0); + double doubleVal = floatVal / scaledResolution.getScaleFactor(); + float floatVal2 = Display.getHeight(); + FloatBuffer floatBuffer = this.floatBufferField2; + floatVal2 -= floatBuffer.get(1); + double doubleVal2 = floatVal2 / scaledResolution.getScaleFactor(); + floatBuffer = this.floatBufferField2; + return new Vector3d(doubleVal, doubleVal2, floatBuffer.get(2)); + } else { + return null; + } +} + + public ItemESP(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.names = BooleanProperty.of(false); + this.neededOnly = BooleanProperty.of(false); + this.intBufferField = GLAllocation.createDirectIntBuffer(16); + this.floatBufferField = GLAllocation.createDirectFloatBuffer(16); + this.floatBufferField3 = GLAllocation.createDirectFloatBuffer(16); + this.floatBufferField2 = GLAllocation.createDirectFloatBuffer(4); + Setting setting = new Setting("NAMES", "Names", SettingType.CHECKBOX, this, this.names); + SettingManager.register(setting); + setting = new Setting("NEEDED_ONLY", "Needed Only", SettingType.CHECKBOX, this, this.neededOnly); + SettingManager.register(setting); +} + +} diff --git a/src/main/java/cc/novoline/modules/visual/ItemPhysic.java b/src/main/java/cc/novoline/modules/visual/ItemPhysic.java new file mode 100644 index 0000000..d6d7eb3 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/ItemPhysic.java @@ -0,0 +1,24 @@ +package cc.novoline.modules.visual; + +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.ModuleManager; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class ItemPhysic extends AbstractModule { + public static boolean stateFlag; + + public ItemPhysic(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); +} + + @Override + public void onEnable() { + stateFlag = true; +} + + @Override + public void onDisable() { + stateFlag = false; +} +} diff --git a/src/main/java/cc/novoline/modules/visual/JumpCircle.java b/src/main/java/cc/novoline/modules/visual/JumpCircle.java new file mode 100644 index 0000000..104a67b --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/JumpCircle.java @@ -0,0 +1,268 @@ +package cc.novoline.modules.visual; + +import cc.novoline.events.events.JumpEvent; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.render.JumpCircleRing; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render3DEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.FloatProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import java.awt.Color; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.MathHelper; +import net.minecraft.client.Minecraft; +import net.minecraft.util.Vec3; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.lwjgl.opengl.GL11; + +public class JumpCircle extends AbstractModule { + private boolean stateFlag; + @Property("radius") + private final FloatProperty radius; + @Property("color") + private final ColorProperty color; + private List jumpCircleRingList; + @Property("color-mode") + private final StringProperty colorMode; + + public JumpCircle(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.jumpCircleRingList = new CopyOnWriteArrayList<>(); + StringProperty strProp = StringProperty.of("Client"); + String[] stringArr = new String[]{"Client", "Custom"}; + this.colorMode = strProp.acceptableValues(stringArr); + Color awtColor = new Color(200, 200, 200); + int color2 = awtColor.getRGB(); + Integer intVal = color2; + this.color = ColorProperty.e(intVal); + this.radius = FloatProperty.of(1.0F).minimum(0.5F).maximum(2.0F); + Setting setting = new Setting("JC_COLOR_MODE", "Color Mode", SettingType.COMBOBOX, this, this.colorMode); + SettingManager.register(setting); + setting = new Setting("JC_COLOR", "Color", SettingType.COLOR_PICKER, this, this.color, null, () -> this.colorMode.equals("Custom")); + SettingManager.register(setting); + setting = new Setting("JC_RADIUS", "Radius", SettingType.SLIDER, this, this.radius, 0.1); + SettingManager.register(setting); +} + + + @EventTarget + public void onRender3D(Render3DEvent event) { + GL11.glPushMatrix(); + GL11.glEnable(3042); + GL11.glBlendFunc(770, 771); + GL11.glDisable(3553); + GlStateManager.disableDepth(); + GL11.glEnable(2848); + short shortVal = (short)(HUD.Q() ? 1 : 0); + GL11.glDisable(2896); + GL11.glDepthMask(false); + GL11.glHint(3154, 4354); + GL11.glLineWidth(5.0F); + GL11.glShadeModel(7425); + boolean flag = (shortVal != 0); + List itemList = this.jumpCircleRingList; + Iterator iter = itemList.iterator(); + + while (true) { + if (iter.hasNext()) { + JumpCircleRing jumpCircleRing = (JumpCircleRing)iter.next(); + double doubleVal21 = jumpCircleRing.getCachedAngle(); + double doubleVal = jumpCircleRing.getCachedAngle22(); + Vec3 vec = jumpCircleRing.getCachedVec(); + double doubleVal2 = vec.getX(); + Minecraft mcClient = this.mc; + double doubleVal3 = doubleVal2 - mcClient.getRenderManager().renderPosX; + Vec3 vec2 = jumpCircleRing.getCachedVec(); + double doubleVal4 = vec2.getY(); + mcClient = this.mc; + double doubleVal22 = doubleVal4 - mcClient.getRenderManager().renderPosY; + Vec3 vec3 = jumpCircleRing.getCachedVec(); + double doubleVal5 = vec3.getZ(); + mcClient = this.mc; + double doubleVal6 = doubleVal5 - mcClient.getRenderManager().renderPosZ; + GL11.glBegin(5); + shortVal = 0; + if (flag) { + break; + } + + int intVal = 0; + + label61: { + while (intVal < 361) { + double doubleVal7 = intVal * Math.PI / 180.0; + double angleRad = doubleVal21 * Math.cos(doubleVal7); + double doubleVal8 = intVal * Math.PI / 180.0; + double angleRad2 = doubleVal21 * Math.sin(doubleVal8); + double doubleVal9 = doubleVal21 - Math.min(0.2, doubleVal21); + double doubleVal10 = intVal * Math.PI / 180.0; + double angleRad3 = doubleVal9 * Math.cos(doubleVal10); + double doubleVal11 = doubleVal21 - Math.min(0.2, doubleVal21); + double doubleVal12 = intVal * Math.PI / 180.0; + double angleRad4 = doubleVal11 * Math.sin(doubleVal12); + Color awtColor = this.resolveColor(); + int intVal2 = awtColor.getRed(); + Color awtColor2 = this.resolveColor(); + int intVal8 = awtColor2.getGreen(); + Color awtColor3 = this.resolveColor(); + Color awtColor4 = new Color(intVal2, intVal8, awtColor3.getBlue(), (int)doubleVal); + RenderUtils.glColor(awtColor4); + GL11.glVertex3d(doubleVal3 + angleRad, doubleVal22, doubleVal6 + angleRad2); + awtColor = this.resolveColor(); + int intVal3 = awtColor.getRed(); + awtColor2 = this.resolveColor(); + int intVal9 = awtColor2.getGreen(); + awtColor3 = this.resolveColor(); + Color awtColor5 = new Color(intVal3, intVal9, awtColor3.getBlue(), 0); + RenderUtils.glColor(awtColor5); + GL11.glVertex3d(doubleVal3 + angleRad3, doubleVal22, doubleVal6 + angleRad4); + intVal++; + if (flag) { + break label61; + } + + if (flag) { + break; + } + } + + GL11.glEnd(); + GL11.glBegin(5); + } + + int intVal4 = 0; + + label50: { + while (intVal4 < 361) { + double doubleVal13 = doubleVal21 * 1.2; + double doubleVal14 = intVal4 * Math.PI / 180.0; + double angleRad5 = doubleVal13 * Math.cos(doubleVal14); + double doubleVal15 = doubleVal21 * 1.2; + double doubleVal16 = intVal4 * Math.PI / 180.0; + double angleRad6 = doubleVal15 * Math.sin(doubleVal16); + double doubleVal17 = intVal4 * Math.PI / 180.0; + double angleRad7 = doubleVal21 * Math.cos(doubleVal17); + double doubleVal18 = intVal4 * Math.PI / 180.0; + double angleRad8 = doubleVal21 * Math.sin(doubleVal18); + Color awtColor6 = this.resolveColor(); + int intVal5 = awtColor6.getRed(); + Color awtColor7 = this.resolveColor(); + int intVal10 = awtColor7.getGreen(); + Color awtColor8 = this.resolveColor(); + Color awtColor9 = new Color(intVal5, intVal10, awtColor8.getBlue(), 0); + RenderUtils.glColor(awtColor9); + GL11.glVertex3d(doubleVal3 + angleRad5, doubleVal22, doubleVal6 + angleRad6); + awtColor6 = this.resolveColor(); + int intVal6 = awtColor6.getRed(); + awtColor7 = this.resolveColor(); + int intVal11 = awtColor7.getGreen(); + awtColor8 = this.resolveColor(); + Color awtColor10 = new Color(intVal6, intVal11, awtColor8.getBlue(), (int)doubleVal / 2); + RenderUtils.glColor(awtColor10); + GL11.glVertex3d(doubleVal3 + angleRad7, doubleVal22, doubleVal6 + angleRad8); + intVal4++; + if (flag) { + break label50; + } + + if (flag) { + break; + } + } + + GL11.glEnd(); + } + + double doubleVal19 = jumpCircleRing.getCachedAngle(); + Float propFloat = this.radius.get(); + double doubleVal20; + int intVal7 = (doubleVal20 = doubleVal19 - (propFloat.floatValue() - 0.05)) == 0.0 ? 0 : (doubleVal20 < 0.0 ? -1 : 1); + if (!flag) { + if (intVal7 >= 0) { + float floatVal = jumpCircleRing.getCachedAngle22() - 1.0F; + jumpCircleRing.createVec3(MathHelper.clamp_float(floatVal, 0.0F, 255.0F)); + } + + float floatVal2 = (float)(jumpCircleRing.getCachedAngle() + 0.005); + Float propFloat2 = this.radius.get(); + float floatVal4 = propFloat2; + jumpCircleRing.evaluateFloat(MathHelper.clamp_float(floatVal2, 0.0F, floatVal4)); + float floatVal3; + intVal7 = (floatVal3 = jumpCircleRing.getCachedAngle2() - 0.0F) == 0.0F ? 0 : (floatVal3 < 0.0F ? -1 : 1); + } + + if (!flag && intVal7 <= 0) { + List itemList2 = this.jumpCircleRingList; + itemList2.remove(jumpCircleRing); + } + + if (!flag) { + continue; + } + } + + GL11.glDepthMask(true); + GlStateManager.enableDepth(); + GL11.glDisable(2848); + GL11.glEnable(3553); + shortVal = 3042; + break; + } + + GL11.glDisable(shortVal); + GL11.glPopMatrix(); +} + + + private Color resolveColor() { + JumpCircle jumpCircle = this; + StringProperty strProp = this.colorMode; + if (!strProp.equals("Custom")) { + return new Color(ColorTheme.getHudColor(0L)); + } + + jumpCircle = this; + + ColorProperty colorProp = jumpCircle.color; + return colorProp.getAwtColor(); +} + + public static Minecraft resolveMinecraft(JumpCircle jumpCircle) { + return jumpCircle.mc; +} + + + public static Minecraft resolveMinecraft33(JumpCircle jumpCircle) { + return jumpCircle.mc; +} + + public static Minecraft resolveMinecraft34(JumpCircle jumpCircle) { + return jumpCircle.mc; +} + + @EventTarget + public void handleJumpEvent(JumpEvent event) { + this.performStep24(); +} + + public void performStep24() { + if (this.isEnabled()) { + List itemList = this.jumpCircleRingList; + itemList.add(new JumpCircleRing(this)); + } +} + +} diff --git a/src/main/java/cc/novoline/modules/visual/MoreBends.java b/src/main/java/cc/novoline/modules/visual/MoreBends.java new file mode 100644 index 0000000..06a39a9 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/MoreBends.java @@ -0,0 +1,170 @@ +package cc.novoline.modules.visual; + +import cc.novoline.events.events.RenderEntityEvent; +import cc.novoline.events.type.RenderEntityState; +import cc.novoline.utils.bends.BendsPlayerData; +import cc.novoline.utils.bends.BendsPack; +import cc.novoline.utils.bends.BendsLogLevel; +import cc.novoline.utils.bends.BendsBooleanSetting; +import cc.novoline.utils.bends.AnimatedEntityEntry; +import cc.novoline.utils.bends.RenderBendsPlayer; +import cc.novoline.utils.bends.BendsSetting; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render3DEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import java.util.List; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.lwjgl.util.vector.Vector3f; + +public class MoreBends extends AbstractModule { + public static float floatValue; + + @Override + public void onDisable() { + AnimatedEntityEntry.performAction(); +} + + @Override + public void onEnable() { + BendsPack.performAction(); + ((BendsBooleanSetting)BendsSetting.resolveBendsSetting("swordTrail")).flagField = true; + AnimatedEntityEntry.performAction2(); +} + + public MoreBends(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); +} + + @EventTarget + public void onRenderEntity(RenderEntityEvent event) { + int intVal; + net.minecraft.entity.Entity entity2; + RenderEntityEvent renderEntityEvent = event; + if (event.getRenderEntityState() != RenderEntityState.PRE) { + return; + } + + renderEntityEvent = event; + + if (renderEntityEvent.getEntityB() instanceof EntityPlayer && this.mc.theWorld != null) { + intVal = (event.getEntityB() instanceof EntityPlayerSP ? 1 : 0); + + if (intVal != 0) { + GameSettings gameSettings2 = this.mc.gameSettings; + intVal = gameSettings2.getThirdPersonView(); + + if (intVal == 0) { + return; + } + } + + intVal = (event.getRendererLivingEntity() instanceof RenderBendsPlayer ? 1 : 0); + + + if (intVal != 0) { + return; + } + + entity2 = event.getEntityB(); + + intVal = (AnimatedEntityEntry.createBendsAnimation(entity2).flagField ? 1 : 0); + + if (intVal == 0) { + return; + } + + entity2 = event.getEntityB(); + + AbstractClientPlayer clientPlayer = (AbstractClientPlayer)entity2; + event.setCancelled(true); + AnimatedEntityEntry.createBendsAnimation(clientPlayer).a(clientPlayer, event.getDoubleValue2(), event.getCachedValue33(), event.getCachedValue4(), 0.0F, floatValue); + } +} + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + if (Minecraft.getMinecraft().theWorld != null) { + int intVal = 0; + + while (true) { + List itemList = BendsPlayerData.dataList; + if (intVal >= itemList.size()) { + break; + } + + label34: { + List itemList2 = BendsPlayerData.dataList; + BendsPlayerData bendsPlayerData = (BendsPlayerData)itemList2.get(intVal); + WorldClient world = Minecraft.getMinecraft().theWorld; + int intVal2 = bendsPlayerData.entityID; + Entity entity2 = world.getEntityByID(intVal2); + if (entity2 != null) { + BendsPlayerData bendsPlayerData2 = bendsPlayerData; + String textStr = bendsPlayerData.clientEntityName; + String nameStr = entity2.getName(); + if (!textStr.equalsIgnoreCase(nameStr)) { + itemList2 = BendsPlayerData.dataList; + itemList2.remove(bendsPlayerData); + BendsPlayerData bendsPlayerData3 = new BendsPlayerData(entity2.getEntityId()); + BendsPlayerData.addData(bendsPlayerData3); + BendsLogLevel.executeString("Reset entity", BendsLogLevel.DEBUG); + break label34; + } + + Vector3f vector3f = bendsPlayerData.motionPrev; + Vector3f vector3f2 = bendsPlayerData.motion; + vector3f.set(vector3f2); + bendsPlayerData.motion.x = (float)entity2.posX - bendsPlayerData.position.x; + bendsPlayerData.motion.y = (float)entity2.posY - bendsPlayerData.position.y; + bendsPlayerData.motion.z = (float)entity2.posZ - bendsPlayerData.position.z; + bendsPlayerData2 = bendsPlayerData; + + bendsPlayerData2.position = new Vector3f((float)entity2.posX, (float)entity2.posY, (float)entity2.posZ); + break label34; + } + + itemList2 = BendsPlayerData.dataList; + itemList2.remove(bendsPlayerData); + + BendsLogLevel.executeString("No entity", BendsLogLevel.DEBUG); + } + + intVal++; + } + } +} + + @EventTarget + public void onRender3D(Render3DEvent event) { + if (Minecraft.getMinecraft().theWorld != null) { + int intVal = 0; + + while (true) { + List itemList = BendsPlayerData.dataList; + if (intVal < itemList.size()) { + List itemList2 = BendsPlayerData.dataList; + BendsPlayerData bendsPlayerData = (BendsPlayerData)itemList2.get(intVal); + float partialTicks = event.getPartialTicks(); + bendsPlayerData.applyUpdate(partialTicks); + intVal++; + + continue; + } + + floatValue = event.getPartialTicks(); + break; + } + } +} +} diff --git a/src/main/java/cc/novoline/modules/visual/Nametags.java b/src/main/java/cc/novoline/modules/visual/Nametags.java new file mode 100644 index 0000000..56e32bc --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/Nametags.java @@ -0,0 +1,441 @@ +package cc.novoline.modules.visual; + +import cc.novoline.events.events.RenderNameTagEvent; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.modules.PlayerRelationType; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.render.NametagEntityPos; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.Novoline; +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.events.events.Render3DEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.player.Freecam; +import cc.novoline.modules.ModuleRegistry; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.stream.Stream; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.IChatComponent; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; + +public final class Nametags extends AbstractModule { + @Property("font-size") + private IntProperty fontSize; + @Property("content") + private final ListProperty content; + private TimerUtil timer; + @Property("health-type") + private final StringProperty healthType; + @Property("tag-font") + private final StringProperty tagFont; + private final List nametagEntityPosList; + @Property("only-targets") + private final BooleanProperty onlyTargets; + @Property("additions") + private final ListProperty additions; + @Property("render-distance") + private final IntProperty renderDistance; + @Property("background-alpha") + private final IntProperty backgroundAlpha; + + + private static boolean matchesEntity(Entity entity) { + boolean flag = entity.isConditionMet23(); + flag = !flag; + + return flag; +} + + public static StringProperty resolveStringProperty2(Nametags nametags) { + return nametags.tagFont; +} + + public ListProperty getAdditions() { + return this.additions; +} + + public ListProperty getListPropertyValue() { + return this.getAdditions(); +} + + public static Minecraft resolveMinecraft35(Nametags nametags) { + return nametags.mc; +} + + private void invokeCallback(Render3DEvent event, NametagEntityPos nametagEntityPos) { + net.minecraft.entity.EntityLivingBase living; + int intVal; + + EntityLivingBase living2 = nametagEntityPos.getTargetLiving(); + boolean flag2 = living2.isConditionMet16(); + label61: { + if (flag2) { + EntityPlayerSP player = this.mc.thePlayer; + EntityLivingBase living3 = nametagEntityPos.getTargetLiving(); + float distanceF = player.getDistanceToEntity(living3); + IntProperty intProp = this.renderDistance; + Integer intVal2 = intProp.get(); + if (distanceF <= intVal2.intValue()) { + break label61; + } + + Novoline novolineInst = Novoline.getInstance(); + if (novolineInst.getPlayerManager().resolvePlayerRelationType(nametagEntityPos.getTargetLiving().getName()) == PlayerRelationType.TARGET) { + break label61; + } + } + + List itemList = this.nametagEntityPosList; + itemList.remove(nametagEntityPos); + } + + WorldClient world = this.mc.theWorld; + List itemList2 = world.getLoadedEntityList(); + EntityLivingBase living4 = nametagEntityPos.getTargetLiving(); + intVal = (itemList2.contains(living4) ? 1 : 0); + + label48: { + label46: + if (intVal != 0) { + BooleanProperty boolProp = this.onlyTargets; + Boolean propFlag = boolProp.get(); + int intVal3 = (propFlag ? 1 : 0); + + if (intVal3 != 0) { + Novoline novolineInst2 = Novoline.getInstance(); + if (novolineInst2.getPlayerManager().resolvePlayerRelationType(nametagEntityPos.getTargetLiving().getName()) != PlayerRelationType.TARGET) { + break label46; + } + } + + EntityLivingBase living5 = nametagEntityPos.getTargetLiving(); + intVal3 = living5.getEntityId(); + + + EntityPlayerSP player2 = this.mc.thePlayer; + if (intVal3 != player2.getEntityId()) { + EntityLivingBase living6 = nametagEntityPos.getTargetLiving(); + IChatComponent chatComp = living6.getDisplayName(); + String msgText = chatComp.getFormattedText(); + boolean flag3 = msgText.contains("NPC"); + + if (!flag3) { + living = nametagEntityPos.getTargetLiving(); + + IChatComponent chatComp2 = living.getDisplayName(); + String textStr = chatComp2.getUnformattedText(); + String nameStr = nametagEntityPos.getTargetLiving().getName(); + if (!textStr.equalsIgnoreCase(nameStr)) { + break label48; + } + } + } + } + + List itemList3 = this.nametagEntityPosList; + itemList3.remove(nametagEntityPos); + } + + living = nametagEntityPos.getTargetLiving(); + + double posX2 = living.lastTickPosX + (nametagEntityPos.getTargetLiving().posX - nametagEntityPos.getTargetLiving().lastTickPosX) * event.getPartialTicks(); + Minecraft mcClient = this.mc; + float floatVal = (float)(posX2 - mcClient.getRenderManager().renderPosX); + double posY2 = nametagEntityPos.getTargetLiving().lastTickPosY + 2.3 + (nametagEntityPos.getTargetLiving().posY + 2.3 - (nametagEntityPos.getTargetLiving().lastTickPosY + 2.3)) * event.getPartialTicks(); + mcClient = this.mc; + float floatVal2 = (float)(posY2 - mcClient.getRenderManager().renderPosY); + double posZ2 = nametagEntityPos.getTargetLiving().lastTickPosZ + (nametagEntityPos.getTargetLiving().posZ - nametagEntityPos.getTargetLiving().lastTickPosZ) * event.getPartialTicks(); + mcClient = this.mc; + float floatVal3 = (float)(posZ2 - mcClient.getRenderManager().renderPosZ); + NametagEntityPos.buildDoubleArray(nametagEntityPos, NametagEntityPos.drawElement(nametagEntityPos, floatVal, floatVal2, floatVal3)); +} + + public ListProperty getContent() { + return this.content; +} + + public ListProperty getListPropertyC() { + return this.getContent(); +} + + public IntProperty getRenderDistance() { + return this.renderDistance; +} + + public IntProperty getIntProperty9() { + return this.getRenderDistance(); +} + + @EventTarget + public void onRender2D(Render2DEvent event) { + List itemList = this.nametagEntityPosList; + Consumer consumer = ((java.util.function.Consumer) NametagEntityPos::performStep); + itemList.forEach(consumer); +} + + + private Boolean supplyBoolean() { + ListProperty listProp = this.additions; + List itemList = (List)listProp.get(); + return itemList.contains("Background"); +} + + public Nametags(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String name) { + super(moduleManager, enumModuleType, name); + this.nametagEntityPosList = new CopyOnWriteArrayList<>(); + IntProperty intProp = IntProperty.of(192); + Integer intVal = 4; + IntProperty intProp2 = intProp.minimum(intVal); + this.renderDistance = intProp2.maximum(256); + StringProperty strProp = StringProperty.of("Client"); + String[] stringArr = new String[]{"Client", "Vanilla"}; + this.tagFont = strProp.acceptableValues(stringArr); + ListProperty listProp = ListProperty.of("Distance"); + String[] stringArr2 = new String[]{"Distance", "Armor"}; + this.content = listProp.acceptableValues((Object[])stringArr2); + ListProperty listProp2 = ListProperty.of("Background"); + String[] stringArr3 = new String[]{"Background", "Health"}; + this.additions = listProp2.acceptableValues((Object[])stringArr3); + StringProperty strProp2 = StringProperty.of("Bar"); + String[] stringArr4 = new String[]{"Bar", "Value"}; + this.healthType = strProp2.acceptableValues(stringArr4); + IntProperty intProp3 = IntProperty.of(100); + IntProperty intProp4 = intProp3.minimum(50); + this.backgroundAlpha = intProp4.maximum(255); + this.onlyTargets = BooleanProperty.of(false); + IntProperty intProp5 = IntProperty.of(20); + IntProperty intProp6 = intProp5.minimum(18); + this.fontSize = intProp6.maximum(30); + this.timer = new TimerUtil(); + Setting setting = new Setting("NAMETAGS_FONT", "Nametags Font", SettingType.COMBOBOX, this, this.tagFont); + SettingManager.register(setting); + setting = new Setting("NAMETAGS_FONT_SIZE", "Font Size", SettingType.SLIDER, this, this.fontSize, 1.0, () -> this.tagFont.equals("Client")); + SettingManager.register(setting); + setting = new Setting("NAMETAGS_RENDER_DIST", "Render distance", SettingType.SLIDER, this, this.renderDistance, 4.0); + SettingManager.register(setting); + setting = new Setting("NAMETAGS_CONTENT", "Content", SettingType.SELECTBOX, this, this.content); + SettingManager.register(setting); + setting = new Setting("NAMETAGS_ADDITIONS", "Additions", SettingType.SELECTBOX, this, this.additions); + SettingManager.register(setting); + setting = new Setting("NAMETAGS_BG_ALPHA", "Background Alpha", SettingType.SLIDER, this, this.backgroundAlpha, 5.0, this::supplyBoolean); + SettingManager.register(setting); + setting = new Setting("NAMETAGS_HEALTH", "Health Type", SettingType.COMBOBOX, this, this.healthType, this::supplyBoolean2); + SettingManager.register(setting); + setting = new Setting("ONLY_TAR", "Only targets", SettingType.CHECKBOX, this, this.onlyTargets); + SettingManager.register(setting); +} + + private NametagEntityPos/* @Nullable */ resolveNametagEntityPos(EntityLivingBase living) { + Stream stream2 = this.nametagEntityPosList.stream(); + Predicate predicate = ((java.util.function.Predicate) (nametagEntityPos) -> nametagEntityPos.getTargetLiving().equals(living)); + Stream stream3 = stream2.filter(predicate); + Optional optional = stream3.findFirst(); + return (NametagEntityPos)optional.orElse(null); +} + + public BooleanProperty getOnlyTargets() { + return this.onlyTargets; +} + + public BooleanProperty getBooleanPropertyValue5() { + return this.getOnlyTargets(); +} + + @EventTarget + private void onRender3D(Render3DEvent event) { + List itemList = this.mc.theWorld.obtainList3(); + Stream stream2 = itemList.stream(); + Predicate predicate = EntityPlayer.class::isInstance; + Stream stream3 = stream2.filter(predicate); + predicate = ((java.util.function.Predicate) Nametags::matchesEntity); + Stream stream4 = stream3.filter(predicate); + predicate = ((java.util.function.Predicate) Entity::isConditionMet16); + Stream stream5 = stream4.filter(predicate); + Function mapper = EntityLivingBase.class::cast; + Stream stream6 = stream5.map(mapper); + Predicate $livingPredicate = ((java.util.function.Predicate) this::matchesEntityLivingBase); + Stream stream7 = stream6.filter($livingPredicate); + Consumer consumer = this::handleEntityLivingBase; + stream7.forEach(consumer); + List itemList2 = this.nametagEntityPosList; + Consumer consumer2 = ((java.util.function.Consumer) (nametagEntityPos) -> this.invokeCallback(event, nametagEntityPos)); + itemList2.forEach(consumer2); +} + + @EventTarget + public void handleRenderNameTagEvent(RenderNameTagEvent event) { + int var9; + boolean var2 = HUD.Q(); + Entity var10000 = event.getEntityA(); + ModuleRegistry var10001 = ModuleRegistry.FREECAM; + if (var10000 != var10001.obtainAbstractModule().obtainAbstractModule()) { + label51: { + label55: { + ModuleRegistry var4 = ModuleRegistry.PLAYERESP; + PlayerESP var3 = var4.getModule(); + Nametags var5 = this; + if (!var2) { + Novoline var6 = this.novoline; + if (var6.getPlayerManager().resolvePlayerRelationType(event.getEntityA().getName()) == PlayerRelationType.TARGET) { + break label55; + } + + var5 = this; + } + + EntityPlayerSP var7 = var5.mc.thePlayer; + Entity var10002 = event.getEntityA(); + float var8 = var7.getDistanceToEntity(var10002); + IntProperty var14 = this.renderDistance; + Integer var15 = var14.get(); + float var17; + var9 = (var17 = var8 - var15.intValue()) == 0.0F ? 0 : (var17 < 0.0F ? -1 : 1); + label48: + if (!var2) { + if (var9 <= 0) { + BooleanProperty var10 = this.onlyTargets; + Boolean var11 = var10.get(); + var9 = (var11 ? 1 : 0); + if (var2) { + break label48; + } + + if (var9 == 0) { + var9 = (event.getEntityA() instanceof EntityArmorStand ? 1 : 0); + if (var2) { + break label51; + } + + if (var9 == 0) { + break label55; + } + } + } + + var9 = (var3.isEnabled() ? 1 : 0); + } + + label56: { + if (!var2) { + if (var9 == 0) { + break label56; + } + + ListProperty var12 = var3.getListPropertyValue2(); + List var13 = (List)var12.get(); + String var16 = "Name"; + var9 = (var13.contains(var16) ? 1 : 0); + } + + if (var2) { + break label51; + } + + if (var9 != 0) { + break label55; + } + } + + var9 = 0; + break label51; + } + + var9 = 1; + } + + event.setCancelled(toBooleanArg(var9)); + } + } + + public IntProperty getBackgroundAlpha() { + return this.backgroundAlpha; +} + + public IntProperty getIntPropertyValue5() { + return this.getBackgroundAlpha(); +} + + public List getNametagEntityPosList() { + return this.nametagEntityPosList; +} + + @Override + public void onDisable() { + List itemList = this.nametagEntityPosList; + itemList.clear(); +} + + public static Minecraft resolveMinecraft36(Nametags nametags) { + return nametags.mc; +} + + public StringProperty getHealthType() { + return this.healthType; +} + + public StringProperty getStringProperty18() { + return this.getHealthType(); +} + + + public static Minecraft resolveMinecraft37(Nametags nametags) { + return nametags.mc; +} + + + private boolean matchesEntityLivingBase(EntityLivingBase living) { + List itemList = this.nametagEntityPosList; + NametagEntityPos nametagEntityPos = this.resolveNametagEntityPos(living); + boolean flag = itemList.contains(nametagEntityPos); + flag = !flag; + + return flag; +} + + private void handleEntityLivingBase(EntityLivingBase living) { + List itemList = this.nametagEntityPosList; + itemList.add(new NametagEntityPos(this, living)); +} + + public static Minecraft resolveMinecraft(Nametags nametags) { + return nametags.mc; +} + + private Boolean supplyBoolean2() { + ListProperty listProp = this.additions; + List itemList = (List)listProp.get(); + return itemList.contains("Health"); +} + + + // The build removes this conversion to retain the original JVM argument. + private static boolean toBooleanArg(int value) { + return value != 0; +} + + + public cc.novoline.modules.configurations.property.object.StringProperty getTagFont() { return this.tagFont; } + public cc.novoline.modules.configurations.property.object.IntProperty getFontSize() { return this.fontSize; } +} diff --git a/src/main/java/cc/novoline/modules/visual/NoEffects.java b/src/main/java/cc/novoline/modules/visual/NoEffects.java new file mode 100644 index 0000000..f817ed6 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/NoEffects.java @@ -0,0 +1,186 @@ +package cc.novoline.modules.visual; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.State; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.PlayerUpdateEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.misc.UhcCrafts; +import cc.novoline.modules.ModuleRegistry; +import cc.novoline.modules.ModuleManager; +import net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.network.Packet; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class NoEffects extends AbstractModule { + @Property("effects") + private final ListProperty effects; + + @EventTarget + public void onPlayerUpdate(PlayerUpdateEvent event) { + boolean enabled; + net.minecraft.client.entity.EntityPlayerSP player; + AbstractModule mod; + mod = this; + + ListProperty listProp = this.effects; + if (listProp.contains("Nausea")) { + mod = this; + + EntityPlayerSP player2 = this.mc.thePlayer; + if (player2.isPotionActive(9)) { + EntityPlayerSP player3 = this.mc.thePlayer; + player3.handleInt5(9); + } + } + + ModuleRegistry modEntry = ModuleRegistry.BRIGHTNESS; + mod = modEntry.getModule(); + + label67: { + Brightness brightness = (Brightness)mod; + enabled = brightness.isEnabled(); + if (enabled) { + StringProperty strProp = brightness.getStringProperty6(); + enabled = strProp.equals("Effect"); + + if (enabled) { + break label67; + } + } + + ListProperty listProp2 = this.effects; + enabled = listProp2.contains("Night Vision"); + + if (enabled) { + EntityPlayerSP player4 = this.mc.thePlayer; + enabled = player4.isPotionActive(16); + + if (enabled) { + EntityPlayerSP player5 = this.mc.thePlayer; + player5.handleInt5(16); + } + } + } + + ListProperty listProp3 = this.effects; + enabled = listProp3.contains("Blindness"); + + byte byteVal; + if (!enabled) { + return; + } + + player = this.mc.thePlayer; + byteVal = 15; + + enabled = player.isPotionActive(15); + + if (!enabled) { + return; + } + + player = this.mc.thePlayer; + byteVal = 15; + + player.handleInt5(byteVal); +} + + + public NoEffects(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + ListProperty listProp = ListProperty.of("Night Vision", "Blindness", "Nausea"); + String[] stringArr = new String[]{"Night Vision", "Blindness", "Nausea"}; + this.effects = listProp.acceptableValues((Object[])stringArr); + SettingManager.register(new Setting("NF_EFFECTS", "Effects", SettingType.SELECTBOX, this, this.effects)); +} + + + @EventTarget + public void onPacket(PacketEvent event) { + net.minecraft.potion.PotionEffect potionEffect; + int intVal; + Packet packet; + { + intVal = UhcCrafts.getIntValue4(); + boolean flag = event.getState().equals(State.INCOMING); + if (intVal == 0) { + if (!flag) { + return; + } + + packet = event.getPacket(); + + flag = packet instanceof S1DPacketEntityEffect; + } + + if (!flag) { + return; + } + + packet = event.getPacket(); + } + + S1DPacketEntityEffect entityEffectPacket; + label70: { + entityEffectPacket = (S1DPacketEntityEffect)packet; + ListProperty listProp = this.effects; + int intVal2 = (listProp.contains("Nausea") ? 1 : 0); + + if (intVal2 != 0) { + potionEffect = entityEffectPacket.obtainPotionEffect(); + + if (potionEffect.getPotionID() == 9) { + break label70; + } + } + + ListProperty listProp2 = this.effects; + intVal2 = (listProp2.contains("Night Vision") ? 1 : 0); + + + + if (intVal2 != 0) { + potionEffect = entityEffectPacket.obtainPotionEffect(); + + if (potionEffect.getPotionID() == 16) { + break label70; + } + } + + ListProperty listProp3 = this.effects; + intVal2 = (listProp3.contains("Blindness") ? 1 : 0); + + + + if (intVal2 == 0) { + return; + } + + potionEffect = entityEffectPacket.obtainPotionEffect(); + + intVal2 = potionEffect.getPotionID(); + + + if (intVal2 != 15) { + return; + } + } + + potionEffect = entityEffectPacket.obtainPotionEffect(); + + potionEffect.setShowParticles(false); + event.setCancelled(true); +} + + +} diff --git a/src/main/java/cc/novoline/modules/visual/NoTitle.java b/src/main/java/cc/novoline/modules/visual/NoTitle.java new file mode 100644 index 0000000..f36292e --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/NoTitle.java @@ -0,0 +1,197 @@ +package cc.novoline.modules.visual; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.Timer; +import cc.novoline.utils.anim.SmoothAnimation; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.LoadWorldEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.ModuleManager; +import cc.novoline.utils.fonts.holders.FontFamilySF_BOLD; +import net.minecraft.network.play.server.S45PacketTitle; +import cc.novoline.utils.fonts.api.FontFamily; + +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S45PacketTitle$Type; +import net.minecraft.util.IChatComponent; + +public class NoTitle extends AbstractModule { + private SmoothAnimation smoothAnim; + private int stateTicks; + @Property("style") + private StringProperty style; + @Property("no-render") + private BooleanProperty noRender; + private String cachedText; + private Timer msTimer; + private String cachedText2; + + + private void invokeCallback(FontRenderer font, ScaledResolution scaledResolution, int value, FontRenderer fontRenderer) { + String textStr3; + textStr3 = this.cachedText; + + if (this.cachedText != null) { + textStr3 = this.cachedText; + + if (!textStr3.isEmpty()) { + String textStr4 = this.cachedText; + double scaledWidthD2 = scaledResolution.getScaledWidth_double() / 2.0; + font.drawElement3(textStr4, scaledWidthD2 - font.stringWidth(this.cachedText) / 2, 100.0, value, true, true); + } + } + + textStr3 = this.cachedText2; + + + if (textStr3 == null) { + return; + } + + textStr3 = this.cachedText2; + + + if (!textStr3.isEmpty()) { + String textStr = this.cachedText2; + double scaledWidthD = scaledResolution.getScaledWidth_double() / 2.0; + String textStr2 = this.cachedText2; + fontRenderer.drawElement3(textStr, scaledWidthD - fontRenderer.stringWidth(textStr2) / 2, 125.0, value, true, true); + } +} + + private Boolean lambdaImpl$new$0() { + Boolean propFlag = this.noRender.get(); + boolean flag = propFlag; + flag = !flag; + + return flag; +} + + + @EventTarget + public void onLoadWorld(LoadWorldEvent event) { + this.cachedText = null; + this.cachedText2 = null; +} + + public NoTitle(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + StringProperty strProp = StringProperty.of("Custom"); + String[] stringArr = new String[]{"Custom", "Vanilla"}; + this.style = strProp.acceptableValues(stringArr); + this.noRender = BooleanProperty.of(false); + this.smoothAnim = new SmoothAnimation(); + this.msTimer = new Timer(); + this.cachedText = null; + this.cachedText2 = null; + Setting setting = new Setting("CT_STYLE", "Style", SettingType.COMBOBOX, this, this.style, this::lambdaImpl$new$0); + SettingManager.register(setting); + setting = new Setting("CT_NO_RENDER", "No Render", SettingType.CHECKBOX, this, this.noRender); + SettingManager.register(setting); +} + + @Override + public void onDisable() { + this.cachedText = null; + this.cachedText2 = null; +} + + @EventTarget + public void onPacket(PacketEvent event) { + boolean flag = HUD.Q(); + Packet packet = event.getPacket(); + if (!flag) { + if (!(packet instanceof S45PacketTitle)) { + return; + } + + packet = event.getPacket(); + } + + S45PacketTitle titlePacket = (S45PacketTitle)packet; + StringProperty strProp = this.style; + boolean flag2 = strProp.equals("Custom"); + if (flag2) { + label39: { + S45PacketTitle$Type title$TypePacket = titlePacket.getType(); + S45PacketTitle$Type title$TypePacket2 = S45PacketTitle$Type.TITLE; + if (title$TypePacket == S45PacketTitle$Type.TITLE) { + IChatComponent chatComp = titlePacket.getMessage(); + this.cachedText = chatComp.getFormattedText(); + break label39; + } + + title$TypePacket = titlePacket.getType(); + title$TypePacket2 = S45PacketTitle$Type.SUBTITLE; + + if (title$TypePacket == title$TypePacket2) { + IChatComponent chatComp2 = titlePacket.getMessage(); + this.cachedText2 = chatComp2.getFormattedText(); + } + } + + this.msTimer.reset(); + this.smoothAnim.applyDouble(0.0); + this.stateTicks = 255; + } + + StringProperty strProp2 = this.style; + flag2 = strProp2.equals("Custom"); + + label30: { + if (flag2) { + break label30; + } + + BooleanProperty boolProp = this.noRender; + Boolean propFlag = boolProp.get(); + flag2 = propFlag; + + if (!flag2) { + return; + } + } + + event.setCancelled(true); +} + + + @EventTarget + public void onRender2D(Render2DEvent event) { + if (this.style.equals("Custom")) { + ScaledResolution scaledRes = event.getResolution(); + FontFamily fontFam = FontFamilySF_BOLD.FAMILY; + FontRenderer font = fontFam.ofSize(46); + FontFamily fontFam2 = FontFamilySF_BOLD.FAMILY; + FontRenderer font2 = fontFam2.ofSize(38); + int ticks = this.stateTicks; + int color = ColorTheme.getColor(255, 255, 255, ticks); + double scaledWidthD = scaledRes.getScaledWidth_double() / 2.0; + double doubleVal = 114.0; + this.smoothAnim.renderVisual(scaledWidthD, doubleVal, 0.1, ((java.lang.Runnable) (() -> this.invokeCallback(font, scaledRes, color, font2))), 300L); + this.stateTicks = (int)(255.0 - this.msTimer.getScaledElapsed(4000L, 255.0)); + NoTitle noTitle = this; + if (this.stateTicks > 40) { + return; + } + + this.cachedText = null; + noTitle = this; + + noTitle.cachedText2 = null; + } +} + +} diff --git a/src/main/java/cc/novoline/modules/visual/PlayerESP.java b/src/main/java/cc/novoline/modules/visual/PlayerESP.java new file mode 100644 index 0000000..211e9d1 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/PlayerESP.java @@ -0,0 +1,1913 @@ +package cc.novoline.modules.visual; + + +import org.lwjgl.util.glu.GLU; +import cc.novoline.events.events.RenderNameTagEvent; +import cc.novoline.events.events.UpdateModelEvent; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.modules.PlayerManager; +import cc.novoline.modules.PlayerRelationType; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.HypixelLobbyType; +import cc.novoline.utils.MovementUtils; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.ServerUtils; +import cc.novoline.utils.TimerUtil; +import cc.novoline.utils.bends.ModelBendsPlayerBase; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.render.ColorPaletteUtil; +import cc.novoline.utils.shader.RoundedBorderShader; +import cc.novoline.utils.shader.RoundedTextureShader; + +import cc.novoline.Novoline; +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.events.events.Render3DEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.ModuleRegistry; +import java.awt.Color; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.WeakHashMap; +import java.util.function.Predicate; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import javax.vecmath.Vector3d; +import javax.vecmath.Vector4d; +import cc.novoline.modules.ModuleManager; + +import cc.novoline.utils.RenderUtilsSupport; +import net.minecraft.client.renderer.GlStateManager; +import cc.novoline.utils.fonts.api.FontFamily; +import cc.novoline.utils.fonts.holders.FontFamilyPOSTERAMA; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumChatFormatting; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.GL11; + +public class PlayerESP extends AbstractModule { + @Property("pESP-hColor-1") + private final ColorProperty pESPHColor1; + @Property("pESP-box_style") + private final StringProperty pESPBox_style; + @Property("pESP-hColor-2") + private final ColorProperty pESPHColor2; + private final FloatBuffer floatBufferField; + private int stateTicks; + @Property("font") + private StringProperty font; + @Property("pESP-box_mode") + private final StringProperty pESPBox_mode; + @Property("pESP-box-color-state") + private final StringProperty pESPBoxColorState; + @Property("pESP-box_color_mode") + private final StringProperty pESPBox_color_mode; + private List stringList; + private boolean stateFlag; + private final FloatBuffer floatBufferField2; + @Property("pESP-boxColor") + private final ColorProperty pESPBoxColor; + @Property("pESP-filter") + private final ListProperty pESPFilter; + private final Color accentColor; + private final Color accentColor2; + @Property("pESP-health-mode") + private final StringProperty pESPHealthMode; + @Property("pESP-health-gradient-length") + private final StringProperty pESPHealthGradientLength; + @Property("pESP-onlyTargets") + private final BooleanProperty pESPOnlyTargets; + @Property("pESP-name-color-type") + private final StringProperty pESPNameColorType; + private TimerUtil timer; + @Property("pESP-health-color-mode") + private final StringProperty pESPHealthColorMode; + private final IntBuffer intBufferField; + private final WeakHashMap weakHashMapArray; + @Property("hat-alpha") + private final IntProperty hatAlpha; + @Property("pESP-nameColor") + private final ColorProperty pESPNameColor; + private double cachedValue; + @Property("bg-transparency") + private final IntProperty bgTransparency; + @Property("hat-size") + private final DoubleProperty hatSize; + @Property("pESP-hurtTime") + private final BooleanProperty pESPHurtTime; + private final FloatBuffer floatBufferField3; + + private Boolean supplyBoolean() { + boolean flag; + label21: { + label23: { + ListProperty listProp = this.pESPFilter; + List itemList = (List)listProp.get(); + flag = itemList.contains("Box"); + if (!flag) { + break label23; + } + + StringProperty strProp = this.pESPBox_color_mode; + flag = strProp.equals("Synced"); + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private void drawElement5(float value, float amount, float factor, float angle, float value2, EntityPlayer player) { + float health; + float floatVal; + int intVal4 = (HUD.H() ? 1 : 0); + double doubleVal = player.computeFloat(); + double doubleVal2 = 100.0 / doubleVal; + double doubleVal3 = angle / 100.0F; + float health2 = player.getHealth(); + boolean flag = (intVal4 != 0); + double doubleVal4; + int intVal = (doubleVal4 = health2 - doubleVal) == 0.0 ? 0 : (doubleVal4 < 0.0 ? -1 : 1); + if (flag) { + if (intVal > 0) { + health2 = (float)(health2 * (doubleVal / health2)); + } + + intVal = (int)(health2 * doubleVal2); + } + + int intVal2; + label104: { + intVal2 = intVal; + float floatVal9 = value - 3.0F; + float floatVal2 = value - 2.0F; + float floatVal3 = floatVal2 - floatVal9; + float floatVal10 = factor - amount; + Color awtColor4 = Color.BLACK; + StringProperty strProp = this.pESPHealthColorMode; + short shortVal = (short)(strProp.get().equals("HP Based") ? 1 : 0); + if (flag) { + if (shortVal != 0) { + PlayerESPHelper.executeRoundedBorderShader(RoundedBorderShader.getRoundedBorderShader(), floatVal9, amount, floatVal3 + 1.0F, floatVal10, 0.0, 0.0, 5.0, new Color(0, 0, 0, 0), awtColor4, true); + float floatVal4 = floatVal10 - 1.0F; + float floatVal5 = floatVal4 * (intVal2 / 100.0F); + Color awtColor5 = new Color(RenderUtils.computeIntArray((EntityLivingBase)player)); + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal6 = floatVal9 + 0.5F; + double doubleVal7 = amount + floatVal10 - 0.5F - floatVal5; + double doubleVal8 = floatVal5; + roundedTextureShader.applyUpdate4(doubleVal6, doubleVal7, 1.0, doubleVal8, 0.0, 0.0, awtColor5, true); + if (flag) { + break label104; + } + } + + GL11.glDisable(3553); + GL11.glColor4f(0.0F, 0.0F, 0.0F, 1.0F); + GL11.glBegin(7); + GL11.glVertex2f(floatVal9 + 2.0F, amount); + GL11.glVertex2f(floatVal9, amount); + GL11.glVertex2f(floatVal9, factor); + GL11.glVertex2f(floatVal9 + 2.0F, factor); + GL11.glEnd(); + shortVal = 7425; + } + + label93: { + float floatVal6; + label105: { + GL11.glShadeModel(shortVal); + floatVal6 = (factor - 0.5F - (amount + 0.5F)) * (intVal2 / 100.0F); + GL11.glBegin(7); + StringProperty strProp2 = this.pESPHealthGradientLength; + String propStr = strProp2.get(); + String textStr = "absolute"; + intVal4 = (propStr.equalsIgnoreCase(textStr) ? 1 : 0); + if (flag) { + if (intVal4 != 0) { + ColorProperty colorProp = this.pESPHColor2; + Color awtColor = colorProp.getAwtColor(); + ColorProperty colorProp2 = this.pESPHColor1; + Color awtColor6 = colorProp2.getAwtColor(); + double doubleVal9 = intVal2 / 100.0F; + intVal4 = RenderUtils.drawElement7(awtColor, awtColor6, doubleVal9); + RenderUtils.glColor(intVal4); + if (flag) { + break label105; + } + } + + StringProperty strProp3 = this.pESPHealthGradientLength; + String propStr2 = strProp3.get(); + textStr = "relative"; + intVal4 = (propStr2.equalsIgnoreCase(textStr) ? 1 : 0); + } + + if (!flag) { + break label93; + } + + if (intVal4 != 0) { + ColorProperty colorProp3 = this.pESPHColor1; + Color awtColor2 = colorProp3.getAwtColor(); + RenderUtils.computeIntArray(awtColor2); + } + } + + GL11.glVertex2f(floatVal9 + 1.5F, factor - 0.5F - floatVal6); + GL11.glVertex2f(floatVal9 + 0.5F, factor - 0.5F - floatVal6); + ColorProperty colorProp4 = this.pESPHColor2; + Color awtColor3 = colorProp4.getAwtColor(); + RenderUtils.computeIntArray(awtColor3); + GL11.glVertex2f(floatVal9 + 0.5F, factor - 0.5F); + GL11.glVertex2f(floatVal9 + 1.5F, factor - 0.5F); + GL11.glEnd(); + intVal4 = (short)3553; + } + + GL11.glEnable(intVal4); + } + + double[] doubleArr; + String textStr2; + double doubleVal5 = value; + double doubleVal10 = factor - intVal2 * doubleVal3; + double[] doubleArr2 = MovementUtils.scaleCoords(doubleVal5, doubleVal10); + doubleArr = new double[]{doubleArr2[0] * 1.0 / 0.48, doubleArr2[1] * 1.0 / 0.48}; + textStr2 = ""; + StringProperty strProp4 = this.pESPHealthMode; + String propStr3 = strProp4.get(); + byte byteVal = -1; + intVal4 = propStr3.hashCode(); + label82: + if (flag) { + switch (intVal4) { + case -2137389811: + intVal4 = (propStr3.equals("Hearts") ? 1 : 0); + if (!flag) { + break label82; + } + + if (intVal4 == 0) { + break; + } + + byteVal = 0; + if (flag) { + break; + } + case 2312: + intVal4 = (propStr3.equals("HP") ? 1 : 0); + if (!flag) { + break label82; + } + + if (intVal4 == 0) { + break; + } + + byteVal = 1; + if (flag) { + break; + } + case 1071632058: + intVal4 = (propStr3.equals("Percentage") ? 1 : 0); + if (!flag) { + break label82; + } + + if (intVal4 != 0) { + byteVal = 2; + } + } + + intVal4 = byteVal; + } + + label108: { + if (flag) { + switch (intVal4) { + case 0: + StringBuilder sb = new StringBuilder(); + String textStr3 = "%.1f"; + Object[] objArr = new Object[1]; + float health3 = player.getHealth() / 2.0F; + objArr[0] = health3; + String textStr4 = String.format(textStr3, objArr); + StringBuilder sb2 = sb.append(textStr4); + StringBuilder sb3 = sb2.append(""); + EnumChatFormatting enumChatFormatting = EnumChatFormatting.RED; + StringBuilder sb4 = sb3.append(enumChatFormatting); + textStr2 = sb4.append("\u2764").toString(); + if (flag) { + break; + } + case 1: + StringBuilder sb5 = new StringBuilder(); + int intVal3 = (int)player.getHealth(); + StringBuilder sb6 = sb5.append(intVal3); + textStr2 = sb6.append(" HP").toString(); + if (flag) { + break; + } + case 2: + StringBuilder sb7 = new StringBuilder(); + StringBuilder sb8 = sb7.append(intVal2); + textStr2 = sb8.append("%").toString(); + } + + health = player.getHealth(); + floatVal = player.computeFloat(); + if (!flag) { + break label108; + } + + float floatVal7; + intVal4 = (floatVal7 = health - floatVal) == 0.0F ? 0 : (floatVal7 < 0.0F ? -1 : 1); + } + + if (intVal4 == 0) { + return; + } + + health = 0.48F; + floatVal = value2; + } + + float health4 = health * floatVal; + GL11.glScalef(health4, health4, health4); + FontFamily fontFam = FontFamilyPOSTERAMA.FAMILY; + FontRenderer font2 = fontFam.ofSize(20); + StringBuilder sb10 = new StringBuilder().append(""); + String textStr5 = sb10.append(textStr2).toString(); + float floatVal8 = (float)doubleArr[0]; + FontRenderer font3 = FontFamilyPOSTERAMA.FAMILY.ofSize(20); + StringBuilder sb11 = new StringBuilder().append("a!"); + String textStr6 = sb11.append(textStr2).toString(); + double doubleVal11 = floatVal8 - font3.stringWidth(textStr6); + double doubleVal12 = (float)doubleArr[1]; + font2.drawElement5(textStr5, doubleVal11, doubleVal12, -1, 1.5F); + GL11.glScaled(1.0F / health4, 1.0F / health4, 1.0F / health4); +} + + private Boolean supplyBoolean2() { + ListProperty listProp = this.pESPFilter; + return listProp.contains("China Hat"); +} + + private void applyUpdate4(double[] doubleArray, float value, EntityPlayer player) { + if (player.getHeldItem() != null) { + float floatVal3 = 0.5F * value; + GL11.glScalef(floatVal3, floatVal3, floatVal3); + float floatVal = (float)(this.getIntValue5() * 2) - this.getIntValue5() / 2; + double doubleVal2 = doubleArray[2] - doubleArray[0]; + double doubleVal = Math.abs(doubleVal2); + doubleVal2 = doubleArray[0] + doubleVal / 2.0; + doubleVal2 = (float)(doubleVal2 - this.computeIntValue2(player.getHeldItem().getDisplayName()) / 2) - 2.0F; + double doubleVal3 = (float)doubleArray[3] + floatVal / 3.0F - 2.0F; + double doubleVal4 = doubleArray[0] + doubleVal / 2.0; + float floatVal2 = (float)(doubleVal4 - this.computeIntValue2(player.getHeldItem().getDisplayName()) / 2); + doubleVal4 = floatVal2 + this.computeIntValue2(player.getHeldItem().getDisplayName()) + 1.0F; + double doubleVal5 = doubleArray[3] + floatVal / 3.0F + this.getIntValue5() + 1.0; + Integer intVal = this.bgTransparency.get(); + int color = (new Color(0, 0, 0, 255 - intVal)).getRGB(); + RenderUtils.drawRect(doubleVal2, doubleVal3, doubleVal4, doubleVal5, color); + String displayName = player.getHeldItem().getDisplayName(); + doubleVal4 = doubleArray[0] + doubleVal / 2.0; + this.applyUpdate5(displayName, (float)(doubleVal4 - this.computeIntValue2(player.getHeldItem().getDisplayName()) / 2), (float)doubleArray[3] + floatVal / 3.0F, -1); + GL11.glScalef(1.0F / floatVal3, 1.0F / floatVal3, 1.0F / floatVal3); + } +} + + @EventTarget + public void handleRenderNameTagEvent(RenderNameTagEvent event) { + RenderNameTagEvent renderNameTagEvent; + ListProperty listProp = this.pESPFilter; + boolean flag = listProp.contains("Name"); + if (!flag) { + return; + } + + renderNameTagEvent = event; + + flag = event.getEntityA() instanceof EntityPlayer; + + if (!flag) { + return; + } + + renderNameTagEvent = event; + + renderNameTagEvent.setCancelled(true); +} + + private Boolean supplyBoolean3() { + ListProperty listProp = this.pESPFilter; + List itemList = (List)listProp.get(); + return itemList.contains("Health"); +} + + public ListProperty getPESPFilter() { + return this.pESPFilter; +} + + public ListProperty getListPropertyValue2() { + return this.getPESPFilter(); +} + + + private int computeIntValue2(String text) { + PlayerESP playerESP = this; + StringProperty strProp = this.font; + if (strProp.equals("Client")) { + FontFamily fontFam = FontFamilyPOSTERAMA.FAMILY; + FontRenderer font2 = fontFam.ofSize(25); + return font2.stringWidth(text); + } + + playerESP = this; + + net.minecraft.client.gui.FontRenderer font3 = playerESP.mc.crackFontRenderer; + return font3.getStringWidth(text); +} + + private Boolean supplyBoolean4() { + String propStr = this.pESPHealthColorMode.get(); + return propStr.contains("Gradient"); +} + + private List getListValue5() { + ArrayList itemList = new ArrayList(); + WorldClient world = this.mc.theWorld; + List itemList2 = world.getLoadedEntityList(); + Stream stream2 = itemList2.stream(); + Predicate predicate = (Entity entity3) -> entity3 instanceof EntityPlayer; + Stream stream3 = stream2.filter(predicate); + predicate = PlayerESP::matchesEntity; + Stream stream4 = stream3.filter(predicate); + Collector collector = Collectors.toList(); + List itemList3 = (java.util.List) stream4.collect(collector); + Iterator iter = itemList3.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + Entity entity2 = (Entity)iter.next(); + EntityPlayer player = (EntityPlayer)entity2; + if (!entity2.equals(this.mc.thePlayer)) { + itemList.add(player); + } + } + + return itemList; +} + + private Boolean lambdaImpl$new$0() { + boolean flag; + ListProperty listProp = this.pESPFilter; + flag = listProp.contains("Name"); + label17: { + if (!flag) { + ListProperty listProp2 = this.pESPFilter; + flag = listProp2.contains("Held Item"); + + if (!flag) { + flag = false; + break label17; + } + } + + flag = true; + } + + return flag; +} + + @EventTarget + public void onRender3D(Render3DEvent event) { + net.minecraft.entity.player.EntityPlayer player2; + java.lang.Object obj; + GL11.glPushMatrix(); + ListProperty listProp = this.pESPFilter; + String textStr = "China Hat"; + boolean flag2 = listProp.contains(textStr); + if (flag2) { + this.handleRender3DEvent(event); + } + + ListProperty listProp2 = this.pESPFilter; + List itemList = (List)listProp2.get(); + textStr = "Skeleton"; + flag2 = itemList.contains(textStr); + + label252: { + if (!flag2) { + break label252; + } + + this.renderVisual4(true); + GL11.glEnable(2903); + GL11.glDisable(2848); + Set itemSet = this.weakHashMapArray.keySet(); + Predicate predicate = ((java.util.function.Predicate) this::matchesEntityPlayer); + itemSet.removeIf(predicate); + + WeakHashMap weakHashMap = this.weakHashMapArray; + WorldClient world = this.mc.theWorld; + List itemList2 = world.getPlayerEntities(); + Set itemSet2 = weakHashMap.keySet(); + Object[] objArr = itemSet2.toArray(); + int len = objArr.length; + Object[] objArr2 = objArr; + int len2 = objArr2.length; + int intVal = 0; + + while (intVal < len2) { + Object obj2 = objArr2[intVal]; + EntityPlayer player3 = (EntityPlayer)obj2; + float[][] floatArr = (float[][])weakHashMap.get(player3); + + label216: + if (floatArr != null) { + int intVal2 = player3.getEntityId(); + if (intVal2 == -1488) { + break label216; + } + + intVal2 = (player3.isConditionMet16() ? 1 : 0); + + if (intVal2 == 0) { + break label216; + } + + intVal2 = (RenderUtils.computeIntArray((Entity)player3) ? 1 : 0); + + if (intVal2 == 0) { + break label216; + } + + player2 = player3; + + intVal2 = (player3.isDead ? 1 : 0); + + if (intVal2 != 0) { + break label216; + } + + player2 = player3; + + + if (player2 == this.mc.thePlayer) { + break label216; + } + + player2 = player3; + + + boolean flag3 = player2.isPlayerSleeping(); + if (flag3) { + break label216; + } + + obj = player3; + + flag3 = player3.isConditionMet23(); + + if (flag3) { + break label216; + } + + GL11.glPushMatrix(); + obj = weakHashMap.get(player3); + + float[][] floatArr2 = (float[][])obj; + GL11.glLineWidth(1.2F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + double posX2 = applyUpdate4(player3.posX, player3.lastTickPosX, event.getPartialTicks()); + Minecraft mcClient = this.mc; + double doubleVal = posX2 - mcClient.getRenderManager().renderPosX; + double posY2 = applyUpdate4(player3.posY, player3.lastTickPosY, event.getPartialTicks()); + Minecraft mcClient2 = this.mc; + double posY3 = posY2 - mcClient2.getRenderManager().renderPosY; + double posZ2 = applyUpdate4(player3.posZ, player3.lastTickPosZ, event.getPartialTicks()); + Minecraft mcClient3 = this.mc; + double posZ3 = posZ2 - mcClient3.getRenderManager().renderPosZ; + GL11.glTranslated(doubleVal, posY3, posZ3); + float yaw = player3.prevRenderYawOffset + (player3.renderYawOffset - player3.prevRenderYawOffset) * this.mc.timer.renderPartialTicks; + GL11.glRotatef(-yaw, 0.0F, 1.0F, 0.0F); + GL11.glTranslated(0.0, 0.0, player3.isSneaking() ? -0.235 : 0.0); + float floatVal3 = player3.isSneaking() ? 0.6F : 0.75F; + float floatVal = (float) (180.0 / Math.PI); + GL11.glPushMatrix(); + GL11.glTranslated(-0.125, floatVal3, 0.0); + float floatVal2; + int intVal3 = (floatVal2 = floatArr2[3][0] - 0.0F) == 0.0F ? 0 : (floatVal2 < 0.0F ? -1 : 1); + if (intVal3 != 0) { + GL11.glRotatef(floatArr2[3][0] * (float) (180.0 / Math.PI), 1.0F, 0.0F, 0.0F); + } + + if (floatArr2[3][1] != 0.0F) { + GL11.glRotatef(floatArr2[3][1] * (float) (180.0 / Math.PI), 0.0F, 1.0F, 0.0F); + } + + if (floatArr2[3][2] != 0.0F) { + GL11.glRotatef(floatArr2[3][2] * (float) (180.0 / Math.PI), 0.0F, 0.0F, 1.0F); + } + + GL11.glBegin(3); + GL11.glVertex3d(0.0, 0.0, 0.0); + GL11.glVertex3d(0.0, -floatVal3, 0.0); + GL11.glEnd(); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glTranslated(0.125, floatVal3, 0.0); + if (floatArr2[4][0] != 0.0F) { + GL11.glRotatef(floatArr2[4][0] * (float) (180.0 / Math.PI), 1.0F, 0.0F, 0.0F); + } + + if (floatArr2[4][1] != 0.0F) { + GL11.glRotatef(floatArr2[4][1] * (float) (180.0 / Math.PI), 0.0F, 1.0F, 0.0F); + } + + if (floatArr2[4][2] != 0.0F) { + GL11.glRotatef(floatArr2[4][2] * (float) (180.0 / Math.PI), 0.0F, 0.0F, 1.0F); + } + + intVal3 = 3; + + + GL11.glBegin(intVal3); + GL11.glVertex3d(0.0, 0.0, 0.0); + double doubleVal2 = 0.0; + double doubleVal3 = -floatVal3; + GL11.glVertex3d(0.0, doubleVal3, 0.0); + GL11.glEnd(); + GL11.glPopMatrix(); + doubleVal2 = 0.0; + doubleVal3 = 0.0; + double doubleVal4 = player3.isSneaking() ? 0.25 : 0.0; + + GL11.glTranslated(doubleVal2, doubleVal3, doubleVal4); + GL11.glPushMatrix(); + double doubleVal5 = player3.isSneaking() ? -0.05 : 0.0; + GL11.glTranslated(0.0, doubleVal5, player3.isSneaking() ? -0.01725 : 0.0); + GL11.glPushMatrix(); + GL11.glTranslated(-0.375, floatVal3 + 0.55, 0.0); + float floatVal4; + int intVal4 = (floatVal4 = floatArr2[1][0] - 0.0F) == 0.0F ? 0 : (floatVal4 < 0.0F ? -1 : 1); + if ((intVal4 != 0)) { + GL11.glRotatef(floatArr2[1][0] * (float) (180.0 / Math.PI), 1.0F, 0.0F, 0.0F); + } + + if (floatArr2[1][1] != 0.0F) { + GL11.glRotatef(floatArr2[1][1] * (float) (180.0 / Math.PI), 0.0F, 1.0F, 0.0F); + } + + if (floatArr2[1][2] != 0.0F) { + GL11.glRotatef(-floatArr2[1][2] * (float) (180.0 / Math.PI), 0.0F, 0.0F, 1.0F); + } + + GL11.glBegin(3); + GL11.glVertex3d(0.0, 0.0, 0.0); + GL11.glVertex3d(0.0, -0.5, 0.0); + GL11.glEnd(); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glTranslated(0.375, floatVal3 + 0.55, 0.0); + if (floatArr2[2][0] != 0.0F) { + GL11.glRotatef(floatArr2[2][0] * (float) (180.0 / Math.PI), 1.0F, 0.0F, 0.0F); + } + + if (floatArr2[2][1] != 0.0F) { + GL11.glRotatef(floatArr2[2][1] * (float) (180.0 / Math.PI), 0.0F, 1.0F, 0.0F); + } + + if (floatArr2[2][2] != 0.0F) { + GL11.glRotatef(-floatArr2[2][2] * (float) (180.0 / Math.PI), 0.0F, 0.0F, 1.0F); + } + + GL11.glBegin(3); + GL11.glVertex3d(0.0, 0.0, 0.0); + GL11.glVertex3d(0.0, -0.5, 0.0); + GL11.glEnd(); + GL11.glPopMatrix(); + GL11.glRotatef(yaw - player3.rotationYawHead, 0.0F, 1.0F, 0.0F); + GL11.glPushMatrix(); + GL11.glTranslated(0.0, floatVal3 + 0.55, 0.0); + if (floatArr2[0][0] != 0.0F) { + GL11.glRotatef(floatArr2[0][0] * (float) (180.0 / Math.PI), 1.0F, 0.0F, 0.0F); + } + + GL11.glBegin(3); + GL11.glVertex3d(0.0, 0.0, 0.0); + GL11.glVertex3d(0.0, 0.3, 0.0); + GL11.glEnd(); + GL11.glPopMatrix(); + GL11.glPopMatrix(); + intVal4 = (player3.isSneaking() ? 1 : 0); + + GL11.glRotatef((intVal4 != 0) ? 25.0F : 0.0F, 1.0F, 0.0F, 0.0F); + double doubleVal6 = player3.isSneaking() ? -0.16175 : 0.0; + GL11.glTranslated(0.0, doubleVal6, player3.isSneaking() ? -0.48025 : 0.0); + GL11.glPushMatrix(); + GL11.glTranslated(0.0, floatVal3, 0.0); + GL11.glBegin(3); + GL11.glVertex3d(-0.125, 0.0, 0.0); + GL11.glVertex3d(0.125, 0.0, 0.0); + GL11.glEnd(); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glTranslated(0.0, floatVal3, 0.0); + GL11.glBegin(3); + GL11.glVertex3d(0.0, 0.0, 0.0); + GL11.glVertex3d(0.0, 0.55, 0.0); + GL11.glEnd(); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glTranslated(0.0, floatVal3 + 0.55, 0.0); + GL11.glBegin(3); + GL11.glVertex3d(-0.375, 0.0, 0.0); + GL11.glVertex3d(0.375, 0.0, 0.0); + GL11.glEnd(); + GL11.glPopMatrix(); + GL11.glPopMatrix(); + } + + intVal++; + + } + + this.renderVisual4(false); + } + + GL11.glPopMatrix(); +} + + private boolean checkEntityPlayer(EntityPlayer player) { + boolean flag = HUD.H(); + boolean flag2 = player.isDead; + if (player.isDead) { + return false; + } + + flag2 = player.isConditionMet23(); + + return !flag ? flag2 : !flag2; +} + + private Boolean supplyBoolean6() { + ListProperty listProp = this.pESPFilter; + List itemList = (List)listProp.get(); + return itemList.contains("Name"); +} + + private static boolean matchesEntity(Entity entity) { + boolean flag = entity.isConditionMet23(); + flag = !flag; + + return flag; +} + + private Boolean supplyBoolean7() { + ListProperty listProp = this.pESPFilter; + List itemList = (List)listProp.get(); + return itemList.contains("Box"); +} + + private Boolean supplyBoolean8() { + ListProperty listProp = this.pESPFilter; + return listProp.contains("China Hat"); +} + + private Boolean supplyBoolean9() { + ListProperty listProp = this.pESPFilter; + List itemList = (List)listProp.get(); + return itemList.contains("Box"); +} + + private Boolean supplyBoolean10() { + boolean flag; + label21: { + label23: { + ListProperty listProp = this.pESPFilter; + List itemList = (List)listProp.get(); + flag = itemList.contains("Health"); + if (!flag) { + break label23; + } + + StringProperty strProp = this.pESPHealthColorMode; + flag = strProp.get().equals("Gradient"); + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private void handleRender3DEvent(Render3DEvent event) { + net.minecraft.entity.player.EntityPlayer player2; + HUD hudMod = ModuleRegistry.HUD.getModule(); + Chams chams = ModuleRegistry.CHAMS.getModule(); + ColorProperty colorProp = chams.getColorPropertyF(); + Color awtColor = colorProp.getAwtColor(); + int color = awtColor.getRGB(); + List itemList = this.getListValue5(); + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + EntityPlayer player3; + player3 = (EntityPlayer)iter.next(); + RenderUtils.renderVisual10(); + GameSettings gameSettings2 = this.mc.gameSettings; + int intVal = gameSettings2.getThirdPersonView(); + if (intVal == 0) { + player2 = player3; + + if (player3 == this.mc.thePlayer) { + continue; + } + } + + GL11.glEnable(2929); + GlStateManager.disableCull(); + GL11.glDisable(3553); + intVal = 7425; + + GL11.glShadeModel(intVal); + Minecraft mcClient = this.mc; + double doubleVal = -mcClient.getRenderManager().renderPosX; + Minecraft mcClient2 = this.mc; + double doubleVal12 = -mcClient2.getRenderManager().renderPosY; + GL11.glTranslated(doubleVal, doubleVal12, -this.mc.getRenderManager().renderPosZ); + player2 = player3; + + double posX2 = RenderUtils.drawElement7(player2.posX, player3.lastTickPosX, event.getPartialTicks()); + double posY2 = RenderUtils.drawElement7(player3.posY, player3.lastTickPosY, event.getPartialTicks()) + player3.height; + double doubleVal2 = 0.1F; + posY2 += 0.1F; + doubleVal2 = player3.isSneaking() ? 0.2 : 0.0; + + double posY3 = posY2 - doubleVal2; + double posZ2 = RenderUtils.drawElement7(player3.posZ, player3.lastTickPosZ, event.getPartialTicks()); + float pitch = player3.rotationPitch; + GL11.glTranslated(posX2, posY3, posZ2); + GL11.glRotatef(player3.getRotationYawHead(), 0.0F, -1.0F, 0.0F); + GL11.glRotatef(pitch / 3.0F, 1.0F, 0.0F, 0.0F); + GL11.glTranslated(0.0, 0.0, pitch / 270.0F); + GL11.glEnable(2848); + GL11.glLineWidth(1.0F); + GL11.glBegin(2); + long longVal = 0L; + byte byteVal = 1; + byte byteVal2 = 0; + + while (true) { + if (byteVal2 <= 360) { + Color awtColor2 = new Color(ColorTheme.getHudColor(longVal)); + int intVal2 = awtColor2.getRed(); + int intVal4 = awtColor2.getGreen(); + Color awtColor3 = new Color(intVal2, intVal4, awtColor2.getBlue(), 255); + RenderUtils.computeIntArray(awtColor3); + DoubleProperty doubleProp = this.hatSize; + Double propDouble = doubleProp.get(); + double doubleVal3 = propDouble; + double doubleVal4 = byteVal2 * Math.PI / 180.0; + double angleRad = doubleVal3 * Math.cos(doubleVal4); + DoubleProperty doubleProp2 = this.hatSize; + Double propDouble2 = doubleProp2.get(); + double doubleVal5 = propDouble2; + double doubleVal6 = byteVal2 * Math.PI / 180.0; + double angleRad3 = doubleVal5 * Math.sin(doubleVal6); + GL11.glVertex3d(angleRad, 0.0, angleRad3); + byteVal2 += byteVal; + + continue; + } + + GL11.glEnd(); + GL11.glDisable(2848); + GL11.glBegin(5); + break; + } + + byte byteVal3 = 0; + + while (true) { + if (byteVal3 <= 360) { + Color awtColor4 = new Color(ColorTheme.getHudColor(longVal)); + int intVal3 = awtColor4.getRed(); + int intVal5 = awtColor4.getGreen(); + int intVal6 = awtColor4.getBlue(); + Integer intVal7 = this.hatAlpha.get(); + Color awtColor5 = new Color(intVal3, intVal5, intVal6, intVal7); + RenderUtils.computeIntArray(awtColor5); + DoubleProperty doubleProp3 = this.hatSize; + Double propDouble3 = doubleProp3.get(); + double doubleVal7 = propDouble3; + double doubleVal8 = byteVal3 * Math.PI / 180.0; + double angleRad2 = doubleVal7 * Math.cos(doubleVal8); + DoubleProperty doubleProp4 = this.hatSize; + Double propDouble4 = doubleProp4.get(); + double doubleVal9 = propDouble4; + double doubleVal10 = byteVal3 * Math.PI / 180.0; + double angleRad4 = doubleVal9 * Math.sin(doubleVal10); + GL11.glVertex3d(angleRad2, 0.0, angleRad4); + GL11.glVertex3d(0.0, 0.3F, 0.0); + longVal -= 20L; + byteVal3 += byteVal; + + continue; + } + + GL11.glEnd(); + Minecraft mcClient3 = this.mc; + double doubleVal11 = mcClient3.getRenderManager().renderPosX; + Minecraft mcClient4 = this.mc; + double doubleVal13 = mcClient4.getRenderManager().renderPosY; + Minecraft mcClient5 = this.mc; + GL11.glTranslated(doubleVal11, doubleVal13, mcClient5.getRenderManager().renderPosZ); + GL11.glShadeModel(7424); + GlStateManager.enableCull(); + GL11.glDisable(2929); + RenderUtils.renderVisual9(); + break; + } + + } +} + + @EventTarget + public void onRender2D(Render2DEvent event) { + cc.novoline.modules.visual.PlayerESP playerESP; + GL11.glPushMatrix(); + long longVal = 0L; + List itemList2 = this.getListValue5(); + Iterator iter = itemList2.iterator(); + + while (true) { + if (iter.hasNext()) { + Object obj = iter.next(); + + EntityPlayer player; + Vector4d vector4d; + label171: + while (true) { + player = (EntityPlayer)obj; + double posX2 = RenderUtils.drawElement7(player.posX, player.lastTickPosX, event.getPartialTicks()); + double posY2 = RenderUtils.drawElement7(player.posY, player.lastTickPosY, event.getPartialTicks()); + double posZ2 = RenderUtils.drawElement7(player.posZ, player.lastTickPosZ, event.getPartialTicks()); + double doubleVal = player.width / 1.5F; + double doubleVal2 = player.height + 0.3; + AxisAlignedBB boundingBox = new AxisAlignedBB(posX2 - doubleVal, posY2, posZ2 - doubleVal, posX2 + doubleVal, posY2 + doubleVal2, posZ2 + doubleVal); + Vector3d[] vector3dArr = new Vector3d[]{ + new Vector3d(boundingBox.minX, boundingBox.minY, boundingBox.minZ), + new Vector3d(boundingBox.minX, boundingBox.maxY, boundingBox.minZ), + new Vector3d(boundingBox.maxX, boundingBox.minY, boundingBox.minZ), + new Vector3d(boundingBox.maxX, boundingBox.maxY, boundingBox.minZ), + new Vector3d(boundingBox.minX, boundingBox.minY, boundingBox.maxZ), + new Vector3d(boundingBox.minX, boundingBox.maxY, boundingBox.maxZ), + new Vector3d(boundingBox.maxX, boundingBox.minY, boundingBox.maxZ), + new Vector3d(boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ) + }; + List itemList = Arrays.asList(vector3dArr); + this.mc.entityRenderer.renderStep(event.getPartialTicks(), 0); + vector4d = null; + + Iterator iter2 = itemList.iterator(); + + while (true) { + if (!iter2.hasNext()) { + break label171; + } + + Vector3d vector3d = (Vector3d)iter2.next(); + ScaledResolution scaledRes = event.getResolution(); + double doubleVal15 = vector3d.x; + Minecraft mcClient = this.mc; + doubleVal15 -= mcClient.getRenderManager().viewerPosX; + double doubleVal3 = vector3d.y; + Minecraft mcClient2 = this.mc; + double doubleVal16 = doubleVal3 - mcClient2.getRenderManager().viewerPosY; + double doubleVal4 = vector3d.z; + Minecraft mcClient3 = this.mc; + vector3d = this.applyUpdate5(scaledRes, doubleVal15, doubleVal16, doubleVal4 - mcClient3.getRenderManager().viewerPosZ); + obj = vector3d; + + label183: { + + if (vector3d == null) { + break label183; + } + + obj = vector3d; + + + if (((Vector3d)obj).z < 0.0) { + break label183; + } + + if (vector3d.z < 1.0) { + Vector4d vector4d2 = vector4d; + if (vector4d == null) { + vector4d = new Vector4d(vector3d.x, vector3d.y, vector3d.z, 0.0); + } + + double doubleVal5 = vector3d.x; + doubleVal15 = vector4d.x; + vector4d.x = Math.min(doubleVal5, doubleVal15); + double doubleVal6 = vector3d.y; + doubleVal15 = vector4d.y; + vector4d.y = Math.min(doubleVal6, doubleVal15); + double doubleVal7 = vector3d.x; + doubleVal15 = vector4d.z; + vector4d.z = Math.max(doubleVal7, doubleVal15); + vector4d2 = vector4d; + + double doubleVal8 = vector3d.y; + doubleVal15 = vector4d.w; + vector4d2.w = Math.max(doubleVal8, doubleVal15); + } + } + + } + } + + this.mc.entityRenderer.renderStep7(); + + label146: + if (vector4d != null) { + float floatVal4; + float floatVal5; + float floatVal6; + float floatVal7; + float floatVal; + float floatVal8; + label144: { + label143: { + label142: { + floatVal = (float)vector4d.x; + floatVal8 = (float)vector4d.y; + floatVal4 = (float)vector4d.z; + floatVal5 = (float)vector4d.w; + float floatVal2 = floatVal5 - floatVal8; + floatVal6 = Math.abs(floatVal2); + float floatVal3 = (float)(floatVal8 - floatVal5 + 0.5); + floatVal7 = 1.0F; + + switch (this.mc.gameSettings.guiScale) { + case 0: + floatVal7 = 0.5F; + break; + case 1: + break label142; + case 2: + default: + break label144; + case 3: + break label143; + } + + + + break label144; + + } + + floatVal7 = 2.0F; + + break label144; + + } + + floatVal7 = 0.6666667F; + } + + double doubleVal9 = floatVal; + double doubleVal17 = floatVal8; + double[] doubleArr = MovementUtils.scaleCoords(doubleVal9, doubleVal17); + double doubleVal10 = floatVal4; + double doubleVal18 = floatVal5; + double[] doubleArr2 = MovementUtils.scaleCoords(doubleVal10, doubleVal18); + double[] doubleArr3 = new double[]{doubleArr[0] * 2.0, doubleArr[1] * 2.0, doubleArr2[0] * 2.0, doubleArr2[1] * 2.0}; + ListProperty listProp = this.pESPFilter; + boolean flag2 = listProp.contains("Name"); + if (flag2) { + this.applyUpdate5(floatVal7, doubleArr3, player, longVal); + } + + ListProperty listProp2 = this.pESPFilter; + flag2 = listProp2.contains("Box"); + + label127: + if (flag2) { + StringProperty strProp = this.pESPBox_color_mode; + flag2 = strProp.equals("Static"); + if (flag2) { + PlayerESP playerESP2 = this; + + StringProperty strProp2 = this.pESPBox_style; + if (strProp2.equals("Corner")) { + double doubleVal11 = floatVal; + double doubleVal19 = floatVal8; + double doubleVal20 = floatVal4; + double doubleVal21 = floatVal5; + boolean flag = this.pESPBox_mode.equals("Bordered"); + ColorProperty colorProp = this.pESPBoxColor; + Integer color = colorProp.getColorInt(); + int intVal = color; + RenderUtils.drawElement2(doubleVal11, doubleVal19, doubleVal20, doubleVal21, 2.0F, true, flag, intVal); + break label127; + } + + playerESP2 = this; + + + ColorProperty colorProp2 = this.pESPBoxColor; + Color awtColor2 = colorProp2.getAwtColor(); + StringProperty strProp3 = this.pESPBox_mode; + playerESP2.drawElement5(floatVal, floatVal8, floatVal4, floatVal5, awtColor2, strProp3.equals("Bordered")); + break label127; + } + + StringProperty strProp4 = this.pESPBox_color_mode; + flag2 = strProp4.equals("Team"); + + if (flag2) { + double doubleVal12 = floatVal; + double doubleVal22 = floatVal8; + double doubleVal23 = floatVal4; + double doubleVal24 = floatVal5; + StringProperty strProp5 = this.pESPBox_style; + boolean flag3 = strProp5.equals("Corner"); + StringProperty strProp6 = this.pESPBox_mode; + boolean flag4 = strProp6.equals("Bordered"); + Color awtColor = ColorPaletteUtil.checkNetworkPlayerInfo(player); + int color2 = awtColor.getRGB(); + RenderUtils.drawElement2(doubleVal12, doubleVal22, doubleVal23, doubleVal24, 2.0F, flag3, flag4, color2); + break label127; + } + + StringProperty strProp7 = this.pESPBox_color_mode; + flag2 = strProp7.equals("Synced"); + + label108: + if (flag2) { + StringProperty strProp8 = this.pESPBoxColorState; + if (strProp8.equals("Static")) { + double doubleVal13 = floatVal; + double doubleVal25 = floatVal8; + double doubleVal26 = floatVal4; + double doubleVal27 = floatVal5; + StringProperty strProp9 = this.pESPBox_style; + boolean flag5 = strProp9.equals("Corner"); + StringProperty strProp10 = this.pESPBox_mode; + boolean flag6 = strProp10.equals("Bordered"); + int color3 = ColorTheme.getHudColor(longVal); + RenderUtils.drawElement2(doubleVal13, doubleVal25, doubleVal26, doubleVal27, 2.0F, flag5, flag6, color3); + break label108; + } + + double doubleVal14 = floatVal; + double doubleVal28 = floatVal8; + double doubleVal29 = floatVal4; + double doubleVal30 = floatVal5; + StringProperty strProp11 = this.pESPBox_style; + boolean flag7 = strProp11.equals("Corner"); + StringProperty strProp12 = this.pESPBox_mode; + boolean flag8 = strProp12.equals("Bordered"); + RenderUtils.drawElement5(doubleVal14, doubleVal28, doubleVal29, doubleVal30, 2.0F, flag7, flag8); + } + } + + ListProperty listProp3 = this.pESPFilter; + flag2 = listProp3.contains("Health"); + + if (flag2) { + this.drawElement5(floatVal, floatVal8, floatVal5, floatVal6, floatVal7, player); + } + + ListProperty listProp4 = this.pESPFilter; + flag2 = listProp4.contains("Armor"); + + if (flag2) { + this.renderElement(doubleArr3, floatVal7, player); + } + + playerESP = this; + + ListProperty listProp5 = this.pESPFilter; + flag2 = listProp5.contains("Held Item"); + + if (!flag2) { + break label146; + } + + playerESP = this; + + playerESP.applyUpdate4(doubleArr3, floatVal7, player); + } + + longVal -= 360L; + + + continue; + } + + GameSettings gameSettings2 = this.mc.gameSettings; + this.cachedValue = gameSettings2.getThirdPersonView(); + GL11.glPopMatrix(); + return; + } +} + + + private Boolean supplyBoolean11() { + boolean flag; + label21: { + label23: { + ListProperty listProp = this.pESPFilter; + List itemList = (List)listProp.get(); + flag = itemList.contains("Name"); + if (!flag) { + break label23; + } + + StringProperty strProp = this.pESPNameColorType; + flag = strProp.get().equals("Static"); + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private Boolean supplyBoolean12() { + ListProperty listProp = this.pESPFilter; + List itemList = (List)listProp.get(); + return itemList.contains("Name"); +} + + private void applyUpdate5(float value, double[] doubleArray, EntityPlayer player, long time) { + int intVal; + int len; + cc.novoline.modules.visual.PlayerESP playerESP; + float floatVal2; + double doubleVal; + int color; + label160: { + floatVal2 = 0.5F * value; + GL11.glScalef(floatVal2, floatVal2, floatVal2); + double doubleVal2 = doubleArray[2] - doubleArray[0]; + doubleVal = Math.abs(doubleVal2); + Color awtColor = this.accentColor; + color = awtColor.getRGB(); + Novoline novolineInst = this.novoline; + PlayerManager playerManager = novolineInst.getPlayerManager(); + String nameStr = player.getName(); + int intVal2 = (playerManager.checkString(nameStr.toLowerCase(), PlayerRelationType.TARGET) ? 1 : 0); + if (intVal2 != 0) { + Color awtColor2 = this.colorField2; + color = awtColor2.getRGB(); + break label160; + } + + Novoline novolineInst2 = this.novoline; + PlayerManager playerManager2 = novolineInst2.getPlayerManager(); + nameStr = player.getName(); + intVal2 = (playerManager2.checkString(nameStr.toLowerCase(), PlayerRelationType.FRIEND) ? 1 : 0); + + if (intVal2 != 0) { + Color awtColor3 = this.colorField; + color = awtColor3.getRGB(); + break label160; + } + + StringProperty strProp = this.pESPNameColorType; + nameStr = "Team"; + intVal2 = (strProp.equals(nameStr) ? 1 : 0); + + if (intVal2 != 0) { + Color awtColor4 = ColorPaletteUtil.checkNetworkPlayerInfo(player); + color = awtColor4.getRGB(); + break label160; + } + + StringProperty strProp2 = this.pESPNameColorType; + nameStr = "Static"; + intVal2 = (strProp2.equals(nameStr) ? 1 : 0); + + if (intVal2 != 0) { + ColorProperty colorProp = this.pESPNameColor; + Color awtColor5 = colorProp.getAwtColor(); + color = awtColor5.getRGB(); + break label160; + } + + StringProperty strProp3 = this.pESPNameColorType; + nameStr = "Synced"; + intVal2 = (strProp3.equals(nameStr) ? 1 : 0); + + + if (intVal2 == 0) { + break label160; + } + + intVal2 = ColorTheme.getHudColor(time); + + + color = intVal2; + } + + StringBuilder sb = new StringBuilder(player.getName()); + Novoline novolineInst3 = Novoline.getInstance(); + int intVal3 = (novolineInst3.isStateFlag2() ? 1 : 0); + byte byteVal; + if (intVal3 != 0) { + List itemList = this.stringList; + Iterator iter = itemList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + String textStr = (String)iter.next(); + String[] stringArr = textStr.split(":"); + String[] stringArr2 = stringArr; + + len = stringArr.length; + byteVal = 1; + + if (len <= 1) { + continue; + } + + stringArr2 = stringArr; + + + String textStr2 = stringArr2[0]; + String textStr3 = stringArr[1]; + if (player.getName().equals(textStr3)) { + StringBuilder sb2 = sb.append(" \u00a77(\u00a7b"); + StringBuilder sb3 = sb2.append(textStr2); + sb3.append("\u00a77)\u00a7r"); + } + } + } + + len = this.getIntValue5(); + byteVal = 2; + + intVal3 = len * byteVal; + + double doubleVal4; + double doubleVal5; + int intVal4; + int intVal5; + float floatVal; + float floatVal3; + double doubleVal3; + double doubleVal6; + floatVal = (float)intVal3 - this.getIntValue5() / 2; + floatVal3 = (float)(doubleArray[0] + doubleVal / 2.0 - this.computeIntValue2(sb.toString()) / 2); + doubleVal3 = floatVal3 - 2.0F; + doubleVal6 = (float)doubleArray[1] - floatVal - 2.0F; + doubleVal4 = floatVal3 + this.computeIntValue2(sb.toString()) + 1.0F; + doubleVal5 = doubleArray[1] - floatVal + this.getIntValue5() + 1.0; + intVal4 = this.mc.displayWidth / 2; + intVal5 = this.mc.displayHeight / 2; + intVal = this.mc.gameSettings.guiScale; + + if (this.mc.gameSettings.guiScale == 3) { + Minecraft mcClient = this.mc; + intVal = (mcClient.isFullScreen() ? 1 : 0); + + if (intVal == 0) { + intVal4 = (int)(intVal4 * 1.5); + intVal5 = (int)(intVal5 * 1.5); + } + } + + HypixelLobbyType lobbyType = HypixelLobbyType.UHC; + intVal = (ServerUtils.serverIs(lobbyType) ? 1 : 0); + + if (intVal != 0) { + if (doubleArray[0] < intVal4) { + if (doubleArray[2] > intVal4) { + if (doubleArray[1] < intVal5) { + label88: + if (doubleArray[3] > intVal5) { + String textStr4 = "Click for Teleport"; + int intVal6 = this.computeIntValue2(textStr4); + int intVal7 = this.computeIntValue2(sb.toString()); + PlayerESP playerESP2 = this; + + StringBuilder sb4 = new StringBuilder().append(textStr4); + String textStr6 = ""; + this.applyUpdate5(sb4.append(textStr6).toString(), floatVal3 + (intVal7 - intVal6) / 2, (float)(doubleArray[1] - floatVal - 12.0), 16777215); + if (Mouse.isButtonDown(2)) { + intVal = (this.stateFlag ? 1 : 0); + + if (this.stateFlag) { + break label88; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + sb4 = new StringBuilder(); + sb4 = sb4.append(".tp "); + textStr6 = player.getName(); + String textStr5 = sb4.append(textStr6).toString(); + player2.sendChatMessage(textStr5); + this.stateFlag = true; + break label88; + } + + playerESP2 = this; + + + playerESP2.stateFlag = false; + } + } + } + } + } + + playerESP = this; + + IntProperty intProp = this.bgTransparency; + Integer intVal8 = intProp.get(); + intVal = intVal8; + + if (intVal < 255) { + Integer intVal9 = this.bgTransparency.get(); + int color2 = (new Color(0, 0, 0, 255 - intVal9)).getRGB(); + RenderUtils.drawRect(doubleVal3, doubleVal6, doubleVal4, doubleVal5, color2); + } + + playerESP = this; + + playerESP.applyUpdate5(sb.toString(), floatVal3, (float)doubleArray[1] - floatVal, color); + GL11.glScaled(1.0F / floatVal2, 1.0F / floatVal2, 1.0F / floatVal2); +} + + private void applyUpdate5(String text, double value, double amount, int index) { + boolean flag = this.font.equals("Client"); + if (flag) { + FontFamily fontFam = FontFamilyPOSTERAMA.FAMILY; + FontRenderer font2 = fontFam.ofSize(25); + font2.drawElement5(text, value, amount, index, 1.5F); + return; + } + + net.minecraft.client.gui.FontRenderer font3 = this.mc.crackFontRenderer; + float floatVal = (float)value; + float floatVal2 = (float)amount; + font3.resolveInt(text, floatVal, floatVal2, index, true); +} + + private void renderElement(double[] doubleArray, float value, EntityPlayer player) { + boolean flag; + label80: { + flag = HUD.Q(); + ItemStack stack = player.inventory.armorInventory[0]; + + if (stack != null) { + break label80; + } + + stack = player.inventory.armorInventory[1]; + + + + if (stack != null) { + break label80; + } + + stack = player.inventory.armorInventory[2]; + + + + if (stack != null) { + break label80; + } + + stack = player.inventory.armorInventory[3]; + + + if (stack == null) { + return; + } + } + + float floatVal = 0.0F; + if (this.mc.theWorld != null) { + RenderUtilsSupport.enableGUIStandardItemLighting(); + } + + ArrayList itemList = new ArrayList(); + ItemStack[] stackArr = player.inventory.armorInventory; + int len = stackArr.length; + int intVal = 0; + + while (intVal < len) { + ItemStack stack2 = stackArr[intVal]; + + + if (stack2 != null) { + itemList.add(stack2); + } + + intVal++; + + + } + + Collections.reverse(itemList); + GlStateManager.disableAlpha(); + GlStateManager.clear(256); + GlStateManager.enableBlend(); + Minecraft mcClient = this.mc; + mcClient.getRenderItem().zLevel = -150.0F; + GL11.glScalef(0.5F * value, 0.5F * value, 0.5F * value); + + Iterator iter = itemList.iterator(); + + do { + if (!iter.hasNext()) { + break; + } + + ItemStack stack3 = (ItemStack)iter.next(); + Minecraft mcClient2 = this.mc; + RenderItem renderItem = mcClient2.getRenderItem(); + float floatVal3 = (float)doubleArray[2] + 2.0F; + float floatVal4 = (float)doubleArray[1] + floatVal; + EntityPlayerSP player2 = this.mc.thePlayer; + floatVal4 -= player2.getDistanceToEntity(player) * 0.053F; + renderItem.updateState3(stack3, floatVal3, floatVal4); + double doubleVal = floatVal; + double doubleVal2 = doubleArray[3] - doubleArray[1]; + floatVal = (float)(doubleVal + Math.abs(doubleVal2) / 4.0); + + } while (!flag); + + GlStateManager.disableDepth(); + GlStateManager.disableLighting(); + GlStateManager.enableDepth(); + float floatVal2 = 1.0F / (0.5F * value); + float floatVal5 = 1.0F / (0.5F * value); + float floatVal6 = 1.0F / (0.5F * value); + GL11.glScalef(floatVal2, floatVal5, floatVal6); + Minecraft mcClient3 = this.mc; + mcClient3.getRenderItem().zLevel = 0.0F; + GlStateManager.enableBlend(); + + GlStateManager.enableAlpha(); +} + + @EventTarget + public void handleUpdateModelEvent(UpdateModelEvent event) { + ListProperty listProp = this.pESPFilter; + List itemList = (List)listProp.get(); + if (itemList.contains("Skeleton")) { + ModelBendsPlayerBase modelBendsPlayerBase = event.getModelBendsPlayerBase(); + this.weakHashMapArray + .put( + (EntityPlayer)event.getTrackedEntity4(), + new float[][]{ + {modelBendsPlayerBase.bipedHead.rotateAngleX, modelBendsPlayerBase.bipedHead.rotateAngleY, modelBendsPlayerBase.bipedHead.floatState2}, + {modelBendsPlayerBase.bipedRightArm.rotateAngleX, modelBendsPlayerBase.bipedRightArm.rotateAngleY, modelBendsPlayerBase.bipedRightArm.floatState2}, + {modelBendsPlayerBase.bipedLeftArm.rotateAngleX, modelBendsPlayerBase.bipedLeftArm.rotateAngleY, modelBendsPlayerBase.bipedLeftArm.floatState2}, + {modelBendsPlayerBase.bipedRightLeg.rotateAngleX, modelBendsPlayerBase.bipedRightLeg.rotateAngleY, modelBendsPlayerBase.bipedRightLeg.floatState2}, + {modelBendsPlayerBase.bipedLeftLeg.rotateAngleX, modelBendsPlayerBase.bipedLeftLeg.rotateAngleY, modelBendsPlayerBase.bipedLeftLeg.floatState2} + } + ); + } +} + + + private Boolean supplyBoolean13() { + boolean flag; + label21: { + label23: { + ListProperty listProp = this.pESPFilter; + List itemList = (List)listProp.get(); + flag = itemList.contains("Box"); + if (!flag) { + break label23; + } + + StringProperty strProp = this.pESPBox_color_mode; + flag = strProp.equals("Team"); + + if (!flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + private int getIntValue5() { + PlayerESP playerESP = this; + + StringProperty strProp = this.font; + if (strProp.equals("Client")) { + FontFamily fontFam = FontFamilyPOSTERAMA.FAMILY; + return fontFam.ofSize(25).obtainFontRenderer(); + } + + playerESP = this; + + + return playerESP.mc.crackFontRenderer.getFontHeight(); +} + + public ColorProperty getPESPBoxColor() { + return this.pESPBoxColor; +} + + public ColorProperty getColorProperty() { + return this.getPESPBoxColor(); +} + + private Boolean supplyBoolean14() { + ListProperty listProp = this.pESPFilter; + List itemList = (List)listProp.get(); + return itemList.contains("Box"); +} + + private Vector3d applyUpdate5(ScaledResolution scaledResolution, double value, double amount, double offset) { + GL11.glGetFloat(2982, this.floatBufferField2); + GL11.glGetFloat(2983, this.floatBufferField3); + GL11.glGetInteger(2978, this.intBufferField); + if (GLU.gluProject((float)value, (float)amount, (float)offset, this.floatBufferField2, this.floatBufferField3, this.intBufferField, this.floatBufferField)) { + float floatVal = this.floatBufferField.get(0); + double doubleVal = floatVal / scaledResolution.getScaleFactor(); + float floatVal2 = Display.getHeight(); + FloatBuffer floatBuffer = this.floatBufferField; + floatVal2 -= floatBuffer.get(1); + double doubleVal2 = floatVal2 / scaledResolution.getScaleFactor(); + floatBuffer = this.floatBufferField; + return new Vector3d(doubleVal, doubleVal2, floatBuffer.get(2)); + } else { + return null; + } +} + + private boolean matchesEntityPlayer(EntityPlayer player) { + List itemList = this.mc.theWorld.obtainList4(); + boolean flag = itemList.contains(player); + flag = !flag; + + return flag; +} + + + private Boolean supplyBoolean15() { + ListProperty listProp = this.pESPFilter; + List itemList = (List)listProp.get(); + return itemList.contains("Health"); +} + + private void renderVisual4(boolean flag) { + label27: { + short shortVal = (short)(flag ? 1 : 0); + + if (flag != false) { + GL11.glDisable(2848); + GL11.glDisable(2929); + GL11.glDisable(3553); + + break label27; + + } + + GL11.glEnable(3553); + shortVal = 2929; + + + GL11.glEnable(shortVal); + } + + byte byteVal = (byte)(flag ? 1 : 0); + + byteVal = (byte)(flag == false ? 1 : 0); + + + GL11.glDepthMask(byteVal != 0); +} + + private Boolean supplyBoolean16() { + boolean flag; + label21: { + label23: { + ListProperty listProp = this.pESPFilter; + List itemList = (List)listProp.get(); + flag = itemList.contains("Health"); + if (!flag) { + break label23; + } + + StringProperty strProp = this.pESPHealthColorMode; + flag = strProp.get().equals("Gradient"); + + if (flag) { + flag = true; + break label21; + } + } + + flag = false; + } + + return flag; +} + + public PlayerESP(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.accentColor = new Color(255, 255, 255); + this.accentColor2 = new Color(0, 0, 0, 100); + this.stateTicks = 0; + this.timer = new TimerUtil(); + this.weakHashMapArray = new WeakHashMap<>(); + this.intBufferField = GLAllocation.createDirectIntBuffer(16); + this.floatBufferField2 = GLAllocation.createDirectFloatBuffer(16); + this.floatBufferField3 = GLAllocation.createDirectFloatBuffer(16); + this.floatBufferField = GLAllocation.createDirectFloatBuffer(4); + ListProperty listProp = ListProperty.of("Health"); + String[] stringArr = new String[]{"Health", "Armor", "Box", "Name", "Skeleton", "Held Item", "China Hat"}; + this.pESPFilter = listProp.acceptableValues((Object[])stringArr); + this.pESPHurtTime = BooleanProperty.of(false); + Integer intVal = -7697665; + this.pESPBoxColor = ColorProperty.e(intVal); + Color awtColor = new Color(245, 255, 94); + int color = awtColor.getRGB(); + Integer intVal2 = color; + this.pESPNameColor = ColorProperty.e(intVal2); + Color awtColor2 = new Color(18, 255, 93); + int color2 = awtColor2.getRGB(); + Integer intVal3 = color2; + this.pESPHColor1 = ColorProperty.e(intVal3); + Color awtColor3 = new Color(241, 42, 42); + int color3 = awtColor3.getRGB(); + Integer intVal4 = color3; + this.pESPHColor2 = ColorProperty.e(intVal4); + StringProperty strProp = StringProperty.of("Bordered"); + String[] stringArr2 = new String[]{"Basic", "Bordered"}; + this.pESPBox_mode = strProp.acceptableValues(stringArr2); + StringProperty strProp2 = StringProperty.of("Static"); + String[] stringArr3 = new String[]{"Team", "Static", "Synced"}; + this.pESPBox_color_mode = strProp2.acceptableValues(stringArr3); + StringProperty strProp3 = StringProperty.of("Static"); + String[] stringArr4 = new String[]{"Static", "Dynamic"}; + this.pESPBoxColorState = strProp3.acceptableValues(stringArr4); + StringProperty strProp4 = StringProperty.of("Full"); + String[] stringArr5 = new String[]{"Full", "Corner"}; + this.pESPBox_style = strProp4.acceptableValues(stringArr5); + StringProperty strProp5 = StringProperty.of("Hearts"); + String[] stringArr6 = new String[]{"Hearts", "HP", "Percentage"}; + this.pESPHealthMode = strProp5.acceptableValues(stringArr6); + StringProperty strProp6 = StringProperty.of("HP Based"); + String[] stringArr7 = new String[]{"HP Based", "Gradient"}; + this.pESPHealthColorMode = strProp6.acceptableValues(stringArr7); + StringProperty strProp7 = StringProperty.of("Absolute"); + String[] stringArr8 = new String[]{"Absolute", "Relative"}; + this.pESPHealthGradientLength = strProp7.acceptableValues(stringArr8); + StringProperty strProp8 = StringProperty.of("Team"); + String[] stringArr9 = new String[]{"Team", "Static", "Synced"}; + this.pESPNameColorType = strProp8.acceptableValues(stringArr9); + this.pESPOnlyTargets = BooleanProperty.of(false); + this.bgTransparency = IntProperty.of(100).minimum(0).maximum(255); + this.hatAlpha = IntProperty.of(150).minimum(50).maximum(255); + this.hatSize = DoubleProperty.of(0.6).minimum(0.6).maximum(2.0); + StringProperty strProp9 = StringProperty.of("Vanilla"); + String[] stringArr10 = new String[]{"Vanilla", "Client"}; + this.font = strProp9.acceptableValues(stringArr10); + GameSettings gameSettings2 = this.mc.gameSettings; + this.cachedValue = gameSettings2.getThirdPersonView(); + Setting setting = new Setting("PESP_FILTER", "Filter", SettingType.SELECTBOX, this, this.pESPFilter); + SettingManager.register(setting); + Setting setting2 = new Setting("PESP_FONT", "Font", SettingType.COMBOBOX, this, this.font, this::lambdaImpl$new$0); + SettingManager.register(setting2); + Setting setting3 = new Setting("PESP_HAT_ALPHA", "Hat Alpha", SettingType.SLIDER, this, this.hatAlpha, 5.0, this::supplyBoolean2); + SettingManager.register(setting3); + Setting setting4 = new Setting("PESP_HAT_SIZE", "Hat Size", SettingType.SLIDER, this, this.hatSize, 0.1, this::supplyBoolean8); + SettingManager.register(setting4); + Setting setting5 = new Setting("HEALTH_DISPLAY_MODE", "Health", SettingType.COMBOBOX, this, this.pESPHealthMode, this::supplyBoolean3); + SettingManager.register(setting5); + Setting setting6 = new Setting("HEALTH_COLOR_MODE", "Health Color", SettingType.COMBOBOX, this, this.pESPHealthColorMode, this::supplyBoolean15); + SettingManager.register(setting6); + Setting setting7 = new Setting("HEALTH_GRADIENT_LENGTH", "Gradient Length", SettingType.COMBOBOX, this, this.pESPHealthGradientLength, this::supplyBoolean4); + SettingManager.register(setting7); + Setting setting8 = new Setting("HEALTH_COLOR_ONE", "Color One", SettingType.COLOR_PICKER, this, this.pESPHColor1, null, this::supplyBoolean10); + SettingManager.register(setting8); + Setting setting9 = new Setting("HEALTH_COLOR_TWO", "Color Two", SettingType.COLOR_PICKER, this, this.pESPHColor2, null, this::supplyBoolean16); + SettingManager.register(setting9); + Setting setting10 = new Setting("BOX_MODE", "Box mode", SettingType.COMBOBOX, this, this.pESPBox_mode, this::supplyBoolean7); + SettingManager.register(setting10); + Setting setting11 = new Setting("BOX_MODE", "Box Style", SettingType.COMBOBOX, this, this.pESPBox_style, this::supplyBoolean14); + SettingManager.register(setting11); + Setting setting12 = new Setting("BOX_COLOR_MODE", "Box Color", SettingType.COMBOBOX, this, this.pESPBox_color_mode, this::supplyBoolean17); + SettingManager.register(setting12); + Setting setting13 = new Setting("BOX_COLOR_STATE", "Box Color State", SettingType.COMBOBOX, this, this.pESPBoxColorState, this::supplyBoolean); + SettingManager.register(setting13); + Setting setting14 = new Setting("BOX_COLOR", "Color", SettingType.COLOR_PICKER, this, this.pESPBoxColor, null, this::supplyBoolean13); + SettingManager.register(setting14); + Setting setting15 = new Setting("PESP-ONLYTARGETS", "Targets Only", SettingType.CHECKBOX, this, this.pESPOnlyTargets); + SettingManager.register(setting15); + Setting setting16 = new Setting("PESP-HT", "HurtTime Check", SettingType.CHECKBOX, this, this.pESPHurtTime, this::supplyBoolean9); + SettingManager.register(setting16); + Setting setting17 = new Setting("PEST-TRANSPARENCY", "Transparency", SettingType.SLIDER, this, this.bgTransparency, 5.0, this::supplyBoolean6); + SettingManager.register(setting17); + Setting setting18 = new Setting("NAME_COLOR_MODE", "Name Color", SettingType.COMBOBOX, this, this.pESPNameColorType, this::supplyBoolean12); + SettingManager.register(setting18); + Setting setting19 = new Setting("NAME_COLOR", "Color", SettingType.COLOR_PICKER, this, this.pESPNameColor, null, this::supplyBoolean11); + SettingManager.register(setting19); +} + + public static double applyUpdate4(double x, double y, double z) { + return y + (x - y) * z; +} + + private Boolean supplyBoolean17() { + ListProperty listProp = this.pESPFilter; + List itemList = (List)listProp.get(); + return itemList.contains("Box"); +} + + private void drawElement5(float value, float amount, float factor, float angle, Color color, boolean flag) { + float floatVal = factor - value; + float floatVal2 = angle - amount; + RoundedBorderShader roundedBorderShader = RoundedBorderShader.getRoundedBorderShader(); + double doubleVal = value; + double doubleVal2 = amount; + double doubleVal3 = floatVal; + double doubleVal4 = floatVal2; + Color awtColor = new Color(0, 0, 0, 0); + PlayerESPHelper.executeRoundedBorderShader(roundedBorderShader, doubleVal, doubleVal2, doubleVal3, doubleVal4, 0.0, 0.0, 4.0, awtColor, new Color(0, 0, 0, color.getAlpha()), true); + PlayerESPHelper.executeRoundedBorderShader(RoundedBorderShader.getRoundedBorderShader(), value + 0.5F, amount + 0.5F, floatVal - 1.0F, floatVal2 - 1.0F, 0.0, 0.0, 2.0, new Color(0, 0, 0, 0), color, true); +} + + +} diff --git a/src/main/java/cc/novoline/modules/visual/PlayerESPHelper.java b/src/main/java/cc/novoline/modules/visual/PlayerESPHelper.java new file mode 100644 index 0000000..42226af --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/PlayerESPHelper.java @@ -0,0 +1,27 @@ +package cc.novoline.modules.visual; + + +import cc.novoline.utils.shader.RoundedBorderShader; +import java.awt.Color; + +public class PlayerESPHelper { + public static RoundedBorderShader getRoundedBorderShader() { + return RoundedBorderShader.getRoundedBorderShader(); +} + + public static void executeRoundedBorderShader( + RoundedBorderShader roundedBorderShader, + double value, + double amount, + double offset, + double dist, + double value2, + double value3, + double value4, + Color color, + Color color2, + boolean flag + ) { + roundedBorderShader.applyUpdate(value, amount, offset, dist, value2, value3, value4, color, color2, flag); +} +} diff --git a/src/main/java/cc/novoline/modules/visual/Projectiles.java b/src/main/java/cc/novoline/modules/visual/Projectiles.java new file mode 100644 index 0000000..d57544b --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/Projectiles.java @@ -0,0 +1,403 @@ +package cc.novoline.modules.visual; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.RenderUtils; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render3DEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import java.awt.Color; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import net.minecraft.entity.EntityIEntityHelper; +import net.minecraft.item.ItemFishingRod; +import net.minecraft.item.ItemEgg; +import net.minecraft.item.ItemSnowball; +import net.minecraft.item.ItemEnderPearl; +import cc.novoline.modules.ModuleManager; +import net.minecraft.util.MathHelper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.entity.Entity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBow; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.BlockPos; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import org.lwjgl.opengl.GL11; + +public class Projectiles extends AbstractModule { + private static final long XOR_KEY = 94488180910478L; + @Property("color") + private final ColorProperty color; + @Property("color-mode") + private final StringProperty colorMode; + + + @EventTarget + public void onRender3D(Render3DEvent event) { + boolean flag; + Item item; + label197: { + boolean flag2; + flag2 = HUD.Q(); + ItemStack stack = this.mc.thePlayer.getHeldItem(); + item = stack.getItem(); + flag = flag2; + EntityPlayerSP player = this.mc.thePlayer; + flag2 = player.isConditionMet78(); + label192: + if (!flag) { + if (flag2) { + flag2 = item instanceof ItemBow; + if (flag) { + break label192; + } + + if (flag2) { + break label197; + } + } + + flag2 = item instanceof ItemSnowball; + } + + if (!flag) { + if (flag2) { + break label197; + } + + flag2 = item instanceof ItemEnderPearl; + } + + if (!flag) { + if (flag2) { + break label197; + } + + flag2 = item instanceof ItemEgg; + } + + if (!flag) { + if (flag2) { + break label197; + } + + flag2 = item instanceof ItemFishingRod; + } + + if (!flag2) { + return; + } + } + + float floatVal; + float floatVal2; + float floatVal3; + float floatVal4; + label198: { + floatVal = 1.5F; + floatVal2 = 0.99F; + floatVal3 = 0.05F; + floatVal4 = 0.3F; + boolean flag3 = item instanceof ItemFishingRod; + if (!flag) { + if (flag3) { + floatVal3 = 0.04F; + floatVal4 = 0.25F; + floatVal2 = 0.92F; + break label198; + } + + flag3 = item instanceof ItemBow; + } + + if (!flag) { + if (flag3) { + EntityPlayerSP player2 = this.mc.thePlayer; + int intVal = 72000 - player2.computeInt4(); + float floatVal5 = intVal / 20.0F; + float floatVal15 = floatVal5 * 2.0F; + floatVal = Math.min(3.0F, floatVal15); + break label198; + } + + flag3 = item instanceof ItemSnowball; + } + + label199: { + if (!flag) { + if (flag3) { + break label199; + } + + flag3 = item instanceof ItemEnderPearl; + } + + if (!flag) { + if (flag3) { + break label199; + } + + flag3 = item instanceof ItemEgg; + } + + if (!flag3) { + break label198; + } + } + + floatVal3 = 0.03F; + floatVal4 = 0.25F; + } + + boolean flag4 = false; + + double posX2 = this.mc.thePlayer.prevPosX + (this.mc.thePlayer.posX - this.mc.thePlayer.prevPosX) * event.getPartialTicks(); + double posY2 = this.mc.thePlayer.prevPosY + (this.mc.thePlayer.posY - this.mc.thePlayer.prevPosY) * event.getPartialTicks(); + EntityPlayerSP player3 = this.mc.thePlayer; + double posY3 = posY2 + player3.getEyeHeight(); + double posZ2 = this.mc.thePlayer.prevPosZ + (this.mc.thePlayer.posZ - this.mc.thePlayer.prevPosZ) * event.getPartialTicks(); + float yaw = this.mc.thePlayer.prevRotationYaw + (this.mc.thePlayer.rotationYaw - this.mc.thePlayer.prevRotationYaw) * event.getPartialTicks(); + float pitch = this.mc.thePlayer.prevRotationPitch + (this.mc.thePlayer.rotationPitch - this.mc.thePlayer.prevRotationPitch) * event.getPartialTicks(); + float floatVal6 = yaw / 180.0F * (float) Math.PI; + float floatVal7 = -MathHelper.sin(floatVal6); + float floatVal8 = pitch / 180.0F * (float) Math.PI; + double doubleVal = floatVal7 * MathHelper.cos(floatVal8); + float floatVal9 = yaw / 180.0F * (float) Math.PI; + float floatVal10 = MathHelper.cos(floatVal9); + float floatVal11 = pitch / 180.0F * (float) Math.PI; + double doubleVal2 = floatVal10 * MathHelper.cos(floatVal11); + float floatVal12 = pitch / 180.0F * (float) Math.PI; + double doubleVal3 = -MathHelper.sin(floatVal12); + double doubleVal4 = doubleVal; + double doubleVal5 = doubleVal3; + double doubleVal6 = doubleVal2; + posY2 = doubleVal4 * doubleVal4 + doubleVal5 * doubleVal5 + doubleVal6 * doubleVal6; + float floatVal13 = MathHelper.sqrt_double(posY2); + doubleVal4 /= floatVal13; + doubleVal5 /= floatVal13; + doubleVal6 /= floatVal13; + doubleVal4 *= floatVal; + doubleVal5 *= floatVal; + doubleVal6 *= floatVal; + double doubleVal7 = doubleVal4; + double doubleVal11 = doubleVal5; + double doubleVal12 = doubleVal6; + ArrayList itemList = new ArrayList(); + posY2 = this.mc.thePlayer.rotationYaw + 90.0F; + posY2 = Math.toRadians(posY2); + double angleRad = -Math.sin(posY2) * 2.0; + posY2 = this.mc.thePlayer.rotationYaw + 90.0F; + posY2 = Math.toRadians(posY2); + double angleRad2 = Math.cos(posY2) * 2.0; + Vec3 vec = new Vec3(posX2 + angleRad, posY3 - 1.0, posZ2 + angleRad2); + itemList.add(vec); + Color awtColor = new Color(255, 255, 255, 170); + int intVal2 = 0; + + label134: + while (intVal2 < 300) { + Vec3 vec2 = new Vec3(posX2, posY3, posZ2); + Vec3 vec6 = new Vec3(posX2 + doubleVal7, posY3 + doubleVal11, posZ2 + doubleVal12); + WorldClient world = this.mc.theWorld; + MovingObjectPosition rayTrace = world.rayTraceBlocks(vec2, vec6, false, true, false); + vec2 = new Vec3(posX2, posY3, posZ2); + Vec3 vec7 = new Vec3(posX2 + doubleVal7, posY3 + doubleVal11, posZ2 + doubleVal12); + + label131: { + MovingObjectPosition rayTrace2 = rayTrace; + if (rayTrace == null) { + break label131; + } + + vec7 = new Vec3(rayTrace.hitVec.xCoord, rayTrace.hitVec.yCoord, rayTrace.hitVec.zCoord); + rayTrace2 = rayTrace; + + BlockPos pos = rayTrace2.getBlockPos(); + Color awtColor2 = this.resolveColor(); + int color2 = awtColor2.getRGB(); + RenderUtils.createVector4d(pos, color2); + if (!flag) { + break; + } + } + + Entity entity = null; + WorldClient world2 = this.mc.theWorld; + player3 = this.mc.thePlayer; + AxisAlignedBB boundingBox3 = new AxisAlignedBB(posX2 - floatVal4, posY3 - floatVal4, posZ2 - floatVal4, posX2 + floatVal4, posY3 + floatVal4, posZ2 + floatVal4); + boundingBox3 = boundingBox3.addCoord(doubleVal7, doubleVal11, doubleVal12); + boundingBox3 = boundingBox3.expand(1.0, 1.0, 1.0); + List itemList2 = world2.evaluateCondition(player3, boundingBox3); + double doubleVal8 = 0.0; + Iterator iter = itemList2.iterator(); + + while (true) { + if (iter.hasNext()) { + Entity entity2 = (Entity)iter.next(); + boolean flag5 = entity2.canBeCollidedWith(); + if (flag) { + break; + } + + if (flag5) { + float floatVal14 = 0.3F; + AxisAlignedBB boundingBox = entity2.getAxisAlignedBB(); + double doubleVal9 = floatVal14; + double doubleVal13 = floatVal14; + double doubleVal14 = floatVal14; + AxisAlignedBB boundingBox2 = boundingBox.expand(doubleVal9, doubleVal13, doubleVal14); + MovingObjectPosition rayTrace3 = boundingBox2.calculateIntercept(vec2, vec7); + label109: + if (rayTrace3 != null) { + Vec3 vec3 = rayTrace3.hitVec; + double dist = vec2.squareDistanceTo(vec3); + posY2 = dist; + label117: + if (!flag) { + if (!(dist < doubleVal8)) { + posY2 = doubleVal8; + if (flag) { + break label117; + } + + if (doubleVal8 != 0.0) { + break label109; + } + } + + entity = entity2; + posY2 = dist; + } + + doubleVal8 = posY2; + } + } + + continue; + } + + label204: { + Entity entity3 = entity; + if (entity == null) { + break label204; + } + + new MovingObjectPosition(entity); + entity3 = entity; + + boolean flag6 = entity3 instanceof EntityIEntityHelper; + if (!flag) { + if (!flag6) { + Color awtColor3 = this.resolveColor(); + int color3 = awtColor3.getRGB(); + RenderUtils.drawElement12(entity, color3); + } + + boolean flag7 = true; + } + + awtColor = new Color(0, 255, 3, 255); + if (!flag) { + break label134; + } + } + + posX2 += doubleVal7; + posY3 += doubleVal11; + posZ2 += doubleVal12; + yaw = (float)(MathHelper.atan2(doubleVal7, doubleVal12) * 180.0 / Math.PI); + doubleVal7 *= floatVal2; + doubleVal3 = doubleVal11 * floatVal2; + doubleVal12 *= floatVal2; + doubleVal11 = doubleVal3 - floatVal3; + Vec3 vec4 = new Vec3(posX2, posY3, posZ2); + itemList.add(vec4); + break; + } + + intVal2++; + if (flag) { + break; + } + } + + boolean flag8 = this.mc.gameSettings.viewBobbing; + this.mc.gameSettings.viewBobbing = false; + this.mc.entityRenderer.renderStep(this.mc.timer.renderPartialTicks, 2); + this.mc.gameSettings.viewBobbing = flag8; + RenderUtils.renderVisual10(); + GL11.glLineWidth(2.0F); + RenderUtils.glColor(awtColor); + GL11.glBegin(3); + + Iterator iter2 = itemList.iterator(); + + while (true) { + if (!iter2.hasNext()) { + break; + } + + Vec3 vec5 = (Vec3)iter2.next(); + posY2 = vec5.getX(); + Minecraft mcClient = this.mc; + double doubleVal10 = posY2 - mcClient.getRenderManager().renderPosX; + posY2 = vec5.getY(); + Minecraft mcClient2 = this.mc; + double posY4 = posY2 - mcClient2.getRenderManager().renderPosY; + posY2 = vec5.getZ(); + Minecraft mcClient3 = this.mc; + double posY5 = posY2 - mcClient3.getRenderManager().renderPosZ; + GL11.glVertex3d(doubleVal10, posY4, posY5); + + } + + GL11.glEnd(); + + RenderUtils.renderVisual9(); +} + + public Projectiles(ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + StringProperty strProp = StringProperty.of("Client"); + String[] stringArr = new String[]{"Client", "Custom"}; + this.colorMode = strProp.acceptableValues(stringArr); + Color awtColor = new Color(200, 200, 200); + int color2 = awtColor.getRGB(); + Integer intVal = color2; + this.color = ColorProperty.e(intVal); + Setting setting = new Setting("PROJECTILES_COLOR_MODE", "Color Mode", SettingType.COMBOBOX, this, this.colorMode); + SettingManager.register(setting); + setting = new Setting("PROJECTILES_COLOR", "Color", SettingType.COLOR_PICKER, this, this.color, null, () -> this.colorMode.equals("Custom")); + SettingManager.register(setting); +} + + private Color resolveColor() { + Projectiles projectiles = this; + + StringProperty strProp = this.colorMode; + if (!strProp.equals("Custom")) { + return new Color(ColorTheme.getHudColor(0L)); + } + + projectiles = this; + + + ColorProperty colorProp = projectiles.color; + return colorProp.getAwtColor(); +} + + +} diff --git a/src/main/java/cc/novoline/modules/visual/Radar.java b/src/main/java/cc/novoline/modules/visual/Radar.java new file mode 100644 index 0000000..66188ba --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/Radar.java @@ -0,0 +1,698 @@ +package cc.novoline.modules.visual; + +import cc.novoline.events.type.GuiState; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.MovementUtils; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.StencilUtil; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.render.RotationAngleUtil; +import cc.novoline.utils.shader.RoundedTextureShader; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.events.events.RenderGuiEvent; +import cc.novoline.events.events.ShaderEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Toolkit; +import java.util.Iterator; +import java.util.List; +import java.util.function.Predicate; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.util.MathHelper; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.entity.player.EntityPlayer; +import org.lwjgl.opengl.GL11; + +public final class Radar extends AbstractModule { + @Property("background-smoothness") + private IntProperty backgroundSmoothness; + @Property("radar-scale") + private DoubleProperty radarScale; + @Property("radar-alpha") + private IntProperty radarAlpha; + @Property("hide-on-debug") + private BooleanProperty hideOnDebug; + int intValueField; + @Property("radar-y-position") + private final IntProperty radarYPosition; + @Property("radar-background") + private StringProperty radarBackground; + @Property("blur") + private BooleanProperty blur; + boolean flagValue; + int intValueField2; + @Property("radar-x-position") + private final IntProperty radarXPosition; + private final Dimension dimensionField; + private int stateTicks; + @Property("radar-size") + private DoubleProperty radarSize; + private int stateTicks2; + @Property("background-roundness") + private DoubleProperty backgroundRoundness; + + @EventTarget + public void onRenderGui(RenderGuiEvent event) { + int intVal; + int intVal16; + cc.novoline.events.events.RenderGuiEvent renderGuiEvent; + int intVal17 = (event.getGuiScreen() instanceof GuiChat ? 1 : 0); + if (intVal17 == 0) { + return; + } + + Boolean propFlag = this.hideOnDebug.get(); + intVal17 = (this.matchesFlag(propFlag) ? 1 : 0); + + if (intVal17 == 0) { + return; + } + + intVal17 = event.getMouseX(); + intVal17 = MovementUtils.evaluateDouble(intVal17); + + int intVal18 = intVal17; + intVal17 = event.getMouseY(); + int intVal19 = MovementUtils.scaleYInt(intVal17); + IntProperty intProp = this.radarXPosition; + Integer intVal2 = intProp.get(); + int intVal3 = intVal2; + IntProperty intProp2 = this.radarYPosition; + intVal2 = intProp2.get(); + int intVal20 = intVal2; + GuiState guiState = event.getState(); + GuiState guiState2 = GuiState.CLICK; + if (guiState == GuiState.CLICK) { + int intVal4 = (this.checkInt3(intVal3, intVal20, intVal18, intVal19) ? 1 : 0); + + if (intVal4 == 0) { + return; + } + + intVal4 = event.getMouseButton(); + + + if (intVal4 != 0) { + return; + } + + this.intValueField = intVal3 - intVal18; + this.intValueField2 = intVal20 - intVal19; + this.flagValue = true; + return; + } + + guiState = event.getState(); + guiState2 = GuiState.RENDER; + + if (guiState == guiState2) { + int intVal5 = (this.flagValue ? 1 : 0); + + if (this.flagValue) { + IntProperty intProp3 = this.radarXPosition; + int intVal6 = this.intValueField + intVal18; + IntProperty intProp4 = this.radarXPosition; + Integer intVal7 = intProp4.getMinimum(); + int intVal21 = intVal7; + IntProperty intProp5 = this.radarXPosition; + Integer intVal8 = intProp5.getMaximum(); + int intVal22 = intVal8; + int intVal9 = MathHelper.clamp_int(intVal6, intVal21, intVal22); + Integer intVal10 = intVal9; + intProp3.set(intVal10); + IntProperty intProp6 = this.radarYPosition; + int intVal11 = this.intValueField2 + intVal19; + intProp4 = this.radarYPosition; + Integer intVal12 = intProp4.getMinimum(); + int intVal23 = intVal12; + intProp5 = this.radarYPosition; + Integer intVal13 = intProp5.getMaximum(); + int intVal24 = intVal13; + int intVal14 = MathHelper.clamp_int(intVal11, intVal23, intVal24); + Integer intVal15 = intVal14; + intProp6.set(intVal15); + } + + intVal5 = (this.checkInt3(intVal3, intVal20, intVal18, intVal19) ? 1 : 0); + + + if (intVal5 == 0) { + return; + } + + GL11.glPushMatrix(); + MovementUtils.evaluateDouble(true); + ColorTheme colorTheme = ColorTheme.BLACK; + int color = colorTheme.getRGB(); + intVal5 = ColorTheme.reAlpha(color, 100); + + int intVal25; + double doubleVal2; + double doubleVal3; + double doubleVal4; + label62: { + intVal25 = intVal5; + intVal = intVal3; + intVal16 = intVal20; + DoubleProperty doubleProp = this.radarSize; + Double propDouble = doubleProp.get(); + doubleVal2 = propDouble; + DoubleProperty doubleProp2 = this.radarSize; + Double propDouble2 = doubleProp2.get(); + doubleVal3 = propDouble2; + Object obj = this.radarBackground; + if (((StringProperty)obj).equals("Basic")) { + DoubleProperty doubleProp3 = this.backgroundRoundness; + Double propDouble3 = doubleProp3.get(); + doubleVal4 = propDouble3 / 2.0; + break label62; + } + + DoubleProperty doubleProp4 = this.radarSize; + obj = doubleProp4.get(); + + Double doubleVal = (Double)obj; + doubleVal4 = doubleVal / 2.0; + } + + int color2 = ColorTheme.WHITE.getRGB(); + RenderUtils.drawBorderedRoundedRect(intVal, intVal16, doubleVal2, doubleVal3, doubleVal4, 2.5F, intVal25, color2); + GL11.glPopMatrix(); + return; + } + + renderGuiEvent = event; + + guiState = event.getState(); + guiState2 = GuiState.RELEASE; + + if (guiState != guiState2) { + return; + } + + renderGuiEvent = event; + + if (renderGuiEvent.getStateTicks3() == 0) { + this.flagValue = false; + } +} + + public void handleRender2DEvent(Render2DEvent event) { + double doubleVal; + double doubleVal5; + label17: { + Color awtColor; + label16: { + Integer intVal = this.radarXPosition.get(); + doubleVal = intVal.intValue(); + IntProperty intProp = this.radarYPosition; + Integer intVal2 = intProp.get(); + doubleVal5 = intVal2.intValue(); + Integer intVal5 = this.radarAlpha.get(); + awtColor = new Color(0, 0, 0, intVal5); + StringProperty strProp = this.radarBackground; + if (!strProp.equals("Basic")) { + break label16; + } + + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + Double propDouble = this.radarSize.get(); + double doubleVal6 = propDouble; + Double propDouble2 = this.radarSize.get(); + double doubleVal7 = propDouble2; + DoubleProperty doubleProp = this.backgroundRoundness; + Double propDouble3 = doubleProp.get(); + double doubleVal8 = propDouble3; + Integer intVal3 = this.backgroundSmoothness.get(); + double doubleVal9 = intVal3.intValue(); + roundedTextureShader.drawRoundedRect(doubleVal, doubleVal5, doubleVal6, doubleVal7, doubleVal8, doubleVal9, awtColor, true); + + break label17; + } + + RoundedTextureShader roundedTextureShader2 = RoundedTextureShader.getInstance(); + Double propDouble4 = this.radarSize.get(); + double doubleVal2 = doubleVal + propDouble4 / 2.0; + DoubleProperty doubleProp2 = this.radarSize; + Double propDouble5 = doubleProp2.get(); + double doubleVal10 = doubleVal5 + propDouble5 / 2.0; + doubleProp2 = this.radarSize; + Double propDouble6 = doubleProp2.get(); + double doubleVal11 = propDouble6; + IntProperty intProp2 = this.backgroundSmoothness; + Integer intVal4 = intProp2.get(); + double doubleVal12 = intVal4.intValue(); + roundedTextureShader2.handleDouble(doubleVal2, doubleVal10, doubleVal11, doubleVal12, awtColor, true); + } + + int color = ColorTheme.getHudColor(0L); + double doubleVal3 = 4.25; + DoubleProperty doubleProp3 = this.radarSize; + Double propDouble7 = doubleProp3.get(); + double doubleVal4 = doubleVal + propDouble7 / 2.0 - 0.25; + DoubleProperty doubleProp4 = this.radarSize; + Double propDouble8 = doubleProp4.get(); + double doubleVal13 = doubleVal5 + propDouble8 / 2.0 - doubleVal3; + DoubleProperty doubleProp5 = this.radarSize; + Double propDouble9 = doubleProp5.get(); + double doubleVal14 = doubleVal + propDouble9 / 2.0 + 0.25; + DoubleProperty doubleProp6 = this.radarSize; + Double propDouble10 = doubleProp6.get(); + double doubleVal15 = (float)(doubleVal5 + propDouble10 / 2.0 + doubleVal3); + RenderUtils.drawRect(doubleVal4, doubleVal13, doubleVal14, doubleVal15, color); + doubleProp3 = this.radarSize; + Double propDouble11 = doubleProp3.get(); + doubleVal4 = doubleVal + propDouble11 / 2.0 - doubleVal3; + doubleProp4 = this.radarSize; + Double propDouble12 = doubleProp4.get(); + double doubleVal16 = doubleVal5 + propDouble12 / 2.0 - 0.25; + doubleProp5 = this.radarSize; + Double propDouble13 = doubleProp5.get(); + double doubleVal17 = doubleVal + propDouble13 / 2.0 + doubleVal3; + doubleProp6 = this.radarSize; + Double propDouble14 = doubleProp6.get(); + double doubleVal18 = doubleVal5 + propDouble14 / 2.0 + 0.25; + RenderUtils.drawRect(doubleVal4, doubleVal16, doubleVal17, doubleVal18, color); + StencilUtil.initStencilToWrite(false); + doubleProp4 = this.radarSize; + Double propDouble15 = doubleProp4.get(); + double doubleVal19 = propDouble15; + doubleProp5 = this.radarSize; + Double propDouble16 = doubleProp5.get(); + double doubleVal20 = propDouble16; + doubleProp6 = this.backgroundRoundness; + Double propDouble17 = doubleProp6.get(); + double doubleVal21 = propDouble17 / 2.0; + ColorTheme colorTheme = ColorTheme.BLACK; + int color2 = colorTheme.getRGB(); + RenderUtils.drawRoundedRect(doubleVal, doubleVal5, doubleVal19, doubleVal20, doubleVal21, color2); + StencilUtil.readStencilBuffer(true); + this.handleInt(color); + StencilUtil.uninitStencilBuffer(); +} + + private boolean matchesFlag(boolean flag) { + boolean flag2 = flag; + + if (flag) { + + if (this.mc.gameSettings.showDebugInfo) { + return false; + } + } + + flag2 = true; + + + return flag2; +} + + + private void handleInt(int value) { + int intVal5 = (HUD.H() ? 1 : 0); + List itemList = this.mc.theWorld.getPlayerEntities(); + Stream stream2 = itemList.stream(); + Predicate predicate = this::matchesEntityPlayer; + Stream stream3 = stream2.filter(predicate); + Collector collector = Collectors.toList(); + List itemList2 = (java.util.List) stream3.collect(collector); + Iterator iter = itemList2.iterator(); + boolean flag = (intVal5 != 0); + + do { + if (!iter.hasNext()) { + break; + } + + double angleRad; + double doubleVal; + label116: { + double angleRad2; + double angleRad3; + double doubleVal2; + EntityPlayer player2 = (EntityPlayer)iter.next(); + float floatVal = RotationAngleUtil.evaluateFloat(player2.posX, player2.posZ); + float yaw = -(floatVal - this.mc.thePlayer.rotationYaw + 180.0F); + double doubleVal3 = yaw; + angleRad = Math.toRadians(doubleVal3); + double posX2 = this.mc.thePlayer.posX - player2.posX; + double doubleVal4 = Math.abs(posX2); + double posZ2 = this.mc.thePlayer.posZ - player2.posZ; + double doubleVal5 = Math.abs(posZ2); + double doubleVal6 = doubleVal4 * doubleVal4 + doubleVal5 * doubleVal5; + double dist = Math.sqrt(doubleVal6); + DoubleProperty doubleProp = this.radarScale; + Double propDouble = doubleProp.get(); + doubleVal = dist / propDouble; + angleRad2 = Math.sin(angleRad); + angleRad3 = Math.cos(angleRad); + DoubleProperty doubleProp2 = this.radarSize; + Double propDouble2 = doubleProp2.get(); + doubleVal2 = propDouble2 * 1.05; + double doubleVal7; + intVal5 = (doubleVal7 = angleRad2 - 0.0) == 0.0 ? 0 : (doubleVal7 < 0.0 ? -1 : 1); + label106: + if (flag) { + if (intVal5 > 0) { + double doubleVal8; + intVal5 = (doubleVal8 = angleRad3 - 0.0) == 0.0 ? 0 : (doubleVal8 < 0.0 ? -1 : 1); + if (!flag) { + break label106; + } + + if (intVal5 < 0) { + double doubleVal9; + intVal5 = (doubleVal9 = angleRad2 * doubleVal - doubleVal2 / 2.0) == 0.0 ? 0 : (doubleVal9 < 0.0 ? -1 : 1); + if (!flag) { + break label106; + } + + if (intVal5 < 0) { + double doubleVal10; + intVal5 = (doubleVal10 = -angleRad3 * doubleVal - doubleVal2 / 2.0) == 0.0 ? 0 : (doubleVal10 < 0.0 ? -1 : 1); + if (!flag) { + break label106; + } + + if (intVal5 < 0) { + break label116; + } + } + } + } + + double doubleVal11; + intVal5 = (doubleVal11 = angleRad2 - 0.0) == 0.0 ? 0 : (doubleVal11 < 0.0 ? -1 : 1); + } + + label91: + if (flag) { + if (intVal5 < 0) { + double doubleVal12; + intVal5 = (doubleVal12 = angleRad3 - 0.0) == 0.0 ? 0 : (doubleVal12 < 0.0 ? -1 : 1); + if (!flag) { + break label91; + } + + if (intVal5 < 0) { + double doubleVal13; + intVal5 = (doubleVal13 = -angleRad2 * doubleVal - doubleVal2 / 2.0) == 0.0 ? 0 : (doubleVal13 < 0.0 ? -1 : 1); + if (!flag) { + break label91; + } + + if (intVal5 < 0) { + double doubleVal14; + intVal5 = (doubleVal14 = -angleRad3 * doubleVal - doubleVal2 / 2.0) == 0.0 ? 0 : (doubleVal14 < 0.0 ? -1 : 1); + if (!flag) { + break label91; + } + + if (intVal5 < 0) { + break label116; + } + } + } + } + + double doubleVal15; + intVal5 = (doubleVal15 = angleRad2 - 0.0) == 0.0 ? 0 : (doubleVal15 < 0.0 ? -1 : 1); + } + + label76: + if (flag) { + if (intVal5 > 0) { + double doubleVal16; + intVal5 = (doubleVal16 = angleRad3 - 0.0) == 0.0 ? 0 : (doubleVal16 < 0.0 ? -1 : 1); + if (!flag) { + break label76; + } + + if (intVal5 > 0) { + double doubleVal17; + intVal5 = (doubleVal17 = angleRad2 * doubleVal - doubleVal2 / 2.0) == 0.0 ? 0 : (doubleVal17 < 0.0 ? -1 : 1); + if (!flag) { + break label76; + } + + if (intVal5 < 0) { + double doubleVal18; + intVal5 = (doubleVal18 = angleRad3 * doubleVal - doubleVal2 / 2.0) == 0.0 ? 0 : (doubleVal18 < 0.0 ? -1 : 1); + if (!flag) { + break label76; + } + + if (intVal5 < 0) { + break label116; + } + } + } + } + + double doubleVal19; + intVal5 = (doubleVal19 = angleRad2 - 0.0) == 0.0 ? 0 : (doubleVal19 < 0.0 ? -1 : 1); + } + + if (flag) { + if (intVal5 >= 0) { + continue; + } + + double doubleVal20; + intVal5 = (doubleVal20 = angleRad3 - 0.0) == 0.0 ? 0 : (doubleVal20 < 0.0 ? -1 : 1); + } + + if (flag) { + if (intVal5 <= 0) { + continue; + } + + double doubleVal21; + intVal5 = (doubleVal21 = -angleRad2 * doubleVal - doubleVal2 / 2.0) == 0.0 ? 0 : (doubleVal21 < 0.0 ? -1 : 1); + } + + if (flag) { + if (intVal5 >= 0) { + continue; + } + + double doubleVal22; + intVal5 = (doubleVal22 = angleRad3 * doubleVal - doubleVal2 / 2.0) == 0.0 ? 0 : (doubleVal22 < 0.0 ? -1 : 1); + } + + if (intVal5 >= 0) { + continue; + } + } + + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + IntProperty intProp = this.radarXPosition; + Integer intVal = intProp.get(); + double doubleVal23 = intVal.intValue(); + double angleRad4 = doubleVal23 + Math.sin(angleRad) * doubleVal - 1.0; + DoubleProperty doubleProp3 = this.radarSize; + Double propDouble3 = doubleProp3.get(); + double doubleVal24 = angleRad4 + propDouble3 / 2.0; + IntProperty intProp2 = this.radarYPosition; + Integer intVal2 = intProp2.get(); + double doubleVal25 = intVal2.intValue(); + double angleRad5 = doubleVal25 + Math.cos(angleRad) * doubleVal - 1.0; + Double propDouble4 = this.radarSize.get(); + double doubleVal26 = angleRad5 + propDouble4 / 2.0; + Integer intVal3 = this.backgroundSmoothness.get(); + double doubleVal27 = 1.5 + 1.5 * (1.0 - 0.0625 * intVal3.intValue()); + Integer intVal4 = this.backgroundSmoothness.get(); + double doubleVal28 = 0.1875 * intVal4.intValue(); + Color awtColor = new Color(value); + roundedTextureShader.handleDouble(doubleVal24, doubleVal26, doubleVal27, doubleVal28, awtColor, true); + } while (flag); +} + + private boolean checkInt3(int value, int index, int count, int amount) { + double doubleVal = this.buildDoubleArray2(value, index)[2]; + double doubleVal2 = this.buildDoubleArray2(value, index)[3]; + int intVal = count; + if (count < value) { + return false; + } + + if (count >= doubleVal) { + return false; + } + + intVal = amount; + + if (intVal < index) { + return false; + } + + return amount < doubleVal2; +} + + + private boolean matchesEntityPlayer(EntityPlayer player) { + EntityPlayer player2 = player; + + if (player == this.mc.thePlayer) { + return false; + } + + player2 = player; + + + return player2 != null; +} + + public Radar(ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + this.dimensionField = Toolkit.getDefaultToolkit().getScreenSize(); + this.stateTicks = (int)(this.dimensionField.getWidth() / 2.0); + this.stateTicks2 = (int)(this.dimensionField.getHeight() / 2.0); + DoubleProperty doubleProp = DoubleProperty.of(0.85); + Double doubleVal = 0.25; + DoubleProperty doubleProp2 = doubleProp.minimum(doubleVal); + this.radarScale = doubleProp2.maximum(5.0); + DoubleProperty doubleProp3 = DoubleProperty.of(120.0); + DoubleProperty doubleProp4 = doubleProp3.minimum(50.0); + this.radarSize = doubleProp4.maximum(200.0); + this.radarAlpha = IntProperty.of(120).minimum(100).maximum(200); + StringProperty strProp = StringProperty.of("Circle"); + String[] stringArr = new String[]{"Basic", "Circle"}; + this.radarBackground = strProp.acceptableValues(stringArr); + this.blur = BooleanProperty.of(false); + this.hideOnDebug = BooleanProperty.of(false); + DoubleProperty doubleProp5 = DoubleProperty.of(12.0); + DoubleProperty doubleProp6 = doubleProp5.minimum(0.0); + this.backgroundRoundness = doubleProp6.maximum(48.0); + this.backgroundSmoothness = IntProperty.of(1).minimum(0).maximum(16); + IntProperty intProp6 = IntProperty.of(5).minimum(1); + int ticks = this.stateTicks; + Integer intVal = ticks; + this.radarXPosition = intProp6.maximum(intVal); + IntProperty intProp8 = IntProperty.of(152).minimum(1); + int ticks2 = this.stateTicks2; + Integer intVal2 = ticks2; + this.radarYPosition = intProp8.maximum(intVal2); + Setting setting = new Setting("RADAR_SIZE", "Size", SettingType.SLIDER, this, this.radarSize, 5.0); + SettingManager.register(setting); + setting = new Setting("RADAR_SCALE", "Scale", SettingType.SLIDER, this, this.radarScale, 0.05); + SettingManager.register(setting); + setting = new Setting("RADAR_BACKGROUND", "Background", SettingType.COMBOBOX, this, this.radarBackground); + SettingManager.register(setting); + setting = new Setting("RADAR_ALPHA", "Alpha", SettingType.SLIDER, this, this.radarAlpha, 5.0); + SettingManager.register(setting); + setting = new Setting("RADAR_ROUNDNESS", "Roundness", SettingType.SLIDER, this, this.backgroundRoundness, 1.0, () -> this.radarBackground.equals("Basic")); + SettingManager.register(setting); + setting = new Setting("RADAR_SMOOTHNESS", "Smoothness", SettingType.SLIDER, this, this.backgroundSmoothness, 1.0); + SettingManager.register(setting); + setting = new Setting("RADAR_BLUR", "Blur", SettingType.CHECKBOX, this, this.blur); + SettingManager.register(setting); + setting = new Setting("RADAR_HIDE_ON_DEBUG", "F3 Hide", SettingType.CHECKBOX, this, this.hideOnDebug); + SettingManager.register(setting); +} + + private double[] buildDoubleArray2(int value, int index) { + double doubleVal2 = value; + DoubleProperty doubleProp = this.radarSize; + Double propDouble = doubleProp.get(); + double doubleVal3 = doubleVal2 + propDouble; + doubleVal2 = index; + doubleProp = this.radarSize; + Double propDouble2 = doubleProp.get(); + double doubleVal = doubleVal2 + propDouble2; + return new double[]{value, index, doubleVal3, doubleVal}; +} + + + @EventTarget + public void onRender2D(Render2DEvent event) { + Boolean propFlag = this.hideOnDebug.get(); + boolean flag = this.matchesFlag(propFlag); + + if (!flag) { + return; + } + + flag = true; + + + double doubleVal = MovementUtils.evaluateDouble(flag); + this.handleRender2DEvent(event); + MovementUtils.unscale(doubleVal); +} + + @EventTarget + public void onShader(ShaderEvent event) { + Boolean propFlag = this.blur.get(); + boolean flag2 = propFlag; + if (!flag2) { + return; + } + + Boolean propFlag2 = this.hideOnDebug.get(); + flag2 = this.matchesFlag(propFlag2); + + + if (!flag2) { + return; + } + + flag2 = true; + + + double doubleVal; + double doubleVal2; + double doubleVal4; + double doubleVal5; + double doubleVal6; + double doubleVal7; + label21: { + doubleVal = MovementUtils.evaluateDouble(flag2); + IntProperty intProp = this.radarXPosition; + Integer intVal = intProp.get(); + doubleVal2 = intVal.intValue(); + IntProperty intProp2 = this.radarYPosition; + Integer intVal2 = intProp2.get(); + doubleVal4 = intVal2.intValue(); + Double propDouble = this.radarSize.get(); + doubleVal5 = propDouble; + Double propDouble2 = this.radarSize.get(); + doubleVal6 = propDouble2; + Object obj = this.radarBackground; + if (((StringProperty)obj).equals("Basic")) { + DoubleProperty doubleProp = this.backgroundRoundness; + Double propDouble3 = doubleProp.get(); + doubleVal7 = propDouble3 / 2.0; + break label21; + } + + DoubleProperty doubleProp2 = this.radarSize; + obj = doubleProp2.get(); + + Double doubleVal3 = (Double)obj; + doubleVal7 = doubleVal3 / 2.0; + } + + ColorTheme colorTheme = ColorTheme.BLACK; + int color = colorTheme.getRGB(); + RenderUtils.drawRoundedRect(doubleVal2, doubleVal4, doubleVal5, doubleVal6, doubleVal7, color); + MovementUtils.unscale(doubleVal); +} + + +} diff --git a/src/main/java/cc/novoline/modules/visual/Scoreboard.java b/src/main/java/cc/novoline/modules/visual/Scoreboard.java new file mode 100644 index 0000000..30b8a4b --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/Scoreboard.java @@ -0,0 +1,746 @@ +package cc.novoline.modules.visual; + +import cc.novoline.events.type.GuiState; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.MovementUtils; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.StringScrambler; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.shader.GaussianBlurShader; +import cc.novoline.utils.shader.RoundedTextureShader; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.events.events.RenderGuiEvent; +import cc.novoline.events.events.ShaderEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.FloatProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.viaversion.viaversion.libs.fastutil.objects.ObjectArrayList; +import cc.novoline.modules.ModuleRegistry; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Toolkit; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Optional; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.function.Supplier; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.gui.GuiChat; + +import net.minecraft.util.MathHelper; +import net.minecraft.client.gui.GuiIngame; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.ScorePlayerTeam; + +public class Scoreboard extends AbstractModule { + @Property("background-type") + private StringProperty backgroundType; + private boolean stateFlag; + @Property("outline-width") + private FloatProperty outlineWidth; + private double cachedValue; + @Property("pos-x") + private DoubleProperty posX; + @Property("glow-radius") + private IntProperty glowRadius; + @Property("smoothness") + private IntProperty smoothness; + private Dimension dimensionField; + @Property("font-size") + private IntProperty fontSize; + @Property("alpha") + private IntProperty alpha; + private double cachedValue2; + private Runnable runnableField; + private double cachedValue3; + @Property("glow-alpha") + private IntProperty glowAlpha; + @Property("roundess") + private IntProperty roundess; + @Property("padding") + private DoubleProperty padding; + private double cachedValue4; + @Property("pos-y") + private DoubleProperty posY; + @Property("shaders") + private ListProperty shaders; + private double cachedValue5; + private double cachedValue6; + + @EventTarget + public void onRender2D(Render2DEvent event) { + int intVal; + Scoreboard scoreboard = this; + + GuiIngame guiIngame = this.mc.ingameGUI; + if (guiIngame.obtainScoreObjective() == null) { + return; + } + + scoreboard = this; + + + GuiIngame guiIngame2 = this.mc.ingameGUI; + List itemList = scoreboard.resolveList2(guiIngame2.obtainScoreObjective()); + int size2 = itemList.size(); + + if (size2 < 2) { + return; + } + + size2 = 1; + + + double doubleVal = MovementUtils.evaluateDouble((size2 != 0)); + ModuleRegistry modEntry = ModuleRegistry.HUD; + HUD hudMod = modEntry.getModule(); + IntProperty intProp = this.fontSize; + Integer intVal2 = intProp.get(); + int intVal11 = intVal2; + DoubleProperty doubleProp = this.posX; + Double propDouble = doubleProp.get(); + double doubleVal7 = propDouble; + DoubleProperty doubleProp2 = this.posY; + Double propDouble2 = doubleProp2.get(); + double doubleVal8 = propDouble2; + double doubleVal2 = hudMod.applyUpdate2(intVal11); + Stream stream2 = itemList.stream(); + Comparator comparator = Comparator.comparing(((java.util.function.Function) ((value0) -> cc.novoline.modules.visual.Scoreboard.invokeCallback3(hudMod, intVal11, value0)))); + Optional optional = stream2.max(comparator); + String propStr = (String)optional.get(); + IntProperty intProp2 = this.alpha; + Integer intVal12 = intProp2.get(); + Color awtColor = new Color(0, 0, 0, intVal12); + StringProperty strProp = this.backgroundType; + String textStr2 = "Basic"; + double doubleVal3; + if (!strProp.equals(textStr2)) { + IntProperty intProp3 = this.roundess; + Integer intVal3 = intProp3.get(); + doubleVal3 = 0.08333333333333333 * intVal3.intValue(); + } else { + doubleVal3 = 0.0; + } + + double doubleVal4; + double doubleVal9; + double doubleVal10; + label124: { + doubleVal4 = 4.0 + doubleVal3; + String textStr = "www.novoline.lol"; + int width = hudMod.getHudStringWidth(intVal11, "www.novoline.lol"); + int width2 = hudMod.getHudStringWidth(intVal11, propStr); + this.cachedValue3 = Math.max(width, width2) + doubleVal4 * 2.0; + double doubleVal5 = itemList.size(); + DoubleProperty doubleProp3 = this.padding; + Double propDouble3 = doubleProp3.get(); + this.cachedValue5 = doubleVal5 * (doubleVal2 + propDouble3) + doubleVal4 * 2.0; + doubleVal7 -= this.cachedValue3; + doubleVal9 = doubleVal7; + doubleVal10 = doubleVal8; + StringProperty strProp2 = this.backgroundType; + intVal = (strProp2.equals("Bar") ? 1 : 0); + if (intVal != 0) { + double doubleVal11 = this.cachedValue3; + double doubleVal12 = this.cachedValue5; + int color = awtColor.getRGB(); + ListProperty listProp = this.shaders; + GaussianBlurShader gaussianBlurShader; + if (listProp.contains("Glow")) { + gaussianBlurShader = GaussianBlurShader.getGaussianBlurShader(); + } else { + gaussianBlurShader = null; + } + + IntProperty intProp4 = this.glowRadius; + Integer intVal4 = intProp4.get(); + int intVal13 = intVal4; + Integer intVal14 = this.glowAlpha.get(); + RenderUtils.drawElement8(doubleVal7, doubleVal8, doubleVal11, doubleVal12, color, 6, gaussianBlurShader, intVal13, intVal14); + break label124; + } + + StringProperty strProp3 = this.backgroundType; + intVal = (strProp3.equals("Basic") ? 1 : 0); + + if (intVal != 0) { + double doubleVal13 = this.cachedValue3; + double doubleVal14 = this.cachedValue5; + IntProperty intProp5 = this.roundess; + Integer intVal5 = intProp5.get(); + double doubleVal15 = intVal5.intValue(); + int color2 = awtColor.getRGB(); + RenderUtils.drawRoundedRect(doubleVal7, doubleVal8, doubleVal13, doubleVal14, doubleVal15, color2); + break label124; + } + + StringProperty strProp4 = this.backgroundType; + intVal = (strProp4.equals("Smooth") ? 1 : 0); + + if (intVal != 0) { + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal16 = this.cachedValue3; + double doubleVal17 = this.cachedValue5; + intProp2 = this.roundess; + Integer intVal6 = intProp2.get(); + double doubleVal18 = intVal6 * 2; + IntProperty intProp6 = this.smoothness; + Integer intVal7 = intProp6.get(); + double doubleVal19 = intVal7.intValue(); + roundedTextureShader.drawRoundedRect(doubleVal7, doubleVal8, doubleVal16, doubleVal17, doubleVal18, doubleVal19, awtColor, true); + break label124; + } + + StringProperty strProp5 = this.backgroundType; + intVal = (strProp5.equals("Outlined") ? 1 : 0); + + if (intVal != 0) { + double doubleVal20 = this.cachedValue3; + double doubleVal21 = this.cachedValue5; + IntProperty intProp7 = this.roundess; + Integer intVal8 = intProp7.get(); + double doubleVal22 = intVal8.intValue(); + Float propFloat = this.outlineWidth.get(); + float floatVal = propFloat; + int color3 = awtColor.getRGB(); + ListProperty listProp2 = this.shaders; + GaussianBlurShader gaussianBlurShader2; + if (listProp2.contains("Glow")) { + gaussianBlurShader2 = GaussianBlurShader.getGaussianBlurShader(); + } else { + gaussianBlurShader2 = null; + } + + IntProperty intProp8 = this.glowRadius; + Integer intVal9 = intProp8.get(); + int intVal15 = intVal9; + Integer intVal16 = this.glowAlpha.get(); + RenderUtils.renderVisual6(doubleVal7, doubleVal8, doubleVal20, doubleVal21, doubleVal22, floatVal, color3, 6, gaussianBlurShader2, intVal15, intVal16); + } + } + + ListProperty listProp3 = this.shaders; + intVal = (listProp3.contains("Blur") ? 1 : 0); + + if (intVal != 0) { + StringProperty strProp6 = this.backgroundType; + intVal = (strProp6.equals("Smooth") ? 1 : 0); + + if (intVal == 0) { + this.runnableField = $lambdaCapture$1(this, doubleVal9, doubleVal10); + } + } + + doubleVal7 += doubleVal4; + double doubleVal6 = doubleVal4 + 1.0; + DoubleProperty doubleProp4 = this.padding; + Double propDouble4 = doubleProp4.get(); + doubleVal8 += doubleVal6 + propDouble4 * 0.5; + intVal = 0; + + int intVal10 = intVal; + + while (true) { + if (intVal10 < itemList.size()) { + + label126: { + if (intVal10 == itemList.size() - 1) { + textStr2 = "www.novoline.lol"; + double doubleVal23 = doubleVal7 + this.cachedValue3 * 0.5; + doubleVal23 = doubleVal23 - hudMod.getHudStringWidth(intVal11, "www.novoline.lol") * 0.5 - doubleVal4; + hudMod.drawElement3(intVal11, textStr2, doubleVal23, doubleVal8); + break label126; + } + + String textStr3; + label78: { + textStr3 = (String)itemList.get(intVal10); + if (intVal10 != 0) { + break label78; + } + + double doubleVal24 = doubleVal7 + this.cachedValue3 * 0.5 - doubleVal4; + double doubleVal25 = doubleVal8 - 1.5; + hudMod.drawElement4(intVal11, textStr3, doubleVal24, doubleVal25, 14540253); + + + break label126; + + } + + hudMod.renderVisual3(intVal11, textStr3, doubleVal7, doubleVal8, 16777215); + } + + DoubleProperty doubleProp5 = this.padding; + Double propDouble5 = doubleProp5.get(); + doubleVal8 += doubleVal2 + propDouble5; + intVal10++; + continue; + } + + MovementUtils.unscale(doubleVal); + break; + } +} + + public Scoreboard(ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + this.dimensionField = Toolkit.getDefaultToolkit().getScreenSize(); + this.cachedValue = this.dimensionField.getWidth() * 0.5; + this.cachedValue2 = this.dimensionField.getHeight() * 0.5; + double doubleVal = this.cachedValue - 10.0; + Double doubleVal2 = doubleVal; + DoubleProperty doubleProp2 = DoubleProperty.of(doubleVal2).minimum(0.0); + double doubleVal3 = this.cachedValue; + Double doubleVal4 = doubleVal3; + this.posX = doubleProp2.maximum(doubleVal4); + double doubleVal5 = this.cachedValue2 * 0.5 + 100.0; + Double doubleVal6 = doubleVal5; + DoubleProperty doubleProp3 = DoubleProperty.of(doubleVal6); + doubleVal4 = 0.0; + DoubleProperty doubleProp4 = doubleProp3.minimum(doubleVal4); + double doubleVal7 = this.cachedValue2; + Double doubleVal8 = doubleVal7; + this.posY = doubleProp4.maximum(doubleVal8); + this.fontSize = IntProperty.of(18).minimum(15).maximum(40); + DoubleProperty doubleProp5 = DoubleProperty.of(0.0); + doubleVal8 = 0.0; + DoubleProperty doubleProp6 = doubleProp5.minimum(doubleVal8); + doubleVal8 = 4.0; + this.padding = doubleProp6.maximum(doubleVal8); + StringProperty strProp = StringProperty.of("Outlined"); + String[] stringArr = new String[]{"Bar", "Basic", "Smooth", "Outlined"}; + this.backgroundType = strProp.acceptableValues(stringArr); + this.alpha = IntProperty.of(150).minimum(50).maximum(255); + this.roundess = IntProperty.of(0).minimum(0).maximum(12); + this.smoothness = IntProperty.of(0).minimum(0).maximum(12); + this.outlineWidth = FloatProperty.of(2.0F).minimum(2.0F).maximum(4.0F); + ListProperty listProp = ListProperty.of("Glow"); + String[] stringArr2 = new String[]{"Blur", "Glow"}; + this.shaders = listProp.acceptableValues((Object[])stringArr2); + this.glowRadius = IntProperty.of(12).minimum(5).maximum(30); + this.glowAlpha = IntProperty.of(100).minimum(50).maximum(255); + Setting setting = new Setting("SB_FONT_SIZE", "Font Size", SettingType.SLIDER, this, this.fontSize, 1.0); + SettingManager.register(setting); + setting = new Setting("SB_PADDING", "Padding", SettingType.SLIDER, this, this.padding, 0.1); + SettingManager.register(setting); + setting = new Setting("SB_BACKGROUND_TYPE", "Background Type", SettingType.COMBOBOX, this, this.backgroundType); + SettingManager.register(setting); + setting = new Setting("SB_ALPHA", "Alpha", SettingType.SLIDER, this, this.alpha, 5.0); + SettingManager.register(setting); + setting = new Setting("SB_ROUNDESS", "Roundness", SettingType.SLIDER, this, this.roundess, 1.0, this::lambdaImpl$new$0); + SettingManager.register(setting); + setting = new Setting("SB_OUTLINE_WIDTH", "Outline Width", SettingType.SLIDER, this, this.outlineWidth, 0.2, () -> this.backgroundType.equals("Outlined")); + SettingManager.register(setting); + setting = new Setting("SB_SMOOTHNESS", "Smoothness", SettingType.SLIDER, this, this.smoothness, 1.0, () -> this.backgroundType.equals("Smooth")); + SettingManager.register(setting); + setting = new Setting("SB_SHADERS", "Shaders", SettingType.SELECTBOX, this, this.shaders, this::supplyBoolean2); + SettingManager.register(setting); + setting = new Setting("SB_GLOW_RADIUS", "Glow Radius", SettingType.SLIDER, this, this.glowRadius, 1.0, this::supplyBoolean3); + SettingManager.register(setting); + setting = new Setting("SB_GLOW_ALPHA", "Glow Alpha", SettingType.SLIDER, this, this.glowAlpha, 5.0, this::supplyBoolean4); + SettingManager.register(setting); +} + + + private void invokeCallback(double value, double amount) { + double doubleVal; + double doubleVal2; + double doubleVal3; + label14: { + doubleVal2 = this.cachedValue3; + doubleVal3 = this.cachedValue5; + StringProperty strProp = this.backgroundType; + int intVal = (strProp.equals("Bar") ? 1 : 0); + if (intVal != 0) { + doubleVal = 0.0; + break label14; + } + + IntProperty intProp = this.roundess; + Integer intVal2 = intProp.get(); + intVal = intVal2; + + doubleVal = intVal; + } + + ColorTheme colorTheme = ColorTheme.BLACK; + int color = colorTheme.getRGB(); + RenderUtils.drawRoundedRect(value, amount, doubleVal2, doubleVal3, doubleVal, color); +} + + private Boolean lambdaImpl$new$0() { + boolean flag = this.backgroundType.equals("Bar"); + flag = !flag; + + return flag; +} + + @EventTarget + public void onShader(ShaderEvent event) { + ListProperty listProp = this.shaders; + boolean flag2 = listProp.contains("Blur"); + if (!flag2) { + return; + } + + StringProperty strProp = this.backgroundType; + flag2 = strProp.equals("Smooth"); + + + if (flag2) { + return; + } + + flag2 = true; + + + double doubleVal = MovementUtils.evaluateDouble(flag2); + this.runnableField.run(); + MovementUtils.unscale(doubleVal); +} + + private Boolean supplyBoolean2() { + boolean flag = this.backgroundType.equals("Smooth"); + flag = !flag; + + return flag; +} + + private Boolean supplyBoolean3() { + boolean flag; + label29: { + label28: { + label31: { + ListProperty listProp = this.shaders; + flag = listProp.contains("Glow"); + if (!flag) { + break label31; + } + + StringProperty strProp = this.backgroundType; + flag = strProp.equals("Bar"); + + if (flag) { + break label28; + } + + StringProperty strProp2 = this.backgroundType; + flag = strProp2.equals("Outlined"); + + if (flag) { + break label28; + } + } + + flag = false; + break label29; + } + + flag = true; + } + + return flag; +} + + private static String invokeCallback2(net.minecraft.scoreboard.Scoreboard scoreboardIn, Score score) { + String textStr = score.getPlayerName(); + return ScorePlayerTeam.formatPlayerName(scoreboardIn.getPlayersTeam(textStr), score.getPlayerName()); +} + + private static Integer invokeCallback3(HUD hUD, int value, String text) { + return hUD.getHudStringWidth(value, text); +} + + private static String mapString(String text) { + String textStr = text.replace("\u25a0", "+"); + textStr = textStr.replace("\u2713", "+"); + return textStr.replace("\u2717", "-"); +} + + @EventTarget + public void onRenderGui(RenderGuiEvent event) { + int intVal; + cc.novoline.events.events.RenderGuiEvent renderGuiEvent; + if (event.getGuiScreen() instanceof GuiChat) { + if (this.mc.ingameGUI.obtainScoreObjective() != null) { + double doubleVal; + double doubleVal2; + double doubleVal16; + double doubleVal3; + label114: { + label120: { + int intVal2 = event.getMouseX(); + doubleVal = MovementUtils.evaluateDouble(intVal2); + int intVal3 = event.getMouseY(); + doubleVal2 = MovementUtils.scaleYInt(intVal3); + DoubleProperty doubleProp = this.posX; + Double propDouble = doubleProp.get(); + double doubleVal4 = propDouble; + DoubleProperty doubleProp2 = this.posY; + Double propDouble2 = doubleProp2.get(); + doubleVal16 = propDouble2; + doubleVal3 = doubleVal4 - this.cachedValue3; + if (doubleVal <= doubleVal3) { + break label120; + } + + if (doubleVal > (doubleVal3 + this.cachedValue3)) { + break label120; + } + + if (doubleVal2 <= doubleVal16) { + break label120; + } + + if (doubleVal2 <= (doubleVal16 + this.cachedValue5)) { + intVal = 1; + break label114; + } + } + + intVal = 0; + } + + int intVal4 = intVal; + GuiState guiState = event.getState(); + GuiState guiState2 = GuiState.CLICK; + if (guiState == GuiState.CLICK) { + int intVal5 = event.getMouseButton(); + + if (intVal5 != 0) { + return; + } + + intVal5 = intVal4; + + + if (intVal5 == 0) { + return; + } + + this.cachedValue6 = doubleVal3 - doubleVal; + this.cachedValue4 = doubleVal16 - doubleVal2; + this.stateFlag = true; + return; + } + + guiState = event.getState(); + guiState2 = GuiState.RENDER; + + if (guiState == guiState2) { + int intVal6 = (this.stateFlag ? 1 : 0); + + if (this.stateFlag) { + DoubleProperty doubleProp3 = this.posX; + double doubleVal5 = this.cachedValue6 + doubleVal + this.cachedValue3; + DoubleProperty doubleProp4 = this.posX; + Double doubleVal6 = doubleProp4.getMinimum(); + double doubleVal17 = doubleVal6; + DoubleProperty doubleProp5 = this.posX; + Double doubleVal7 = doubleProp5.getMaximum(); + double doubleVal18 = doubleVal7; + double doubleVal8 = MathHelper.clamp_double(doubleVal5, doubleVal17, doubleVal18); + Double doubleVal9 = doubleVal8; + doubleProp3.set(doubleVal9); + DoubleProperty doubleProp6 = this.posY; + double doubleVal10 = this.cachedValue4 + doubleVal2; + doubleProp4 = this.posY; + Double doubleVal11 = doubleProp4.getMinimum(); + double doubleVal19 = doubleVal11; + doubleProp5 = this.posY; + Double doubleVal12 = doubleProp5.getMaximum(); + double doubleVal20 = doubleVal12; + double doubleVal13 = MathHelper.clamp_double(doubleVal10, doubleVal19, doubleVal20); + Double doubleVal14 = doubleVal13; + doubleProp6.set(doubleVal14); + } + + intVal6 = intVal4; + + + + if (intVal6 == 0) { + return; + } + + intVal6 = 1; + + + double doubleVal15; + double doubleVal21; + double doubleVal22; + double doubleVal23; + label76: { + doubleVal15 = MovementUtils.evaluateDouble((intVal6 != 0)); + doubleVal21 = this.cachedValue3; + doubleVal22 = this.cachedValue5; + StringProperty strProp = this.backgroundType; + int intVal7 = (strProp.equals("Bar") ? 1 : 0); + if (intVal7 != 0) { + doubleVal23 = 0.0; + break label76; + } + + IntProperty intProp = this.roundess; + Integer intVal8 = intProp.get(); + intVal7 = intVal8; + + doubleVal23 = intVal7; + } + + StringProperty strProp2 = this.backgroundType; + float floatVal; + if (strProp2.equals("Outlined")) { + Float propFloat = this.outlineWidth.get(); + float floatVal2 = propFloat; + floatVal = Math.max(2.5F, floatVal2); + } else { + floatVal = 2.5F; + } + + int color = ColorTheme.getColor(0, 0, 0, 100); + int color2 = ColorTheme.WHITE.getRGB(); + RenderUtils.drawBorderedRoundedRect(doubleVal3, doubleVal16, doubleVal21, doubleVal22, doubleVal23, floatVal, color, color2); + MovementUtils.unscale(doubleVal15); + return; + } + + renderGuiEvent = event; + + guiState = event.getState(); + guiState2 = GuiState.RELEASE; + + if (guiState != guiState2) { + return; + } + + renderGuiEvent = event; + + if (renderGuiEvent.getStateTicks3() == 0) { + this.stateFlag = false; + } + } + } +} + + + private Boolean supplyBoolean4() { + boolean flag; + label29: { + label28: { + label31: { + ListProperty listProp = this.shaders; + flag = listProp.contains("Glow"); + if (!flag) { + break label31; + } + + StringProperty strProp = this.backgroundType; + flag = strProp.equals("Bar"); + + if (flag) { + break label28; + } + + StringProperty strProp2 = this.backgroundType; + flag = strProp2.equals("Outlined"); + + if (flag) { + break label28; + } + } + + flag = false; + break label29; + } + + flag = true; + } + + return flag; +} + + @Override + public void onEnable() {} + + private List resolveList2(ScoreObjective scoreObjective) { + net.minecraft.scoreboard.Scoreboard scoreboard2; + ArrayList itemList; + label14: { + scoreboard2 = scoreObjective.getScoreboard(); + Collection collection = scoreboard2.getSortedScores(scoreObjective); + Stream stream2 = collection.stream(); + Predicate predicate = Scoreboard::matchesScore; + Stream stream3 = stream2.filter(predicate); + Supplier supplier = ObjectArrayList::new; + Collector collector = Collectors.toCollection(supplier); + List itemList2 = (java.util.List) stream3.collect(collector); + Iterable iterable = itemList2; + + if (itemList2.size() <= 15) { + itemList = new ArrayList(itemList2); + break label14; + } + + iterable = Iterables.skip(itemList2, collection.size() - 15); + + + itemList = Lists.newArrayList(iterable); + } + + ArrayList itemList3 = itemList; + Stream stream4 = itemList3.stream(); + Function mapper = $lambdaCapture$10(scoreboard2); + Stream stream5 = stream4.map(mapper); + Collector collector2 = Collectors.toList(); + List itemList4 = (java.util.List) stream5.collect(collector2); + String textStr = scoreObjective.getDisplayName(); + String textStr2 = StringScrambler.createString(textStr); + itemList4.add(textStr2); + Stream stream6 = itemList4.stream(); + java.util.function.Function var19Next = ((java.util.function.Function) Scoreboard::mapString); + Stream stream7 = stream6.map(var19Next); + Collector collector3 = Collectors.toList(); + List itemList5 = (java.util.List) stream7.collect(collector3); + Collections.reverse(itemList5); + return itemList5; +} + + private static boolean matchesScore(Score score) { + boolean flag = HUD.H(); + String textStr = score.getPlayerName(); + if (textStr == null) { + return false; + } + + textStr = score.getPlayerName(); + + boolean flag2 = textStr.startsWith("#"); + return !flag ? flag2 : !flag2; +} + + private static java.lang.Runnable $lambdaCapture$1(cc.novoline.modules.visual.Scoreboard captured0, double captured1, double captured2) { return () -> captured0.invokeCallback(captured1, captured2); } + + private static java.util.function.Function $lambdaCapture$10(net.minecraft.scoreboard.Scoreboard captured0) { return (value0) -> cc.novoline.modules.visual.Scoreboard.invokeCallback2(captured0, value0); } + +} diff --git a/src/main/java/cc/novoline/modules/visual/SessionInfo.java b/src/main/java/cc/novoline/modules/visual/SessionInfo.java new file mode 100644 index 0000000..d48b3a3 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/SessionInfo.java @@ -0,0 +1,890 @@ +package cc.novoline.modules.visual; + +import cc.novoline.events.type.GuiState; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.MovementUtils; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.fonts.api.FontRenderer; +import cc.novoline.utils.fonts.holders.FontFamilySESSION_ICONS; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.shader.GaussianBlurShader; +import cc.novoline.utils.shader.RoundedTextureShader; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.events.events.RenderGuiEvent; +import cc.novoline.events.events.ShaderEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.DoubleProperty; +import cc.novoline.modules.configurations.property.object.FloatProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import com.google.common.collect.Lists; +import cc.novoline.modules.ModuleRegistry; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Toolkit; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Date; +import java.util.List; +import java.util.Optional; +import java.util.stream.Stream; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.gui.GuiChat; + +import net.minecraft.util.MathHelper; +import cc.novoline.utils.fonts.api.FontFamily; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class SessionInfo extends AbstractModule { + private Runnable runnableField; + @Property("pos-y") + private DoubleProperty posY; + @Property("debug-hide") + private BooleanProperty debugHide; + @Property("glow-alpha") + private IntProperty glowAlpha; + private double cachedValue; + @Property("glow-radius") + private IntProperty glowRadius; + private double cachedValue2; + @Property("shaders") + private ListProperty shaders; + @Property("ban-type") + private BooleanProperty banType; + private SimpleDateFormat simpleDateFormatField; + private boolean stateFlag; + private double cachedValue3; + @Property("smoothness") + private IntProperty smoothness; + private GaussianBlurShader gaussianBlurShaderField; + @Property("padding") + private DoubleProperty padding; + @Property("draw-icons") + private BooleanProperty drawIcons; + @Property("roundess") + private IntProperty roundess; + private double cachedValue4; + @Property("pos-x") + private DoubleProperty posX; + private double cachedValue5; + @Property("alpha") + private IntProperty alpha; + @Property("outline-width") + private FloatProperty outlineWidth; + @Property("background-type") + private StringProperty backgroundType; + private Dimension dimensionField; + @Property("font-size") + private IntProperty fontSize; + private double cachedValue6; + @Property("elements") + private ListProperty elements; + + @EventTarget + public void onRenderGui(RenderGuiEvent event) { + cc.novoline.events.events.RenderGuiEvent renderGuiEvent; + int intVal6 = (event.getGuiScreen() instanceof GuiChat ? 1 : 0); + if (intVal6 == 0) { + return; + } + + BooleanProperty boolProp = this.debugHide; + Boolean propFlag = boolProp.get(); + intVal6 = (propFlag ? 1 : 0); + + if (intVal6 != 0) { + intVal6 = (this.mc.gameSettings.showDebugInfo ? 1 : 0); + + if (this.mc.gameSettings.showDebugInfo) { + return; + } + } + + intVal6 = event.getMouseX(); + intVal6 = MovementUtils.evaluateDouble(intVal6); + + double doubleVal; + double doubleVal2; + double doubleVal3; + double doubleVal15; + label120: { + label138: { + doubleVal = intVal6; + intVal6 = event.getMouseY(); + doubleVal2 = MovementUtils.scaleYInt(intVal6); + DoubleProperty doubleProp = this.posX; + Double propDouble = doubleProp.get(); + doubleVal3 = propDouble; + DoubleProperty doubleProp2 = this.posY; + Double propDouble2 = doubleProp2.get(); + doubleVal15 = propDouble2; + if (doubleVal <= doubleVal3) { + break label138; + } + + if (doubleVal > (doubleVal3 + this.cachedValue5)) { + break label138; + } + + if (doubleVal2 <= doubleVal15) { + break label138; + } + + if (doubleVal2 <= (doubleVal15 + this.cachedValue4)) { + intVal6 = 1; + break label120; + } + } + + intVal6 = 0; + } + + int intVal = intVal6; + GuiState guiState = event.getState(); + GuiState guiState2 = GuiState.CLICK; + if (guiState == GuiState.CLICK) { + int intVal2 = event.getMouseButton(); + + if (intVal2 != 0) { + return; + } + + intVal2 = intVal; + + + if (intVal2 == 0) { + return; + } + + this.cachedValue2 = doubleVal3 - doubleVal; + this.cachedValue3 = doubleVal15 - doubleVal2; + this.stateFlag = true; + return; + } + + guiState = event.getState(); + guiState2 = GuiState.RENDER; + + if (guiState == guiState2) { + int intVal3 = (this.stateFlag ? 1 : 0); + + if (this.stateFlag) { + DoubleProperty doubleProp3 = this.posX; + double doubleVal4 = this.cachedValue2 + doubleVal; + DoubleProperty doubleProp4 = this.posX; + Double doubleVal5 = doubleProp4.getMinimum(); + double doubleVal16 = doubleVal5; + DoubleProperty doubleProp5 = this.posX; + Double doubleVal6 = doubleProp5.getMaximum(); + double doubleVal17 = doubleVal6; + double doubleVal7 = MathHelper.clamp_double(doubleVal4, doubleVal16, doubleVal17); + Double doubleVal8 = doubleVal7; + doubleProp3.set(doubleVal8); + DoubleProperty doubleProp6 = this.posY; + double doubleVal9 = this.cachedValue3 + doubleVal2; + doubleProp4 = this.posY; + Double doubleVal10 = doubleProp4.getMinimum(); + double doubleVal18 = doubleVal10; + doubleProp5 = this.posY; + Double doubleVal11 = doubleProp5.getMaximum(); + double doubleVal19 = doubleVal11; + double doubleVal12 = MathHelper.clamp_double(doubleVal9, doubleVal18, doubleVal19); + Double doubleVal13 = doubleVal12; + doubleProp6.set(doubleVal13); + } + + intVal3 = intVal; + + + + if (intVal3 == 0) { + return; + } + + intVal3 = 1; + + + double doubleVal14; + double doubleVal20; + double doubleVal21; + double doubleVal22; + label82: { + doubleVal14 = MovementUtils.evaluateDouble((intVal3 != 0)); + doubleVal20 = this.cachedValue5; + doubleVal21 = this.cachedValue4; + StringProperty strProp = this.backgroundType; + int intVal4 = (strProp.equals("Bar") ? 1 : 0); + if (intVal4 != 0) { + doubleVal22 = 0.0; + break label82; + } + + IntProperty intProp = this.roundess; + Integer intVal5 = intProp.get(); + intVal4 = intVal5; + + doubleVal22 = intVal4; + } + + StringProperty strProp2 = this.backgroundType; + float floatVal; + if (strProp2.equals("Outlined")) { + Float propFloat = this.outlineWidth.get(); + float floatVal2 = propFloat; + floatVal = Math.max(2.5F, floatVal2); + } else { + floatVal = 2.5F; + } + + int color = ColorTheme.getColor(0, 0, 0, 100); + int color2 = ColorTheme.WHITE.getRGB(); + RenderUtils.drawBorderedRoundedRect(doubleVal3, doubleVal15, doubleVal20, doubleVal21, doubleVal22, floatVal, color, color2); + MovementUtils.unscale(doubleVal14); + return; + } + + renderGuiEvent = event; + + guiState = event.getState(); + guiState2 = GuiState.RELEASE; + + if (guiState != guiState2) { + return; + } + + renderGuiEvent = event; + + if (renderGuiEvent.getStateTicks3() == 0) { + this.stateFlag = false; + } +} + + private Boolean supplyBoolean() { + boolean flag = this.backgroundType.equals("Bar"); + flag = !flag; + + return flag; +} + + + public SimpleDateFormat getSimpleDateFormat() { + return this.simpleDateFormatField; +} + + public String computeStringValue2(String text) { + int intVal; + boolean flag2 = HUD.Q(); + String textStr = text; + boolean flag = flag2; + byte byteVal = -1; + intVal = textStr.hashCode(); + + switch (intVal) { + case 67316793: + intVal = (textStr.equals("Play Time") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 0; + if (!flag) { + break; + } + case 72499381: + intVal = (textStr.equals("Kills") ? 1 : 0); + + if (intVal == 0) { + break; + } + + byteVal = 1; + if (!flag) { + break; + } + case 2696247: + intVal = (textStr.equals("Wins") ? 1 : 0); + + if (intVal != 0) { + byteVal = 2; + } + } + + intVal = byteVal; + + switch (intVal) { + case 0: + return "B"; + case 1: + return "C"; + case 2: + return "D"; + default: + return "A"; + } +} + + private Boolean supplyBoolean2() { + boolean flag; + label29: { + label28: { + label31: { + ListProperty listProp = this.shaders; + flag = listProp.contains("Glow"); + if (!flag) { + break label31; + } + + StringProperty strProp = this.backgroundType; + flag = strProp.equals("Bar"); + + if (flag) { + break label28; + } + + StringProperty strProp2 = this.backgroundType; + flag = strProp2.equals("Outlined"); + + if (flag) { + break label28; + } + } + + flag = false; + break label29; + } + + flag = true; + } + + return flag; +} + + + private void invokeCallback(double value, double amount) { + double doubleVal; + double doubleVal2; + double doubleVal3; + label14: { + doubleVal2 = this.cachedValue5; + doubleVal3 = this.cachedValue4; + StringProperty strProp = this.backgroundType; + int intVal = (strProp.equals("Bar") ? 1 : 0); + if (intVal != 0) { + doubleVal = 0.0; + break label14; + } + + IntProperty intProp = this.roundess; + Integer intVal2 = intProp.get(); + intVal = intVal2; + + doubleVal = intVal; + } + + ColorTheme colorTheme = ColorTheme.BLACK; + int color = colorTheme.getRGB(); + RenderUtils.drawRoundedRect(value, amount, doubleVal2, doubleVal3, doubleVal, color); +} + + private List getListValue6() { + ArrayList itemList = Lists.newArrayList(); + ClickGui clickGuiMod = ModuleRegistry.CLICKGUI.getModule(); + Integer intVal = clickGuiMod.getIntegerValue(); + Integer intVal2 = clickGuiMod.getInteger(); + Integer intVal3 = clickGuiMod.getIntegerValue2(); + Integer intVal4 = clickGuiMod.getIntegerValue3(); + long timeMs = System.currentTimeMillis() - clickGuiMod.getLongValue() - clickGuiMod.getLastTimestamp(); + String textStr = this.simpleDateFormatField.format(new Date(timeMs)); + itemList.add("Session Info| "); + StringBuilder sb2 = new StringBuilder().append("Play Time|"); + String textStr2 = sb2.append(textStr).toString(); + itemList.add(textStr2); + ListProperty listProp = this.elements; + boolean flag = listProp.contains("Kills"); + if (flag) { + StringBuilder sb4 = new StringBuilder().append("Kills|"); + String textStr3 = sb4.append(intVal2).toString(); + itemList.add(textStr3); + } + + ListProperty listProp2 = this.elements; + flag = listProp2.contains("Wins"); + + if (flag) { + StringBuilder sb6 = new StringBuilder().append("Wins|"); + String textStr4 = sb6.append(intVal).toString(); + itemList.add(textStr4); + } + + ListProperty listProp3 = this.elements; + flag = listProp3.contains("Bans"); + + if (flag) { + StringBuilder sb7 = new StringBuilder(); + String textStr5 = "Bans"; + sb7 = sb7.append(textStr5); + BooleanProperty boolProp = this.banType; + Boolean propFlag = boolProp.get(); + textStr5 = propFlag ? " staff/wd" : ""; + + StringBuilder sb8 = sb7.append(textStr5); + StringBuilder sb9 = sb8.append("|"); + StringBuilder sb10 = sb9.append(intVal3); + StringBuilder sb11 = sb10.append("/"); + String textStr6 = sb11.append(intVal4).toString(); + itemList.add(textStr6); + } + + return itemList; +} + + private Boolean lambdaImpl$new$0() { + ListProperty listProp = this.elements; + return listProp.contains("Bans"); +} + + @EventTarget + public void onRender2D(Render2DEvent event) { + boolean flag; + double doubleVal11; + double doubleVal12; + double doubleVal13; + double doubleVal14; + java.lang.Float floatVal; + cc.novoline.modules.visual.SessionInfo sessionInfo; + boolean flag3; + Boolean propFlag = this.debugHide.get(); + flag3 = propFlag; + + if (flag3) { + flag3 = this.mc.gameSettings.showDebugInfo; + + if (this.mc.gameSettings.showDebugInfo) { + return; + } + } + + flag3 = true; + + double doubleVal = MovementUtils.evaluateDouble(flag3); + ModuleRegistry modEntry = ModuleRegistry.HUD; + HUD hudMod = modEntry.getModule(); + List itemList = this.getListValue6(); + StringProperty strProp = hudMod.getStringPropertyS(); + String textStr3 = "Vanilla"; + byte byteVal = (byte)(strProp.equals(textStr3) ? 1 : 0); + int intVal = byteVal; + if (byteVal != 0) { + intVal = 20; + } else { + IntProperty intProp = this.fontSize; + Integer intVal2 = intProp.get(); + intVal = intVal2; + } + + int intVal13 = intVal; + double doubleVal2 = hudMod.applyUpdate2(intVal13); + DoubleProperty doubleProp = this.posX; + Double propDouble = doubleProp.get(); + double doubleVal3 = propDouble; + DoubleProperty doubleProp2 = this.posY; + Double propDouble2 = doubleProp2.get(); + double doubleVal15 = propDouble2; + double doubleVal4 = doubleVal3; + double doubleVal16 = doubleVal15; + IntProperty intProp2 = this.alpha; + Integer intVal14 = intProp2.get(); + Color awtColor = new Color(0, 0, 0, intVal14); + StringProperty strProp2 = this.backgroundType; + double doubleVal5; + if (!strProp2.equals("Bar")) { + IntProperty intProp3 = this.roundess; + Integer intVal3 = intProp3.get(); + doubleVal5 = 0.08333333333333333 * intVal3.intValue(); + } else { + doubleVal5 = 0.0; + } + + double doubleVal6 = 4.0 + doubleVal5; + Stream stream2 = itemList.stream(); + Comparator comparator = Comparator.comparing(((java.util.function.Function) ((value0) -> cc.novoline.modules.visual.SessionInfo.invokeCallback2(hudMod, intVal13, value0)))); + Optional optional = stream2.max(comparator); + String propStr = (String)optional.get(); + double doubleVal7 = 6.5 * intVal13 + doubleVal6 * 2.0; + BooleanProperty boolProp = this.drawIcons; + Boolean propFlag2 = boolProp.get(); + byte byteVal2 = (byte)(propFlag2 ? 1 : 0); + byteVal2 = (byte)(byteVal2 != 0 ? 8 : 0); + + label178: { + this.cachedValue5 = doubleVal7 + byteVal2; + double doubleVal8 = itemList.size(); + Double propDouble3 = this.padding.get(); + this.cachedValue4 = doubleVal8 * (doubleVal2 + propDouble3) + doubleVal6 * 2.0; + StringProperty strProp3 = this.backgroundType; + textStr3 = "Bar"; + flag = strProp3.equals(textStr3); + if (flag) { + GaussianBlurShader gaussianBlurShader; + int color; + label159: { + doubleVal11 = this.cachedValue5; + doubleVal12 = this.cachedValue4; + color = awtColor.getRGB(); + SessionInfo sessionInfo2 = this; + + ListProperty listProp = this.shaders; + if (!listProp.contains("Glow")) { + gaussianBlurShader = null; + break label159; + } + + sessionInfo2 = this; + + + gaussianBlurShader = sessionInfo2.gaussianBlurShaderField; + } + + IntProperty intProp4 = this.glowRadius; + Integer intVal4 = intProp4.get(); + int intVal15 = intVal4; + Integer intVal16 = this.glowAlpha.get(); + RenderUtils.drawElement8(doubleVal3, doubleVal15, doubleVal11, doubleVal12, color, 6, gaussianBlurShader, intVal15, intVal16); + break label178; + } + + StringProperty strProp4 = this.backgroundType; + textStr3 = "Smooth"; + flag = strProp4.equals(textStr3); + + if (flag) { + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal17 = this.cachedValue5; + double doubleVal18 = this.cachedValue4; + intProp2 = this.roundess; + Integer intVal5 = intProp2.get(); + double doubleVal19 = intVal5 * 2; + IntProperty intProp5 = this.smoothness; + Integer intVal6 = intProp5.get(); + double doubleVal20 = intVal6.intValue(); + roundedTextureShader.drawRoundedRect(doubleVal3, doubleVal15, doubleVal17, doubleVal18, doubleVal19, doubleVal20, awtColor, true); + break label178; + } + + StringProperty strProp5 = this.backgroundType; + textStr3 = "Outlined"; + flag = strProp5.equals(textStr3); + + if (flag) { + double doubleVal21; + int color2; + GaussianBlurShader gaussianBlurShader2; + label139: { + doubleVal13 = this.cachedValue5; + doubleVal14 = this.cachedValue4; + IntProperty intProp6 = this.roundess; + Integer intVal7 = intProp6.get(); + doubleVal21 = intVal7.intValue(); + Float propFloat = this.outlineWidth.get(); + floatVal = propFloat; + color2 = awtColor.getRGB(); + SessionInfo sessionInfo3 = this; + + ListProperty listProp2 = this.shaders; + if (!listProp2.contains("Glow")) { + gaussianBlurShader2 = null; + break label139; + } + + sessionInfo3 = this; + + + gaussianBlurShader2 = sessionInfo3.gaussianBlurShaderField; + } + + IntProperty intProp7 = this.glowRadius; + Integer intVal8 = intProp7.get(); + int intVal17 = intVal8; + Integer intVal18 = this.glowAlpha.get(); + RenderUtils.renderVisual6(doubleVal3, doubleVal15, doubleVal13, doubleVal14, doubleVal21, floatVal, color2, 6, gaussianBlurShader2, intVal17, intVal18); + break label178; + } + + StringProperty strProp6 = this.backgroundType; + textStr3 = "Basic"; + flag = strProp6.equals(textStr3); + + if (flag) { + double doubleVal22 = this.cachedValue5; + double doubleVal23 = this.cachedValue4; + IntProperty intProp8 = this.roundess; + Integer intVal9 = intProp8.get(); + double doubleVal24 = intVal9.intValue(); + int color3 = awtColor.getRGB(); + RenderUtils.drawRoundedRect(doubleVal3, doubleVal15, doubleVal22, doubleVal23, doubleVal24, color3); + } + } + + ListProperty listProp3 = this.shaders; + textStr3 = "Blur"; + flag = listProp3.contains(textStr3); + + label126: { + + if (!flag) { + break label126; + } + + sessionInfo = this; + + StringProperty strProp7 = this.backgroundType; + textStr3 = "Smooth"; + flag = strProp7.equals(textStr3); + + if (flag) { + break label126; + } + + sessionInfo = this; + + sessionInfo.runnableField = ((java.lang.Runnable) (() -> this.invokeCallback(doubleVal4, doubleVal16))); + } + + double doubleVal25 = doubleVal3 + doubleVal6; + double doubleVal9 = doubleVal6 + 1.0; + DoubleProperty doubleProp3 = this.padding; + Double propDouble4 = doubleProp3.get(); + double doubleVal10 = doubleVal15 + (doubleVal9 + propDouble4 * 0.5); + FontFamily fontFam = FontFamilySESSION_ICONS.FAMILY; + int intVal10 = intVal13 + 10; + FontRenderer font = fontFam.ofSize(intVal10); + int intVal11 = 0; + + while (true) { + if (intVal11 < itemList.size()) { + String textStr = (String)itemList.get(intVal11); + textStr3 = "\\|"; + String[] stringArr = textStr.split(textStr3); + String textStr4 = stringArr[0]; + String textStr5 = stringArr[1]; + String textStr2 = this.computeStringValue2(textStr4); + + label184: { + int intVal12 = intVal11; + if (intVal11 == 0) { + double doubleVal26 = doubleVal25 + this.cachedValue5 * 0.5 - doubleVal6; + double doubleVal27 = doubleVal10 - 1.0; + hudMod.drawElement4(intVal13, textStr4, doubleVal26, doubleVal27, 16777215); + break label184; + } + + BooleanProperty boolProp2 = this.drawIcons; + propFlag = boolProp2.get(); + intVal12 = (propFlag ? 1 : 0); + + if (intVal12 != 0) { + double doubleVal28 = doubleVal10 + (byteVal != 0 ? 0.0 : doubleVal2 * 0.15); + font.drawString(textStr2, doubleVal25, doubleVal28, 16777215, true); + } + + BooleanProperty boolProp3 = this.drawIcons; + Boolean propFlag3 = boolProp3.get(); + double doubleVal29 = doubleVal25 + (propFlag3 ? 0.7 * intVal13 + 2.0 : 0.0); + byte byteVal3 = byteVal; + byteVal3 = (byte)(byteVal != 0 ? 0 : 1); + + double doubleVal30 = doubleVal10 + byteVal3; + hudMod.renderVisual3(intVal13, textStr4, doubleVal29, doubleVal30, 16777215); + doubleVal29 = doubleVal25 + this.cachedValue5; + double doubleVal31 = doubleVal29 - hudMod.getHudStringWidth(intVal13, textStr5) - doubleVal6 * 2.0; + byte byteVal4 = byteVal; + byteVal4 = (byte)(byteVal != 0 ? 0 : 1); + + double doubleVal32 = doubleVal10 + byteVal4; + hudMod.renderVisual3(intVal13, textStr5, doubleVal31, doubleVal32, 16777215); + } + + DoubleProperty doubleProp4 = this.padding; + Double propDouble5 = doubleProp4.get(); + doubleVal10 += doubleVal2 + propDouble5; + intVal11++; + continue; + } + + MovementUtils.unscale(doubleVal); + break; + } +} + + + private Boolean supplyBoolean4() { + boolean flag; + label29: { + label28: { + label31: { + ListProperty listProp = this.shaders; + flag = listProp.contains("Glow"); + if (!flag) { + break label31; + } + + StringProperty strProp = this.backgroundType; + flag = strProp.equals("Bar"); + + if (flag) { + break label28; + } + + StringProperty strProp2 = this.backgroundType; + flag = strProp2.equals("Outlined"); + + if (flag) { + break label28; + } + } + + flag = false; + break label29; + } + + flag = true; + } + + return flag; +} + + public SessionInfo(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.simpleDateFormatField = new SimpleDateFormat("HH:mm:ss"); + this.dimensionField = Toolkit.getDefaultToolkit().getScreenSize(); + this.cachedValue6 = this.dimensionField.getWidth() * 0.5; + this.cachedValue = this.dimensionField.getHeight() * 0.5; + DoubleProperty doubleProp2 = DoubleProperty.of(10.0).minimum(0.0); + double doubleVal = this.cachedValue6; + Double doubleVal2 = doubleVal; + this.posX = doubleProp2.maximum(doubleVal2); + DoubleProperty doubleProp3 = DoubleProperty.of(80.0); + doubleVal2 = 0.0; + DoubleProperty doubleProp4 = doubleProp3.minimum(doubleVal2); + double doubleVal3 = this.cachedValue; + Double doubleVal4 = doubleVal3; + this.posY = doubleProp4.maximum(doubleVal4); + ListProperty listProp = ListProperty.of("Kills", "Wins"); + String[] stringArr = new String[]{"Kills", "Wins", "Bans"}; + this.elements = listProp.acceptableValues((Object[])stringArr); + this.banType = BooleanProperty.of(true); + this.drawIcons = BooleanProperty.of(true); + this.fontSize = IntProperty.of(18).minimum(15).maximum(40); + DoubleProperty doubleProp5 = DoubleProperty.of(0.0); + doubleVal4 = 0.0; + DoubleProperty doubleProp6 = doubleProp5.minimum(doubleVal4); + doubleVal4 = 6.0; + this.padding = doubleProp6.maximum(doubleVal4); + StringProperty strProp = StringProperty.of("Basic"); + String[] stringArr2 = new String[]{"Bar", "Basic", "Outlined", "Smooth"}; + this.backgroundType = strProp.acceptableValues(stringArr2); + this.alpha = IntProperty.of(150).minimum(50).maximum(255); + this.roundess = IntProperty.of(0).minimum(0).maximum(12); + this.smoothness = IntProperty.of(0).minimum(0).maximum(12); + this.outlineWidth = FloatProperty.of(2.0F).minimum(2.0F).maximum(4.0F); + ListProperty listProp2 = ListProperty.of("Glow"); + String[] stringArr3 = new String[]{"Blur", "Glow"}; + this.shaders = listProp2.acceptableValues((Object[])stringArr3); + this.glowRadius = IntProperty.of(12).minimum(5).maximum(30); + this.glowAlpha = IntProperty.of(100).minimum(50).maximum(255); + this.debugHide = BooleanProperty.of(true); + this.gaussianBlurShaderField = new GaussianBlurShader(); + Setting setting = new Setting("SI_ELEMENTS", "Elements", SettingType.SELECTBOX, this, this.elements); + SettingManager.register(setting); + setting = new Setting("SI_BAN_TYPE", "Ban Type", SettingType.CHECKBOX, this, this.banType, this::lambdaImpl$new$0); + SettingManager.register(setting); + setting = new Setting("SI_DRAW_ICONS", "Draw Icons", SettingType.CHECKBOX, this, this.drawIcons); + SettingManager.register(setting); + setting = new Setting("SI_FONT_SIZE", "Font Size", SettingType.SLIDER, this, this.fontSize, 1.0); + SettingManager.register(setting); + setting = new Setting("SI_PADDING", "Padding", SettingType.SLIDER, this, this.padding, 0.1); + SettingManager.register(setting); + setting = new Setting("SI_BACKGROUND_TYPE", "Background Type", SettingType.COMBOBOX, this, this.backgroundType); + SettingManager.register(setting); + setting = new Setting("SI_ALPHA", "Alpha", SettingType.SLIDER, this, this.alpha, 5.0); + SettingManager.register(setting); + setting = new Setting("SI_ROUNDESS", "Roundness", SettingType.SLIDER, this, this.roundess, 1.0, this::supplyBoolean); + SettingManager.register(setting); + setting = new Setting("SI_OUTLINE_WIDTH", "Outline Width", SettingType.SLIDER, this, this.outlineWidth, 0.2, () -> this.backgroundType.equals("Outlined")); + SettingManager.register(setting); + setting = new Setting("SI_SMOOTHNESS", "Smoothness", SettingType.SLIDER, this, this.smoothness, 1.0, () -> this.backgroundType.equals("Smooth")); + SettingManager.register(setting); + setting = new Setting("SI_SHADERS", "Shaders", SettingType.SELECTBOX, this, this.shaders, this::supplyBoolean5); + SettingManager.register(setting); + setting = new Setting("SI_GLOW_RADIUS", "Glow Radius", SettingType.SLIDER, this, this.glowRadius, 1.0, this::supplyBoolean4); + SettingManager.register(setting); + setting = new Setting("SI_GLOW_ALPHA", "Glow Alpha", SettingType.SLIDER, this, this.glowAlpha, 5.0, this::supplyBoolean2); + SettingManager.register(setting); + setting = new Setting("SI_DEBUG_HIDE", "F3 Hide", SettingType.CHECKBOX, this, this.debugHide); + SettingManager.register(setting); +} + + private static Integer invokeCallback2(HUD hUD, int value, String text) { + return hUD.getHudStringWidth(value, text); +} + + @Override + public void onEnable() { + this.gaussianBlurShaderField = new GaussianBlurShader(); +} + + private Boolean supplyBoolean5() { + boolean flag = this.backgroundType.equals("Smooth"); + flag = !flag; + + return flag; +} + + @EventTarget + public void onShader(ShaderEvent event) { + boolean flag2; + Boolean propFlag = this.debugHide.get(); + flag2 = propFlag; + + if (flag2) { + flag2 = this.mc.gameSettings.showDebugInfo; + + if (this.mc.gameSettings.showDebugInfo) { + return; + } + } + + ListProperty listProp = this.shaders; + flag2 = listProp.contains("Blur"); + + if (!flag2) { + return; + } + + StringProperty strProp = this.backgroundType; + flag2 = strProp.equals("Smooth"); + + + if (flag2) { + return; + } + + flag2 = true; + + + double doubleVal = MovementUtils.evaluateDouble(flag2); + this.runnableField.run(); + MovementUtils.unscale(doubleVal); +} + +} diff --git a/src/main/java/cc/novoline/modules/visual/SimsESP.java b/src/main/java/cc/novoline/modules/visual/SimsESP.java new file mode 100644 index 0000000..d1f0f8c --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/SimsESP.java @@ -0,0 +1,247 @@ +package cc.novoline.modules.visual; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.RenderUtils; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.render.ColorPaletteUtil; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render3DEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import java.awt.Color; +import java.util.Comparator; +import java.util.List; +import java.util.function.Predicate; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import org.lwjgl.opengl.GL11; + +public class SimsESP extends AbstractModule { + @Property("color-mode") + private StringProperty colorMode; + private double cachedValue; + @Property("color") + private ColorProperty color; + + + public SimsESP(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + StringProperty strProp = StringProperty.of("Static"); + String[] stringArr = new String[]{"Team", "Health", "Static", "Synced", "Rainbow"}; + this.colorMode = strProp.acceptableValues(stringArr); + Color awtColor = new Color(0, 255, 0, 255); + int color2 = awtColor.getRGB(); + Integer intVal = color2; + this.color = ColorProperty.e(intVal); + Setting setting = new Setting("SESP_COLOR_MODE", "Color Mode", SettingType.COMBOBOX, this, this.colorMode); + SettingManager.register(setting); + setting = new Setting("SESP_COLOR", "Color", SettingType.COLOR_PICKER, this, this.color, null, () -> this.colorMode.equals("Static")); + SettingManager.register(setting); +} + + private Color resolveColor2(Color color2) { + int intVal = color2.getRed() - 15; + int intVal2 = Math.max(0, intVal); + int intVal3 = color2.getGreen() - 15; + intVal = Math.max(0, intVal3); + int intVal4 = color2.getBlue() - 15; + return new Color(intVal2, intVal, Math.max(0, intVal4)); +} + + + @EventTarget + public void onRender3D(Render3DEvent event) { + SimsESP simsESP = this; + List itemList = this.getList(); + if (itemList.isEmpty()) { + return; + } + + simsESP = this; + + simsESP.cachedValue += 0.5; + long longVal = 0L; + int intVal = 0; + + while (true) { + List itemList3 = this.getList(); + if (intVal >= itemList3.size()) { + break; + } + + List itemList2 = this.getList(); + EntityPlayer player = (EntityPlayer)itemList2.get(intVal); + if (player != this.mc.thePlayer) { + if (!player.isConditionMet23()) { + Color awtColor2; + label80: { + ColorProperty colorProp = this.color; + awtColor2 = colorProp.getAwtColor(); + StringProperty strProp = this.colorMode; + boolean flag = strProp.equals("Health"); + if (flag) { + float health = player.getHealth(); + double doubleVal = health / (player.getMaxHealth() / 100.0F) / 100.0F; + Color awtColor = new Color(255, 93, 93); + Color awtColor3 = new Color(44, 255, 90); + double doubleVal2 = (float)doubleVal; + awtColor2 = new Color(RenderUtils.interpolateColor(awtColor, awtColor3, doubleVal2)); + break label80; + } + + StringProperty strProp2 = this.colorMode; + flag = strProp2.equals("Team"); + + if (flag) { + awtColor2 = ColorPaletteUtil.checkNetworkPlayerInfo(player); + break label80; + } + + StringProperty strProp3 = this.colorMode; + flag = strProp3.equals("Synced"); + + if (flag) { + awtColor2 = new Color(ColorTheme.getHudColor(longVal)); + longVal -= 120L; + break label80; + } + + simsESP = this; + + StringProperty strProp4 = this.colorMode; + flag = strProp4.equals("Rainbow"); + + if (flag) { + awtColor2 = new Color(ColorTheme.computeIntFromLong(longVal)); + longVal -= 120L; + } + } + + simsESP = this; + + simsESP.renderRender3DEvent2(event, player, awtColor2); + } + } + + intVal++; + } +} + + private Float mapEntityPlayer(EntityPlayer player) { + EntityPlayerSP player2 = this.mc.thePlayer; + float distanceF = player.getDistanceToEntity(player2); + return distanceF; +} + + private List getList() { + List itemList = this.mc.theWorld.getPlayerEntities(); + Stream stream2 = itemList.stream(); + Predicate predicate = (EntityPlayer player2) -> player2 != this.mc.thePlayer; + Stream stream3 = stream2.filter(predicate); + Comparator comparator = Comparator.comparing(this::mapEntityPlayer); + Stream stream4 = stream3.sorted(comparator); + Collector collector = Collectors.toList(); + return (java.util.List) stream4.collect(collector); +} + + + private void renderRender3DEvent2(Render3DEvent event, Entity entity, Color color2) { + int intVal; + double posX2 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * event.getPartialTicks(); + Minecraft mcClient = this.mc; + double doubleVal = posX2 - mcClient.getRenderManager().renderPosX; + posX2 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * event.getPartialTicks(); + mcClient = this.mc; + double doubleVal2 = posX2 - mcClient.getRenderManager().renderPosY; + posX2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * event.getPartialTicks(); + mcClient = this.mc; + double doubleVal8 = posX2 - mcClient.getRenderManager().renderPosZ; + GL11.glPushMatrix(); + GL11.glEnable(3042); + GL11.glBlendFunc(770, 771); + GL11.glDisable(3553); + GL11.glDisable(2896); + GlStateManager.disableCull(); + GlStateManager.enableDepth(); + GL11.glDepthMask(true); + GL11.glShadeModel(7424); + double doubleVal3 = 0.2; + double doubleVal4 = entity.height + 0.7; + GL11.glBegin(5); + int intVal2 = 0; + + while (true) { + if (intVal2 < 420) { + + if (intVal2 % 60 == 0) { + RenderUtils.glColor(color2); + GL11.glVertex3d(doubleVal, doubleVal2 + doubleVal4 + 0.35, doubleVal8); + double doubleVal5 = this.cachedValue + intVal2; + double angleRad = Math.toRadians(doubleVal5); + posX2 = doubleVal + -Math.sin(angleRad) * doubleVal3; + double doubleVal9 = doubleVal2 + doubleVal4; + double doubleVal10 = this.cachedValue + intVal2; + doubleVal10 = Math.toRadians(doubleVal10); + GL11.glVertex3d(posX2, doubleVal9, doubleVal8 + Math.cos(doubleVal10) * doubleVal3); + color2 = this.resolveColor2(color2); + } + + intVal2++; + continue; + } + + GL11.glEnd(); + break; + } + + Color awtColor = color2.darker(); + GL11.glBegin(5); + int intVal3 = 0; + + while (true) { + if (intVal3 < 420) { + intVal = intVal3 % 60; + + if (intVal == 0) { + RenderUtils.glColor(awtColor); + GL11.glVertex3d(doubleVal, doubleVal2 + doubleVal4 - 0.35, doubleVal8); + double doubleVal6 = this.cachedValue + intVal3; + double angleRad2 = Math.toRadians(doubleVal6); + posX2 = doubleVal + -Math.sin(angleRad2) * doubleVal3; + double doubleVal11 = doubleVal2 + doubleVal4; + double doubleVal7 = this.cachedValue + intVal3; + doubleVal7 = Math.toRadians(doubleVal7); + GL11.glVertex3d(posX2, doubleVal11, doubleVal8 + Math.cos(doubleVal7) * doubleVal3); + awtColor = this.resolveColor2(awtColor); + } + + intVal3++; + continue; + } + + GL11.glEnd(); + GL11.glDisable(2848); + GL11.glEnable(3553); + intVal = 3042; + break; + } + + GL11.glDisable(intVal); + GL11.glPopMatrix(); +} + +} diff --git a/src/main/java/cc/novoline/modules/visual/TabGui.java b/src/main/java/cc/novoline/modules/visual/TabGui.java new file mode 100644 index 0000000..c2f79e0 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/TabGui.java @@ -0,0 +1,902 @@ +package cc.novoline.modules.visual; + +import cc.novoline.events.type.GuiState; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.modules.configurations.util.TabGuiCategoryItem; +import cc.novoline.modules.configurations.util.TabGuiSettingItem; +import cc.novoline.modules.configurations.util.TabGuiSelectOption; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.MovementUtils; +import cc.novoline.utils.RenderUtils; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.render.TabGuiRenderSwitchMap; +import cc.novoline.utils.render.TabGuiModuleItem; +import cc.novoline.utils.shader.RoundedTextureShader; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.KeyPressEvent; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.events.events.RenderGuiEvent; +import cc.novoline.events.events.ShaderEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.ModuleRegistry; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Toolkit; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.function.Consumer; +import java.util.function.Predicate; +import java.util.stream.Stream; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.gui.GuiChat; +import net.minecraft.util.MathHelper; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.lwjgl.opengl.GL11; + +public class TabGui extends AbstractModule { + @Property("blur") + private BooleanProperty blur; + public List tabGuiCategoryItemList; + private Dimension dimensionField; + private int stateTicks; + private int stateTicks2; + @Property("alpha") + private IntProperty alpha; + @Property("hide-on-debug") + private BooleanProperty hideOnDebug; + private int stateTicks3; + private int stateTicks4; + private boolean stateFlag; + @Property("font-size") + private IntProperty fontSize; + private int stateTicks5; + private int stateTicks6; + @Property("padding") + private IntProperty padding; + @Property("smoothness") + private IntProperty smoothness; + @Property("height") + private IntProperty height; + + + public int getStateTicks5() { + return this.stateTicks5; +} + + public int getStateTicks4() { + return this.stateTicks4; +} + + private boolean checkInt4(int value, int index) { + int intVal = value; + if (value < 0) { + return false; + } + + intVal = value; + + int intVal2 = this.getIntValue7(); + if (intVal >= intVal2) { + return false; + } + + intVal = index; + intVal2 = this.getIntValue6(); + + if (intVal < intVal2) { + return false; + } + + intVal = index; + + intVal2 = this.getIntValue6() + 6 * this.getIntValue24(); + + return intVal < intVal2; +} + + public int getIntValue6() { + Integer height2 = this.height.get(); + return height2; +} + + @EventTarget + public void onShader(ShaderEvent event) { + boolean empty = this.tabGuiCategoryItemList.isEmpty(); + if (empty) { + return; + } + + Boolean propFlag = this.hideOnDebug.get(); + empty = this.matchesFlag(propFlag); + + if (!empty) { + return; + } + + BooleanProperty boolProp = this.blur; + Boolean propFlag2 = boolProp.get(); + empty = propFlag2; + + if (!empty) { + return; + } + + empty = true; + + double doubleVal = MovementUtils.evaluateDouble(empty); + float floatVal = 0.0F; + float floatVal2 = this.getIntValue6(); + float floatVal3 = this.getIntValue7(); + float floatVal4 = this.getIntValue6() + 6 * this.getIntValue24(); + this.renderVisual5(floatVal, floatVal2, floatVal3, floatVal4, ColorTheme.BLACK.getRGB()); + GL11.glScaled(1.0 / doubleVal, 1.0 / doubleVal, 1.0 / doubleVal); +} + + + public int getIntValue21() { + return this.stateTicks2; +} + + + public void applyUpdate5(String text, double value, double amount, int index) { + HUD hudMod = ModuleRegistry.HUD.getModule(); + Integer intVal = this.fontSize.get(); + int intVal2 = intVal; + hudMod.renderVisual3(intVal2, text, value, amount, index); +} + + @EventTarget + public void onRender2D(Render2DEvent event) { + List itemList = this.tabGuiCategoryItemList; + boolean empty = itemList.isEmpty(); + if (empty) { + return; + } + + Boolean propFlag = this.hideOnDebug.get(); + empty = this.matchesFlag(propFlag); + + if (!empty) { + return; + } + + GL11.glPushMatrix(); + empty = true; + + MovementUtils.evaluateDouble(empty); + float floatVal = 0.0F; + float floatVal2 = this.getIntValue6(); + float floatVal3 = this.getIntValue7(); + float floatVal4 = 6 * this.getIntValue24(); + this.applyUpdate5(floatVal, floatVal2, floatVal3, floatVal4); + itemList = this.tabGuiCategoryItemList; + Consumer consumer = ((java.util.function.Consumer) TabGuiCategoryItem::renderVisual); + itemList.forEach(consumer); + GL11.glPopMatrix(); +} + + @EventTarget + public void onKeyPress(KeyPressEvent event) { + Object obj; + cc.novoline.modules.visual.TabGui tabGui; + TabGuiSettingItem tabGuiSettingItem; + int keyCode; + TabGuiCategoryItem tabGuiCategoryItem; + byte byteVal; + TabGuiModuleItem tabGuiModuleItem; + byte byteVal2; + TabGuiSettingItem tabGuiSettingItem2; + Setting setting; + label333: { + label332: { + keyCode = event.getKey(); + tabGuiCategoryItem = this.getLJF(); + TabGuiCategoryItem tabGuiCategoryItem2 = Objects.requireNonNull(tabGuiCategoryItem); + byteVal = (byte)(tabGuiCategoryItem2.isExpanded() ? 1 : 0); + tabGuiModuleItem = tabGuiCategoryItem.getSelectedModuleItem(); + byteVal2 = (byte)(tabGuiModuleItem.isExpanded() ? 1 : 0); + tabGuiSettingItem2 = tabGuiModuleItem.getSelectedSettingItem(); + TabGuiSettingItem tabGuiSettingItem3 = tabGuiSettingItem2; + + if (tabGuiSettingItem2 == null) { + break label332; + } + + tabGuiSettingItem3 = tabGuiSettingItem2; + + + setting = tabGuiSettingItem3.getSetting(); + + break label333; + + } + + setting = null; + } + + label354: { + label338: { + label339: { + label355: { + int intVal = keyCode; + + switch (keyCode) { + case 28: + intVal = byteVal; + break; + case 200: + break label355; + case 203: + break label354; + case 205: + break label338; + case 208: + break label339; + default: + return; + } + + + + if (intVal == 0) { + return; + } + + intVal = byteVal2; + + + + if (intVal != 0) { + label305: { + Setting setting2 = Objects.requireNonNull(setting); + + if (setting2.getSettingType() != SettingType.CHECKBOX) { + break label305; + } + + setting2 = setting; + + + BooleanProperty boolProp = setting2.getBooleanProperty(); + boolProp.toggle(); + + return; + + } + + label343: { + TabGuiSelectOption tabGuiSelectOption; + label298: { + tabGuiSelectOption = tabGuiSettingItem2.getTabGuiSelectOption(); + + switch (TabGuiRenderSwitchMap.SWITCH_MAP[setting.getSettingType().ordinal()]) { + case 1: + setting.applyUpdate3(tabGuiSelectOption.getTextValue()); + break; + case 2: + break label298; + default: + break label343; + } + + + + break label343; + + } + + List itemList = setting.getList(); + String textStr = tabGuiSelectOption.getTextValue(); + boolean flag2 = itemList.contains(textStr); + label290: { + if (flag2) { + List itemList2 = setting.getList(); + textStr = tabGuiSelectOption.getTextValue(); + itemList2.remove(textStr); + + break label290; + + } + + List itemList3 = setting.getList(); + textStr = tabGuiSelectOption.getTextValue(); + itemList3.add(textStr); + } + } + + + return; + + } + + tabGuiModuleItem.getModule().toggle(); + + + + return; + + } + + byte byteVal3 = byteVal; + + if (byteVal == 0) { + TabGui tabGui2 = this; + + if (this.stateTicks5 == 0) { + List itemList4 = this.tabGuiCategoryItemList; + this.stateTicks5 = itemList4.size() - 1; + + return; + + } + + tabGui2 = this; + + + tabGui2.stateTicks5--; + + return; + + } + + byteVal3 = byteVal2; + + + + if (byteVal3 == 0) { + TabGui tabGui3 = this; + + if (this.stateTicks4 == 0) { + List itemList5 = tabGuiCategoryItem.getModuleItems(); + this.stateTicks4 = itemList5.size() - 1; + + return; + + } + + tabGui3 = this; + + + tabGui3.stateTicks4--; + + return; + + } + + obj = Objects.requireNonNull(tabGuiSettingItem2); + + byteVal3 = (byte)(((TabGuiSettingItem) obj).isStateFlag() ? 1 : 0); + + + if (byteVal3 == 0) { + TabGui tabGui4 = this; + + if (this.stateTicks2 == 0) { + List itemList6 = tabGuiModuleItem.getSettingItems(); + this.stateTicks2 = itemList6.size() - 1; + + return; + + } + + tabGui4 = this; + + + tabGui4.stateTicks2--; + + return; + + } + + obj = Objects.requireNonNull(setting); + + label273: { + Setting setting3 = (Setting)obj; + + if (setting3.getSettingType() != SettingType.SLIDER) { + break label273; + } + + setting3 = setting; + + + double doubleVal = setting.getDoubleValue() + setting.getCachedValue(); + setting3.applyUpdate(Double.valueOf(doubleVal)); + + return; + + } + + TabGui tabGui5 = this; + + if (this.stateTicks3 == 0) { + List itemList7 = tabGuiSettingItem2.getTabGuiSelectOptionList(); + this.stateTicks3 = itemList7.size() - 1; + + return; + + } + + tabGui5 = this; + + + tabGui5.stateTicks3--; + + return; + + } + + int intVal2 = byteVal; + + if (byteVal == 0) { + TabGui tabGui6 = this; + + intVal2 = this.stateTicks5; + List itemList8 = this.tabGuiCategoryItemList; + if (intVal2 == itemList8.size() - 1) { + this.stateTicks5 = 0; + + return; + + } + + tabGui6 = this; + + + tabGui6.stateTicks5++; + + return; + + } + + intVal2 = byteVal2; + + + + if (intVal2 == 0) { + TabGui tabGui7 = this; + + intVal2 = this.stateTicks4; + List itemList9 = tabGuiCategoryItem.getModuleItems(); + if (intVal2 == itemList9.size() - 1) { + this.stateTicks4 = 0; + + return; + + } + + tabGui7 = this; + + + tabGui7.stateTicks4++; + + return; + + } + + intVal2 = (Objects.requireNonNull(tabGuiSettingItem2).isStateFlag() ? 1 : 0); + + + label263: { + + + if (intVal2 != 0) { + break label263; + } + + tabGui = this; + + intVal2 = this.stateTicks2; + + + List itemList10 = tabGuiModuleItem.getSettingItems(); + if (intVal2 == itemList10.size() - 1) { + this.stateTicks2 = 0; + + return; + + } + + tabGui = this; + + tabGui.stateTicks2++; + + return; + + } + + label253: { + Setting setting4 = setting; + + if (setting.getSettingType() != SettingType.SLIDER) { + break label253; + } + + setting4 = setting; + + + double doubleVal2 = setting.getDoubleValue() - setting.getCachedValue(); + setting4.applyUpdate(Double.valueOf(doubleVal2)); + + return; + + } + + TabGui tabGui8 = this; + + intVal2 = this.stateTicks3; + List itemList11 = tabGuiSettingItem2.getTabGuiSelectOptionList(); + if (intVal2 == itemList11.size() - 1) { + this.stateTicks3 = 0; + + return; + + } + + tabGui8 = this; + + + tabGui8.stateTicks3++; + + return; + + } + + byte byteVal4 = byteVal; + + if (byteVal == 0) { + this.stateTicks4 = 0; + tabGuiCategoryItem.setExpanded(true); + + return; + + } + + byteVal4 = byteVal2; + + + if (byteVal4 == 0) { + byteVal4 = (byte)(tabGuiModuleItem.hasNoSettings() ? 1 : 0); + + if (byteVal4 == 0) { + this.stateTicks2 = 0; + tabGuiModuleItem.setExpanded(true); + + return; + + } + } + + byteVal4 = (byte)(Objects.requireNonNull(tabGuiSettingItem2).isStateFlag() ? 1 : 0); + + if (byteVal4 != 0) { + return; + } + + label349: { + SettingType settingType = setting.getSettingType(); + SettingType settingType2 = SettingType.SELECTBOX; + + if (settingType == SettingType.SELECTBOX) { + break label349; + } + + settingType = setting.getSettingType(); + settingType2 = SettingType.COMBOBOX; + + + + if (settingType == settingType2) { + break label349; + } + + settingType = setting.getSettingType(); + settingType2 = SettingType.SLIDER; + + + if (settingType != settingType2) { + return; + } + } + + tabGuiSettingItem2.setStateFlag(true); + + return; + + } + + boolean flag3 = tabGuiCategoryItem.isExpanded(); + + if (!flag3) { + return; + } + + flag3 = tabGuiModuleItem.isExpanded(); + + + label146: { + label145: { + + + if (!flag3) { + break label146; + } + + tabGuiSettingItem = Objects.requireNonNull(tabGuiSettingItem2); + + flag3 = tabGuiSettingItem.isStateFlag(); + + + if (!flag3) { + break label145; + } + + this.stateTicks3 = 0; + tabGuiSettingItem = tabGuiSettingItem2; + + tabGuiSettingItem.setStateFlag(false); + + return; + + } + + this.stateTicks2 = 0; + tabGuiModuleItem.setExpanded(false); + + return; + + } + + this.stateTicks4 = 0; + tabGuiCategoryItem.setExpanded(false); +} + + @Override + public void onEnable() { + EnumModuleType[] modCategoryArr = EnumModuleType.values(); + + for (EnumModuleType enumModuleType : modCategoryArr) { + List itemList = this.tabGuiCategoryItemList; + itemList.add(new TabGuiCategoryItem(this, enumModuleType)); + + } +} + + public int getIntValue22() { + return this.stateTicks3; +} + + + public int getIntValue23() { + Integer intVal = this.padding.get(); + return intVal; +} + + private @Nullable TabGuiCategoryItem getLJF() { + Stream stream2 = this.tabGuiCategoryItemList.stream(); + Predicate predicate = ((java.util.function.Predicate) TabGuiCategoryItem::isReadyState); + Stream stream3 = stream2.filter(predicate); + Optional optional = stream3.findFirst(); + return (TabGuiCategoryItem)optional.orElse(null); +} + + public int computeIntValue3(String text) { + HUD hudMod = ModuleRegistry.HUD.getModule(); + Integer intVal = this.fontSize.get(); + int intVal2 = intVal; + return hudMod.getHudStringWidth(intVal2, text); +} + + @Override + public void onDisable() { + List itemList = this.tabGuiCategoryItemList; + itemList.clear(); +} + + private boolean matchesFlag(boolean flag) { + if (flag) { + + if (this.mc.gameSettings.showDebugInfo) { + return false; + } + } + + return true; +} + + public void renderVisual5(float value, float amount, float factor, float angle, int index) { + RenderUtils.drawRect(value, amount, factor, angle, index); +} + + public int getIntValue24() { + HUD hudMod = ModuleRegistry.HUD.getModule(); + IntProperty intProp = this.fontSize; + Integer intVal = intProp.get(); + int intVal2 = hudMod.applyUpdate2(intVal) + 1; + intProp = this.padding; + Integer intVal3 = intProp.get(); + return intVal2 + intVal3; +} + + public int getIntValue7() { + return this.computeIntValue3("Movement") + 15; +} + + public int computeIntInt(int value) { + HUD hudMod = ModuleRegistry.HUD.getModule(); + int intVal = hudMod.applyUpdate2(value) + 1; + Integer intVal2 = this.padding.get(); + return intVal + intVal2; +} + + @EventTarget + public void onRenderGui(RenderGuiEvent event) { + cc.novoline.events.events.RenderGuiEvent renderGuiEvent; + int intVal6 = (event.getGuiScreen() instanceof GuiChat ? 1 : 0); + if (intVal6 == 0) { + return; + } + + Boolean propFlag = this.hideOnDebug.get(); + intVal6 = (this.matchesFlag(propFlag) ? 1 : 0); + + if (intVal6 == 0) { + return; + } + + intVal6 = event.getMouseX(); + intVal6 = MovementUtils.evaluateDouble(intVal6); + + int intVal = intVal6; + intVal6 = event.getMouseY(); + int intVal7 = MovementUtils.scaleYInt(intVal6); + int intVal2 = this.getIntValue6(); + GuiState guiState = event.getState(); + GuiState guiState2 = GuiState.CLICK; + if (guiState == GuiState.CLICK) { + int intVal3 = (this.checkInt4(intVal, intVal7) ? 1 : 0); + + if (intVal3 == 0) { + return; + } + + intVal3 = event.getMouseButton(); + + + if (intVal3 != 0) { + return; + } + + this.stateTicks = intVal2 - intVal7; + this.stateFlag = true; + return; + } + + guiState = event.getState(); + guiState2 = GuiState.RENDER; + + if (guiState == guiState2) { + boolean flag2 = this.stateFlag; + + if (this.stateFlag) { + IntProperty intProp = this.height; + int ticks = this.stateTicks + intVal7; + Integer height2 = this.height.getMinimum(); + int intVal8 = height2; + Integer height3 = this.height.getMaximum(); + int intVal9 = height3; + int intVal4 = MathHelper.clamp_int(ticks, intVal8, intVal9); + Integer intVal5 = intVal4; + intProp.set(intVal5); + } + + flag2 = this.checkInt4(intVal, intVal7); + + + if (!flag2) { + return; + } + + GL11.glPushMatrix(); + flag2 = true; + + MovementUtils.evaluateDouble(flag2); + float floatVal = this.getIntValue6(); + float floatVal2 = this.getIntValue7(); + float floatVal3 = this.getIntValue6() + 6 * this.getIntValue24(); + int color = ColorTheme.WHITE.getRGB(); + int color2 = ColorTheme.getColor(0, 0, 0, 100); + RenderUtils.drawBorderedRect(0.0F, floatVal, floatVal2, floatVal3, 2.5F, color, color2); + GL11.glPopMatrix(); + return; + } + + renderGuiEvent = event; + + guiState = event.getState(); + guiState2 = GuiState.RELEASE; + + if (guiState != guiState2) { + return; + } + + renderGuiEvent = event; + + if (renderGuiEvent.getStateTicks3() == 0) { + this.stateFlag = false; + } +} + + public List getListI() { + return this.tabGuiCategoryItemList; +} + + public TabGui(ModuleManager moduleManager, EnumModuleType enumModuleType, String text, String str) { + super(moduleManager, enumModuleType, text, str); + this.dimensionField = Toolkit.getDefaultToolkit().getScreenSize(); + this.stateTicks6 = (int)(this.dimensionField.getHeight() / 2.0); + this.tabGuiCategoryItemList = new ObjectArrayList<>(); + this.stateTicks5 = 0; + this.stateTicks4 = 0; + this.stateTicks2 = 0; + this.stateTicks3 = 0; + IntProperty intProp = IntProperty.of(18); + Integer intVal2 = 15; + IntProperty intProp2 = intProp.minimum(intVal2); + this.fontSize = intProp2.maximum(30); + IntProperty intProp3 = IntProperty.of(1); + IntProperty intProp4 = intProp3.minimum(1); + this.padding = intProp4.maximum(9); + IntProperty intProp5 = IntProperty.of(120); + IntProperty intProp6 = intProp5.minimum(100); + this.alpha = intProp6.maximum(200); + IntProperty intProp7 = IntProperty.of(2); + IntProperty intProp8 = intProp7.minimum(2); + int ticks = this.stateTicks6; + Integer intVal = ticks; + this.height = intProp8.maximum(intVal); + this.blur = BooleanProperty.of(false); + IntProperty intProp9 = IntProperty.of(2); + intVal = 0; + IntProperty intProp10 = intProp9.minimum(intVal); + intVal = 16; + this.smoothness = intProp10.maximum(intVal); + this.hideOnDebug = BooleanProperty.of(false); + Setting setting = new Setting("TG_FONT_SIZE", "Font Size", SettingType.SLIDER, this, this.fontSize, 1.0); + SettingManager.register(setting); + setting = new Setting("TG_PADDING", "Padding", SettingType.SLIDER, this, this.padding, 1.0); + SettingManager.register(setting); + setting = new Setting("TG_ALPHA", "Alpha", SettingType.SLIDER, this, this.alpha, 5.0); + SettingManager.register(setting); + setting = new Setting("TG_SMOOTHNESS", "Smoothness", SettingType.SLIDER, this, this.smoothness, 1.0); + SettingManager.register(setting); + setting = new Setting("TG_BLUR", "Blur", SettingType.CHECKBOX, this, this.blur); + SettingManager.register(setting); + setting = new Setting("TG_HIDE_ON_DEBUG", "F3 Hide", SettingType.CHECKBOX, this, this.hideOnDebug); + SettingManager.register(setting); +} + + public void applyUpdate5(float value, float amount, float factor, float angle) { + RoundedTextureShader roundedTextureShader = RoundedTextureShader.getInstance(); + double doubleVal = value; + double doubleVal2 = amount; + double doubleVal3 = factor; + double doubleVal4 = angle; + Integer intVal = this.smoothness.get(); + double doubleVal5 = intVal.intValue(); + Integer intVal2 = this.alpha.get(); + Color awtColor = new Color(0, 0, 0, intVal2); + roundedTextureShader.drawRoundedRect(doubleVal, doubleVal2, doubleVal3, doubleVal4, 0.0, doubleVal5, awtColor, true); +} + + + public int getRowHeight() { return this.getIntValue6(); } +} diff --git a/src/main/java/cc/novoline/modules/visual/Tracers.java b/src/main/java/cc/novoline/modules/visual/Tracers.java new file mode 100644 index 0000000..bf8f9f2 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/Tracers.java @@ -0,0 +1,138 @@ +package cc.novoline.modules.visual; + +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.modules.PlayerRelationType; +import cc.novoline.utils.RenderUtils; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.Novoline; +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render3DEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import java.util.Iterator; +import java.util.List; +import java.util.function.Predicate; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.entity.player.EntityPlayer; + +public class Tracers extends AbstractModule { + @Property("only-tar") + BooleanProperty onlyTar; + + + @EventTarget + public void onRender3D(Render3DEvent event) { + double[] doubleArr; + boolean flag3 = HUD.H(); + List itemList = this.mc.theWorld.getPlayerEntities(); + Stream stream2 = itemList.stream(); + Predicate predicate = this::matchesEntityPlayer; + Stream stream3 = stream2.filter(predicate); + Collector collector = Collectors.toList(); + List itemList2 = (java.util.List) stream3.collect(collector); + Iterator iter = itemList2.iterator(); + boolean flag = flag3; + + do { + if (!iter.hasNext()) { + break; + } + + EntityPlayer player2 = (EntityPlayer)iter.next(); + EntityPlayer player3 = player2; + if (!player2.isConditionMet16()) { + continue; + } + + player3 = player2; + + if (player3 == this.mc.thePlayer) { + continue; + } + + player3 = player2; + + if (player3.isConditionMet23()) { + continue; + } + + player3 = player2; + + double posX3; + double doubleVal; + double posZ3; + label30: { + double posX2 = player3.lastTickPosX + (player2.posX - player2.lastTickPosX) * event.getPartialTicks(); + Minecraft mcClient = this.mc; + posX3 = posX2 - mcClient.getRenderManager().renderPosX; + double posY2 = player2.lastTickPosY + (player2.posY - player2.lastTickPosY) * event.getPartialTicks(); + Minecraft mcClient2 = this.mc; + doubleVal = posY2 - mcClient2.getRenderManager().renderPosY; + double posZ2 = player2.lastTickPosZ + (player2.posZ - player2.lastTickPosZ) * event.getPartialTicks(); + Minecraft mcClient3 = this.mc; + posZ3 = posZ2 - mcClient3.getRenderManager().renderPosZ; + boolean flag2 = this.mc.gameSettings.viewBobbing; + RenderUtils.renderVisual8(); + this.mc.gameSettings.viewBobbing = false; + this.mc.entityRenderer.renderStep(this.mc.timer.renderPartialTicks, 2); + this.mc.gameSettings.viewBobbing = flag2; + Novoline novolineInst = this.novoline; + byte byteVal = (byte)(novolineInst.getPlayerManager().checkString(player2.getName(), PlayerRelationType.TARGET) ? 1 : 0); + byte byteVal2 = byteVal; + if (byteVal != 0) { + doubleArr = new double[]{1.0, 0.0, 0.0}; + break label30; + } + + byteVal2 = 3; + + doubleArr = new double[byteVal2]; + doubleArr[0] = 1.0; + doubleArr[1] = 1.0; + doubleArr[2] = 1.0; + } + + double[] doubleArr2 = doubleArr; + double doubleVal2 = doubleVal + player2.getEyeHeight(); + RenderUtils.drawElement10(player2, doubleArr2, posX3, doubleVal2, posZ3); + RenderUtils.renderVisual(); + } while (flag); +} + + public Tracers(ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + this.onlyTar = BooleanProperty.of(false); + SettingManager.register(new Setting("TC_ONLY_TAR", "Targets Only", SettingType.CHECKBOX, this, this.onlyTar)); +} + + + private boolean matchesEntityPlayer(EntityPlayer player) { + Boolean propFlag = this.onlyTar.get(); + boolean flag2 = propFlag; + + if (flag2) { + Novoline novolineInst = this.novoline; + boolean flag3 = novolineInst.getPlayerManager().checkString(player.getName(), PlayerRelationType.TARGET); + + if (!flag3) { + return false; + } + } + + flag2 = true; + + + return flag2; +} + + +} diff --git a/src/main/java/cc/novoline/modules/visual/Trail.java b/src/main/java/cc/novoline/modules/visual/Trail.java new file mode 100644 index 0000000..8bda247 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/Trail.java @@ -0,0 +1,259 @@ +package cc.novoline.modules.visual; + +import cc.novoline.events.events.RenderEntityEvent; +import cc.novoline.events.type.RenderEntityState; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.render.PlayerTrailTrack; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.render.TrailVertex; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.PlayerUpdateEvent; +import cc.novoline.events.events.Render3DEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import cc.novoline.modules.ModuleRegistry; +import java.awt.Color; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.function.Predicate; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class Trail extends AbstractModule { + @Property("color-mode") + private final StringProperty colorMode; + private List playerTrailTrackList; + @Property("color") + private final ColorProperty color; + + @EventTarget + public void onRender3D(Render3DEvent event) { + boolean flag; + HUD hudMod; + boolean flag2 = HUD.Q(); + hudMod = ModuleRegistry.HUD.getModule(); + flag = flag2; + Minecraft mcClient = this.mc; + flag2 = this.applyUpdate2((EntityPlayer)mcClient.getRenderViewEntity()); + label24: + if (!flag) { + if (!flag2) { + List itemList = this.playerTrailTrackList; + Minecraft mcClient2 = this.mc; + PlayerTrailTrack playerTrailTrack = new PlayerTrailTrack(this, (EntityPlayer)mcClient2.getRenderViewEntity()); + itemList.add(playerTrailTrack); + break label24; + } + + Minecraft mcClient3 = this.mc; + List itemList2 = (this.resolvePlayerTrailTrack((EntityPlayer)mcClient3.getRenderViewEntity())).getTrailVertexList(); + Minecraft mcClient4 = this.mc; + EntityPlayer player = (EntityPlayer)mcClient4.getRenderViewEntity(); + Minecraft mcClient5 = Minecraft.getMinecraft(); + double doubleVal = mcClient5.getRenderManager().renderPosX; + double doubleVal2 = Minecraft.getMinecraft().getRenderManager().renderPosY; + Minecraft mcClient6 = Minecraft.getMinecraft(); + TrailVertex trailVertex = new TrailVertex(player, doubleVal, doubleVal2, mcClient6.getRenderManager().renderPosZ); + itemList2.add(trailVertex); + } + + List itemList3 = this.playerTrailTrackList; + Iterator iter = itemList3.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + PlayerTrailTrack playerTrailTrack2 = (PlayerTrailTrack)iter.next(); + playerTrailTrack2.drawElement(hudMod); + } +} + + public static Minecraft applyUpdate2(Trail trail) { + return trail.mc; +} + + @EventTarget + public void onPlayerUpdate(PlayerUpdateEvent event) { + Iterator iter = this.playerTrailTrackList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + PlayerTrailTrack playerTrailTrack = (PlayerTrailTrack)iter.next(); + WorldClient world = this.mc.theWorld; + List itemList = world.getPlayerEntities(); + EntityPlayer player = playerTrailTrack.getTargetPlayer(); + if (!itemList.contains(player)) { + List itemList2 = playerTrailTrack.getTrailVertexList2(); + itemList2.clear(); + List itemList3 = this.playerTrailTrackList; + itemList3.remove(playerTrailTrack); + } + } +} + + + private boolean applyUpdate2(EntityPlayer player) { + Iterator iter = this.playerTrailTrackList.iterator(); + + while (true) { + if (!iter.hasNext()) { + break; + } + + PlayerTrailTrack playerTrailTrack = (PlayerTrailTrack)iter.next(); + if (playerTrailTrack.getTargetPlayer() == player) { + return true; + } + } + + return false; +} + + public Trail(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + this.playerTrailTrackList = new CopyOnWriteArrayList<>(); + StringProperty strProp = StringProperty.of("Client"); + String[] stringArr = new String[]{"Client", "Custom"}; + this.colorMode = strProp.acceptableValues(stringArr); + Color awtColor = new Color(200, 200, 200); + int color2 = awtColor.getRGB(); + Integer intVal = color2; + this.color = ColorProperty.e(intVal); + Setting setting = new Setting("TRAIL_COLOR_MODE", "Color Mode", SettingType.COMBOBOX, this, this.colorMode); + SettingManager.register(setting); + setting = new Setting("TRAIL_COLOR", "Color", SettingType.COLOR_PICKER, this, this.color, null, () -> this.colorMode.equals("Custom")); + SettingManager.register(setting); +} + + public static Minecraft resolveMinecraft38(Trail trail) { + return trail.mc; +} + + + private boolean applyInt5(EntityPlayer player) { + boolean flag = HUD.H(); + boolean flag2 = player.isDead; + if (player.isDead) { + return false; + } + + flag2 = player.isConditionMet23(); + + return !flag ? flag2 : !flag2; +} + + private void applyUpdate3(EntityPlayer player) { + List itemList = this.playerTrailTrackList; + Predicate predicate = ((java.util.function.Predicate) (playerTrailTrack) -> playerTrailTrack.getTargetPlayer() == player); + itemList.removeIf(predicate); +} + + public static Minecraft resolveMinecraft(Trail trail) { + return trail.mc; +} + + public static Minecraft applyUpdate3(Trail trail) { + return trail.mc; +} + + + public static Minecraft applyInt5(Trail trail) { + return trail.mc; +} + + private PlayerTrailTrack resolvePlayerTrailTrack(EntityPlayer player) { + PlayerTrailTrack playerTrailTrack; + Iterator iter = this.playerTrailTrackList.iterator(); + + while (true) { + if (iter.hasNext()) { + PlayerTrailTrack playerTrailTrack2 = (PlayerTrailTrack)iter.next(); + playerTrailTrack = playerTrailTrack2; + + if (PlayerTrailTrack.drawElement(playerTrailTrack2) == player) { + playerTrailTrack = playerTrailTrack2; + break; + } + + continue; + } + + return null; + } + + return playerTrailTrack; +} + + @EventTarget + public void handleRenderEntityEvent(RenderEntityEvent event) { + cc.novoline.modules.visual.Trail trail; + RenderEntityEvent renderEntityEvent = event; + if (event.getRenderEntityState() != RenderEntityState.PRE) { + return; + } + + renderEntityEvent = event; + + EntityPlayer player; + boolean flag = renderEntityEvent.getEntityB() instanceof EntityPlayer; + if (!flag) { + return; + } + + trail = this; + player = (EntityPlayer)event.getEntityB(); + + flag = this.applyUpdate2(player); + + label27: + if (!flag) { + Entity entity = event.getEntityB(); + boolean flag2 = entity.isConditionMet23(); + if (flag2) { + break label27; + } + + List itemList = this.playerTrailTrackList; + PlayerTrailTrack playerTrailTrack = new PlayerTrailTrack(this, (EntityPlayer)event.getEntityB()); + itemList.add(playerTrailTrack); + + return; + } + + trail = this; + player = (EntityPlayer)event.getEntityB(); + + PlayerTrailTrack playerTrailTrack2 = trail.resolvePlayerTrailTrack(player); + List itemList2 = playerTrailTrack2.getTrailVertexList2(); + EntityPlayer player2 = PlayerTrailTrack.drawElement(playerTrailTrack2); + double doubleVal3 = event.getDoubleValue2(); + Minecraft mcClient = Minecraft.getMinecraft(); + doubleVal3 += mcClient.getRenderManager().renderPosX; + double doubleVal = event.getCachedValue33(); + Minecraft mcClient2 = Minecraft.getMinecraft(); + double doubleVal4 = doubleVal + mcClient2.getRenderManager().renderPosY; + double doubleVal2 = event.getCachedValue4(); + Minecraft mcClient3 = Minecraft.getMinecraft(); + TrailVertex trailVertex = new TrailVertex(player2, doubleVal3, doubleVal4, doubleVal2 + mcClient3.getRenderManager().renderPosZ); + itemList2.add(trailVertex); +} + + + public cc.novoline.modules.configurations.property.object.StringProperty getColorMode() { return this.colorMode; } + public cc.novoline.modules.configurations.property.object.ColorProperty getColor() { return this.color; } +} diff --git a/src/main/java/cc/novoline/modules/visual/Waypoints.java b/src/main/java/cc/novoline/modules/visual/Waypoints.java new file mode 100644 index 0000000..b9e6423 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/Waypoints.java @@ -0,0 +1,150 @@ +package cc.novoline.modules.visual; + +import cc.novoline.modules.configurations.holder.EKWaypointsHelper; +import cc.novoline.modules.configurations.holder.EKTypeToken; +import cc.novoline.modules.configurations.util.WaypointEntry; +import cc.novoline.utils.render.PropertyValueSerializer; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.Render2DEvent; +import cc.novoline.events.events.Render3DEvent; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import com.viaversion.viaversion.libs.fastutil.objects.ObjectArrayList; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.function.Consumer; +import java.util.function.Predicate; +import java.util.stream.Stream; +import cc.novoline.modules.ModuleManager; +import ninja.leaping.configurate.objectmapping.ObjectMappingException; +import ninja.leaping.configurate.ConfigurationNode; +import ninja.leaping.configurate.objectmapping.serialize.TypeSerializerCollection; +import cc.novoline.modules.configurations.holder.SavingModuleHolderSupport; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; + +public final class Waypoints +extends AbstractModule { + private List waypointEntryList; + private final List waypointEntryList2; + private final static long XOR_KEY = 88321966589754L; + + public boolean evaluateFlag9(String string) { + boolean bl; + SavingModuleHolderSupport.applyUpdate(string, "name"); + Predicate predicate = arg_0 -> Waypoints.invokeCallback(string, arg_0); + boolean bl4 = bl = this.waypointEntryList.removeIf(predicate); + + if (bl4) { + try { + this.performStep26(); + } + catch (ObjectMappingException aZp2) { + this.logger.warn("An error occurred while saving friends list", (Throwable)aZp2); + } + } + bl4 = bl; + + return bl4; +} + + private void performStep25() { + try { + ConfigurationNode agg2 = this.playerManagerConfigisnotlHelper.e(); + Object[] objectArray = new Object[]{"waypoints"}; + ConfigurationNode agg3 = agg2.a(objectArray); + EKWaypointsHelper vY2 = new EKWaypointsHelper(this); + ArrayList arrayList = new ArrayList(); + List list = agg3.a(vY2, arrayList); + this.waypointEntryList.addAll(list); + } + catch (ObjectMappingException aZp2) { + throw new RuntimeException("An error occurred while deserialization of the waypoints file", aZp2); + } +} + + public void handleWaypointEntry(@NonNull WaypointEntry eK) { + this.waypointEntryList.add(eK); + try { + this.performStep26(); + } + catch (ObjectMappingException aZp2) { + this.logger.warn("An error occurred while saving friends list", (Throwable)aZp2); + } +} + + + + @EventTarget + public void onRender3D(Render3DEvent render3DEvent) { + Iterator iterator = this.waypointEntryList.iterator(); + while (true) { + if (!iterator.hasNext()) break; + WaypointEntry eK = iterator.next(); + double d = (float)eK.getStateTicks2() + 0.0f * render3DEvent.getPartialTicks(); + float f = (float)(d - this.mc.getRenderManager().renderPosX); + double d2 = (float)eK.getStateTicks() + 0.0f * render3DEvent.getPartialTicks(); + float f2 = (float)(d2 - this.mc.getRenderManager().renderPosY); + double d3 = (float)eK.getIntValue() + 0.0f * render3DEvent.getPartialTicks(); + float f3 = (float)(d3 - this.mc.getRenderManager().renderPosZ); + eK.setDoubleArray2(eK.buildDoubleArray(f, f2, f3)); + } +} + + public @Nullable WaypointEntry getEKA(String string) { + Stream stream = this.waypointEntryList.stream(); + Predicate predicate = arg_0 -> Waypoints.invokeCallback2(string, arg_0); + Stream stream2 = stream.filter(predicate); + Optional optional = stream2.findFirst(); + return optional.orElse(null); +} + + private static boolean invokeCallback(String string, WaypointEntry eK) { + String string2 = eK.getCachedText(); + return string2.equalsIgnoreCase(string); +} + + @Override + public void handleTypeSerializerCollection(@NonNull TypeSerializerCollection bh2) { + PropertyValueSerializer ayG2 = new PropertyValueSerializer(); + bh2.a(PropertyValueSerializer.typeToken2, ayG2); +} + + public List getWaypointEntryList2() { + return this.waypointEntryList2; +} + + public Waypoints(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String string, String string2, String string3) { + super(moduleManager, string, enumModuleType, string2, string3); + this.waypointEntryList = new ObjectArrayList(); + this.waypointEntryList2 = Collections.unmodifiableList(this.waypointEntryList); + this.performStep25(); +} + + private void performStep26() throws ObjectMappingException { + ConfigurationNode agg2 = this.playerManagerConfigisnotlHelper.e(); + Object[] objectArray = new Object[]{"waypoints"}; + ConfigurationNode agg3 = agg2.a(objectArray); + EKTypeToken a4t2 = new EKTypeToken(this); + agg3.resolveConfigurationNode(a4t2, this.waypointEntryList); +} + + private static boolean invokeCallback2(String string, WaypointEntry eK) { + String string2 = eK.getCachedText(); + return string2.equalsIgnoreCase(string); +} + + public List getListValue7() { + return this.waypointEntryList; +} + + @EventTarget + public void onRender2D(Render2DEvent render2DEvent) { + Consumer consumer = WaypointEntry::renderVisual; + this.waypointEntryList.forEach(consumer); +} +} diff --git a/src/main/java/cc/novoline/modules/visual/Wings.java b/src/main/java/cc/novoline/modules/visual/Wings.java new file mode 100644 index 0000000..894bcfc --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/Wings.java @@ -0,0 +1,90 @@ +package cc.novoline.modules.visual; + +import cc.novoline.events.events.RenderEntityEvent; +import cc.novoline.events.type.RenderEntityState; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.render.ModelDragonWings; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; + +import cc.novoline.events.EventTarget; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.ColorProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import java.awt.Color; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.entity.EntityPlayerSP; +import org.checkerframework.checker.nullness.qual.NonNull; + +public class Wings extends AbstractModule { + @Property("color-mode") + private final StringProperty colorMode; + @Property("scale") + private IntProperty scale; + private static final long XOR_KEY = 50146010453466L; + private ModelDragonWings modelDragonWingsField; + @Property("color") + private final ColorProperty color; + + @EventTarget + public void handleRenderEntityEvent(RenderEntityEvent event) { + RenderEntityEvent renderEntityEvent = event; + + if (event.getRenderEntityState() != RenderEntityState.PRE) { + return; + } + + renderEntityEvent = event; + + + if (renderEntityEvent.getEntityB() == this.mc.thePlayer) { + ModelDragonWings modelDragonWings = this.modelDragonWingsField; + EntityPlayerSP player = this.mc.thePlayer; + float partialTicks = this.mc.timer.renderPartialTicks; + Integer intVal = this.scale.get(); + int intVal2 = intVal; + Color awtColor = this.resolveColor(); + modelDragonWings.renderStep(player, partialTicks, intVal2, awtColor); + } +} + + + private Color resolveColor() { + Wings wings = this; + StringProperty strProp = this.colorMode; + if (!strProp.equals("Custom")) { + return new Color(ColorTheme.getHudColor(0L)); + } + + wings = this; + + ColorProperty colorProp = wings.color; + return colorProp.getAwtColor(); +} + + + public Wings(@NonNull ModuleManager moduleManager, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + this.modelDragonWingsField = new ModelDragonWings(); + StringProperty strProp = StringProperty.of("Client"); + String[] stringArr = new String[]{"Client", "Custom"}; + this.colorMode = strProp.acceptableValues(stringArr); + Color awtColor = new Color(200, 200, 200); + int color2 = awtColor.getRGB(); + Integer intVal = color2; + this.color = ColorProperty.e(intVal); + this.scale = IntProperty.of(100).minimum(50).maximum(250); + Setting setting = new Setting("WINGS_COLOR_MODE", "Color Mode", SettingType.COMBOBOX, this, this.colorMode); + SettingManager.register(setting); + setting = new Setting("WINGS_COLOR", "Color", SettingType.COLOR_PICKER, this, this.color, null, () -> this.colorMode.equals("Custom")); + SettingManager.register(setting); + setting = new Setting("WINGS_SCALE", "Scale", SettingType.SLIDER, this, this.scale, 5.0); + SettingManager.register(setting); +} + + +} diff --git a/src/main/java/cc/novoline/modules/visual/XRay.java b/src/main/java/cc/novoline/modules/visual/XRay.java new file mode 100644 index 0000000..f8ff4f4 --- /dev/null +++ b/src/main/java/cc/novoline/modules/visual/XRay.java @@ -0,0 +1,1077 @@ +package cc.novoline.modules.visual; +import cc.novoline.gui.screen.setting.SettingType; +import cc.novoline.utils.ColorTheme; +import cc.novoline.utils.RenderUtils; +import cc.novoline.utils.TimerUtil; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.utils.render.RotationAngleUtil; + +import cc.novoline.events.EventTarget; +import cc.novoline.events.events.MotionUpdateEvent; +import cc.novoline.events.events.PacketEvent; +import cc.novoline.events.events.Render3DEvent; +import cc.novoline.events.events.SettingEvent; +import cc.novoline.events.events.TickUpdateEvent; +import cc.novoline.events.type.State; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.configurations.annotation.Property; +import cc.novoline.modules.configurations.property.object.BooleanProperty; +import cc.novoline.modules.configurations.property.object.IntProperty; +import cc.novoline.modules.configurations.property.object.ListProperty; +import cc.novoline.modules.configurations.property.object.StringProperty; +import com.google.common.collect.Lists; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.function.Consumer; +import java.util.function.Predicate; +import net.minecraft.block.BlockGoldOre; +import net.minecraft.block.BlockRedstoneOre; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.multiplayer.PlayerControllerMP; + +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.util.MathHelper; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.init.Blocks; +import net.minecraft.network.Packet; +import net.minecraft.network.play.client.C07PacketPlayerDigging$Action; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import org.checkerframework.checker.nullness.qual.NonNull; + +public final class XRay extends AbstractModule { + @Property("tracers-filter") + private final ListProperty tracersFilter; + private int stateTicks; + private int stateTicks2; + @Property("chunk-update") + private final BooleanProperty chunkUpdate; + private TimerUtil timer; + private int stateTicks3; + private List blockPosList; + private TimerUtil timer2; + @Property("tracers") + private final BooleanProperty tracers; + private int stateTicks4; + @Property("mode") + private final StringProperty mode; + private List integerList; + private int stateTicks5; + private BlockPos targetPos; + @Property("delay") + private IntProperty delay; + @Property("distance") + private final IntProperty distance; + @Property("esp") + private final BooleanProperty esp; + private int stateTicks6; + private List packetList; + @Property("opacity") + private final IntProperty opacity; + @Property("esp-filter") + private final ListProperty espFilter; + private List blockPosList2; + private int stateTicks7; + private int stateTicks8; + + @Override + public void onDisable() { + this.mc.renderGlobal.performStep2(); + List itemList = this.blockPosList; + itemList.clear(); + itemList = this.blockPosList2; + itemList.clear(); + itemList = this.packetList; + itemList.clear(); +} + + public int getIntValue8() { + Integer intVal = this.distance.get(); + return intVal; +} + + public IntProperty getOpacity() { + return this.opacity; +} + + public IntProperty getIntPropertyValue6() { + return this.getOpacity(); +} + + @EventTarget + public void onTickUpdate(TickUpdateEvent event) { + TimerUtil timerUtil; + Object obj = this.mc.theWorld; + if (this.mc.theWorld == null) { + return; + } + + BooleanProperty boolProp = this.chunkUpdate; + obj = boolProp.get(); + + boolean flag = ((Boolean) obj); + if (!flag) { + return; + } + + timerUtil = this.timer; + + Integer intVal = this.delay.get(); + long longVal = intVal.intValue(); + flag = timerUtil.delay(longVal); + + if (!flag) { + return; + } + + this.mc.renderGlobal.performStep2(); + timerUtil = this.timer; + + timerUtil.reset(); +} + + public boolean isReadyState23() { + Boolean propFlag = this.esp.get(); + return propFlag; +} + + + @EventTarget + public void onSetting(SettingEvent event) { + cc.novoline.modules.visual.XRay xRay; + int intVal3; + + label40: { + + if (!event.getSettingName().equals("XRAY_ESP")) { + intVal3 = (event.getSettingName().equals("XRAY_TRACERS") ? 1 : 0); + + if (intVal3 == 0) { + break label40; + } + } + + this.mc.renderGlobal.performStep2(); + + + + return; + + } + + intVal3 = (event.getSettingName().equals("XRAY_OPACITY") ? 1 : 0); + + + if (intVal3 == 0) { + return; + } + + xRay = this; + + intVal3 = this.stateTicks2; + + + Integer intVal = this.opacity.get(); + if (intVal3 == intVal) { + return; + } + + this.mc.renderGlobal.performStep2(); + xRay = this; + + IntProperty intProp = this.opacity; + Integer intVal2 = intProp.get(); + xRay.stateTicks2 = intVal2; +} + + @EventTarget + public void onMotionUpdate(MotionUpdateEvent event) { + int intVal; + if (event.getState() == State.PRE) { + XRay xRay = this; + if (this.targetPos == null) { + return; + } + + xRay = this; + + double doubleVal = xRay.mc.thePlayer.rotationYaw; + double angleRad = Math.toRadians(doubleVal); + double doubleVal2 = -MathHelper.sin(angleRad); + double doubleVal3 = this.mc.thePlayer.rotationYaw; + double angleRad2 = Math.toRadians(doubleVal3); + double doubleVal4 = MathHelper.cos(angleRad2); + double doubleVal5 = 2.0; + int intVal2 = -6; + + label96: + while (true) { + int intVal3 = intVal2; + + while (true) { + if (intVal3 >= 7) { + break label96; + } + + int intVal4 = -6; + + while (intVal4 < 7) { + intVal3 = intVal2 % 2; + + label88: { + if (intVal3 != 0) { + break label88; + } + + intVal3 = intVal4 % 2; + + label83: + if (intVal3 != 0) { + BlockPos pos2; + label111: { + double doubleVal6; + double doubleVal7; + double doubleVal8; + label79: { + pos2 = this.targetPos; + doubleVal6 = pos2.getX() + doubleVal2 * doubleVal5; + doubleVal7 = pos2.getY(); + doubleVal8 = pos2.getZ() + doubleVal4 * doubleVal5; + if (!(this.mc.thePlayer.rotationPitch < -60.0F)) { + if (this.mc.thePlayer.rotationPitch <= 60.0F) { + break label79; + } + } + + pos2 = new BlockPos(doubleVal6 + intVal2, doubleVal7, doubleVal8 + intVal4); + + break label111; + } + + EntityPlayerSP player = this.mc.thePlayer; + EnumFacing facing = player.getHorizontalFacing(); + intVal = facing.getFrontOffsetX(); + + if (intVal == 0) { + pos2 = new BlockPos(doubleVal6 + intVal2, doubleVal7 + intVal4, doubleVal8); + break label111; + } + + pos2 = new BlockPos(doubleVal6, doubleVal7 + intVal4, doubleVal8 + intVal2); + } + + List itemList = this.blockPosList2; + byte byteVal = (byte)(itemList.contains(pos2) ? 1 : 0); + if (byteVal != 0) { + break label83; + } + + WorldClient world = this.mc.theWorld; + IBlockState blockState = world.getBlockState(pos2); + Block block = blockState.getBlock(); + byteVal = (byte)(block.evaluateCondition4() ? 1 : 0); + + if (byteVal == 0) { + break label83; + } + + EntityPlayerSP player2 = this.mc.thePlayer; + BlockPos pos = this.targetPos; + if (player2.applyArmorCalculations(pos, pos2) > 2.0) { + EnumFacing facing2 = Block.resolveEnumFacing(pos2); + float[] floatArr = RotationAngleUtil.evaluateFloat(pos2, facing2); + List itemList2 = this.packetList; + int intVal5 = facing2.getIndex(); + EntityPlayerSP player3 = this.mc.thePlayer; + C08PacketPlayerBlockPlacement playerBlockPlacementPacket = new C08PacketPlayerBlockPlacement(pos2, intVal5, player3.getHeldItem(), floatArr[0], floatArr[1], floatArr[2]); + itemList2.add(playerBlockPlacementPacket); + List itemList3 = this.blockPosList2; + itemList3.add(pos2); + } + } + } + + intVal4++; + + } + + intVal2++; + + break; + } + } + + List itemList4 = this.blockPosList2; + Predicate predicate = this::matchesBlockPos; + itemList4.removeIf(predicate); + + this.targetPos = null; + } +} + + @EventTarget + public void onRender3D(Render3DEvent event) { + boolean flag; + boolean flag2; + boolean flag3; + boolean flag4; + boolean flag5; + boolean flag6; + boolean flag7; + boolean flag8; + boolean flag9; + boolean flag10; + boolean flag11; + boolean flag12; + boolean flag13; + boolean flag14; + boolean flag15; + TimerUtil timerUtil; + boolean flag16; + short shortVal; + + flag16 = HUD.H(); + XRay xRay = this; + + BooleanProperty boolProp = this.esp; + Boolean propFlag = boolProp.get(); + if (propFlag) { + List itemList = this.blockPosList; + Iterator iter = itemList.iterator(); + + do { + if (!iter.hasNext()) { + break; + } + + BlockPos pos = (BlockPos)iter.next(); + Minecraft mcClient = this.mc; + + EntityPlayerSP player = this.mc.thePlayer; + double doubleVal3 = pos.getX(); + double doubleVal4 = pos.getZ(); + double doubleVal = player.resolveDouble(doubleVal3, doubleVal4); + IntProperty intProp = this.distance; + Integer intVal = intProp.get(); + double doubleVal2; + shortVal = (short)((doubleVal2 = doubleVal - intVal.intValue()) == 0.0 ? 0 : (doubleVal2 < 0.0 ? -1 : 1)); + + if (shortVal > 0) { + continue; + } + + mcClient = this.mc; + + + Block block; + WorldClient world = mcClient.theWorld; + IBlockState blockState = world.getBlockState(pos); + block = blockState.getBlock(); + BooleanProperty boolProp2 = this.esp; + Boolean propFlag2 = boolProp2.get(); + flag = propFlag2; + + label384: + if (flag) { + label382: { + if (block == Blocks.diamond_ore) { + ListProperty listProp = this.espFilter; + flag2 = listProp.contains("Diamond"); + + if (flag2) { + flag2 = true; + break label382; + } + } + + flag2 = false; + } + + boolean flag17; + label375: { + flag17 = flag2; + if (block == Blocks.iron_ore) { + ListProperty listProp2 = this.espFilter; + flag3 = listProp2.contains("Iron"); + + if (flag3) { + flag3 = true; + break label375; + } + } + + flag3 = false; + } + + boolean flag18; + label368: { + flag18 = flag3; + if (block == Blocks.lapis_ore) { + ListProperty listProp3 = this.espFilter; + flag4 = listProp3.contains("Lapis"); + + if (flag4) { + flag4 = true; + break label368; + } + } + + flag4 = false; + } + + boolean flag19; + label361: { + flag19 = flag4; + if (block == Blocks.redstone_ore) { + ListProperty listProp4 = this.espFilter; + flag5 = listProp4.contains("Redstone"); + + if (flag5) { + flag5 = true; + break label361; + } + } + + flag5 = false; + } + + boolean flag20; + label354: { + flag20 = flag5; + if (block == Blocks.coal_ore) { + ListProperty listProp5 = this.espFilter; + flag6 = listProp5.contains("Coal"); + + if (flag6) { + flag6 = true; + break label354; + } + } + + flag6 = false; + } + + boolean flag21; + label347: { + flag21 = flag6; + if (block == Blocks.emerald_ore) { + ListProperty listProp6 = this.espFilter; + flag7 = listProp6.contains("Emerald"); + + if (flag7) { + flag7 = true; + break label347; + } + } + + flag7 = false; + } + + boolean flag22; + label340: { + flag22 = flag7; + if (block == Blocks.gold_ore) { + ListProperty listProp7 = this.espFilter; + flag8 = listProp7.contains("Gold"); + + if (flag8) { + flag8 = true; + break label340; + } + } + + flag8 = false; + } + + boolean flag23 = flag8; + flag = flag17; + + if (flag17) { + int ticks = this.stateTicks3; + RenderUtils.createVector4d(pos, ticks); + + break label384; + + } + + flag = flag18; + + + + if (flag) { + int ticks2 = this.stateTicks8; + RenderUtils.createVector4d(pos, ticks2); + + break label384; + + } + + flag = flag19; + + + + if (flag) { + int ticks3 = this.stateTicks4; + RenderUtils.createVector4d(pos, ticks3); + + break label384; + + } + + flag = flag20; + + + + if (flag) { + int ticks4 = this.stateTicks7; + RenderUtils.createVector4d(pos, ticks4); + + break label384; + + } + + flag = flag21; + + + + if (flag) { + int ticks5 = this.stateTicks5; + RenderUtils.createVector4d(pos, ticks5); + + break label384; + + } + + flag = flag22; + + + + if (flag) { + int ticks6 = this.stateTicks6; + RenderUtils.createVector4d(pos, ticks6); + + break label384; + + } + + flag = flag23; + + + if (flag) { + int ticks7 = this.stateTicks; + RenderUtils.createVector4d(pos, ticks7); + } + } + + BooleanProperty boolProp3 = this.tracers; + Boolean propFlag3 = boolProp3.get(); + flag = propFlag3; + + if (flag) { + label292: { + if (block == Blocks.diamond_ore) { + ListProperty listProp8 = this.tracersFilter; + flag9 = listProp8.contains("Diamond"); + + if (flag9) { + flag9 = true; + break label292; + } + } + + flag9 = false; + } + + boolean flag24; + label285: { + flag24 = flag9; + if (block == Blocks.iron_ore) { + ListProperty listProp9 = this.tracersFilter; + flag10 = listProp9.contains("Iron"); + + if (flag10) { + flag10 = true; + break label285; + } + } + + flag10 = false; + } + + boolean flag25; + label278: { + flag25 = flag10; + if (block == Blocks.lapis_ore) { + ListProperty listProp10 = this.tracersFilter; + flag11 = listProp10.contains("Lapis"); + + if (flag11) { + flag11 = true; + break label278; + } + } + + flag11 = false; + } + + boolean flag26; + label271: { + flag26 = flag11; + if (block == Blocks.redstone_ore) { + ListProperty listProp11 = this.tracersFilter; + flag12 = listProp11.contains("Redstone"); + + if (flag12) { + flag12 = true; + break label271; + } + } + + flag12 = false; + } + + boolean flag27; + label264: { + flag27 = flag12; + if (block == Blocks.coal_ore) { + ListProperty listProp12 = this.tracersFilter; + flag13 = listProp12.contains("Coal"); + + if (flag13) { + flag13 = true; + break label264; + } + } + + flag13 = false; + } + + boolean flag28; + label257: { + flag28 = flag13; + if (block == Blocks.emerald_ore) { + ListProperty listProp13 = this.tracersFilter; + flag14 = listProp13.contains("Emerald"); + + if (flag14) { + flag14 = true; + break label257; + } + } + + flag14 = false; + } + + boolean flag29; + label250: { + flag29 = flag14; + if (block == Blocks.gold_ore) { + ListProperty listProp14 = this.tracersFilter; + flag15 = listProp14.contains("Gold"); + + if (flag15) { + flag15 = true; + break label250; + } + } + + flag15 = false; + } + + boolean flag30 = flag15; + boolean flag31 = flag24; + + if (flag24) { + int ticks8 = this.stateTicks3; + RenderUtils.drawElement12(pos, ticks8); + + continue; + + } + + flag31 = flag25; + + + + if (flag31) { + int ticks9 = this.stateTicks8; + RenderUtils.drawElement12(pos, ticks9); + + continue; + + } + + flag31 = flag26; + + + + if (flag31) { + int ticks10 = this.stateTicks4; + RenderUtils.drawElement12(pos, ticks10); + + continue; + + } + + flag31 = flag27; + + + + if (flag31) { + int ticks11 = this.stateTicks7; + RenderUtils.drawElement12(pos, ticks11); + + continue; + + } + + flag31 = flag28; + + + + if (flag31) { + int ticks12 = this.stateTicks5; + RenderUtils.drawElement12(pos, ticks12); + + continue; + + } + + flag31 = flag29; + + + + if (flag31) { + int ticks13 = this.stateTicks6; + RenderUtils.drawElement12(pos, ticks13); + if (flag16) { + continue; + } + } + + flag31 = flag30; + + + if (flag31) { + int ticks14 = this.stateTicks; + RenderUtils.drawElement12(pos, ticks14); + } + } + } while (flag16); + } + + xRay = this; + + + Minecraft mcClient2 = xRay.mc; + + if (xRay.mc.thePlayer == null) { + return; + } + + mcClient2 = this.mc; + + + PlayerControllerMP controller = mcClient2.playerController; + shortVal = (short)(controller.evaluateCondition3() ? 1 : 0); + + + if (shortVal == 0) { + return; + } + + List itemList2 = this.packetList; + shortVal = (short)(itemList2.isEmpty() ? 1 : 0); + + + + if (shortVal != 0) { + return; + } + + shortVal = 1800; + + + short shortVal2 = shortVal; + short shortVal3 = 180; + List itemList3 = this.packetList; + int size2 = itemList3.size(); + + if (size2 > shortVal3) { + label179: { + List itemList4 = this.packetList; + List itemList5 = itemList4.subList(0, shortVal3); + TimerUtil timerUtil2 = this.timer2; + long longVal = shortVal2; + boolean flag32 = timerUtil2.delay(longVal); + + if (!flag32) { + break label179; + } + + Consumer> consumer = this::applyInt5; + itemList5.forEach(consumer); + List itemList6 = this.packetList; + itemList6.removeAll(itemList5); + + + TimerUtil timerUtil3 = this.timer2; + timerUtil3.reset(); + } + + if (flag16) { + return; + } + } + + timerUtil = this.timer2; + + long longVal2 = shortVal2; + size2 = (timerUtil.delay(longVal2) ? 1 : 0); + + + if (size2 == 0) { + return; + } + + List itemList7 = this.packetList; + Consumer> consumer2 = this::applyInt5; + itemList7.forEach(consumer2); + List itemList8 = this.packetList; + itemList8.clear(); + timerUtil = this.timer2; + + timerUtil.reset(); +} + + @EventTarget + public void onPacket(PacketEvent event) { + cc.novoline.modules.visual.XRay xRay; + boolean flag; + boolean flag2 = HUD.Q(); + PacketEvent packetEvent = event; + + if (event.getState() == cc.novoline.events.State.OUTGOING) { + Packet packet = event.getPacket(); + if (!flag2) { + if (!(packet instanceof C07PacketPlayerDigging)) { + return; + } + + packet = event.getPacket(); + } + + label100: { + C07PacketPlayerDigging playerDiggingPacket = (C07PacketPlayerDigging)packet; + C07PacketPlayerDigging$Action playerDigging$ActionPacket = playerDiggingPacket.getStatus2(); + C07PacketPlayerDigging$Action playerDigging$ActionPacket2 = C07PacketPlayerDigging$Action.STOP_DESTROY_BLOCK; + if (playerDigging$ActionPacket == C07PacketPlayerDigging$Action.STOP_DESTROY_BLOCK) { + List itemList = this.blockPosList; + BlockPos pos = playerDiggingPacket.getPosition2(); + itemList.remove(pos); + break label100; + } + + playerDigging$ActionPacket = playerDiggingPacket.getStatus2(); + playerDigging$ActionPacket2 = C07PacketPlayerDigging$Action.START_DESTROY_BLOCK; + + label70: + if (playerDigging$ActionPacket == playerDigging$ActionPacket2) { + StringProperty strProp = this.mode; + int intVal = (strProp.equals("Advanced") ? 1 : 0); + if (intVal == 0) { + break label70; + } + + BlockPos pos2 = playerDiggingPacket.getPosition2(); + intVal = pos2.getY(); + + label85: { + EntityPlayerSP player = this.mc.thePlayer; + BlockPos pos3 = player.getPosition(); + if (intVal == pos3.getY()) { + break label85; + } + + xRay = this; + + if (this.mc.thePlayer.rotationPitch >= -60.0F) { + xRay = this; + + if (!(this.mc.thePlayer.rotationPitch > 60.0F)) { + break label70; + } + } + } + + xRay = this; + + xRay.targetPos = playerDiggingPacket.getPosition2(); + } + } + + return; + } + + packetEvent = event; + + + Packet packet2 = packetEvent.getPacket(); + if (!flag2) { + if (!(packet2 instanceof S23PacketBlockChange)) { + return; + } + + packet2 = event.getPacket(); + } + + BlockPos pos4; + S23PacketBlockChange blockChangePacket = (S23PacketBlockChange)packet2; + pos4 = blockChangePacket.getBlockPosition(); + WorldClient world = this.mc.theWorld; + IBlockState blockState = world.getBlockState(pos4); + Block block = blockState.getBlock(); + flag = block instanceof BlockGoldOre; + + if (!flag) { + flag = block instanceof BlockRedstoneOre; + + if (!flag) { + return; + } + } + + List itemList2 = this.blockPosList; + flag = itemList2.contains(pos4); + + if (!flag) { + List itemList3 = this.blockPosList; + itemList3.add(pos4); + } +} + + public StringProperty getMode() { + return this.mode; +} + + public StringProperty getStringPropertyE() { + return this.getMode(); +} + + + public List getListValue8() { + return this.integerList; +} + + + @Override + public void onEnable() { + this.mc.renderGlobal.performStep2(); +} + + public List getListValue9() { + return this.blockPosList; +} + + + public XRay(@NonNull ModuleManager moduleManager, char ch, EnumModuleType enumModuleType, String text) { + super(moduleManager, enumModuleType, text); + Integer[] integerArr = new Integer[33]; + integerArr[0] = 10; + integerArr[1] = 11; + integerArr[2] = 8; + integerArr[3] = 9; + integerArr[4] = 14; + integerArr[5] = 15; + integerArr[6] = 16; + integerArr[7] = 21; + integerArr[8] = 41; + integerArr[9] = 42; + integerArr[10] = 46; + integerArr[11] = 48; + integerArr[12] = 52; + integerArr[13] = 56; + integerArr[14] = 57; + integerArr[15] = 61; + integerArr[16] = 62; + integerArr[17] = 73; + integerArr[18] = 74; + integerArr[19] = 84; + integerArr[20] = 89; + integerArr[21] = 103; + integerArr[22] = 116; + integerArr[23] = 117; + integerArr[24] = 118; + integerArr[25] = 120; + integerArr[26] = 129; + integerArr[27] = 133; + integerArr[28] = 137; + integerArr[29] = 145; + integerArr[30] = 152; + integerArr[31] = 153; + integerArr[32] = 154; + this.integerList = Lists.newArrayList(integerArr); + this.blockPosList = new ArrayList<>(); + this.blockPosList2 = new ArrayList<>(); + this.timer = new TimerUtil(); + this.timer2 = new TimerUtil(); + this.packetList = new ArrayList<>(); + StringProperty strProp = StringProperty.of("Advanced"); + String[] stringArr = new String[]{"Basic", "Advanced"}; + this.mode = strProp.acceptableValues(stringArr); + this.opacity = IntProperty.of(160).minimum(0).maximum(255); + this.esp = BooleanProperty.of(true); + this.tracers = BooleanProperty.of(true); + ListProperty listProp = ListProperty.of("Diamond", "Gold", "Iron"); + String[] stringArr2 = new String[]{"Redstone", "Diamond", "Emerald", "Lapis", "Iron", "Coal", "Gold"}; + this.espFilter = listProp.acceptableValues((Object[])stringArr2); + ListProperty listProp2 = ListProperty.of("Diamond", "Gold", "Iron"); + String[] stringArr3 = new String[]{"Redstone", "Diamond", "Emerald", "Lapis", "Iron", "Coal", "Gold"}; + this.tracersFilter = listProp2.acceptableValues((Object[])stringArr3); + this.distance = IntProperty.of(42).minimum(16).maximum(64); + this.chunkUpdate = BooleanProperty.of(false); + this.delay = IntProperty.of(5000).minimum(1000).maximum(10000); + this.stateTicks3 = ColorTheme.getColor(0, 255, 255); + this.stateTicks8 = ColorTheme.getColor(225, 225, 225); + this.stateTicks7 = ColorTheme.getColor(255, 0, 0); + this.stateTicks6 = ColorTheme.getColor(0, 255, 0); + this.stateTicks = ColorTheme.getColor(255, 255, 0); + this.stateTicks4 = ColorTheme.getColor(0, 0, 255); + this.stateTicks5 = ColorTheme.getColor(0, 30, 30); + Setting setting = new Setting("XRAY_MODE", "Mode", SettingType.COMBOBOX, this, this.mode); + SettingManager.register(setting); + Setting setting2 = new Setting("XRAY_ESP", "ESP", SettingType.CHECKBOX, this, this.esp); + SettingManager.register(setting2); + Setting setting3 = new Setting("XRAY_ESP_FILTER", "ESP Filter", SettingType.SELECTBOX, this, this.espFilter, this.esp::get); + SettingManager.register(setting3); + Setting setting4 = new Setting("XRAY_TRACERS", "Tracers", SettingType.CHECKBOX, this, this.tracers); + SettingManager.register(setting4); + Setting setting5 = new Setting("XRAY_TRACERS_FILTER", "Tracers Filter", SettingType.SELECTBOX, this, this.tracersFilter, this.tracers::get); + SettingManager.register(setting5); + Setting setting6 = new Setting("XRAY_OPACITY", "Opacity", SettingType.SLIDER, this, this.opacity, 5.0); + SettingManager.register(setting6); + Setting setting7 = new Setting("XRAY_DISTANCE", "Distance", SettingType.SLIDER, this, this.distance, 4.0); + SettingManager.register(setting7); + Setting setting8 = new Setting("XRAY_UPDATE", "Chunks Update", SettingType.CHECKBOX, this, this.chunkUpdate); + SettingManager.register(setting8); + Setting setting9 = new Setting("XRAY_DELAY", "Update Delay", SettingType.SLIDER, this, this.delay, 500.0, "ms", this.chunkUpdate::get); + SettingManager.register(setting9); +} + + private boolean matchesBlockPos(BlockPos pos) { + EntityPlayerSP player = this.mc.thePlayer; + int intVal = (player.resolveDouble2(pos) > 8.0) ? 1 : 0; + + return ((intVal & 1) != 0); +} + +} diff --git a/src/main/java/cc/novoline/script/Script.java b/src/main/java/cc/novoline/script/Script.java new file mode 100644 index 0000000..e495637 --- /dev/null +++ b/src/main/java/cc/novoline/script/Script.java @@ -0,0 +1,248 @@ +package cc.novoline.script; +import cc.novoline.Novoline; +import cc.novoline.events.EventManager; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.modules.ModuleFactory; +import cc.novoline.modules.configurations.holder.StoringModuleHolder; +import cc.novoline.utils.notifications.NotificationType; +import cc.novoline.gui.screen.setting.SettingManager; +import cc.novoline.gui.screen.setting.Setting; +import cc.novoline.modules.configurations.holder.ModuleHolder; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import javax.script.Invocable; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; +import cc.novoline.modules.ModuleArrayMap; +import cc.novoline.modules.ModuleManager; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiIngame; +import net.minecraft.client.gui.GuiNewChat; +import net.minecraft.network.play.client.C02PacketUseEntity$Action; +import net.minecraft.network.play.client.C07PacketPlayerDigging$Action; +import net.minecraft.network.play.client.C0BPacketEntityAction$Action; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.EnumFacing; +import net.skidunion.security.SkidUnionAnnotation; +import org.lwjgl.opengl.GL11; + +public class Script { + public String textField; + public ScriptEngine scriptEngineField; + public Invocable invocable; + public StoringModuleHolder storingModuleHolder; + public String textValue; + public AbstractModule abstractModuleField; + private static boolean e; + public boolean flagValue; + + public static boolean e() { + return e; +} + + public void c(boolean bl) { + block3: { + Script script; + script = this; + + script.flagValue = bl; + if (bl) break block3; + script = this; + script.b(); + } +} + + public void b() { + boolean bl; + block9: { + AbstractModule abstractModule; + boolean bl2 = Script.e(); + EventManager.unregister(this); + bl = bl2; + abstractModule = this.abstractModuleField; + + if (abstractModule == null) break block9; + abstractModule = this.abstractModuleField; + boolean bl3 = abstractModule.isEnabled(); + if (bl3) { + bl3 = this.abstractModuleField.toggle(); + } + } + Novoline novoline = Novoline.getInstance(); + ModuleManager moduleManager = novoline.getModuleManager(); + ArrayList arrayList = new ArrayList(moduleManager.getModules().values()); + Iterator iterator = arrayList.iterator(); + while (true) { + { + ModuleHolder moduleHolder; + if (!iterator.hasNext()) break; + ModuleHolder moduleHolder2 = moduleHolder = (ModuleHolder)iterator.next(); + if (bl) { + String string = moduleHolder2.getName(); + StringBuilder stringBuilder = new StringBuilder(); + StringBuilder stringBuilder2 = stringBuilder.append(this.textField); + if (!string.equals(stringBuilder2.append("-SCRIPT").toString())) continue; + moduleHolder2 = moduleHolder; + } + Object Module2 = moduleHolder2.getModule(); + ((AbstractModule)Module2).setEnabled(false); + List list = SettingManager.getSettingsByMod((AbstractModule)this.abstractModuleField); + Iterator iterator2 = list.iterator(); + while (true) { + if (!iterator2.hasNext()) break; + Setting playerESPHelper2 = (Setting)iterator2.next(); + List list2 = SettingManager.getSettings(); + list2.remove(playerESPHelper2); + + } + Novoline novoline2 = Novoline.getInstance(); + ModuleManager moduleManager2 = novoline2.getModuleManager(); + ModuleArrayMap moduleArrayMap = moduleManager2.getModules(); + StringBuilder stringBuilder = new StringBuilder(); + StringBuilder stringBuilder3 = stringBuilder.append(this.textField); + moduleArrayMap.remove(stringBuilder3.append("-SCRIPT").toString()); + } + Novoline novoline3 = Novoline.getInstance(); + List list = novoline3.getScriptManager().b(); + list.remove(this.abstractModuleField); + } +} + + public void h() { + try { + this.scriptEngineField.eval(this.getTextValue()); + } + catch (ScriptException scriptException) { + GuiIngame guiIngame = Minecraft.getMinecraft().ingameGUI; + GuiNewChat guiNewChat = guiIngame.getChatGUI(); + StringBuilder stringBuilder = new StringBuilder(); + StringBuilder stringBuilder2 = stringBuilder.append((Object)EnumChatFormatting.RED); + String string = scriptException.getMessage(); + String string2 = string.split("\tat")[0]; + guiNewChat.printChatMessage(new ChatComponentText(stringBuilder2.append(string2).toString())); + } +} + + private static AbstractModule invokeCallback(ScriptModule scriptModule, ModuleManager moduleManager) { + return scriptModule; +} + + public static boolean a() { + boolean bl = Script.e(); + return !bl; +} + + public Script(String string, String string2) { + ScriptEngine scriptEngine; + this.textValue = string2; + this.textField = string; + ScriptEngineManager scriptEngineManager = new ScriptEngineManager(); + this.scriptEngineField = scriptEngine = scriptEngineManager.getEngineByName("nashorn"); + this.invocable = (Invocable)((Object)scriptEngine); + scriptEngine.put("script", this); + scriptEngine.put("COMBAT", (Object)EnumModuleType.COMBAT); + scriptEngine.put("MOVEMENT", (Object)EnumModuleType.MOVEMENT); + scriptEngine.put("PLAYER", (Object)EnumModuleType.PLAYER); + scriptEngine.put("MISC", (Object)EnumModuleType.MISC); + scriptEngine.put("VISUALS", (Object)EnumModuleType.VISUALS); + scriptEngine.put("EXPLOITS", (Object)EnumModuleType.EXPLOITS); + scriptEngine.put("connection", new ScriptConnection(scriptEngine)); + scriptEngine.put("player", new ScriptPlayer()); + scriptEngine.put("world", new ScriptWorld()); + scriptEngine.put("angle_util", new ScriptAngleUtil()); + scriptEngine.put("entity_util", new ScriptEntity()); + scriptEngine.put("timer_util", new ScriptGameUtil()); + scriptEngine.put("file_util", new ScriptFileUtil()); + scriptEngine.put("web_util", new ScriptWebUtil()); + scriptEngine.put("game", new ScriptTimer()); + scriptEngine.put("client", new ScriptClientUtil()); + scriptEngine.put("render_util", new ScriptRenderUtil()); + scriptEngine.put("ATTACK", (Object)C02PacketUseEntity$Action.ATTACK); + scriptEngine.put("INTERACT", (Object)C02PacketUseEntity$Action.INTERACT); + scriptEngine.put("INTERACT_AT", (Object)C02PacketUseEntity$Action.INTERACT_AT); + scriptEngine.put("START_SNEAKING", (Object)C0BPacketEntityAction$Action.START_SNEAKING); + scriptEngine.put("STOP_SNEAKING", (Object)C0BPacketEntityAction$Action.STOP_SNEAKING); + scriptEngine.put("START_SPRINTING", (Object)C0BPacketEntityAction$Action.START_SPRINTING); + scriptEngine.put("STOP_SPRINTING", (Object)C0BPacketEntityAction$Action.STOP_SPRINTING); + scriptEngine.put("STOP_SLEEPING", (Object)C0BPacketEntityAction$Action.STOP_SLEEPING); + scriptEngine.put("RIDING_JUMP", (Object)C0BPacketEntityAction$Action.RIDING_JUMP); + scriptEngine.put("OPEN_INVENTORY", (Object)C0BPacketEntityAction$Action.OPEN_INVENTORY); + scriptEngine.put("UP", EnumFacing.UP); + scriptEngine.put("DOWN", EnumFacing.DOWN); + scriptEngine.put("SOUTH", EnumFacing.SOUTH); + scriptEngine.put("NORTH", EnumFacing.NORTH); + scriptEngine.put("WEST", EnumFacing.WEST); + scriptEngine.put("EAST", EnumFacing.EAST); + scriptEngine.put("START_DESTROY_BLOCK", (Object)C07PacketPlayerDigging$Action.START_DESTROY_BLOCK); + scriptEngine.put("ABORT_DESTROY_BLOCK", (Object)C07PacketPlayerDigging$Action.ABORT_DESTROY_BLOCK); + scriptEngine.put("STOP_DESTROY_BLOCK", (Object)C07PacketPlayerDigging$Action.STOP_DESTROY_BLOCK); + scriptEngine.put("DROP_ALL_ITEMS", (Object)C07PacketPlayerDigging$Action.DROP_ALL_ITEMS); + scriptEngine.put("DROP_ITEM", (Object)C07PacketPlayerDigging$Action.DROP_ITEM); + scriptEngine.put("RELEASE_USE_ITEM", (Object)C07PacketPlayerDigging$Action.RELEASE_USE_ITEM); + scriptEngine.put("INFO", NotificationType.INFO); + scriptEngine.put("SUCCESS", NotificationType.SUCCESS); + scriptEngine.put("WARNING", NotificationType.WARNING); + scriptEngine.put("ERROR", NotificationType.ERROR); + scriptEngine.put("GL11", GL11.class); +} + + public String getTextValue() { + return this.textValue; +} + + public String g() { + return this.textField; +} + + public AbstractModule d() { + return this.abstractModuleField; +} + + public static void b(boolean bl) { + e = bl; +} + + public boolean c() { + return this.flagValue; +} + + static { + if (!Script.e()) { + Script.b(true); + } + } + + @SkidUnionAnnotation + public ScriptModule registerModule(String string, EnumModuleType enumModuleType) { + this.b(); + EventManager.register(this); + Novoline novoline = Novoline.getInstance(); + ScriptModule scriptModule = new ScriptModule(novoline.getModuleManager(), string, enumModuleType, this.scriptEngineField); + ModuleFactory moduleFactory = $lambdaCapture$0(scriptModule); + Novoline novoline2 = Novoline.getInstance(); + ModuleManager moduleManager = novoline2.getModuleManager(); + StringBuilder stringBuilder = new StringBuilder(); + StringBuilder stringBuilder2 = stringBuilder.append(this.textField); + String string2 = stringBuilder2.append("-SCRIPT").toString(); + moduleManager.register(string2, moduleFactory, false); + this.abstractModuleField = scriptModule; + Novoline novoline3 = Novoline.getInstance(); + List list = novoline3.getScriptManager().b(); + list.add(scriptModule); + return scriptModule; +} + + public void a(String string) { + this.textValue = string; +} + + private static ModuleFactory $lambdaCapture$0(ScriptModule $c0) { + return arg_0 -> Script.invokeCallback($c0, arg_0); +} +} + diff --git a/src/main/java/cc/novoline/script/ScriptAngleUtil.java b/src/main/java/cc/novoline/script/ScriptAngleUtil.java new file mode 100644 index 0000000..b806f81 --- /dev/null +++ b/src/main/java/cc/novoline/script/ScriptAngleUtil.java @@ -0,0 +1,23 @@ +package cc.novoline.script; + +import cc.novoline.utils.render.RotationAngleUtil; +import net.minecraft.entity.Entity; +import net.minecraft.util.Vec3; +import net.skidunion.security.SkidUnionAnnotation; + +public class ScriptAngleUtil { + @SkidUnionAnnotation + public float[] getAngles(Entity entity) { + return RotationAngleUtil.getRotationsEntity(entity); +} + + @SkidUnionAnnotation + public float getYawToPoint(double value, double amount) { + return RotationAngleUtil.evaluateFloat(value, amount); +} + + @SkidUnionAnnotation + public Vec3 getVec3(double x, double y, double z) { + return new Vec3(x, y, z); +} +} diff --git a/src/main/java/cc/novoline/script/ScriptClientUtil.java b/src/main/java/cc/novoline/script/ScriptClientUtil.java new file mode 100644 index 0000000..74d5eed --- /dev/null +++ b/src/main/java/cc/novoline/script/ScriptClientUtil.java @@ -0,0 +1,58 @@ +package cc.novoline.script; + +import cc.novoline.Novoline; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.combat.KillAura; +import cc.novoline.utils.notifications.NotificationManager; +import cc.novoline.utils.notifications.NotificationType; +import java.util.Arrays; +import cc.novoline.modules.ModuleManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiIngame; +import net.minecraft.entity.Entity; +import net.minecraft.util.ChatComponentText; +import net.skidunion.security.SkidUnionAnnotation; + +public class ScriptClientUtil { + @SkidUnionAnnotation + public void print(String... args) { + String textStr = Arrays.toString(args); + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(textStr)); +} + + @SkidUnionAnnotation + public String getVersion() { + return Novoline.getInstance().getVersion(); +} + + @SkidUnionAnnotation + public void toggleModule(String text) { + Novoline novolineInst = Novoline.getInstance(); + ModuleManager modManager = novolineInst.getModuleManager(); + AbstractModule mod = modManager.getByName(text); + mod.toggle(); +} + + @SkidUnionAnnotation + public void postNotification(String text, String str, int value, NotificationType notificationType) { + Novoline novolineInst = Novoline.getInstance(); + NotificationManager notifManager = novolineInst.getNotificationManager(); + notifManager.pop(text, str, value, notificationType); +} + + @SkidUnionAnnotation + public Entity getAuraTarget() { + Novoline novolineInst = Novoline.getInstance(); + ModuleManager modManager = novolineInst.getModuleManager(); + KillAura killAura = modManager.getByClass(KillAura.class); + return killAura.getTrackedEntity(); +} + + @SkidUnionAnnotation + public boolean isEnabled(String text) { + Novoline novolineInst = Novoline.getInstance(); + ModuleManager modManager = novolineInst.getModuleManager(); + AbstractModule mod = modManager.getModules().getByName(text); + return mod.isEnabled(); +} +} diff --git a/src/main/java/cc/novoline/script/ScriptConnection.java b/src/main/java/cc/novoline/script/ScriptConnection.java new file mode 100644 index 0000000..939633c --- /dev/null +++ b/src/main/java/cc/novoline/script/ScriptConnection.java @@ -0,0 +1,1303 @@ +package cc.novoline.script; + +import java.util.UUID; +import javax.script.ScriptEngine; +import net.minecraft.network.play.client.C09PacketHeldItemChange; +import net.minecraft.network.play.client.C01PacketChatMessage; +import net.minecraft.network.play.client.C00PacketKeepAlive; +import net.minecraft.network.play.client.C04PacketPlayerPosition; +import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.network.play.client.C06PacketPlayerPosLook; +import net.minecraft.network.play.client.C05PacketPlayerLook; +import net.minecraft.network.play.client.C18PacketSpectate; +import net.minecraft.network.play.client.C03PacketPlayer; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.network.play.client.C0CPacketInput; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraft.network.play.client.C07PacketPlayerDigging; +import net.minecraft.network.play.client.C0APacketAnimation; +import net.minecraft.network.play.client.C13PacketPlayerAbilities; +import net.minecraft.network.play.client.C0FPacketConfirmTransaction; +import net.minecraft.network.play.client.C0EPacketClickWindow; +import net.minecraft.network.play.client.C02PacketUseEntity; +import net.minecraft.client.Minecraft; +import net.minecraft.client.network.NetHandlerPlayClient; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C02PacketUseEntity$Action; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.Vec3; +import net.skidunion.security.SkidUnionAnnotation; + +public class ScriptConnection { + private ScriptEngine scriptEngineField; + + public ScriptConnection(ScriptEngine scriptEngine) { + this.scriptEngineField = scriptEngine; +} + + @SkidUnionAnnotation + public void sendPacket(String message, Object... objectArray) { + java.lang.Object obj; + java.lang.Object obj2; + int intVal; + Minecraft mcClient; + int intVal2; + mcClient = Minecraft.getMinecraft(); + String textStr = message; + intVal2 = ScriptWorld.b(); + byte byteVal = -1; + intVal = intVal2; + intVal2 = textStr.hashCode(); + label345: + if (intVal == 0) { + switch (intVal2) { + case 1546828: + intVal2 = (textStr.equals("0x04") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 0; + if (intVal == 0) { + break; + } + case 1546846: + intVal2 = (textStr.equals("0x0F") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 1; + if (intVal == 0) { + break; + } + case 1546830: + intVal2 = (textStr.equals("0x06") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 2; + if (intVal == 0) { + break; + } + case 1546829: + intVal2 = (textStr.equals("0x05") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 3; + if (intVal == 0) { + break; + } + case 1546827: + intVal2 = (textStr.equals("0x03") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 4; + if (intVal == 0) { + break; + } + case 1546826: + intVal2 = (textStr.equals("0x02") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 5; + if (intVal == 0) { + break; + } + case 1546825: + intVal2 = (textStr.equals("0x01") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 6; + if (intVal == 0) { + break; + } + case 1546832: + intVal2 = (textStr.equals("0x08") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 7; + if (intVal == 0) { + break; + } + case 1546831: + intVal2 = (textStr.equals("0x07") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 8; + if (intVal == 0) { + break; + } + case 1546833: + intVal2 = (textStr.equals("0x09") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 9; + if (intVal == 0) { + break; + } + case 1546841: + intVal2 = (textStr.equals("0x0A") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 10; + if (intVal == 0) { + break; + } + case 1546842: + intVal2 = (textStr.equals("0x0B") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 11; + if (intVal == 0) { + break; + } + case 1546824: + intVal2 = (textStr.equals("0x00") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 12; + if (intVal == 0) { + break; + } + case 1546844: + intVal2 = (textStr.equals("0x0D") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 13; + if (intVal == 0) { + break; + } + case 47951626: + intVal2 = (textStr.equals("0x013") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 14; + if (intVal == 0) { + break; + } + case 1546843: + intVal2 = (textStr.equals("0x0C") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 15; + if (intVal == 0) { + break; + } + case 1546845: + intVal2 = (textStr.equals("0x0E") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 16; + if (intVal == 0) { + break; + } + case 1546863: + intVal2 = (textStr.equals("0x18") ? 1 : 0); + if (intVal != 0) { + break label345; + } + + if (intVal2 != 0) { + byteVal = 17; + } + } + + intVal2 = byteVal; + } + + label250: { + label249: { + label248: { + label247: { + label366: { + label367: { + label244: { + label368: { + label369: { + label370: { + label240: { + label371: { + label372: { + label237: { + switch (intVal2) { + case 0: + String textStr2 = String.valueOf(objectArray[0]); + double doubleVal = Double.parseDouble(textStr2); + textStr2 = String.valueOf(objectArray[1]); + double doubleVal3 = Double.parseDouble(textStr2); + textStr2 = String.valueOf(objectArray[2]); + double doubleVal4 = Double.parseDouble(textStr2); + Boolean flag = (Boolean)objectArray[3]; + boolean flag11 = flag; + NetHandlerPlayClient netHandler = mcClient.thePlayer.sendQueue; + netHandler.addToSendQueue(new C04PacketPlayerPosition(doubleVal, doubleVal3, doubleVal4, flag11)); + if (intVal == 0) { + return; + } + case 1: + switch (objectArray.length) { + case 0: + NetHandlerPlayClient netHandler2 = mcClient.thePlayer.sendQueue; + C0FPacketConfirmTransaction confirmTransactionPacket = new C0FPacketConfirmTransaction(); + netHandler2.addToSendQueue(confirmTransactionPacket); + if (intVal == 0) { + break; + } + case 3: + Integer intVal3 = (Integer)objectArray[0]; + int intVal4 = intVal3; + Object uidObj = objectArray[1]; + short shortVal = Short.parseShort(String.valueOf(uidObj)); + Boolean flag2 = (Boolean)objectArray[2]; + boolean flag12 = flag2; + NetHandlerPlayClient netHandler3 = mcClient.thePlayer.sendQueue; + C0FPacketConfirmTransaction confirmTransactionPacket2 = new C0FPacketConfirmTransaction(intVal4, shortVal, flag12); + netHandler3.addToSendQueue(confirmTransactionPacket2); + } + + if (intVal == 0) { + return; + } + case 2: + String textStr3 = String.valueOf(objectArray[0]); + double doubleVal2 = Double.parseDouble(textStr3); + textStr3 = String.valueOf(objectArray[1]); + double doubleVal5 = Double.parseDouble(textStr3); + textStr3 = String.valueOf(objectArray[2]); + double doubleVal6 = Double.parseDouble(textStr3); + textStr3 = String.valueOf(objectArray[3]); + float floatVal4 = Float.parseFloat(textStr3); + textStr3 = String.valueOf(objectArray[4]); + float floatVal5 = Float.parseFloat(textStr3); + Boolean flag3 = (Boolean)objectArray[5]; + boolean flag13 = flag3; + NetHandlerPlayClient netHandler4 = mcClient.thePlayer.sendQueue; + C06PacketPlayerPosLook playerPosLookPacket = new C06PacketPlayerPosLook(doubleVal2, doubleVal5, doubleVal6, floatVal4, floatVal5, flag13); + netHandler4.addToSendQueue(playerPosLookPacket); + if (intVal == 0) { + return; + } + case 3: + break; + case 4: + break label237; + case 5: + break label372; + case 6: + break label371; + case 7: + break label240; + case 8: + break label370; + case 9: + break label369; + case 10: + break label368; + case 11: + break label244; + case 12: + break label367; + case 13: + break label366; + case 14: + break label247; + case 15: + break label248; + case 16: + break label249; + case 17: + break label250; + default: + return; + } + + String textStr4 = String.valueOf(objectArray[0]); + float floatVal = Float.parseFloat(textStr4); + textStr4 = String.valueOf(objectArray[1]); + float floatVal6 = Float.parseFloat(textStr4); + Boolean flag4 = (Boolean)objectArray[2]; + boolean flag14 = flag4; + NetHandlerPlayClient netHandler5 = mcClient.thePlayer.sendQueue; + C05PacketPlayerLook playerLookPacket = new C05PacketPlayerLook(floatVal, floatVal6, flag14); + netHandler5.addToSendQueue(playerLookPacket); + if (intVal == 0) { + return; + } + } + + int len = objectArray.length; + if (intVal == 0) { + if (len == 0) { + NetHandlerPlayClient netHandler6 = mcClient.thePlayer.sendQueue; + C03PacketPlayer playerPacket = new C03PacketPlayer(); + netHandler6.addToSendQueue(playerPacket); + return; + } + + len = objectArray.length; + } + + if (len != 1) { + return; + } + + NetHandlerPlayClient netHandler7 = mcClient.thePlayer.sendQueue; + Boolean flag15 = (Boolean)objectArray[0]; + C03PacketPlayer playerPacket2 = new C03PacketPlayer(flag15); + netHandler7.addToSendQueue(playerPacket2); + if (intVal == 0) { + return; + } + } + + Entity entity = (Entity)objectArray[0]; + Object obj3 = objectArray[1]; + if (intVal == 0) { + if (obj3 instanceof C02PacketUseEntity$Action) { + NetHandlerPlayClient netHandler8 = mcClient.thePlayer.sendQueue; + C02PacketUseEntity useEntityPacket = new C02PacketUseEntity(entity, (C02PacketUseEntity$Action)objectArray[1]); + netHandler8.addToSendQueue(useEntityPacket); + return; + } + + obj3 = objectArray[1]; + } + + Vec3 vec = (Vec3)obj3; + NetHandlerPlayClient netHandler9 = mcClient.thePlayer.sendQueue; + C02PacketUseEntity useEntityPacket2 = new C02PacketUseEntity(entity, vec); + netHandler9.addToSendQueue(useEntityPacket2); + if (intVal == 0) { + return; + } + } + + NetHandlerPlayClient netHandler10 = mcClient.thePlayer.sendQueue; + C01PacketChatMessage chatMessagePacket = new C01PacketChatMessage((String)objectArray[0]); + netHandler10.addToSendQueue(chatMessagePacket); + if (intVal == 0) { + return; + } + } + + switch (objectArray.length) { + case 0: + NetHandlerPlayClient netHandler11 = mcClient.thePlayer.sendQueue; + C08PacketPlayerBlockPlacement playerBlockPlacementPacket = new C08PacketPlayerBlockPlacement(); + netHandler11.addToSendQueue(playerBlockPlacementPacket); + if (intVal == 0) { + break; + } + case 1: + NetHandlerPlayClient netHandler12 = mcClient.thePlayer.sendQueue; + C08PacketPlayerBlockPlacement playerBlockPlacementPacket2 = new C08PacketPlayerBlockPlacement((ItemStack)objectArray[0]); + netHandler12.addToSendQueue(playerBlockPlacementPacket2); + if (intVal == 0) { + break; + } + case 6: + BlockPos pos = (BlockPos)objectArray[0]; + Integer intVal5 = (Integer)objectArray[1]; + int intVal11 = intVal5; + ItemStack stack = (ItemStack)objectArray[2]; + String textStr5 = String.valueOf(objectArray[3]); + float floatVal7 = Float.parseFloat(textStr5); + textStr5 = String.valueOf(objectArray[4]); + float floatVal8 = Float.parseFloat(textStr5); + textStr5 = String.valueOf(objectArray[5]); + float floatVal9 = Float.parseFloat(textStr5); + NetHandlerPlayClient netHandler13 = mcClient.thePlayer.sendQueue; + C08PacketPlayerBlockPlacement playerBlockPlacementPacket3 = new C08PacketPlayerBlockPlacement(pos, intVal11, stack, floatVal7, floatVal8, floatVal9); + netHandler13.addToSendQueue(playerBlockPlacementPacket3); + } + + if (intVal == 0) { + return; + } + } + + label373: { + int len2 = objectArray.length; + if (intVal == 0) { + if (len2 == 0) { + NetHandlerPlayClient netHandler14 = mcClient.thePlayer.sendQueue; + C07PacketPlayerDigging playerDiggingPacket = new C07PacketPlayerDigging(); + netHandler14.addToSendQueue(playerDiggingPacket); + return; + } + + obj = objectArray; + if (intVal != 0) { + break label373; + } + + len2 = objectArray.length; + } + + if (len2 != 3) { + return; + } + + obj = objectArray[1]; + } + + BlockPos pos2 = (BlockPos)obj; + EnumFacing facing = (EnumFacing)objectArray[2]; + net.minecraft.network.play.client.C07PacketPlayerDigging$Action playerDigging$ActionPacket = (net.minecraft.network.play.client.C07PacketPlayerDigging$Action)objectArray[0]; + NetHandlerPlayClient netHandler15 = mcClient.thePlayer.sendQueue; + C07PacketPlayerDigging playerDiggingPacket2 = new C07PacketPlayerDigging(playerDigging$ActionPacket, pos2, facing); + netHandler15.addToSendQueue(playerDiggingPacket2); + if (intVal == 0) { + return; + } + } + + int len3 = objectArray.length; + if (intVal == 0) { + if (len3 == 0) { + NetHandlerPlayClient netHandler16 = mcClient.thePlayer.sendQueue; + C09PacketHeldItemChange heldItemChangePacket = new C09PacketHeldItemChange(); + netHandler16.addToSendQueue(heldItemChangePacket); + return; + } + + len3 = objectArray.length; + } + + if (len3 != 1) { + return; + } + + NetHandlerPlayClient netHandler17 = mcClient.thePlayer.sendQueue; + Integer intVal6 = (Integer)objectArray[0]; + C09PacketHeldItemChange heldItemChangePacket2 = new C09PacketHeldItemChange(intVal6); + netHandler17.addToSendQueue(heldItemChangePacket2); + if (intVal == 0) { + return; + } + } + + NetHandlerPlayClient netHandler18 = mcClient.thePlayer.sendQueue; + C0APacketAnimation animationPacket = new C0APacketAnimation(); + netHandler18.addToSendQueue(animationPacket); + if (intVal == 0) { + return; + } + } + + label375: { + int len4 = objectArray.length; + if (intVal == 0) { + if (len4 == 0) { + NetHandlerPlayClient netHandler19 = mcClient.thePlayer.sendQueue; + C0BPacketEntityAction entityActionPacket = new C0BPacketEntityAction(); + netHandler19.addToSendQueue(entityActionPacket); + return; + } + + obj2 = objectArray; + if (intVal != 0) { + break label375; + } + + len4 = objectArray.length; + } + + if (len4 != 1) { + return; + } + + obj2 = objectArray[0]; + } + + Entity entity2 = (Entity)obj2; + NetHandlerPlayClient netHandlerPlayClient = mcClient.thePlayer.sendQueue; + C0BPacketEntityAction entityActionPacket2 = new C0BPacketEntityAction(entity2, (net.minecraft.network.play.client.C0BPacketEntityAction$Action)objectArray[1]); + netHandlerPlayClient.addToSendQueue(entityActionPacket2); + if (intVal == 0) { + return; + } + } + + int len5 = objectArray.length; + if (intVal == 0) { + if (len5 == 0) { + NetHandlerPlayClient netHandlerPlayClient2 = mcClient.thePlayer.sendQueue; + C00PacketKeepAlive keepAlivePacket = new C00PacketKeepAlive(); + netHandlerPlayClient2.addToSendQueue(keepAlivePacket); + return; + } + + len5 = objectArray.length; + } + + if (len5 != 1) { + return; + } + + NetHandlerPlayClient netHandlerPlayClient3 = mcClient.thePlayer.sendQueue; + Integer intVal7 = (Integer)objectArray[0]; + C00PacketKeepAlive keepAlivePacket2 = new C00PacketKeepAlive(intVal7); + netHandlerPlayClient3.addToSendQueue(keepAlivePacket2); + if (intVal == 0) { + return; + } + } + + NetHandlerPlayClient netHandlerPlayClient4 = mcClient.thePlayer.sendQueue; + Integer intVal8 = (Integer)objectArray[0]; + C0DPacketCloseWindow closeWindowPacket = new C0DPacketCloseWindow(intVal8); + netHandlerPlayClient4.addToSendQueue(closeWindowPacket); + if (intVal == 0) { + return; + } + } + + String textStr6 = String.valueOf(objectArray[0]); + float floatVal2 = Float.parseFloat(textStr6); + textStr6 = String.valueOf(objectArray[1]); + float floatVal10 = Float.parseFloat(textStr6); + Boolean flag5 = (Boolean)objectArray[2]; + boolean flag16 = flag5; + Boolean flag6 = (Boolean)objectArray[3]; + boolean flag17 = flag6; + Boolean flag7 = (Boolean)objectArray[4]; + boolean flag18 = flag7; + Boolean flag8 = (Boolean)objectArray[5]; + boolean flag19 = flag8; + NetHandlerPlayClient netHandlerPlayClient5 = mcClient.thePlayer.sendQueue; + C13PacketPlayerAbilities playerAbilitiesPacket = new C13PacketPlayerAbilities(floatVal2, floatVal10, flag16, flag17, flag18, flag19); + netHandlerPlayClient5.addToSendQueue(playerAbilitiesPacket); + if (intVal == 0) { + return; + } + } + + String textStr7 = String.valueOf(objectArray[0]); + float floatVal3 = Float.parseFloat(textStr7); + textStr7 = String.valueOf(objectArray[1]); + float floatVal11 = Float.parseFloat(textStr7); + Boolean flag9 = (Boolean)objectArray[2]; + boolean flag20 = flag9; + Boolean flag10 = (Boolean)objectArray[3]; + boolean flag21 = flag10; + NetHandlerPlayClient netHandlerPlayClient6 = mcClient.thePlayer.sendQueue; + C0CPacketInput inputPacket = new C0CPacketInput(floatVal3, floatVal11, flag20, flag21); + netHandlerPlayClient6.addToSendQueue(inputPacket); + if (intVal == 0) { + return; + } + } + + Integer intVal9 = (Integer)objectArray[0]; + int intVal10 = intVal9; + intVal9 = (Integer)objectArray[1]; + int intVal12 = intVal9; + intVal9 = (Integer)objectArray[2]; + int intVal13 = intVal9; + intVal9 = (Integer)objectArray[3]; + int intVal14 = intVal9; + ItemStack stack2 = (ItemStack)objectArray[4]; + Object actObj = objectArray[5]; + short shortVal2 = Short.parseShort(String.valueOf(actObj)); + NetHandlerPlayClient netHandlerPlayClient7 = mcClient.thePlayer.sendQueue; + C0EPacketClickWindow clickWindowPacket = new C0EPacketClickWindow(intVal10, intVal12, intVal13, intVal14, stack2, shortVal2); + netHandlerPlayClient7.addToSendQueue(clickWindowPacket); + if (intVal == 0) { + return; + } + } + + if (objectArray.length == 0) { + NetHandlerPlayClient netHandlerPlayClient8 = mcClient.thePlayer.sendQueue; + C18PacketSpectate spectatePacket = new C18PacketSpectate(); + netHandlerPlayClient8.addToSendQueue(spectatePacket); + return; + } + + NetHandlerPlayClient netHandlerPlayClient9 = mcClient.thePlayer.sendQueue; + C18PacketSpectate spectatePacket2 = new C18PacketSpectate((UUID)objectArray[0]); + netHandlerPlayClient9.addToSendQueue(spectatePacket2); +} + + @SkidUnionAnnotation + public void sendPacketNoEvent(String message, Object... objectArray) { + java.lang.Object obj; + java.lang.Object obj2; + int intVal; + Minecraft mcClient; + int intVal2; + intVal2 = ScriptWorld.a(); + mcClient = Minecraft.getMinecraft(); + String textStr = message; + byte byteVal = -1; + intVal = intVal2; + intVal2 = textStr.hashCode(); + label345: + if (intVal != 0) { + switch (intVal2) { + case 1546828: + intVal2 = (textStr.equals("0x04") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 0; + if (intVal != 0) { + break; + } + case 1546846: + intVal2 = (textStr.equals("0x0F") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 1; + if (intVal != 0) { + break; + } + case 1546830: + intVal2 = (textStr.equals("0x06") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 2; + if (intVal != 0) { + break; + } + case 1546829: + intVal2 = (textStr.equals("0x05") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 3; + if (intVal != 0) { + break; + } + case 1546827: + intVal2 = (textStr.equals("0x03") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 4; + if (intVal != 0) { + break; + } + case 1546826: + intVal2 = (textStr.equals("0x02") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 5; + if (intVal != 0) { + break; + } + case 1546825: + intVal2 = (textStr.equals("0x01") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 6; + if (intVal != 0) { + break; + } + case 1546832: + intVal2 = (textStr.equals("0x08") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 7; + if (intVal != 0) { + break; + } + case 1546831: + intVal2 = (textStr.equals("0x07") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 8; + if (intVal != 0) { + break; + } + case 1546833: + intVal2 = (textStr.equals("0x09") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 9; + if (intVal != 0) { + break; + } + case 1546841: + intVal2 = (textStr.equals("0x0A") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 10; + if (intVal != 0) { + break; + } + case 1546842: + intVal2 = (textStr.equals("0x0B") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 11; + if (intVal != 0) { + break; + } + case 1546824: + intVal2 = (textStr.equals("0x00") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 12; + if (intVal != 0) { + break; + } + case 1546844: + intVal2 = (textStr.equals("0x0D") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 13; + if (intVal != 0) { + break; + } + case 47951626: + intVal2 = (textStr.equals("0x013") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 14; + if (intVal != 0) { + break; + } + case 1546843: + intVal2 = (textStr.equals("0x0C") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 15; + if (intVal != 0) { + break; + } + case 1546845: + intVal2 = (textStr.equals("0x0E") ? 1 : 0); + + if (intVal2 == 0) { + break; + } + + byteVal = 16; + if (intVal != 0) { + break; + } + case 1546863: + intVal2 = (textStr.equals("0x18") ? 1 : 0); + if (intVal == 0) { + break label345; + } + + if (intVal2 != 0) { + byteVal = 17; + } + } + + intVal2 = byteVal; + } + + label250: { + label249: { + label248: { + label247: { + label366: { + label367: { + label244: { + label368: { + label369: { + label370: { + label240: { + label371: { + label372: { + label237: { + switch (intVal2) { + case 0: + String textStr2 = String.valueOf(objectArray[0]); + double doubleVal = Double.parseDouble(textStr2); + textStr2 = String.valueOf(objectArray[1]); + double doubleVal3 = Double.parseDouble(textStr2); + textStr2 = String.valueOf(objectArray[2]); + double doubleVal4 = Double.parseDouble(textStr2); + Boolean flag = (Boolean)objectArray[3]; + boolean flag11 = flag; + NetHandlerPlayClient netHandler = mcClient.thePlayer.sendQueue; + netHandler.sendPacketNoEvent(new C04PacketPlayerPosition(doubleVal, doubleVal3, doubleVal4, flag11)); + if (intVal != 0) { + return; + } + case 1: + switch (objectArray.length) { + case 0: + NetHandlerPlayClient netHandler2 = mcClient.thePlayer.sendQueue; + C0FPacketConfirmTransaction confirmTransactionPacket = new C0FPacketConfirmTransaction(); + netHandler2.sendPacketNoEvent(confirmTransactionPacket); + if (intVal != 0) { + break; + } + case 3: + Integer intVal3 = (Integer)objectArray[0]; + int intVal4 = intVal3; + Object uidObj = objectArray[1]; + short shortVal = Short.parseShort(String.valueOf(uidObj)); + Boolean flag2 = (Boolean)objectArray[2]; + boolean flag12 = flag2; + NetHandlerPlayClient netHandler3 = mcClient.thePlayer.sendQueue; + C0FPacketConfirmTransaction confirmTransactionPacket2 = new C0FPacketConfirmTransaction(intVal4, shortVal, flag12); + netHandler3.sendPacketNoEvent(confirmTransactionPacket2); + } + + if (intVal != 0) { + return; + } + case 2: + String textStr3 = String.valueOf(objectArray[0]); + double doubleVal2 = Double.parseDouble(textStr3); + textStr3 = String.valueOf(objectArray[1]); + double doubleVal5 = Double.parseDouble(textStr3); + textStr3 = String.valueOf(objectArray[2]); + double doubleVal6 = Double.parseDouble(textStr3); + textStr3 = String.valueOf(objectArray[3]); + float floatVal4 = Float.parseFloat(textStr3); + textStr3 = String.valueOf(objectArray[4]); + float floatVal5 = Float.parseFloat(textStr3); + Boolean flag3 = (Boolean)objectArray[5]; + boolean flag13 = flag3; + NetHandlerPlayClient netHandler4 = mcClient.thePlayer.sendQueue; + C06PacketPlayerPosLook playerPosLookPacket = new C06PacketPlayerPosLook(doubleVal2, doubleVal5, doubleVal6, floatVal4, floatVal5, flag13); + netHandler4.sendPacketNoEvent(playerPosLookPacket); + if (intVal != 0) { + return; + } + case 3: + break; + case 4: + break label237; + case 5: + break label372; + case 6: + break label371; + case 7: + break label240; + case 8: + break label370; + case 9: + break label369; + case 10: + break label368; + case 11: + break label244; + case 12: + break label367; + case 13: + break label366; + case 14: + break label247; + case 15: + break label248; + case 16: + break label249; + case 17: + break label250; + default: + return; + } + + String textStr4 = String.valueOf(objectArray[0]); + float floatVal = Float.parseFloat(textStr4); + textStr4 = String.valueOf(objectArray[1]); + float floatVal6 = Float.parseFloat(textStr4); + Boolean flag4 = (Boolean)objectArray[2]; + boolean flag14 = flag4; + NetHandlerPlayClient netHandler5 = mcClient.thePlayer.sendQueue; + C05PacketPlayerLook playerLookPacket = new C05PacketPlayerLook(floatVal, floatVal6, flag14); + netHandler5.sendPacketNoEvent(playerLookPacket); + if (intVal != 0) { + return; + } + } + + int len = objectArray.length; + if (intVal != 0) { + if (len == 0) { + NetHandlerPlayClient netHandler6 = mcClient.thePlayer.sendQueue; + C03PacketPlayer playerPacket = new C03PacketPlayer(); + netHandler6.sendPacketNoEvent(playerPacket); + return; + } + + len = objectArray.length; + } + + if (len != 1) { + return; + } + + NetHandlerPlayClient netHandler7 = mcClient.thePlayer.sendQueue; + Boolean flag15 = (Boolean)objectArray[0]; + C03PacketPlayer playerPacket2 = new C03PacketPlayer(flag15); + netHandler7.sendPacketNoEvent(playerPacket2); + if (intVal != 0) { + return; + } + } + + Entity entity = (Entity)objectArray[0]; + Object obj3 = objectArray[1]; + if (intVal != 0) { + if (obj3 instanceof C02PacketUseEntity$Action) { + NetHandlerPlayClient netHandler8 = mcClient.thePlayer.sendQueue; + C02PacketUseEntity useEntityPacket = new C02PacketUseEntity(entity, (C02PacketUseEntity$Action)objectArray[1]); + netHandler8.sendPacketNoEvent(useEntityPacket); + return; + } + + obj3 = objectArray[1]; + } + + Vec3 vec = (Vec3)obj3; + NetHandlerPlayClient netHandler9 = mcClient.thePlayer.sendQueue; + C02PacketUseEntity useEntityPacket2 = new C02PacketUseEntity(entity, vec); + netHandler9.sendPacketNoEvent(useEntityPacket2); + if (intVal != 0) { + return; + } + } + + NetHandlerPlayClient netHandler10 = mcClient.thePlayer.sendQueue; + C01PacketChatMessage chatMessagePacket = new C01PacketChatMessage((String)objectArray[0]); + netHandler10.sendPacketNoEvent(chatMessagePacket); + if (intVal != 0) { + return; + } + } + + switch (objectArray.length) { + case 0: + NetHandlerPlayClient netHandler11 = mcClient.thePlayer.sendQueue; + C08PacketPlayerBlockPlacement playerBlockPlacementPacket = new C08PacketPlayerBlockPlacement(); + netHandler11.sendPacketNoEvent(playerBlockPlacementPacket); + if (intVal != 0) { + break; + } + case 1: + NetHandlerPlayClient netHandler12 = mcClient.thePlayer.sendQueue; + C08PacketPlayerBlockPlacement playerBlockPlacementPacket2 = new C08PacketPlayerBlockPlacement((ItemStack)objectArray[0]); + netHandler12.sendPacketNoEvent(playerBlockPlacementPacket2); + if (intVal != 0) { + break; + } + case 6: + BlockPos pos = (BlockPos)objectArray[0]; + Integer intVal5 = (Integer)objectArray[1]; + int intVal11 = intVal5; + ItemStack stack = (ItemStack)objectArray[2]; + String textStr5 = String.valueOf(objectArray[3]); + float floatVal7 = Float.parseFloat(textStr5); + textStr5 = String.valueOf(objectArray[4]); + float floatVal8 = Float.parseFloat(textStr5); + textStr5 = String.valueOf(objectArray[5]); + float floatVal9 = Float.parseFloat(textStr5); + NetHandlerPlayClient netHandler13 = mcClient.thePlayer.sendQueue; + C08PacketPlayerBlockPlacement playerBlockPlacementPacket3 = new C08PacketPlayerBlockPlacement(pos, intVal11, stack, floatVal7, floatVal8, floatVal9); + netHandler13.sendPacketNoEvent(playerBlockPlacementPacket3); + } + + if (intVal != 0) { + return; + } + } + + label373: { + int len2 = objectArray.length; + if (intVal != 0) { + if (len2 == 0) { + NetHandlerPlayClient netHandler14 = mcClient.thePlayer.sendQueue; + C07PacketPlayerDigging playerDiggingPacket = new C07PacketPlayerDigging(); + netHandler14.sendPacketNoEvent(playerDiggingPacket); + return; + } + + obj = objectArray; + if (intVal == 0) { + break label373; + } + + len2 = objectArray.length; + } + + if (len2 != 3) { + return; + } + + obj = objectArray[1]; + } + + BlockPos pos2 = (BlockPos)obj; + EnumFacing facing = (EnumFacing)objectArray[2]; + net.minecraft.network.play.client.C07PacketPlayerDigging$Action playerDigging$ActionPacket = (net.minecraft.network.play.client.C07PacketPlayerDigging$Action)objectArray[0]; + NetHandlerPlayClient netHandler15 = mcClient.thePlayer.sendQueue; + C07PacketPlayerDigging playerDiggingPacket2 = new C07PacketPlayerDigging(playerDigging$ActionPacket, pos2, facing); + netHandler15.sendPacketNoEvent(playerDiggingPacket2); + if (intVal != 0) { + return; + } + } + + int len3 = objectArray.length; + if (intVal != 0) { + if (len3 == 0) { + NetHandlerPlayClient netHandler16 = mcClient.thePlayer.sendQueue; + C09PacketHeldItemChange heldItemChangePacket = new C09PacketHeldItemChange(); + netHandler16.sendPacketNoEvent(heldItemChangePacket); + return; + } + + len3 = objectArray.length; + } + + if (len3 != 1) { + return; + } + + NetHandlerPlayClient netHandler17 = mcClient.thePlayer.sendQueue; + Integer intVal6 = (Integer)objectArray[0]; + C09PacketHeldItemChange heldItemChangePacket2 = new C09PacketHeldItemChange(intVal6); + netHandler17.sendPacketNoEvent(heldItemChangePacket2); + if (intVal != 0) { + return; + } + } + + NetHandlerPlayClient netHandler18 = mcClient.thePlayer.sendQueue; + C0APacketAnimation animationPacket = new C0APacketAnimation(); + netHandler18.sendPacketNoEvent(animationPacket); + if (intVal != 0) { + return; + } + } + + label375: { + int len4 = objectArray.length; + if (intVal != 0) { + if (len4 == 0) { + NetHandlerPlayClient netHandler19 = mcClient.thePlayer.sendQueue; + C0BPacketEntityAction entityActionPacket = new C0BPacketEntityAction(); + netHandler19.sendPacketNoEvent(entityActionPacket); + return; + } + + obj2 = objectArray; + if (intVal == 0) { + break label375; + } + + len4 = objectArray.length; + } + + if (len4 != 1) { + return; + } + + obj2 = objectArray[0]; + } + + Entity entity2 = (Entity)obj2; + NetHandlerPlayClient netHandlerPlayClient = mcClient.thePlayer.sendQueue; + C0BPacketEntityAction entityActionPacket2 = new C0BPacketEntityAction(entity2, (net.minecraft.network.play.client.C0BPacketEntityAction$Action)objectArray[1]); + netHandlerPlayClient.sendPacketNoEvent(entityActionPacket2); + if (intVal != 0) { + return; + } + } + + int len5 = objectArray.length; + if (intVal != 0) { + if (len5 == 0) { + NetHandlerPlayClient netHandlerPlayClient2 = mcClient.thePlayer.sendQueue; + C00PacketKeepAlive keepAlivePacket = new C00PacketKeepAlive(); + netHandlerPlayClient2.sendPacketNoEvent(keepAlivePacket); + return; + } + + len5 = objectArray.length; + } + + if (len5 != 1) { + return; + } + + NetHandlerPlayClient netHandlerPlayClient3 = mcClient.thePlayer.sendQueue; + Integer intVal7 = (Integer)objectArray[0]; + C00PacketKeepAlive keepAlivePacket2 = new C00PacketKeepAlive(intVal7); + netHandlerPlayClient3.sendPacketNoEvent(keepAlivePacket2); + if (intVal != 0) { + return; + } + } + + NetHandlerPlayClient netHandlerPlayClient4 = mcClient.thePlayer.sendQueue; + Integer intVal8 = (Integer)objectArray[0]; + C0DPacketCloseWindow closeWindowPacket = new C0DPacketCloseWindow(intVal8); + netHandlerPlayClient4.sendPacketNoEvent(closeWindowPacket); + if (intVal != 0) { + return; + } + } + + String textStr6 = String.valueOf(objectArray[0]); + float floatVal2 = Float.parseFloat(textStr6); + textStr6 = String.valueOf(objectArray[1]); + float floatVal10 = Float.parseFloat(textStr6); + Boolean flag5 = (Boolean)objectArray[2]; + boolean flag16 = flag5; + Boolean flag6 = (Boolean)objectArray[3]; + boolean flag17 = flag6; + Boolean flag7 = (Boolean)objectArray[4]; + boolean flag18 = flag7; + Boolean flag8 = (Boolean)objectArray[5]; + boolean flag19 = flag8; + NetHandlerPlayClient netHandlerPlayClient5 = mcClient.thePlayer.sendQueue; + C13PacketPlayerAbilities playerAbilitiesPacket = new C13PacketPlayerAbilities(floatVal2, floatVal10, flag16, flag17, flag18, flag19); + netHandlerPlayClient5.sendPacketNoEvent(playerAbilitiesPacket); + if (intVal != 0) { + return; + } + } + + String textStr7 = String.valueOf(objectArray[0]); + float floatVal3 = Float.parseFloat(textStr7); + textStr7 = String.valueOf(objectArray[1]); + float floatVal11 = Float.parseFloat(textStr7); + Boolean flag9 = (Boolean)objectArray[2]; + boolean flag20 = flag9; + Boolean flag10 = (Boolean)objectArray[3]; + boolean flag21 = flag10; + NetHandlerPlayClient netHandlerPlayClient6 = mcClient.thePlayer.sendQueue; + C0CPacketInput inputPacket = new C0CPacketInput(floatVal3, floatVal11, flag20, flag21); + netHandlerPlayClient6.sendPacketNoEvent(inputPacket); + if (intVal != 0) { + return; + } + } + + Integer intVal9 = (Integer)objectArray[0]; + int intVal10 = intVal9; + intVal9 = (Integer)objectArray[1]; + int intVal12 = intVal9; + intVal9 = (Integer)objectArray[2]; + int intVal13 = intVal9; + intVal9 = (Integer)objectArray[3]; + int intVal14 = intVal9; + ItemStack stack2 = (ItemStack)objectArray[4]; + Object actObj = objectArray[5]; + short shortVal2 = Short.parseShort(String.valueOf(actObj)); + NetHandlerPlayClient netHandlerPlayClient7 = mcClient.thePlayer.sendQueue; + C0EPacketClickWindow clickWindowPacket = new C0EPacketClickWindow(intVal10, intVal12, intVal13, intVal14, stack2, shortVal2); + netHandlerPlayClient7.sendPacketNoEvent(clickWindowPacket); + if (intVal != 0) { + return; + } + } + + if (objectArray.length == 0) { + NetHandlerPlayClient netHandlerPlayClient8 = mcClient.thePlayer.sendQueue; + C18PacketSpectate spectatePacket = new C18PacketSpectate(); + netHandlerPlayClient8.sendPacketNoEvent(spectatePacket); + return; + } + + NetHandlerPlayClient netHandlerPlayClient9 = mcClient.thePlayer.sendQueue; + C18PacketSpectate spectatePacket2 = new C18PacketSpectate((UUID)objectArray[0]); + netHandlerPlayClient9.sendPacketNoEvent(spectatePacket2); +} +} diff --git a/src/main/java/cc/novoline/script/ScriptEntity.java b/src/main/java/cc/novoline/script/ScriptEntity.java new file mode 100644 index 0000000..c178e67 --- /dev/null +++ b/src/main/java/cc/novoline/script/ScriptEntity.java @@ -0,0 +1,69 @@ +package cc.novoline.script; + +import java.util.UUID; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; +import net.skidunion.security.SkidUnionAnnotation; + +public class ScriptEntity { + @SkidUnionAnnotation + public double getEyeHeight(Entity entity) { + return entity.getEyeHeight(); +} + + @SkidUnionAnnotation + public double getX(Entity entity) { + return entity.posX; +} + + @SkidUnionAnnotation + public String getName(Entity entity) { + return entity.getName(); +} + + @SkidUnionAnnotation + public double getPrevPosZ(Entity entity) { + return entity.prevPosZ; +} + + @SkidUnionAnnotation + public double getHealth(Entity entity) { + return ((EntityLivingBase)entity).getHealth(); +} + + @SkidUnionAnnotation + public double getZ(Entity entity) { + return entity.posZ; +} + + @SkidUnionAnnotation + public boolean isDead(Entity entity) { + return entity.isDead; +} + + @SkidUnionAnnotation + public ItemStack getHeldItem(EntityLivingBase living) { + return living.getHeldItem(); +} + + @SkidUnionAnnotation + public double getPrevPosY(Entity entity) { + return entity.prevPosY; +} + + @SkidUnionAnnotation + public double getY(Entity entity) { + return entity.posY; +} + + @SkidUnionAnnotation + public double getPrevPosX(Entity entity) { + return entity.prevPosX; +} + + @SkidUnionAnnotation + public UUID getUUID(Entity entity) { + return entity.getUUID2(); +} +} diff --git a/src/main/java/cc/novoline/script/ScriptFileUtil.java b/src/main/java/cc/novoline/script/ScriptFileUtil.java new file mode 100644 index 0000000..a07b488 --- /dev/null +++ b/src/main/java/cc/novoline/script/ScriptFileUtil.java @@ -0,0 +1,116 @@ +package cc.novoline.script; + +import cc.novoline.Novoline; +import java.io.BufferedWriter; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.LinkOption; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.attribute.FileAttribute; +import net.skidunion.security.SkidUnionAnnotation; +import org.apache.commons.io.IOUtils; + +public class ScriptFileUtil { + @SkidUnionAnnotation + public void writeFile(String text, String... args) { + String textStr; + FileWriter fileWriter; + label52: { + StringBuilder sb = new StringBuilder(); + Novoline novolineInst = Novoline.getInstance(); + String pathStr = novolineInst.getDataFolderString(); + sb = sb.append(pathStr); + textStr = sb.append(text).toString(); + fileWriter = null; + Path filePath = Paths.get(textStr); + byte byteVal = 0; + + LinkOption[] linkOptionArr = new LinkOption[0]; + if (!Files.notExists(filePath, linkOptionArr)) { + break label52; + } + + try { + ScriptFileUtil.$keepCatch(); + filePath = Paths.get(textStr); + byteVal = 0; + } catch (IOException ex) { + ex.printStackTrace(); + break label52; + } + + + try { + FileAttribute[] fileAttributeArr = new FileAttribute[byteVal]; + Files.createFile(filePath, fileAttributeArr); + } catch (IOException ex2) { + ex2.printStackTrace(); + } + } + + try { + fileWriter = new FileWriter(textStr); + } catch (IOException ex3) { + ex3.printStackTrace(); + } + + if (fileWriter != null) { + BufferedWriter bufferedWriter = new BufferedWriter(fileWriter); + + try { + bufferedWriter.flush(); + String[] stringArr = args; + int len = stringArr.length; + int intVal3 = 0; + + while (intVal3 < len) { + String textStr2 = stringArr[intVal3]; + bufferedWriter.write(textStr2); + bufferedWriter.newLine(); + intVal3++; + + } + + bufferedWriter.close(); + } catch (IOException ex4) { + ex4.printStackTrace(); + } + } +} + + @SkidUnionAnnotation + public void createDirectory(String text) { + StringBuilder sb = new StringBuilder(); + Novoline novolineInst = Novoline.getInstance(); + String pathStr = novolineInst.getDataFolderString(); + sb = sb.append(pathStr); + String textStr = sb.append(text).toString(); + + try { + Path filePath = Paths.get(textStr); + FileAttribute[] fileAttributeArr = new FileAttribute[0]; + Files.createDirectory(filePath, fileAttributeArr); + } catch (IOException ex) { + ex.printStackTrace(); + } +} + + + @SkidUnionAnnotation + public String readFile(String text) { + try { + StringBuilder sb = new StringBuilder(); + Novoline novolineInst = Novoline.getInstance(); + String pathStr = novolineInst.getDataFolderString(); + sb = sb.append(pathStr); + return IOUtils.toString(new FileReader(sb.append(text).toString())); + } catch (IOException ex) { + ex.printStackTrace(); + return "CAN'T READ NIGGER"; + } +} + private static void $keepCatch() throws E {} +} diff --git a/src/main/java/cc/novoline/script/ScriptGameUtil.java b/src/main/java/cc/novoline/script/ScriptGameUtil.java new file mode 100644 index 0000000..4086583 --- /dev/null +++ b/src/main/java/cc/novoline/script/ScriptGameUtil.java @@ -0,0 +1,11 @@ +package cc.novoline.script; + +import cc.novoline.utils.TimerUtil; +import net.skidunion.security.SkidUnionAnnotation; + +public class ScriptGameUtil { + @SkidUnionAnnotation + public ScriptTimerUtil getTimer() { + return new ScriptTimerUtil(new TimerUtil()); +} +} diff --git a/src/main/java/cc/novoline/script/ScriptManager.java b/src/main/java/cc/novoline/script/ScriptManager.java new file mode 100644 index 0000000..c77d2ba --- /dev/null +++ b/src/main/java/cc/novoline/script/ScriptManager.java @@ -0,0 +1,346 @@ +package cc.novoline.script; + +import cc.novoline.Novoline; +import cc.novoline.modules.AbstractModule; +import cc.novoline.modules.EnumModuleType; +import cc.novoline.script.util.NashornClassFilter; +import cc.novoline.script.util.NashornEngineBridge; +import java.io.FileReader; +import java.io.IOException; +import java.nio.file.FileVisitOption; +import java.nio.file.Files; +import java.nio.file.LinkOption; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.function.Consumer; +import java.util.function.Predicate; +import java.util.stream.Collector; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import jdk.nashorn.api.scripting.NashornScriptEngineFactory; +import net.minecraft.client.Minecraft; +import org.apache.commons.io.IOUtils; + +public class ScriptManager { + public List