first commit
This commit is contained in:
commit
2834f0f846
|
@ -0,0 +1,43 @@
|
||||||
|
.gradle
|
||||||
|
build/
|
||||||
|
!gradle/wrapper/gradle-wrapper.jar
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
run/
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea/modules.xml
|
||||||
|
.idea/jarRepositories.xml
|
||||||
|
.idea/compiler.xml
|
||||||
|
.idea/libraries/
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
out/
|
||||||
|
!**/src/main/**/out/
|
||||||
|
!**/src/test/**/out/
|
||||||
|
|
||||||
|
### Eclipse ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
bin/
|
||||||
|
!**/src/main/**/bin/
|
||||||
|
!**/src/test/**/bin/
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
### Mac OS ###
|
||||||
|
.DS_Store
|
|
@ -0,0 +1,3 @@
|
||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DiscordProjectSettings">
|
||||||
|
<option name="show" value="ASK" />
|
||||||
|
<option name="description" value="" />
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="GradleSettings">
|
||||||
|
<option name="linkedExternalProjectsSettings">
|
||||||
|
<GradleProjectSettings>
|
||||||
|
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||||
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="modules">
|
||||||
|
<set>
|
||||||
|
<option value="$PROJECT_DIR$" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
</GradleProjectSettings>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="zulu-1.8" project-jdk-type="JavaSDK">
|
||||||
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -0,0 +1,102 @@
|
||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
jcenter()
|
||||||
|
maven {
|
||||||
|
name = "forge"
|
||||||
|
url = "http://files.minecraftforge.net/maven"
|
||||||
|
}
|
||||||
|
maven {
|
||||||
|
name = 'sponge'
|
||||||
|
url = 'https://repo.spongepowered.org/maven'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
|
||||||
|
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'net.minecraftforge.gradle.tweaker-client'
|
||||||
|
apply plugin: 'org.spongepowered.mixin'
|
||||||
|
apply plugin: 'java'
|
||||||
|
|
||||||
|
version = "1.0"
|
||||||
|
group= "net.silentclient" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
|
archivesBaseName = "client"
|
||||||
|
|
||||||
|
sourceCompatibility = targetCompatibility = 1.8
|
||||||
|
compileJava.options.encoding = 'UTF-8'
|
||||||
|
|
||||||
|
minecraft {
|
||||||
|
version = "1.8.9"
|
||||||
|
tweakClass = "net.silentclient.client.mixin.SilentClientTweaker"
|
||||||
|
runDir = "run"
|
||||||
|
mappings = "stable_20"
|
||||||
|
makeObfSourceJar = false
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven { url "https://jitpack.io" }
|
||||||
|
maven {
|
||||||
|
name = 'sponge'
|
||||||
|
url = 'https://repo.spongepowered.org/maven/'
|
||||||
|
}
|
||||||
|
mavenCentral()
|
||||||
|
jcenter()
|
||||||
|
}
|
||||||
|
|
||||||
|
configurations {
|
||||||
|
embed
|
||||||
|
compile.extendsFrom(embed)
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
embed('org.spongepowered:mixin:0.7.11-SNAPSHOT') {
|
||||||
|
exclude module: 'launchwrapper'
|
||||||
|
exclude module: 'guava'
|
||||||
|
exclude module: 'gson'
|
||||||
|
exclude module: 'commons-io'
|
||||||
|
}
|
||||||
|
|
||||||
|
compile('org.spongepowered:mixin:0.7.11-SNAPSHOT')
|
||||||
|
}
|
||||||
|
|
||||||
|
mixin {
|
||||||
|
defaultObfuscationEnv notch
|
||||||
|
add sourceSets.main, "mixins.SilentClient.refmap.json"
|
||||||
|
}
|
||||||
|
|
||||||
|
processResources {
|
||||||
|
inputs.files "src/main/resources"
|
||||||
|
outputs.dir "build/classes/main"
|
||||||
|
copy {
|
||||||
|
from("src/main/resources")
|
||||||
|
into("build/classes/main")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
jar {
|
||||||
|
dependsOn configurations.compile
|
||||||
|
from {
|
||||||
|
configurations.embed.collect {
|
||||||
|
it.isDirectory() ? it : zipTree(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
|
||||||
|
}
|
||||||
|
|
||||||
|
jar {
|
||||||
|
manifest.attributes(
|
||||||
|
"MixinConfigs": 'mixins.SilentClient.json',
|
||||||
|
"TweakClass": "net.silentclient.client.mixin.SilentClientTweaker",
|
||||||
|
"TweakOrder": 0,
|
||||||
|
"Manifest-Version": 1.0
|
||||||
|
)
|
||||||
|
|
||||||
|
configurations.embed.each { dep ->
|
||||||
|
from(project.zipTree(dep)) {
|
||||||
|
exclude 'META-INF', 'META-INF/**'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
|
@ -0,0 +1,5 @@
|
||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-bin.zip
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
|
@ -0,0 +1,240 @@
|
||||||
|
#!/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/master/subprojects/plugins/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
|
||||||
|
|
||||||
|
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||||
|
|
||||||
|
APP_NAME="Gradle"
|
||||||
|
APP_BASE_NAME=${0##*/}
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
|
# 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
|
||||||
|
which java >/dev/null 2>&1 || 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
|
||||||
|
|
||||||
|
# Increase the maximum file descriptors if we can.
|
||||||
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
|
case $MAX_FD in #(
|
||||||
|
max*)
|
||||||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
|
warn "Could not query maximum file descriptor limit"
|
||||||
|
esac
|
||||||
|
case $MAX_FD in #(
|
||||||
|
'' | soft) :;; #(
|
||||||
|
*)
|
||||||
|
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
|
||||||
|
|
||||||
|
# Collect all arguments for the java command;
|
||||||
|
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||||
|
# shell script including quotes and variable substitutions, so put them in
|
||||||
|
# double quotes to make sure that they get re-expanded; and
|
||||||
|
# * put everything else in single quotes, so that it's not re-expanded.
|
||||||
|
|
||||||
|
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" "$@"
|
|
@ -0,0 +1,91 @@
|
||||||
|
@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=.
|
||||||
|
set APP_BASE_NAME=%~n0
|
||||||
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
|
|
||||||
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
|
@rem Find java.exe
|
||||||
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
|
set JAVA_EXE=java.exe
|
||||||
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:findJavaFromJavaHome
|
||||||
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
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
|
|
@ -0,0 +1 @@
|
||||||
|
Class,Method,Signature,Interface
|
|
|
@ -0,0 +1 @@
|
||||||
|
Mixin Implementation Report generated on 2023-06-27 21:53:29
|
|
@ -0,0 +1,108 @@
|
||||||
|
invertYMouse:false
|
||||||
|
mouseSensitivity:0.5
|
||||||
|
fov:0.0
|
||||||
|
gamma:0.0
|
||||||
|
saturation:0.0
|
||||||
|
renderDistance:12
|
||||||
|
guiScale:0
|
||||||
|
particles:0
|
||||||
|
bobView:true
|
||||||
|
anaglyph3d:false
|
||||||
|
maxFps:120
|
||||||
|
fboEnable:true
|
||||||
|
difficulty:2
|
||||||
|
fancyGraphics:true
|
||||||
|
ao:2
|
||||||
|
renderClouds:true
|
||||||
|
resourcePacks:[]
|
||||||
|
incompatibleResourcePacks:[]
|
||||||
|
lastServer:
|
||||||
|
lang:en_US
|
||||||
|
chatVisibility:0
|
||||||
|
chatColors:true
|
||||||
|
chatLinks:true
|
||||||
|
chatLinksPrompt:true
|
||||||
|
chatOpacity:1.0
|
||||||
|
snooperEnabled:true
|
||||||
|
fullscreen:false
|
||||||
|
enableVsync:true
|
||||||
|
useVbo:false
|
||||||
|
hideServerAddress:false
|
||||||
|
advancedItemTooltips:false
|
||||||
|
pauseOnLostFocus:true
|
||||||
|
touchscreen:false
|
||||||
|
overrideWidth:0
|
||||||
|
overrideHeight:0
|
||||||
|
heldItemTooltips:true
|
||||||
|
chatHeightFocused:1.0
|
||||||
|
chatHeightUnfocused:0.44366196
|
||||||
|
chatScale:1.0
|
||||||
|
chatWidth:1.0
|
||||||
|
showInventoryAchievementHint:true
|
||||||
|
mipmapLevels:4
|
||||||
|
streamBytesPerPixel:0.5
|
||||||
|
streamMicVolume:1.0
|
||||||
|
streamSystemVolume:1.0
|
||||||
|
streamKbps:0.5412844
|
||||||
|
streamFps:0.31690142
|
||||||
|
streamCompression:1
|
||||||
|
streamSendMetadata:true
|
||||||
|
streamPreferredServer:
|
||||||
|
streamChatEnabled:0
|
||||||
|
streamChatUserFilter:0
|
||||||
|
streamMicToggleBehavior:0
|
||||||
|
forceUnicodeFont:false
|
||||||
|
allowBlockAlternatives:true
|
||||||
|
reducedDebugInfo:false
|
||||||
|
useNativeTransport:true
|
||||||
|
entityShadows:true
|
||||||
|
realmsNotifications:true
|
||||||
|
key_key.attack:-100
|
||||||
|
key_key.use:-99
|
||||||
|
key_key.forward:17
|
||||||
|
key_key.left:30
|
||||||
|
key_key.back:31
|
||||||
|
key_key.right:32
|
||||||
|
key_key.jump:57
|
||||||
|
key_key.sneak:42
|
||||||
|
key_key.sprint:29
|
||||||
|
key_key.drop:16
|
||||||
|
key_key.inventory:18
|
||||||
|
key_key.chat:20
|
||||||
|
key_key.playerlist:15
|
||||||
|
key_key.pickItem:-98
|
||||||
|
key_key.command:53
|
||||||
|
key_key.screenshot:60
|
||||||
|
key_key.togglePerspective:63
|
||||||
|
key_key.smoothCamera:0
|
||||||
|
key_key.streamStartStop:64
|
||||||
|
key_key.streamPauseUnpause:65
|
||||||
|
key_key.streamCommercial:0
|
||||||
|
key_key.streamToggleMic:0
|
||||||
|
key_key.fullscreen:87
|
||||||
|
key_key.spectatorOutlines:0
|
||||||
|
key_key.hotbar.1:2
|
||||||
|
key_key.hotbar.2:3
|
||||||
|
key_key.hotbar.3:4
|
||||||
|
key_key.hotbar.4:5
|
||||||
|
key_key.hotbar.5:6
|
||||||
|
key_key.hotbar.6:7
|
||||||
|
key_key.hotbar.7:8
|
||||||
|
key_key.hotbar.8:9
|
||||||
|
key_key.hotbar.9:10
|
||||||
|
soundCategory_master:1.0
|
||||||
|
soundCategory_music:1.0
|
||||||
|
soundCategory_record:1.0
|
||||||
|
soundCategory_weather:1.0
|
||||||
|
soundCategory_block:1.0
|
||||||
|
soundCategory_hostile:1.0
|
||||||
|
soundCategory_neutral:1.0
|
||||||
|
soundCategory_player:1.0
|
||||||
|
soundCategory_ambient:1.0
|
||||||
|
modelPart_cape:true
|
||||||
|
modelPart_jacket:true
|
||||||
|
modelPart_left_sleeve:true
|
||||||
|
modelPart_right_sleeve:true
|
||||||
|
modelPart_left_pants_leg:true
|
||||||
|
modelPart_right_pants_leg:true
|
||||||
|
modelPart_hat:true
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1 @@
|
||||||
|
{"stat.flyOneCm":850,"stat.walkOneCm":734,"stat.jump":4,"stat.playOneMinute":106,"stat.leaveGame":1,"stat.timeSinceDeath":106,"stat.sprintOneCm":392,"achievement.exploreAllBiomes":{"value":0,"progress":["Extreme Hills"]}}
|
|
@ -0,0 +1 @@
|
||||||
|
[{"name":"Player819","uuid":"00bb7f76-47ca-3891-96fe-03177d2fac78","expiresOn":"2023-07-27 21:22:54 +0600"}]
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,70 @@
|
||||||
|
[21:53:29] [main/INFO]: Extra: [--tweakClass, net.silentclient.client.mixin.SilentClientTweaker]
|
||||||
|
[21:53:29] [main/INFO]: Running with arguments: [--userProperties, {}, --assetsDir, /Users/kirillsaint/.gradle/caches/minecraft/assets, --assetIndex, 1.8, --accessToken{REDACTED}, --version, 1.8.9, --tweakClass, net.silentclient.client.mixin.SilentClientTweaker]
|
||||||
|
[21:53:29] [main/INFO]: Loading tweak class name net.silentclient.client.mixin.SilentClientTweaker
|
||||||
|
[21:53:29] [main/INFO]: Using primary tweak class name net.silentclient.client.mixin.SilentClientTweaker
|
||||||
|
[21:53:29] [main/INFO]: Calling tweak class net.silentclient.client.mixin.SilentClientTweaker
|
||||||
|
[21:53:29] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.7.11 Source=file:/Users/kirillsaint/.gradle/caches/modules-2/files-2.1/org.spongepowered/mixin/0.7.11-SNAPSHOT/7a670207bdb97db418118ad1e9bb42424ff3776d/mixin-0.7.11-SNAPSHOT.jar Service=LaunchWrapper Env=UNKNOWN
|
||||||
|
[21:53:29] [main/INFO]: FML platform manager could not load class cpw.mods.fml.relauncher.CoreModManager. Proceeding without FML support.
|
||||||
|
[21:53:29] [main/WARN]: MixinEnvironment::addConfiguration is deprecated and will be removed. Use Mixins::addConfiguration instead!
|
||||||
|
[21:53:29] [main/INFO]: Compatibility level set to JAVA_8
|
||||||
|
[21:53:29] [main/ERROR]: Mixin config mixins.SilentClient.json does not specify "minVersion" property
|
||||||
|
[21:53:29] [main/INFO]: Loading tweak class name org.spongepowered.asm.mixin.EnvironmentStateTweaker
|
||||||
|
[21:53:29] [main/INFO]: Calling tweak class org.spongepowered.asm.mixin.EnvironmentStateTweaker
|
||||||
|
[21:53:29] [main/WARN]: Reference map 'mixins.SilentClient.refmap.json' for mixins.SilentClient.json could not be read. If this is a development environment you can ignore this message
|
||||||
|
[21:53:29] [main/ERROR]: Classloader restrictions [PACKAGE_CLASSLOADER_EXCLUSION] encountered loading mixins.SilentClient.json:mixins.MinecraftMixin, name: net.silentclient.client.mixin.mixins.MinecraftMixin
|
||||||
|
[21:53:29] [main/INFO]: Launching wrapped minecraft {net.minecraft.client.main.Main}
|
||||||
|
[21:53:29] [main/INFO]: Mixing mixins.MinecraftMixin from mixins.SilentClient.json into net.minecraft.client.Minecraft
|
||||||
|
[21:53:30] [Client thread/ERROR]: Can't find the resource index file: 1.8.9/assets/indexes/1.8.json
|
||||||
|
[21:53:30] [Client thread/INFO]: Setting user: Player276
|
||||||
|
[21:53:30] [Client thread/INFO]: (Session ID is token:FML:Player276)
|
||||||
|
[21:53:31] [Client thread/INFO]: ---------[ Silent Client Initialising ]---------
|
||||||
|
[21:53:31] [Client thread/INFO]: MC Version: 1.8.9
|
||||||
|
[21:53:31] [Client thread/INFO]: SC Version: v2.0.0-unknown-debug
|
||||||
|
[21:53:31] [Client thread/INFO]: Width: 854
|
||||||
|
[21:53:31] [Client thread/INFO]: Height: 480
|
||||||
|
[21:53:31] [Client thread/INFO]: Fullscreen: false
|
||||||
|
[21:53:31] [Client thread/INFO]: GC Name: PS Scavenge
|
||||||
|
[21:53:31] [Client thread/INFO]: GC Object Name: java.lang:type=GarbageCollector,name=PS Scavenge
|
||||||
|
[21:53:31] [Client thread/INFO]: GC Name: PS MarkSweep
|
||||||
|
[21:53:31] [Client thread/INFO]: GC Object Name: java.lang:type=GarbageCollector,name=PS MarkSweep
|
||||||
|
[21:53:31] [Client thread/INFO]: -------------------------------------------------
|
||||||
|
[21:53:31] [Client thread/INFO]: -- Start Memory Debug -- CLIENT_PRE_INIT
|
||||||
|
[21:53:31] [Client thread/INFO]: Max: 1908932608 (1908.932608MB)
|
||||||
|
[21:53:31] [Client thread/INFO]: Total: 237502464 (237.502464MB)
|
||||||
|
[21:53:31] [Client thread/INFO]: Free: 55073896 (55.073896MB)
|
||||||
|
[21:53:31] [Client thread/INFO]: -- End Memory Debug -- CLIENT_PRE_INIT
|
||||||
|
[21:53:31] [Client thread/INFO]: INITIALISING > silent-directory
|
||||||
|
[21:53:31] [Client thread/INFO]: INITIALISING > event-manager
|
||||||
|
[21:53:31] [Client thread/INFO]: -- Start Memory Debug -- CLIENT_POST_INIT
|
||||||
|
[21:53:31] [Client thread/INFO]: Max: 1908932608 (1908.932608MB)
|
||||||
|
[21:53:31] [Client thread/INFO]: Total: 237502464 (237.502464MB)
|
||||||
|
[21:53:31] [Client thread/INFO]: Free: 55073896 (55.073896MB)
|
||||||
|
[21:53:31] [Client thread/INFO]: -- End Memory Debug -- CLIENT_POST_INIT
|
||||||
|
[21:53:31] [Client thread/INFO]: LWJGL Version: 2.9.2
|
||||||
|
[21:53:31] [Client thread/INFO]: Reloading ResourceManager: Default
|
||||||
|
[21:53:31] [Client thread/ERROR]: Couldn't initialize twitch stream
|
||||||
|
[21:53:31] [Sound Library Loader/INFO]: Starting up SoundSystem...
|
||||||
|
[21:53:31] [Thread-7/INFO]: Initializing LWJGL OpenAL
|
||||||
|
[21:53:31] [Thread-7/INFO]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org)
|
||||||
|
[21:53:31] [Thread-7/INFO]: OpenAL initialized.
|
||||||
|
[21:53:32] [Sound Library Loader/INFO]: Sound engine started
|
||||||
|
[21:53:32] [Client thread/INFO]: Created: 512x512 textures-atlas
|
||||||
|
[21:53:32] [Client thread/INFO]: -- Start Memory Debug -- CLIENT_PRE_START
|
||||||
|
[21:53:32] [Client thread/INFO]: Max: 1908932608 (1908.932608MB)
|
||||||
|
[21:53:32] [Client thread/INFO]: Total: 432013312 (432.013312MB)
|
||||||
|
[21:53:32] [Client thread/INFO]: Free: 238746824 (238.746824MB)
|
||||||
|
[21:53:32] [Client thread/INFO]: -- End Memory Debug -- CLIENT_PRE_START
|
||||||
|
[21:53:32] [Client thread/INFO]: ---------[ Silent Client Starting ]--------------
|
||||||
|
[21:53:32] [Client thread/INFO]: -------------------------------------------------
|
||||||
|
[21:53:32] [Client thread/INFO]: -- Start Memory Debug -- CLIENT_POST_INIT
|
||||||
|
[21:53:32] [Client thread/INFO]: Max: 1908932608 (1908.932608MB)
|
||||||
|
[21:53:32] [Client thread/INFO]: Total: 432013312 (432.013312MB)
|
||||||
|
[21:53:32] [Client thread/INFO]: Free: 238746824 (238.746824MB)
|
||||||
|
[21:53:32] [Client thread/INFO]: -- End Memory Debug -- CLIENT_POST_INIT
|
||||||
|
[21:53:38] [Client thread/WARN]: Unable to play unknown soundEvent: minecraft:music.menu
|
||||||
|
[21:53:38] [Client thread/WARN]: Unable to play unknown soundEvent: minecraft:gui.button.press
|
||||||
|
[21:53:38] [Client thread/INFO]: ---------[ Silent Client Stopping ]--------------
|
||||||
|
[21:53:38] [Client thread/INFO]: -------------------------------------------------
|
||||||
|
[21:53:38] [Client thread/INFO]: Stopping!
|
||||||
|
[21:53:38] [Client thread/INFO]: SoundSystem shutting down...
|
||||||
|
[21:53:38] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com
|
|
@ -0,0 +1,2 @@
|
||||||
|
rootProject.name = 'client'
|
||||||
|
|
|
@ -0,0 +1,113 @@
|
||||||
|
package net.silentclient.client;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.GsonBuilder;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.silentclient.client.event.EventManager;
|
||||||
|
import net.silentclient.client.event.EventTarget;
|
||||||
|
import net.silentclient.client.event.impl.ClientTickEvent;
|
||||||
|
import net.silentclient.client.types.BuildData;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.lang.management.GarbageCollectorMXBean;
|
||||||
|
import java.lang.management.ManagementFactory;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class Client {
|
||||||
|
public static final Logger logger = LogManager.getLogger("SC");
|
||||||
|
private final String version = "2.0.0";
|
||||||
|
|
||||||
|
private static final Client INSTANCE = new Client();
|
||||||
|
public static final Client getInstance() {
|
||||||
|
return INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public File dir;
|
||||||
|
|
||||||
|
private BuildData buildData = new BuildData();
|
||||||
|
|
||||||
|
public static void memoryDebug(String paramString) {
|
||||||
|
LogManager.getLogger().info("-- Start Memory Debug -- " + paramString);
|
||||||
|
long l1 = Runtime.getRuntime().maxMemory();
|
||||||
|
long l2 = Runtime.getRuntime().totalMemory();
|
||||||
|
long l3 = Runtime.getRuntime().freeMemory();
|
||||||
|
LogManager.getLogger().info("Max: " + l1 + " (" + (l1 / 1000000.0D) + "MB)");
|
||||||
|
LogManager.getLogger().info("Total: " + l2 + " (" + (l2 / 1000000.0D) + "MB)");
|
||||||
|
LogManager.getLogger().info("Free: " + l3 + " (" + (l3 / 1000000.0D) + "MB)");
|
||||||
|
LogManager.getLogger().info("-- End Memory Debug -- " + paramString);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init() {
|
||||||
|
try {
|
||||||
|
InputStream in = getClass().getResourceAsStream("/build_data.json");
|
||||||
|
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
|
||||||
|
StringBuffer content = new StringBuffer();
|
||||||
|
String inputLine;
|
||||||
|
while ((inputLine = reader.readLine()) != null) {
|
||||||
|
content.append(inputLine);
|
||||||
|
}
|
||||||
|
GsonBuilder builder = new GsonBuilder();
|
||||||
|
Gson gson = builder.create();
|
||||||
|
|
||||||
|
buildData = gson.fromJson(content.toString(), BuildData.class);
|
||||||
|
in.close();
|
||||||
|
} catch (Exception e1) {
|
||||||
|
Client.logger.catching(e1);
|
||||||
|
}
|
||||||
|
logger.info("---------[ Silent Client Initialising ]---------");
|
||||||
|
logger.info("MC Version: 1.8.9");
|
||||||
|
logger.info("SC Version: " + getVersion());
|
||||||
|
logger.info("Width: " + Minecraft.getMinecraft().displayWidth);
|
||||||
|
logger.info("Height: " + Minecraft.getMinecraft().displayHeight);
|
||||||
|
logger.info("Fullscreen: " + Minecraft.getMinecraft().isFullScreen());
|
||||||
|
List<GarbageCollectorMXBean> gcMxBeans = ManagementFactory.getGarbageCollectorMXBeans();
|
||||||
|
|
||||||
|
for (GarbageCollectorMXBean gcMxBean : gcMxBeans) {
|
||||||
|
logger.info("GC Name: " + gcMxBean.getName());
|
||||||
|
logger.info("GC Object Name: " + gcMxBean.getObjectName());
|
||||||
|
}
|
||||||
|
logger.info("-------------------------------------------------");
|
||||||
|
memoryDebug("CLIENT_PRE_INIT");
|
||||||
|
logger.info("INITIALISING > silent-directory");
|
||||||
|
dir = new File(Minecraft.getMinecraft().mcDataDir, "SilentClient");
|
||||||
|
if (!dir.exists()) {
|
||||||
|
dir.mkdirs();
|
||||||
|
}
|
||||||
|
logger.info("INITIALISING > event-manager");
|
||||||
|
EventManager.register(this);
|
||||||
|
memoryDebug("CLIENT_POST_INIT");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void start() throws Throwable {
|
||||||
|
memoryDebug("CLIENT_PRE_START");
|
||||||
|
logger.info("---------[ Silent Client Starting ]--------------");
|
||||||
|
logger.info("-------------------------------------------------");
|
||||||
|
memoryDebug("CLIENT_POST_INIT");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void shutdown() {
|
||||||
|
logger.info("---------[ Silent Client Stopping ]--------------");
|
||||||
|
logger.info("-------------------------------------------------");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Events
|
||||||
|
@EventTarget
|
||||||
|
public void onTick(ClientTickEvent event) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Instances
|
||||||
|
|
||||||
|
public BuildData getBuildData() {
|
||||||
|
return buildData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVersion() {
|
||||||
|
return "v" + version + "-" + getBuildData().getCommit() + "-" + getBuildData().getBranch();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package net.silentclient.client.event;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class Event {
|
||||||
|
public Event call() {
|
||||||
|
final ArrayList<EventData> dataList = EventManager.get(this.getClass());
|
||||||
|
|
||||||
|
if(dataList != null) {
|
||||||
|
for(EventData data : dataList) {
|
||||||
|
try {
|
||||||
|
data.target.invoke(data.source, this);
|
||||||
|
} catch(Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package net.silentclient.client.event;
|
||||||
|
|
||||||
|
public class EventCancelable extends Event {
|
||||||
|
private boolean cancelled = false;
|
||||||
|
|
||||||
|
public boolean isCancelable() {
|
||||||
|
return cancelled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCancelled(boolean cancelled) {
|
||||||
|
this.cancelled = cancelled;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package net.silentclient.client.event;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
public class EventData {
|
||||||
|
public final Object source;
|
||||||
|
public final Method target;
|
||||||
|
public final byte priority;
|
||||||
|
|
||||||
|
public EventData(Object source, Method target, byte priority) {
|
||||||
|
this.source = source;
|
||||||
|
this.target = target;
|
||||||
|
this.priority = priority;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,133 @@
|
||||||
|
package net.silentclient.client.event;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class EventManager {
|
||||||
|
private static final Map<Class<? extends Event>, ArrayList<EventData>> REGISTRY_MAP = new HashMap<Class<? extends Event>, ArrayList<EventData>>();
|
||||||
|
|
||||||
|
private static void sortListValue(final Class<? extends Event> clazz) {
|
||||||
|
|
||||||
|
final ArrayList<EventData> flexableArray = new ArrayList<EventData>();
|
||||||
|
|
||||||
|
for(final byte b : EventPriority.VALUE_ARRAY) {
|
||||||
|
for(EventData methodData : EventManager.REGISTRY_MAP.get(clazz)) {
|
||||||
|
if(methodData.priority == b) {
|
||||||
|
flexableArray.add(methodData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
EventManager.REGISTRY_MAP.put(clazz, flexableArray);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isMethodBad(final Method method) {
|
||||||
|
return method.getParameterTypes().length != 1 || !method.isAnnotationPresent(EventTarget.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isMethodBad(final Method method, final Class<? extends Event> clazz) {
|
||||||
|
return isMethodBad(method) || method.getParameterTypes()[0].equals(clazz);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ArrayList<EventData> get(final Class<? extends Event> clazz){
|
||||||
|
return REGISTRY_MAP.get(clazz);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void cleanMap(final boolean removeOnlyEmptyValues) {
|
||||||
|
|
||||||
|
final Iterator<Map.Entry<Class<? extends Event>, ArrayList<EventData>>> iterator = EventManager.REGISTRY_MAP.entrySet().iterator();
|
||||||
|
|
||||||
|
while(iterator.hasNext()) {
|
||||||
|
if(!removeOnlyEmptyValues || iterator.next().getValue().isEmpty()) {
|
||||||
|
iterator.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void unregister(final Object o, final Class<? extends Event> clazz) {
|
||||||
|
|
||||||
|
if(REGISTRY_MAP.containsKey(clazz)) {
|
||||||
|
for(final EventData methodData : REGISTRY_MAP.get(clazz)) {
|
||||||
|
if(methodData.source.equals(o)) {
|
||||||
|
REGISTRY_MAP.get(clazz).remove(methodData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cleanMap(true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void unregister(final Object o) {
|
||||||
|
|
||||||
|
for(ArrayList<EventData> flexableArray : REGISTRY_MAP.values()) {
|
||||||
|
|
||||||
|
for(int i = flexableArray.size() -1; i >= 0; i--) {
|
||||||
|
|
||||||
|
if(flexableArray.get(i).source.equals(o)) {
|
||||||
|
flexableArray.remove(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
cleanMap(true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public static void register(final Method method, final Object o) {
|
||||||
|
|
||||||
|
final Class<?> clazz = method.getParameterTypes()[0];
|
||||||
|
|
||||||
|
final EventData methodData = new EventData(o, method, method.getAnnotation(EventTarget.class).value());
|
||||||
|
|
||||||
|
if(!methodData.target.isAccessible()) {
|
||||||
|
methodData.target.setAccessible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(REGISTRY_MAP.containsKey(clazz)) {
|
||||||
|
|
||||||
|
if(!REGISTRY_MAP.get(clazz).contains(methodData)) {
|
||||||
|
REGISTRY_MAP.get(clazz).add(methodData);
|
||||||
|
sortListValue((Class<? extends Event>) clazz);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
REGISTRY_MAP.put((Class<? extends Event>) clazz, new ArrayList<EventData>() {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
{
|
||||||
|
this.add(methodData);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void register(final Object o, final Class<? extends Event> clazz) {
|
||||||
|
|
||||||
|
for(final Method method : o.getClass().getMethods()) {
|
||||||
|
if(!isMethodBad(method, clazz)) {
|
||||||
|
register(method, o);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void register(Object o) {
|
||||||
|
for(final Method method : o.getClass().getMethods()) {
|
||||||
|
if(!isMethodBad(method)) {
|
||||||
|
register(method, o);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package net.silentclient.client.event;
|
||||||
|
|
||||||
|
public class EventPriority {
|
||||||
|
|
||||||
|
public static final byte FIRST = 0, SECOND = 1, THIRD = 2, FOURTH = 3, FIRTH = 4;
|
||||||
|
|
||||||
|
public static final byte[] VALUE_ARRAY = new byte[] { FIRST, SECOND, THIRD, FOURTH, FIRTH };
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package net.silentclient.client.event;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
@Target(ElementType.METHOD)
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
public @interface EventTarget {
|
||||||
|
byte value() default EventPriority.THIRD;
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.silentclient.client.event.Event;
|
||||||
|
|
||||||
|
public class ClientTickEvent extends Event {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.silentclient.client.event.Event;
|
||||||
|
|
||||||
|
public class ConnectToServerEvent extends Event {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.silentclient.client.event.Event;
|
||||||
|
|
||||||
|
public class EntityAttackEvent extends Event {
|
||||||
|
private final Entity victim;
|
||||||
|
private final Entity player;
|
||||||
|
|
||||||
|
public EntityAttackEvent(Entity victim, Entity player) {
|
||||||
|
this.victim = victim;
|
||||||
|
this.player = player;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Entity getVictim() {
|
||||||
|
return victim;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Entity getPlayer() {
|
||||||
|
return player;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.silentclient.client.event.Event;
|
||||||
|
|
||||||
|
public class EntityDamageEvent extends Event {
|
||||||
|
private Entity entity;
|
||||||
|
|
||||||
|
public EntityDamageEvent(Entity entity) {
|
||||||
|
this.entity = entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Entity getEntity() {
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.silentclient.client.event.EventCancelable;
|
||||||
|
|
||||||
|
public class EntityJoinLevelEvent extends EventCancelable {
|
||||||
|
private final boolean loadedFromDisk;
|
||||||
|
private final Entity entity;
|
||||||
|
|
||||||
|
public EntityJoinLevelEvent(Entity entity)
|
||||||
|
{
|
||||||
|
this(entity, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityJoinLevelEvent(Entity entity, boolean loadedFromDisk)
|
||||||
|
{
|
||||||
|
this.entity = entity;
|
||||||
|
this.loadedFromDisk = loadedFromDisk;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Entity getEntity()
|
||||||
|
{
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean loadedFromDisk()
|
||||||
|
{
|
||||||
|
return loadedFromDisk;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.silentclient.client.event.Event;
|
||||||
|
|
||||||
|
public class EventCameraRotation extends Event {
|
||||||
|
private float yaw;
|
||||||
|
private float pitch;
|
||||||
|
private float roll;
|
||||||
|
|
||||||
|
public EventCameraRotation(float yaw, float pitch, float roll) {
|
||||||
|
this.yaw = yaw;
|
||||||
|
this.pitch = pitch;
|
||||||
|
this.roll = roll;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getYaw() {
|
||||||
|
return yaw;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setYaw(float yaw) {
|
||||||
|
this.yaw = yaw;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getPitch() {
|
||||||
|
return pitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPitch(float pitch) {
|
||||||
|
this.pitch = pitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getRoll() {
|
||||||
|
return roll;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoll(float roll) {
|
||||||
|
this.roll = roll;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.silentclient.client.event.Event;
|
||||||
|
|
||||||
|
public class EventClickMouse extends Event {
|
||||||
|
private final int button;
|
||||||
|
|
||||||
|
public EventClickMouse(int button) {
|
||||||
|
this.button = button;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getButton() {
|
||||||
|
return button;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.silentclient.client.event.Event;
|
||||||
|
|
||||||
|
public class EventDebugFps extends Event {
|
||||||
|
private int fps;
|
||||||
|
|
||||||
|
public EventDebugFps(int fps) {
|
||||||
|
this.fps = fps;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getFps() {
|
||||||
|
return fps;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFps(int fps) {
|
||||||
|
this.fps = fps;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||||
|
import net.silentclient.client.event.Event;
|
||||||
|
|
||||||
|
public class EventFovUpdate extends Event {
|
||||||
|
private AbstractClientPlayer entity;
|
||||||
|
private float fov;
|
||||||
|
|
||||||
|
public EventFovUpdate(AbstractClientPlayer entity, float fov) {
|
||||||
|
this.entity = entity;
|
||||||
|
this.fov = fov;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getFov() {
|
||||||
|
return fov;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFov(float fov) {
|
||||||
|
this.fov = fov;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AbstractClientPlayer getEntity() {
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.silentclient.client.event.Event;
|
||||||
|
|
||||||
|
public class EventHitOverlay extends Event {
|
||||||
|
private float red;
|
||||||
|
private float green;
|
||||||
|
private float blue;
|
||||||
|
private float alpha;
|
||||||
|
|
||||||
|
public EventHitOverlay(float red, float green, float blue, float alpha) {
|
||||||
|
this.red = red;
|
||||||
|
this.green = green;
|
||||||
|
this.blue = blue;
|
||||||
|
this.alpha = alpha;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getRed() {
|
||||||
|
return red;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRed(float red) {
|
||||||
|
this.red = red;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getGreen() {
|
||||||
|
return green;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGreen(float green) {
|
||||||
|
this.green = green;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getBlue() {
|
||||||
|
return blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBlue(float blue) {
|
||||||
|
this.blue = blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getAlpha() {
|
||||||
|
return alpha;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAlpha(float alpha) {
|
||||||
|
this.alpha = alpha;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,55 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.silentclient.client.event.EventCancelable;
|
||||||
|
|
||||||
|
public class EventPlaySound extends EventCancelable {
|
||||||
|
private String soundName;
|
||||||
|
private float volume;
|
||||||
|
private float pitch;
|
||||||
|
private float originalVolume;
|
||||||
|
private float originalPitch;
|
||||||
|
|
||||||
|
public EventPlaySound(String soundName, float volume, float pitch, float originalVolume, float originalPitch) {
|
||||||
|
this.soundName = soundName;
|
||||||
|
this.volume = volume;
|
||||||
|
this.pitch = pitch;
|
||||||
|
this.originalVolume = originalVolume;
|
||||||
|
this.originalPitch = originalPitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getVolume() {
|
||||||
|
return volume;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVolume(float volume) {
|
||||||
|
this.volume = volume;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getPitch() {
|
||||||
|
return pitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPitch(float pitch) {
|
||||||
|
this.pitch = pitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getOriginalVolume() {
|
||||||
|
return originalVolume;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOriginalVolume(float originalVolume) {
|
||||||
|
this.originalVolume = originalVolume;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getOriginalPitch() {
|
||||||
|
return originalPitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOriginalPitch(float originalPitch) {
|
||||||
|
this.originalPitch = originalPitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSoundName() {
|
||||||
|
return soundName;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.silentclient.client.event.EventCancelable;
|
||||||
|
|
||||||
|
public class EventPlayerHeadRotation extends EventCancelable {
|
||||||
|
private float yaw;
|
||||||
|
private float pitch;
|
||||||
|
|
||||||
|
public EventPlayerHeadRotation(float yaw, float pitch) {
|
||||||
|
this.yaw = yaw;
|
||||||
|
this.pitch = pitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getYaw() {
|
||||||
|
return yaw;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getPitch() {
|
||||||
|
return pitch;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.minecraft.network.Packet;
|
||||||
|
import net.silentclient.client.event.EventCancelable;
|
||||||
|
|
||||||
|
public class EventReceivePacket extends EventCancelable {
|
||||||
|
private Packet<?> packet;
|
||||||
|
|
||||||
|
public EventReceivePacket(Packet<?> packet) {
|
||||||
|
this.packet = packet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Packet<?> getPacket() {
|
||||||
|
return packet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPacket(Packet<?> packet) {
|
||||||
|
this.packet = packet;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.silentclient.client.event.EventCancelable;
|
||||||
|
|
||||||
|
public class EventRender3D extends EventCancelable {
|
||||||
|
private float partialTicks;
|
||||||
|
|
||||||
|
public EventRender3D(float partialTicks) {
|
||||||
|
this.partialTicks = partialTicks;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getPartialTicks() {
|
||||||
|
return partialTicks;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.silentclient.client.event.EventCancelable;
|
||||||
|
|
||||||
|
public class EventRenderCrosshair extends EventCancelable {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.silentclient.client.event.Event;
|
||||||
|
|
||||||
|
public class EventRenderDamageTint extends Event {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.silentclient.client.event.EventCancelable;
|
||||||
|
|
||||||
|
public class EventRenderHitbox extends EventCancelable {
|
||||||
|
private Entity entity;
|
||||||
|
private double x, y, z;
|
||||||
|
private float entityYaw;
|
||||||
|
private float partialTicks;
|
||||||
|
|
||||||
|
public EventRenderHitbox(Entity entity, double x, double y, double z, float entityYaw, float partialTicks) {
|
||||||
|
this.entity = entity;
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
this.z = z;
|
||||||
|
this.entityYaw = entityYaw;
|
||||||
|
this.partialTicks = partialTicks;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Entity getEntity() {
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getX() {
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getY() {
|
||||||
|
return y;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getZ() {
|
||||||
|
return z;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getEntityYaw() {
|
||||||
|
return entityYaw;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getPartialTicks() {
|
||||||
|
return partialTicks;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.silentclient.client.event.EventCancelable;
|
||||||
|
|
||||||
|
public class EventScrollMouse extends EventCancelable {
|
||||||
|
private int amount;
|
||||||
|
|
||||||
|
public EventScrollMouse(int amount) {
|
||||||
|
this.amount = amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAmount() {
|
||||||
|
return amount;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.silentclient.client.event.EventCancelable;
|
||||||
|
|
||||||
|
public class EventSendMessage extends EventCancelable {
|
||||||
|
private final String message;
|
||||||
|
|
||||||
|
public EventSendMessage(String message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.minecraft.network.Packet;
|
||||||
|
import net.silentclient.client.event.EventCancelable;
|
||||||
|
|
||||||
|
public class EventSendPacket extends EventCancelable {
|
||||||
|
private Packet<?> packet;
|
||||||
|
|
||||||
|
public EventSendPacket(Packet<?> packet) {
|
||||||
|
this.packet = packet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Packet<?> getPacket() {
|
||||||
|
return packet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPacket(Packet<?> packet) {
|
||||||
|
this.packet = packet;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.silentclient.client.event.Event;
|
||||||
|
|
||||||
|
public class EventText extends Event {
|
||||||
|
private String text;
|
||||||
|
private String outputText;
|
||||||
|
|
||||||
|
public EventText(String text) {
|
||||||
|
this.text = text;
|
||||||
|
this.outputText = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getText() {
|
||||||
|
return this.text;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOutputText() {
|
||||||
|
return this.outputText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String replace(String src, String target) {
|
||||||
|
this.outputText = text.replace(src, target);
|
||||||
|
return this.outputText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOutputText(String outputText) {
|
||||||
|
this.outputText = outputText;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.silentclient.client.event.Event;
|
||||||
|
|
||||||
|
public class EventTransformFirstPersonItem extends Event {
|
||||||
|
private ItemStack itemToRender;
|
||||||
|
private float equipProgress;
|
||||||
|
private float swingProgress;
|
||||||
|
|
||||||
|
public EventTransformFirstPersonItem(ItemStack itemToRender, float equipProgress, float swingProgress) {
|
||||||
|
this.itemToRender = itemToRender;
|
||||||
|
this.equipProgress = equipProgress;
|
||||||
|
this.swingProgress = swingProgress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getItemToRender() {
|
||||||
|
return itemToRender;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItemToRender(ItemStack itemToRender) {
|
||||||
|
this.itemToRender = itemToRender;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getEquipProgress() {
|
||||||
|
return equipProgress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEquipProgress(float equipProgress) {
|
||||||
|
this.equipProgress = equipProgress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getSwingProgress() {
|
||||||
|
return swingProgress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSwingProgress(float swingProgress) {
|
||||||
|
this.swingProgress = swingProgress;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.silentclient.client.event.Event;
|
||||||
|
|
||||||
|
public class EventZoomFov extends Event {
|
||||||
|
private float fov;
|
||||||
|
|
||||||
|
public EventZoomFov(float fov) {
|
||||||
|
this.fov = fov;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getFov() {
|
||||||
|
return fov;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFov(float fov) {
|
||||||
|
this.fov = fov;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.silentclient.client.event.EventCancelable;
|
||||||
|
|
||||||
|
public class KeyEvent extends EventCancelable {
|
||||||
|
|
||||||
|
private final int key;
|
||||||
|
|
||||||
|
public KeyEvent(int key) {
|
||||||
|
this.key = key;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getKey() {
|
||||||
|
return key;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.minecraft.client.multiplayer.WorldClient;
|
||||||
|
import net.silentclient.client.event.Event;
|
||||||
|
|
||||||
|
public class LoadWorldEvent extends Event {
|
||||||
|
private final WorldClient world;
|
||||||
|
|
||||||
|
public LoadWorldEvent(WorldClient world) {
|
||||||
|
this.world = world;
|
||||||
|
}
|
||||||
|
|
||||||
|
public WorldClient getWorld() {
|
||||||
|
return world;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.minecraft.util.IChatComponent;
|
||||||
|
import net.silentclient.client.event.EventCancelable;
|
||||||
|
|
||||||
|
public class NewMessageEvent extends EventCancelable {
|
||||||
|
private final IChatComponent message;
|
||||||
|
|
||||||
|
public NewMessageEvent(IChatComponent message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IChatComponent getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.silentclient.client.event.Event;
|
||||||
|
|
||||||
|
public class RenderEvent extends Event {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.entity.RendererLivingEntity;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.silentclient.client.event.EventCancelable;
|
||||||
|
|
||||||
|
public class RenderLivingEvent extends EventCancelable {
|
||||||
|
private Entity entity;
|
||||||
|
public double x;
|
||||||
|
public double y;
|
||||||
|
public double z;
|
||||||
|
private RendererLivingEntity<EntityLivingBase> renderer;
|
||||||
|
|
||||||
|
public RenderLivingEvent(Entity entity, double x, double y, double z, RendererLivingEntity<EntityLivingBase> renderer) {
|
||||||
|
this.entity = entity;
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
this.z = z;
|
||||||
|
this.renderer = renderer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Entity getEntity() {
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RendererLivingEntity<EntityLivingBase> getRenderer() {
|
||||||
|
return renderer;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package net.silentclient.client.event.impl;
|
||||||
|
|
||||||
|
import net.silentclient.client.event.EventCancelable;
|
||||||
|
|
||||||
|
public class RenderTickEvent extends EventCancelable {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,79 @@
|
||||||
|
package net.silentclient.client.mixin;
|
||||||
|
|
||||||
|
import net.minecraft.launchwrapper.ITweaker;
|
||||||
|
import net.minecraft.launchwrapper.LaunchClassLoader;
|
||||||
|
import org.spongepowered.asm.launch.MixinBootstrap;
|
||||||
|
import org.spongepowered.asm.mixin.MixinEnvironment;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class SilentClientTweaker implements ITweaker {
|
||||||
|
private List<String> launchArgs = new ArrayList<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final void acceptOptions(List<String> args, File gameDir, File assetsDir, String profile)
|
||||||
|
{
|
||||||
|
// Add the launch arguments to our launchArgs array
|
||||||
|
this.launchArgs.addAll(args);
|
||||||
|
|
||||||
|
// Constants
|
||||||
|
final String VERSION = "--version";
|
||||||
|
final String ASSET_DIR = "--assetDir";
|
||||||
|
final String GAME_DIR = "--gameDir";
|
||||||
|
|
||||||
|
// Check if version is passed as a launch argument, if not add it
|
||||||
|
if (!args.contains(VERSION) && profile != null)
|
||||||
|
{
|
||||||
|
launchArgs.add(VERSION);
|
||||||
|
launchArgs.add(profile);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if assetDir is passed as a launch argument, if not add it
|
||||||
|
if (!args.contains(ASSET_DIR) && profile != null)
|
||||||
|
{
|
||||||
|
launchArgs.add(ASSET_DIR);
|
||||||
|
launchArgs.add(profile);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if gameDir is passed as a launch argument, if not add it
|
||||||
|
if (!args.contains(GAME_DIR) && profile != null)
|
||||||
|
{
|
||||||
|
launchArgs.add(GAME_DIR);
|
||||||
|
launchArgs.add(profile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final void injectIntoClassLoader(LaunchClassLoader classLoader)
|
||||||
|
{
|
||||||
|
MixinBootstrap.init();
|
||||||
|
|
||||||
|
// Retrieve the default mixin environment and register the config file
|
||||||
|
MixinEnvironment environment = MixinEnvironment.getDefaultEnvironment();
|
||||||
|
|
||||||
|
environment.addConfiguration("mixins.SilentClient.json");
|
||||||
|
|
||||||
|
// Check if the obfuscation context is null
|
||||||
|
if (environment.getObfuscationContext() == null)
|
||||||
|
{
|
||||||
|
environment.setObfuscationContext("notch");
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is a client side, client :)
|
||||||
|
environment.setSide(MixinEnvironment.Side.CLIENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLaunchTarget()
|
||||||
|
{
|
||||||
|
return MixinBootstrap.getPlatform().getLaunchTarget();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getLaunchArguments()
|
||||||
|
{
|
||||||
|
return launchArgs.toArray(new String[0]);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
package net.silentclient.client.mixin.mixins;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.silentclient.client.Client;
|
||||||
|
import net.silentclient.client.event.impl.ClientTickEvent;
|
||||||
|
import org.lwjgl.opengl.Display;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(Minecraft.class)
|
||||||
|
public class MinecraftMixin {
|
||||||
|
@Inject(method = "startGame", at = @At("HEAD"))
|
||||||
|
public void initClient(CallbackInfo callbackInfo) {
|
||||||
|
Client.getInstance().init();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "startGame", at = @At("TAIL"))
|
||||||
|
public void startClient(CallbackInfo callbackInfo) throws Throwable {
|
||||||
|
Client.getInstance().start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "shutdownMinecraftApplet", at = @At("HEAD"))
|
||||||
|
public void shutdownClient(CallbackInfo callbackInfo) throws Throwable {
|
||||||
|
Client.getInstance().shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Redirect(method = "createDisplay", at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/Display;setTitle(Ljava/lang/String;)V"))
|
||||||
|
public void setWindowTitle(String newTitle) {
|
||||||
|
Display.setTitle("Silent Client " + Client.getInstance().getVersion() + " (1.8.9)");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "runTick", at = @At(value = "INVOKE", target = "Lnet/minecraft/profiler/Profiler;endSection()V", shift = At.Shift.BEFORE))
|
||||||
|
public void tickEvent(CallbackInfo callbackInfo) {
|
||||||
|
new ClientTickEvent().call();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package net.silentclient.client.types;
|
||||||
|
|
||||||
|
public class BuildData {
|
||||||
|
public String commit;
|
||||||
|
public String branch;
|
||||||
|
|
||||||
|
public BuildData() {
|
||||||
|
this.branch = "unknown";
|
||||||
|
this.commit = "unknown";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBranch() {
|
||||||
|
return branch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCommit() {
|
||||||
|
return commit;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"commit": "unknown",
|
||||||
|
"branch": "debug"
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"required": true,
|
||||||
|
"compatibilityLevel": "JAVA_8",
|
||||||
|
"verbose": true,
|
||||||
|
"package": "net.silentclient.client.mixin",
|
||||||
|
"refmap": "mixins.SilentClient.refmap.json",
|
||||||
|
"mixins": [
|
||||||
|
"mixins.MinecraftMixin"
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in New Issue