Initial commit

This commit is contained in:
feud 2025-01-10 11:16:35 -08:00
commit b56dc934a5
252 changed files with 30609 additions and 0 deletions

1
README.md Normal file
View File

@ -0,0 +1 @@
# Raven bS Premium

132
build.gradle Normal file
View File

@ -0,0 +1,132 @@
buildscript {
repositories {
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
url 'https://repo.spongepowered.org/maven'
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1'
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
}
}
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'java'
group = "keystrokesmod"
archivesBaseName = "raven-bS"
compileJava {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
options.encoding 'UTF-8'
}
minecraft {
version = "1.8.9-11.15.1.2318-1.8.9"
runDir = "run"
mappings = "stable_20"
makeObfSourceJar = false
clientJvmArgs += '-Dfml.coreMods.load=keystrokesmod.mixins.MixinLoader'
}
mixin {
defaultObfuscationEnv searge
sourceSets {
main {
ext.refMap = 'mixins.raven.refmap.json'
}
}
}
repositories {
mavenCentral()
maven {
url 'https://repo.spongepowered.org/maven'
}
}
configurations {
embed
compile.extendsFrom embed
}
dependencies {
implementation group: 'commons-io', name: 'commons-io', version: '2.11.0'
embed('org.spongepowered:mixin:0.6-SNAPSHOT') {
exclude module: 'gson'
exclude module: 'guava'
exclude module: 'jarjar'
exclude module: 'commons-codec'
exclude module: 'commons-io'
exclude module: 'launchwrapper'
exclude module: 'asm-commons'
exclude module: 'slf4j-api'
}
implementation 'org.jetbrains:annotations:24.1.0'
}
processResources {
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version': project.version, 'mcversion': project.minecraft.version
}
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
jar {
from(configurations.embed.collect {
it.isDirectory() ? it : zipTree(it)
}) {
exclude 'dummyThing',
'LICENSE.txt',
'META-INF/MUMFREY.RSA',
'META-INF/maven/**',
'org/**/*.html'
exclude 'LICENSE.md'
exclude 'pack.mcmeta'
exclude '**/module-info.class'
exclude '*.so'
exclude '*.dylib'
exclude '*.dll'
exclude '*.jnilib'
exclude 'ibxm/**'
exclude 'com/jcraft/**'
exclude 'org/lwjgl/**'
exclude 'net/java/**'
exclude 'META-INF/proguard/**'
exclude 'META-INF/versions/**'
exclude 'META-INF/com.android.tools/**'
exclude 'fabric.mod.json'
}
manifest {
attributes(
'MixinConfigs': 'mixins.raven.json',
'TweakClass': 'org.spongepowered.asm.launch.MixinTweaker',
'TweakOrder': 0,
"FMLCorePlugin": "keystrokesmod.mixins.MixinLoader",
"ForceLoadAsMod": true,
'FMLCorePluginContainsFMLMod': true,
"ModSide": "CLIENT"
)
}
}

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,6 @@
#Mon Sep 14 12:28:28 PDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-bin.zip

164
gradlew vendored Normal file
View File

@ -0,0 +1,164 @@
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
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" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

90
gradlew.bat vendored Normal file
View File

@ -0,0 +1,90 @@
@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
@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=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
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 init
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
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
: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 %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="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!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@ -0,0 +1,143 @@
package keystrokesmod;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import keystrokesmod.keystroke.KeySrokeRenderer;
import keystrokesmod.keystroke.KeyStrokeConfigGui;
import keystrokesmod.keystroke.keystrokeCommand;
import keystrokesmod.module.Module;
import keystrokesmod.clickgui.ClickGui;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.utility.ModuleUtils;
import keystrokesmod.script.ScriptManager;
import keystrokesmod.utility.*;
import keystrokesmod.utility.command.CommandManager;
import keystrokesmod.utility.profile.Profile;
import keystrokesmod.utility.profile.ProfileManager;
import net.minecraft.client.Minecraft;
import net.minecraftforge.client.ClientCommandHandler;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.Phase;
@Mod(
modid = "keystrokes",
name = "KeystrokesMod",
version = "KMV5",
acceptedMinecraftVersions = "[1.8.9]"
)
public class Raven {
public static boolean debug = false;
public static Minecraft mc = Minecraft.getMinecraft();
private static KeySrokeRenderer keySrokeRenderer;
private static boolean isKeyStrokeConfigGuiToggled;
private static final ScheduledExecutorService ex = Executors.newScheduledThreadPool(2);
public static ModuleManager moduleManager;
public static ClickGui clickGui;
public static ProfileManager profileManager;
public static ScriptManager scriptManager;
public static CommandManager commandManager;
public static Profile currentProfile;
public static PacketsHandler packetsHandler;
private static boolean firstLoad;
public Raven() {
moduleManager = new ModuleManager();
}
@EventHandler
public void init(FMLInitializationEvent e) {
Runtime.getRuntime().addShutdownHook(new Thread(ex::shutdown));
ClientCommandHandler.instance.registerCommand(new keystrokeCommand());
FMLCommonHandler.instance().bus().register(this);
FMLCommonHandler.instance().bus().register(new DebugInfoRenderer());
FMLCommonHandler.instance().bus().register(new CPSCalculator());
FMLCommonHandler.instance().bus().register(new MovementFix(mc));
FMLCommonHandler.instance().bus().register(new KeySrokeRenderer());
FMLCommonHandler.instance().bus().register(new Ping());
FMLCommonHandler.instance().bus().register(packetsHandler = new PacketsHandler());
FMLCommonHandler.instance().bus().register(new ModuleUtils(mc));
Reflection.getFields();
Reflection.getMethods();
moduleManager.register();
scriptManager = new ScriptManager();
keySrokeRenderer = new KeySrokeRenderer();
clickGui = new ClickGui();
profileManager = new ProfileManager();
scriptManager.loadScripts();
profileManager.loadProfiles();
profileManager.loadProfile("default");
Reflection.setKeyBindings();
FMLCommonHandler.instance().bus().register(ModuleManager.scaffold);
FMLCommonHandler.instance().bus().register(ModuleManager.tower);
commandManager = new CommandManager();
}
@SubscribeEvent
public void onTick(ClientTickEvent e) {
if (e.phase == Phase.END) {
if (Utils.nullCheck()) {
if (Reflection.sendMessage) {
Utils.sendMessage("&cThere was an error, relaunch the game.");
Reflection.sendMessage = false;
}
for (Module module : getModuleManager().getModules()) {
if (mc.currentScreen == null && module.canBeEnabled()) {
module.keybind();
}
else if (mc.currentScreen instanceof ClickGui) {
module.guiUpdate();
}
if (module.isEnabled()) {
module.onUpdate();
}
}
if (mc.currentScreen == null) {
for (Profile profile : Raven.profileManager.profiles) {
profile.getModule().keybind();
}
for (Module module : Raven.scriptManager.scripts.values()) {
module.keybind();
}
}
}
if (isKeyStrokeConfigGuiToggled) {
isKeyStrokeConfigGuiToggled = false;
mc.displayGuiScreen(new KeyStrokeConfigGui());
}
}
}
@SubscribeEvent
public void onEntityJoinWorld(EntityJoinWorldEvent e) {
if (e.entity == mc.thePlayer && !firstLoad) {
firstLoad = true;
scriptManager.loadScripts();
}
}
public static ModuleManager getModuleManager() {
return moduleManager;
}
public static ScheduledExecutorService getExecutor() {
return ex;
}
public static KeySrokeRenderer getKeyStrokeRenderer() {
return keySrokeRenderer;
}
public static void toggleKeyStrokeConfigGui() {
isKeyStrokeConfigGuiToggled = true;
}
}

View File

@ -0,0 +1,321 @@
package keystrokesmod.clickgui;
import keystrokesmod.Raven;
import keystrokesmod.clickgui.components.Component;
import keystrokesmod.clickgui.components.impl.BindComponent;
import keystrokesmod.clickgui.components.impl.CategoryComponent;
import keystrokesmod.clickgui.components.impl.ModuleComponent;
import keystrokesmod.module.Module;
import keystrokesmod.module.impl.client.CommandLine;
import keystrokesmod.module.impl.client.Gui;
import keystrokesmod.utility.Commands;
import keystrokesmod.utility.Timer;
import keystrokesmod.utility.Utils;
import keystrokesmod.utility.shader.BlurUtils;
import keystrokesmod.utility.shader.RoundedUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.gui.inventory.GuiInventory;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraftforge.client.event.GuiScreenEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.client.config.GuiButtonExt;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import java.awt.*;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
public class ClickGui extends GuiScreen {
private ScheduledFuture sf;
private Timer logoSmoothWidth;
private Timer logoSmoothLength;
private Timer smoothEntity;
private Timer backgroundFade;
private Timer blurSmooth;
private ScaledResolution sr;
private GuiButtonExt commandLineSend;
private GuiTextField commandLineInput;
public static ArrayList<CategoryComponent> categories;
public int originalScale;
public ClickGui() {
categories = new ArrayList();
int y = 5;
Module.category[] values;
int length = (values = Module.category.values()).length;
for (int i = 0; i < length; ++i) {
Module.category c = values[i];
CategoryComponent categoryComponent = new CategoryComponent(c);
categoryComponent.setY(y);
categories.add(categoryComponent);
y += 20;
}
}
public void initMain() {
(this.logoSmoothWidth = this.smoothEntity = this.blurSmooth = this.backgroundFade = new Timer(500.0F)).start();
this.sf = Raven.getExecutor().schedule(() -> {
(this.logoSmoothLength = new Timer(650.0F)).start();
}, 650L, TimeUnit.MILLISECONDS);
}
@Override
public void initGui() {
super.initGui();
this.sr = new ScaledResolution(this.mc);
for (CategoryComponent categoryComponent : categories) {
categoryComponent.setScreenHeight(this.sr.getScaledHeight());
}
(this.commandLineInput = new GuiTextField(1, this.mc.fontRendererObj, 22, this.height - 100, 150, 20)).setMaxStringLength(256);
this.buttonList.add(this.commandLineSend = new GuiButtonExt(2, 22, this.height - 70, 150, 20, "Send"));
this.commandLineSend.visible = CommandLine.a;
}
public void drawScreen(int x, int y, float p) {
if (Gui.backgroundBlur.getInput() != 0) {
BlurUtils.prepareBlur();
RoundedUtils.drawRound(0, 0, this.width, this.height, 0.0f, true, Color.black);
float inputToRange = (float) (3 * ((Gui.backgroundBlur.getInput() + 35) / 100));
BlurUtils.blurEnd(2, this.blurSmooth.getValueFloat(1, inputToRange, 1));
}
if (Gui.darkBackground.isToggled()) {
drawRect(0, 0, this.width, this.height, (int) (this.backgroundFade.getValueFloat(0.0F, 0.7F, 2) * 255.0F) << 24);
}
int r;
if (!Gui.removeWatermark.isToggled()) {
int h = this.height / 4;
int wd = this.width / 2;
int w_c = 30 - this.logoSmoothWidth.getValueInt(0, 30, 3);
this.drawCenteredString(this.fontRendererObj, "r", wd + 1 - w_c, h - 25, Utils.getChroma(2L, 1500L));
this.drawCenteredString(this.fontRendererObj, "a", wd - w_c, h - 15, Utils.getChroma(2L, 1200L));
this.drawCenteredString(this.fontRendererObj, "v", wd - w_c, h - 5, Utils.getChroma(2L, 900L));
this.drawCenteredString(this.fontRendererObj, "e", wd - w_c, h + 5, Utils.getChroma(2L, 600L));
this.drawCenteredString(this.fontRendererObj, "n", wd - w_c, h + 15, Utils.getChroma(2L, 300L));
this.drawCenteredString(this.fontRendererObj, "bS", wd + 1 + w_c, h + 30, Utils.getChroma(2L, 0L));
this.drawVerticalLine(wd - 10 - w_c, h - 30, h + 43, Color.white.getRGB());
this.drawVerticalLine(wd + 10 + w_c, h - 30, h + 43, Color.white.getRGB());
if (this.logoSmoothLength != null) {
r = this.logoSmoothLength.getValueInt(0, 20, 2);
this.drawHorizontalLine(wd - 10, wd - 10 + r, h - 29, -1);
this.drawHorizontalLine(wd + 10, wd + 10 - r, h + 42, -1);
}
}
for (CategoryComponent c : categories) {
c.render(this.fontRendererObj);
c.mousePosition(x, y);
for (Component m : c.getModules()) {
m.drawScreen(x, y);
}
}
GL11.glColor3f(1.0f, 1.0f, 1.0f);
if (!Gui.removePlayerModel.isToggled()) {
GlStateManager.pushMatrix();
GlStateManager.disableBlend();
GuiInventory.drawEntityOnScreen(this.width + 15 - this.smoothEntity.getValueInt(0, 40, 2), this.height - 10, 40, (float) (this.width - 25 - x), (float) (this.height - 50 - y), this.mc.thePlayer);
GlStateManager.enableBlend();
GlStateManager.popMatrix();
}
if (CommandLine.a) {
if (!this.commandLineSend.visible) {
this.commandLineSend.visible = true;
}
r = CommandLine.animate.isToggled() ? CommandLine.an.getValueInt(0, 200, 2) : 200;
if (CommandLine.b) {
r = 200 - r;
if (r == 0) {
CommandLine.b = false;
CommandLine.a = false;
this.commandLineSend.visible = false;
}
}
drawRect(0, 0, r, this.height, -1089466352);
this.drawHorizontalLine(0, r - 1, (this.height - 345), -1);
this.drawHorizontalLine(0, r - 1, (this.height - 115), -1);
drawRect(r - 1, 0, r, this.height, -1);
Commands.rc(this.fontRendererObj, this.height, r, this.sr.getScaleFactor());
int x2 = r - 178;
this.commandLineInput.xPosition = x2;
this.commandLineSend.xPosition = x2;
this.commandLineInput.drawTextBox();
super.drawScreen(x, y, p);
}
else if (CommandLine.b) {
CommandLine.b = false;
}
}
public void mouseClicked(int x, int y, int m) throws IOException {
Iterator var4 = categories.iterator();
while (true) {
CategoryComponent category;
do {
do {
if (!var4.hasNext()) {
if (CommandLine.a) {
this.commandLineInput.mouseClicked(x, y, m);
super.mouseClicked(x, y, m);
}
return;
}
category = (CategoryComponent) var4.next();
if (category.v(x, y) && !category.i(x, y) && m == 0) {
category.overTitle(true);
category.xx = x - category.getX();
category.yy = y - category.getY();
}
if (category.overTitle(x, y) && m == 1) {
category.mouseClicked(!category.isOpened());
}
if (category.i(x, y) && m == 0) {
category.cv(!category.p());
}
} while (!category.isOpened());
} while (category.getModules().isEmpty());
for (Component c : category.getModules()) {
if (c.onClick(x, y, m) && c instanceof ModuleComponent) {
category.openModule((ModuleComponent) c);
}
}
}
}
public void mouseReleased(int x, int y, int s) {
if (s == 0) {
Iterator<CategoryComponent> iterator = categories.iterator();
while (iterator.hasNext()) {
CategoryComponent category = iterator.next();
category.overTitle(false);
if (category.isOpened() && !category.getModules().isEmpty()) {
for (Component module : category.getModules()) {
module.mouseReleased(x, y, s);
}
}
}
}
}
@Override
public void handleMouseInput() throws IOException {
super.handleMouseInput();
int wheelInput = Mouse.getDWheel();
if (wheelInput != 0) {
for (CategoryComponent category : categories) {
category.onScroll(wheelInput);
}
}
}
@Override
public void setWorldAndResolution(Minecraft p_setWorldAndResolution_1_, final int p_setWorldAndResolution_2_, final int p_setWorldAndResolution_3_) {
this.mc = p_setWorldAndResolution_1_;
originalScale = this.mc.gameSettings.guiScale;
this.mc.gameSettings.guiScale = (int) Gui.guiScale.getInput() + 1;
this.itemRender = p_setWorldAndResolution_1_.getRenderItem();
this.fontRendererObj = p_setWorldAndResolution_1_.fontRendererObj;
final ScaledResolution scaledresolution = new ScaledResolution(this.mc);
this.width = scaledresolution.getScaledWidth();
this.height = scaledresolution.getScaledHeight();
if (!MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.InitGuiEvent.Pre(this, this.buttonList))) {
this.buttonList.clear();
this.initGui();
}
MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.InitGuiEvent.Post(this, this.buttonList));
}
@Override
public void keyTyped(char t, int k) {
if (k == Keyboard.KEY_ESCAPE && !binding()) {
this.mc.displayGuiScreen(null);
} else {
Iterator<CategoryComponent> iterator = categories.iterator();
while (iterator.hasNext()) {
CategoryComponent category = iterator.next();
if (category.isOpened() && !category.getModules().isEmpty()) {
for (Component module : category.getModules()) {
module.keyTyped(t, k);
}
}
}
if (CommandLine.a) {
String cm = this.commandLineInput.getText();
if (k == 28 && !cm.isEmpty()) {
Commands.rCMD(this.commandLineInput.getText());
this.commandLineInput.setText("");
return;
}
this.commandLineInput.textboxKeyTyped(t, k);
}
}
}
public void actionPerformed(GuiButton b) {
if (b == this.commandLineSend) {
Commands.rCMD(this.commandLineInput.getText());
this.commandLineInput.setText("");
}
}
@Override
public void onGuiClosed() {
this.logoSmoothLength = null;
if (this.sf != null) {
this.sf.cancel(true);
this.sf = null;
}
for (CategoryComponent c : categories) {
c.dragging = false;
for (Component m : c.getModules()) {
m.onGuiClosed();
}
}
this.mc.gameSettings.guiScale = originalScale;
}
public boolean doesGuiPauseGame() {
return false;
}
private boolean binding() {
for (CategoryComponent c : categories) {
for (ModuleComponent m : c.getModules()) {
for (Component component : m.settings) {
if (component instanceof BindComponent && ((BindComponent) component).isBinding) {
return true;
}
}
}
}
return false;
}
public static int[] calculateBlur(int setting) {
int passes = (int) (setting * 6.0 / 100.0 + 1.0);
int offset = (int) (setting * 3.0 / 100.0);
return new int[]{passes, offset};
}
}

View File

@ -0,0 +1,29 @@
package keystrokesmod.clickgui.components;
public class Component {
public void render() {
}
public void drawScreen(int x, int y) {
}
public boolean onClick(int x, int y, int b) {
return false;
}
public void mouseReleased(int x, int y, int m) {
}
public void keyTyped(char t, int k) {
}
public void updateHeight(int n) {
}
public int getHeight() {
return 0;
}
public void onGuiClosed() {
}
}

View File

@ -0,0 +1,105 @@
package keystrokesmod.clickgui.components.impl;
import keystrokesmod.Raven;
import keystrokesmod.clickgui.components.Component;
import keystrokesmod.module.Module;
import keystrokesmod.module.impl.client.Gui;
import keystrokesmod.utility.Theme;
import keystrokesmod.utility.profile.ProfileModule;
import net.minecraft.client.Minecraft;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
public class BindComponent extends Component {
public boolean isBinding;
private ModuleComponent moduleComponent;
private int bind;
private int x;
private int y;
public BindComponent(ModuleComponent moduleComponent, int bind) {
this.moduleComponent = moduleComponent;
this.x = moduleComponent.categoryComponent.getX() + moduleComponent.categoryComponent.getWidth();
this.y = moduleComponent.categoryComponent.getY() + moduleComponent.yPos;
this.bind = bind;
}
public void updateHeight(int n) {
this.bind = n;
}
public void render() {
GL11.glPushMatrix();
GL11.glScaled(0.5D, 0.5D, 0.5D);
this.drawString(!this.moduleComponent.mod.canBeEnabled() && this.moduleComponent.mod.script == null ? "Module cannot be bound." : this.isBinding ? "Press a key..." : "Current bind: '§e" + (this.moduleComponent.mod.getKeycode() >= 1000 ? "M" + (this.moduleComponent.mod.getKeycode() - 1000) : Keyboard.getKeyName(this.moduleComponent.mod.getKeycode())) + "§r'");
GL11.glPopMatrix();
}
public void drawScreen(int x, int y) {
this.y = this.moduleComponent.categoryComponent.getModuleY() + this.bind;
this.x = this.moduleComponent.categoryComponent.getX();
}
public boolean onClick(int x, int y, int b) {
if (this.i(x, y) && this.moduleComponent.isOpened && this.moduleComponent.mod.canBeEnabled()) {
if (b == 0) {
this.isBinding = !this.isBinding;
}
else if (b == 1 && this.moduleComponent.mod.moduleCategory() != Module.category.profiles) {
this.moduleComponent.mod.setHidden(!this.moduleComponent.mod.isHidden());
if (Raven.currentProfile != null) {
((ProfileModule) Raven.currentProfile.getModule()).saved = false;
}
}
else if (b > 1) {
if (this.isBinding) {
this.moduleComponent.mod.setBind(b + 1000);
if (Raven.currentProfile != null) {
((ProfileModule) Raven.currentProfile.getModule()).saved = false;
}
this.isBinding = false;
}
}
}
return false;
}
public void keyTyped(char t, int keybind) {
if (this.isBinding) {
if (keybind == Keyboard.KEY_0 || keybind == Keyboard.KEY_ESCAPE) {
if (this.moduleComponent.mod instanceof Gui) {
this.moduleComponent.mod.setBind(54);
} else {
this.moduleComponent.mod.setBind(0);
}
if (Raven.currentProfile != null) {
((ProfileModule) Raven.currentProfile.getModule()).saved = false;
}
}
else {
if (Raven.currentProfile != null) {
((ProfileModule) Raven.currentProfile.getModule()).saved = false;
}
this.moduleComponent.mod.setBind(keybind);
}
this.isBinding = false;
}
}
public boolean i(int x, int y) {
return x > this.x && x < this.x + this.moduleComponent.categoryComponent.getWidth() && y > this.y - 1 && y < this.y + 12;
}
public int getHeight() {
return 16;
}
private void drawString(String s) {
Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(s, (float) ((this.moduleComponent.categoryComponent.getX() + 4) * 2), (float) ((this.moduleComponent.categoryComponent.getY() + this.bind + 3) * 2), !this.moduleComponent.mod.hidden ? Theme.getGradient(Theme.descriptor[0], Theme.descriptor[1], 0) : Theme.getGradient(Theme.hiddenBind[0], Theme.hiddenBind[1], 0));
}
public void onGuiClosed() {
this.isBinding = false;
}
}

View File

@ -0,0 +1,65 @@
package keystrokesmod.clickgui.components.impl;
import keystrokesmod.Raven;
import keystrokesmod.clickgui.components.Component;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.utility.profile.ProfileModule;
import net.minecraft.client.Minecraft;
import org.lwjgl.opengl.GL11;
import java.awt.*;
public class ButtonComponent extends Component {
private final int c = (new Color(20, 255, 0)).getRGB();
private Module mod;
private ButtonSetting buttonSetting;
private ModuleComponent p;
private int o;
private int x;
private int y;
public ButtonComponent(Module mod, ButtonSetting op, ModuleComponent b, int o) {
this.mod = mod;
this.buttonSetting = op;
this.p = b;
this.x = b.categoryComponent.getX() + b.categoryComponent.getWidth();
this.y = b.categoryComponent.getY() + b.yPos;
this.o = o;
}
public void render() {
GL11.glPushMatrix();
GL11.glScaled(0.5D, 0.5D, 0.5D);
Minecraft.getMinecraft().fontRendererObj.drawString((this.buttonSetting.isMethodButton ? "[=] " : (this.buttonSetting.isToggled() ? "[+] " : "[-] ")) + this.buttonSetting.getName(), (float) ((this.p.categoryComponent.getX() + 4) * 2), (float) ((this.p.categoryComponent.getY() + this.o + 4) * 2), this.buttonSetting.isToggled() ? this.c : -1, false);
GL11.glPopMatrix();
}
public void updateHeight(int n) {
this.o = n;
}
public void drawScreen(int x, int y) {
this.y = this.p.categoryComponent.getModuleY() + this.o;
this.x = this.p.categoryComponent.getX();
}
public boolean onClick(int x, int y, int b) {
if (this.i(x, y) && b == 0 && this.p.isOpened) {
if (this.buttonSetting.isMethodButton) {
this.buttonSetting.runMethod();
return false;
}
this.buttonSetting.toggle();
this.mod.guiButtonToggled(this.buttonSetting);
if (Raven.currentProfile != null) {
((ProfileModule) Raven.currentProfile.getModule()).saved = false;
}
}
return false;
}
public boolean i(int x, int y) {
return x > this.x && x < this.x + this.p.categoryComponent.getWidth() && y > this.y && y < this.y + 11;
}
}

View File

@ -0,0 +1,374 @@
package keystrokesmod.clickgui.components.impl;
import keystrokesmod.Raven;
import keystrokesmod.clickgui.components.Component;
import keystrokesmod.module.Module;
import keystrokesmod.module.impl.client.Gui;
import keystrokesmod.utility.RenderUtils;
import keystrokesmod.utility.Timer;
import keystrokesmod.utility.Utils;
import keystrokesmod.utility.profile.Manager;
import keystrokesmod.utility.profile.Profile;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
import java.awt.*;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.stream.Collectors;
public class CategoryComponent {
public List<ModuleComponent> modules = new CopyOnWriteArrayList<>();
public Module.category categoryName;
public boolean opened;
public int width;
public int y;
public int x;
public int titleHeight;
public boolean dragging;
public int xx;
public int yy;
public boolean n4m = false;
public String pvp;
public boolean pin = false;
public boolean hovering = false;
public boolean hoveringOverCategory = false;
public Timer smoothTimer;
private Timer textTimer;
public Timer smoothScrollTimer;
public ScaledResolution scale;
public float big;
private float bigSettings;
private final int translucentBackground = new Color(0, 0, 0, 110).getRGB();
private final int regularOutline = new Color(81, 99, 149).getRGB();
private final int regularOutline2 = new Color(97, 67, 133).getRGB();
private final int categoryNameColor = new Color(220, 220, 220).getRGB();
private float lastHeight;
public int moduleY;
private int lastModuleY;
private int screenHeight;
private boolean scrolled;
private int targetModuleY;
private float closedHeight;
public CategoryComponent(Module.category category) {
this.categoryName = category;
this.width = 92;
this.x = 5;
this.moduleY = this.y = 5;
this.titleHeight = 13;
this.smoothTimer = null;
this.textTimer = null;
this.xx = 0;
this.opened = false;
this.dragging = false;
int moduleRenderX = this.titleHeight + 3;
this.scale = new ScaledResolution(Minecraft.getMinecraft());
this.targetModuleY = this.moduleY;
for (Module mod : Raven.getModuleManager().inCategory(this.categoryName)) {
ModuleComponent b = new ModuleComponent(mod, this, moduleRenderX);
this.modules.add(b);
moduleRenderX += 16;
}
}
public List<ModuleComponent> getModules() {
return this.modules;
}
public void reloadModules(boolean isProfile) {
this.modules.clear();
this.titleHeight = 13;
int moduleRenderY = this.titleHeight + 3;
if ((this.categoryName == Module.category.profiles && isProfile) || (this.categoryName == Module.category.scripts && !isProfile)) {
ModuleComponent manager = new ModuleComponent(isProfile ? new Manager() : new keystrokesmod.script.Manager(), this, moduleRenderY);
this.modules.add(manager);
if ((Raven.profileManager == null && isProfile) || (Raven.scriptManager == null && !isProfile)) {
return;
}
if (isProfile) {
for (Profile profile : Raven.profileManager.profiles) {
moduleRenderY += 16;
ModuleComponent b = new ModuleComponent(profile.getModule(), this, moduleRenderY);
this.modules.add(b);
}
}
else {
Collection<Module> modulesCollection = Raven.scriptManager.scripts.values();
List<Module> sortedModules = modulesCollection.stream().sorted(Comparator.comparing(Module::getName, String.CASE_INSENSITIVE_ORDER)).collect(Collectors.toList());
for (Module module : sortedModules) {
moduleRenderY += 16;
ModuleComponent b = new ModuleComponent(module, this, moduleRenderY);
this.modules.add(b);
}
}
}
}
public void setX(int n) {
this.x = n;
}
public void setY(int y) {
this.moduleY = this.y = y;
this.targetModuleY = y;
}
public void overTitle(boolean d) {
this.dragging = d;
}
public boolean p() {
return this.pin;
}
public void cv(boolean on) {
this.pin = on;
}
public boolean isOpened() {
return this.opened;
}
public void mouseClicked(boolean on) {
this.opened = on;
(this.smoothTimer = new Timer(500)).start();
(this.textTimer = new Timer(200)).start();
}
public void openModule(ModuleComponent component) {
if (!component.isOpened) {
closedHeight = this.y + this.titleHeight + big + 4;
}
(this.smoothTimer = new Timer(200)).start();
}
public void onScroll(int mouseScrollInput) {
if (!hoveringOverCategory || !this.opened) {
return;
}
int scrollSpeed = (int) Gui.scrollSpeed.getInput();
if (mouseScrollInput > 0) {
this.targetModuleY += scrollSpeed;
} else if (mouseScrollInput < 0) {
this.targetModuleY -= scrollSpeed;
}
scrolled = true;
(smoothScrollTimer = new Timer(200)).start();
}
public void render(FontRenderer renderer) {
this.targetModuleY = Math.min(this.targetModuleY, this.y);
if (this.targetModuleY + this.bigSettings < this.y + this.big + this.titleHeight) {
this.targetModuleY = (int) (this.y + this.big - this.bigSettings);
}
this.width = 92;
int modulesHeight = 0;
int settingsHeight = 0;
if (!this.modules.isEmpty() && this.opened) {
for (ModuleComponent c : this.modules) {
settingsHeight += c.getHeight();
int height = !c.isOpened ? 16 : c.getModuleHeight();
if (modulesHeight + height > this.screenHeight * 0.9d) {
modulesHeight = (int) (this.screenHeight * 0.9d);
continue;
}
modulesHeight += c.getHeight();
}
big = modulesHeight;
bigSettings = settingsHeight;
}
float middlePos = (float) (this.x + this.width / 2 - Minecraft.getMinecraft().fontRendererObj.getStringWidth(this.categoryName.name()) / 2);
float xPos = opened ? middlePos : this.x + 12;
float extra = this.y + this.titleHeight + modulesHeight + 4;
if (smoothTimer != null && System.currentTimeMillis() - smoothTimer.last >= 330) {
smoothTimer = null;
}
if (extra != lastHeight && smoothTimer != null) {
double diff = lastHeight - extra;
if (diff < 0) {
extra = smoothTimer.getValueFloat(lastHeight, this.y + this.titleHeight + modulesHeight + 4, 1);
}
else if (diff > 0) {
extra = smoothTimer.getValueFloat(this.opened ? closedHeight : lastHeight, this.y + this.titleHeight + modulesHeight + 4, 1);
}
}
float namePos = textTimer == null ? xPos : textTimer.getValueFloat(this.x + 12, middlePos, 1);
if (!this.opened) {
namePos = textTimer == null ? xPos : middlePos - textTimer.getValueFloat(0, this.width / 2 - Minecraft.getMinecraft().fontRendererObj.getStringWidth(this.categoryName.name()) / 2 - 12, 1);
}
if (scrolled && smoothScrollTimer != null) {
if (System.currentTimeMillis() - smoothScrollTimer.last <= 200) {
float interpolated = smoothScrollTimer.getValueFloat(lastModuleY, targetModuleY, 4);
moduleY = (int) interpolated;
}
else {
moduleY = targetModuleY;
scrolled = false;
smoothScrollTimer = null;
}
}
else {
moduleY = targetModuleY;
}
lastModuleY = moduleY;
lastHeight = extra;
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_SCISSOR_TEST);
RenderUtils.scissor(0, this.y - 2, this.x + this.width + 4, extra - this.y + 4);
RenderUtils.drawRoundedGradientOutlinedRectangle(this.x - 2, this.y, this.x + this.width + 2, extra, 9, translucentBackground,
((opened || hovering) && Gui.rainBowOutlines.isToggled()) ? RenderUtils.setAlpha(Utils.getChroma(2, 0), 0.5) : regularOutline, ((opened || hovering) && Gui.rainBowOutlines.isToggled()) ? RenderUtils.setAlpha(Utils.getChroma(2, 700), 0.5) : regularOutline2);
renderItemForCategory(this.categoryName, this.x + 1, this.y + 4, opened || hovering);
renderer.drawString(this.n4m ? this.pvp : this.categoryName.name(), namePos, (float) (this.y + 4), categoryNameColor, false);
RenderUtils.scissor(0, this.y + this.titleHeight + 3, this.x + this.width + 4, extra - this.y - 4 - this.titleHeight);
if (!this.n4m) {
int prevY = this.y;
this.y = this.moduleY;
if (this.opened || smoothTimer != null) {
for (Component c2 : this.modules) {
c2.render();
}
}
this.y = prevY;
}
GL11.glDisable(GL11.GL_SCISSOR_TEST);
GL11.glPopMatrix();
}
public void updateHeight() {
int y = this.titleHeight + 3;
for (Component component : this.modules) {
component.updateHeight(y);
y += component.getHeight();
}
}
public int getX() {
return this.x;
}
public int getY() {
return this.y;
}
public int getModuleY() {
return this.moduleY;
}
public int getWidth() {
return this.width;
}
public void mousePosition(int x, int y) {
if (this.dragging) {
this.setX(x - this.xx);
this.setY(y - this.yy);
}
hoveringOverCategory = overCategory(x, y);
hovering = overTitle(x, y);
}
public boolean i(int x, int y) {
return x >= this.x + 92 - 13 && x <= this.x + this.width && (float) y >= (float) this.y + 2.0F && y <= this.y + this.titleHeight + 1;
}
public boolean overTitle(int x, int y) {
return x >= this.x && x <= this.x + this.width && (float) y >= (float) this.y + 2.0F && y <= this.y + this.titleHeight + 1;
}
public boolean overCategory(int x, int y) {
return x >= this.x - 2 && x <= this.x + this.width + 2 && (float) y >= (float) this.y + 2.0F && y <= this.y + this.titleHeight + big + 1;
}
public boolean v(int x, int y) {
return x >= this.x && x <= this.x + this.width && y >= this.y && y <= this.y + this.titleHeight;
}
private void renderItemForCategory(Module.category category, int x, int y, boolean enchant) {
RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
double scale = 0.55;
GlStateManager.pushMatrix();
GlStateManager.scale(scale, scale, scale);
ItemStack itemStack = null;
switch (category) {
case combat:
itemStack = new ItemStack(Items.diamond_sword);
break;
case movement:
itemStack = new ItemStack(Items.diamond_boots);
break;
case player:
itemStack = new ItemStack(Items.golden_apple);
break;
case world:
itemStack = new ItemStack(Items.map);
break;
case render:
itemStack = new ItemStack(Items.ender_eye);
break;
case minigames:
itemStack = new ItemStack(Items.gold_ingot);
break;
case fun:
itemStack = new ItemStack(Items.slime_ball);
break;
case other:
itemStack = new ItemStack(Items.clock);
break;
case client:
itemStack = new ItemStack(Items.compass);
break;
case profiles:
itemStack = new ItemStack(Items.book);
break;
case scripts:
itemStack = new ItemStack(Items.redstone);
break;
}
if (itemStack != null) {
if (enchant) {
if (category != Module.category.player) {
itemStack.addEnchantment(Enchantment.unbreaking, 2);
} else {
itemStack.setItemDamage(1);
}
}
RenderHelper.enableGUIStandardItemLighting();
GlStateManager.disableBlend();
renderItem.renderItemAndEffectIntoGUI(itemStack, (int) (x / scale), (int) (y / scale));
GlStateManager.enableBlend();
RenderHelper.disableStandardItemLighting();
}
GlStateManager.scale(1, 1, 1);
GlStateManager.popMatrix();
}
public void setScreenHeight(int screenHeight) {
this.screenHeight = screenHeight;
}
}

View File

@ -0,0 +1,34 @@
package keystrokesmod.clickgui.components.impl;
import keystrokesmod.clickgui.components.Component;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.utility.Theme;
import net.minecraft.client.Minecraft;
import org.lwjgl.opengl.GL11;
public class DescriptionComponent extends Component {
private DescriptionSetting desc;
private ModuleComponent p;
private int o;
private int x;
private int y;
public DescriptionComponent(DescriptionSetting desc, ModuleComponent b, int o) {
this.desc = desc;
this.p = b;
this.x = b.categoryComponent.getX() + b.categoryComponent.getWidth();
this.y = b.categoryComponent.getY() + b.yPos;
this.o = o;
}
public void render() {
GL11.glPushMatrix();
GL11.glScaled(0.5D, 0.5D, 0.5D);
Minecraft.getMinecraft().fontRendererObj.drawString(this.desc.getDesc(), (float) ((this.p.categoryComponent.getX() + 4) * 2), (float) ((this.p.categoryComponent.getY() + this.o + 4) * 2), Theme.getGradient(Theme.descriptor[0], Theme.descriptor[1], 0), true);
GL11.glPopMatrix();
}
public void updateHeight(int n) {
this.o = n;
}
}

View File

@ -0,0 +1,313 @@
package keystrokesmod.clickgui.components.impl;
import keystrokesmod.Raven;
import keystrokesmod.clickgui.components.Component;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.Setting;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.RenderUtils;
import keystrokesmod.utility.Timer;
import keystrokesmod.utility.Utils;
import keystrokesmod.utility.profile.Manager;
import keystrokesmod.utility.profile.ProfileModule;
import net.minecraft.client.Minecraft;
import org.lwjgl.opengl.GL11;
import java.awt.*;
import java.util.ArrayList;
import java.util.Iterator;
public class ModuleComponent extends Component {
private int originalHoverAlpha = 120;
private final int c2 = (new Color(154, 2, 255)).getRGB();
private final int hoverColor = (new Color(0, 0, 0, originalHoverAlpha)).getRGB();
private final int unsavedColor = new Color(114, 188, 250).getRGB();
private final int invalidColor = new Color(255, 80, 80).getRGB();
private final int enabledColor = new Color(24, 154, 255).getRGB();
private final int disabledColor = new Color(192, 192, 192).getRGB();
public Module mod;
public CategoryComponent categoryComponent;
public int yPos;
public ArrayList<Component> settings;
public boolean isOpened;
private boolean hovering;
private Timer hoverTimer;
private boolean hoverStarted;
private Timer smoothTimer;
private int smoothingY = 16;
public ModuleComponent(Module mod, CategoryComponent p, int yPos) {
this.mod = mod;
this.categoryComponent = p;
this.yPos = yPos;
this.settings = new ArrayList();
this.isOpened = false;
int y = yPos + 12;
if (mod != null && !mod.getSettings().isEmpty()) {
for (Setting v : mod.getSettings()) {
if (v instanceof SliderSetting) {
SliderSetting n = (SliderSetting) v;
SliderComponent s = new SliderComponent(n, this, y);
this.settings.add(s);
y += 12;
} else if (v instanceof ButtonSetting) {
ButtonSetting b = (ButtonSetting) v;
ButtonComponent c = new ButtonComponent(mod, b, this, y);
this.settings.add(c);
y += 12;
} else if (v instanceof DescriptionSetting) {
DescriptionSetting d = (DescriptionSetting) v;
DescriptionComponent m = new DescriptionComponent(d, this, y);
this.settings.add(m);
y += 12;
}
}
}
this.settings.add(new BindComponent(this, y));
}
public void updateHeight(int newY) {
this.yPos = newY;
int y = this.yPos + 16;
Iterator var3 = this.settings.iterator();
while (true) {
while (var3.hasNext()) {
Component co = (Component) var3.next();
co.updateHeight(y);
if (co instanceof SliderComponent) {
y += 16;
} else if (co instanceof ButtonComponent || co instanceof BindComponent || co instanceof DescriptionComponent) {
y += 12;
}
}
return;
}
}
public static void e() {
GL11.glDisable(2929);
GL11.glEnable(3042);
GL11.glDisable(3553);
GL11.glBlendFunc(770, 771);
GL11.glDepthMask(true);
GL11.glEnable(2848);
GL11.glHint(3154, 4354);
GL11.glHint(3155, 4354);
}
public static void f() {
GL11.glEnable(3553);
GL11.glDisable(3042);
GL11.glEnable(2929);
GL11.glDisable(2848);
GL11.glHint(3154, 4352);
GL11.glHint(3155, 4352);
GL11.glEdgeFlag(true);
}
public static void g() {
GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.0F);
}
public static void v(float x, float y, float x1, float y1, int t, int b) {
e();
GL11.glShadeModel(7425);
GL11.glBegin(7);
g();
GL11.glVertex2f(x, y1);
GL11.glVertex2f(x1, y1);
g();
GL11.glVertex2f(x1, y);
GL11.glVertex2f(x, y);
GL11.glEnd();
GL11.glShadeModel(7424);
f();
}
public void render() {
if (hovering || hoverTimer != null) {
double hoverAlpha = (hovering && hoverTimer != null) ? hoverTimer.getValueFloat(0, originalHoverAlpha, 1) : (hoverTimer != null && !hovering) ? originalHoverAlpha - hoverTimer.getValueFloat(0, originalHoverAlpha, 1) : originalHoverAlpha;
if (hoverAlpha == 0) {
hoverTimer = null;
}
RenderUtils.drawRoundedRectangle(this.categoryComponent.getX(), this.categoryComponent.getY() + yPos, this.categoryComponent.getX() + this.categoryComponent.getWidth(), this.categoryComponent.getY() + 16 + this.yPos, 8, Utils.mergeAlpha(hoverColor, (int) hoverAlpha));
}
v((float) this.categoryComponent.getX(), (float) (this.categoryComponent.getY() + this.yPos), (float) (this.categoryComponent.getX() + this.categoryComponent.getWidth()), (float) (this.categoryComponent.getY() + 15 + this.yPos), this.mod.isEnabled() ? this.c2 : -12829381, this.mod.isEnabled() ? this.c2 : -12302777);
GL11.glPushMatrix();
int button_rgb = this.mod.isEnabled() ? enabledColor : disabledColor;
if (this.mod.script != null && this.mod.script.error) {
button_rgb = invalidColor;
}
if (this.mod.moduleCategory() == Module.category.profiles && !(this.mod instanceof Manager) && !((ProfileModule) this.mod).saved && Raven.currentProfile.getModule() == this.mod) {
button_rgb = unsavedColor;
}
if (smoothTimer != null && System.currentTimeMillis() - smoothTimer.last >= 300) {
smoothTimer = null;
}
if (smoothTimer != null) {
int height = getModuleHeight();
if (isOpened) {
smoothingY = smoothTimer.getValueInt(16, height, 1);
if (smoothingY == height) {
smoothTimer = null;
}
}
else {
smoothingY = smoothTimer.getValueInt(height, 16, 1);
if (smoothingY == 16) {
smoothTimer = null;
}
}
this.categoryComponent.updateHeight();
}
Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(this.mod.getName(), (float) (this.categoryComponent.getX() + this.categoryComponent.getWidth() / 2 - Minecraft.getMinecraft().fontRendererObj.getStringWidth(this.mod.getName()) / 2), (float) (this.categoryComponent.getY() + this.yPos + 4), button_rgb);
GL11.glPopMatrix();
boolean scissorRequired = smoothTimer != null;
if (scissorRequired) {
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_SCISSOR_TEST);
RenderUtils.scissor(this.categoryComponent.getX() - 2, this.categoryComponent.getY() + this.yPos + 4, this.categoryComponent.getWidth() + 4, smoothingY + 4);
}
if (this.isOpened || smoothTimer != null) {
for (Component settingComponent : this.settings) {
settingComponent.render();
}
}
if (scissorRequired) {
GL11.glDisable(GL11.GL_SCISSOR_TEST);
GL11.glPopMatrix();
}
}
public int getHeight() {
if (smoothTimer != null) {
return smoothingY;
}
if (!this.isOpened) {
return 16;
}
else {
int h = 16;
Iterator var2 = this.settings.iterator();
while (true) {
while (var2.hasNext()) {
Component c = (Component) var2.next();
if (c instanceof SliderComponent) {
h += 16;
}
else if (c instanceof ButtonComponent || c instanceof BindComponent || c instanceof DescriptionComponent) {
h += 12;
}
}
return h;
}
}
}
public int getModuleHeight() {
int h = 16;
Iterator var2 = this.settings.iterator();
while (true) {
while (var2.hasNext()) {
Component c = (Component) var2.next();
if (c instanceof SliderComponent) {
h += 16;
}
else if (c instanceof ButtonComponent || c instanceof BindComponent || c instanceof DescriptionComponent) {
h += 12;
}
}
return h;
}
}
public void drawScreen(int x, int y) {
if (!this.settings.isEmpty()) {
for (Component c : this.settings) {
c.drawScreen(x, y);
}
}
if (overModuleName(x, y) && this.categoryComponent.opened) {
hovering = true;
if (hoverTimer == null) {
(hoverTimer = new Timer(75)).start();
hoverStarted = true;
}
}
else {
if (hovering && hoverStarted) {
(hoverTimer = new Timer(75)).start();
}
hoverStarted = false;
hovering = false;
}
}
public String getName() {
return mod.getName();
}
public boolean onClick(int x, int y, int mouse) {
if (this.overModuleName(x, y) && mouse == 0 && this.mod.canBeEnabled()) {
this.mod.toggle();
if (this.mod.moduleCategory() != Module.category.profiles) {
if (Raven.currentProfile != null) {
((ProfileModule) Raven.currentProfile.getModule()).saved = false;
}
}
}
if (this.overModuleName(x, y) && mouse == 1) {
this.isOpened = !this.isOpened;
(this.smoothTimer = new Timer(200)).start();
this.categoryComponent.updateHeight();
return true;
}
for (Component settingComponent : this.settings) {
settingComponent.onClick(x, y, mouse);
}
return false;
}
public void mouseReleased(int x, int y, int m) {
for (Component c : this.settings) {
c.mouseReleased(x, y, m);
}
}
public void keyTyped(char t, int k) {
for (Component c : this.settings) {
c.keyTyped(t, k);
}
}
public void onGuiClosed() {
for (Component c : this.settings) {
c.onGuiClosed();
}
smoothTimer = null;
hoverTimer = null;
smoothingY = getHeight();
}
public boolean overModuleName(int x, int y) {
return x > this.categoryComponent.getX() && x < this.categoryComponent.getX() + this.categoryComponent.getWidth() && y > this.categoryComponent.getModuleY() + this.yPos && y < this.categoryComponent.getModuleY() + 16 + this.yPos;
}
}

View File

@ -0,0 +1,132 @@
package keystrokesmod.clickgui.components.impl;
import keystrokesmod.Raven;
import keystrokesmod.clickgui.components.Component;
import keystrokesmod.module.Module;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.RenderUtils;
import keystrokesmod.utility.Utils;
import keystrokesmod.utility.profile.ProfileModule;
import net.minecraft.client.Minecraft;
import org.lwjgl.opengl.GL11;
import java.awt.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
public class SliderComponent extends Component {
private SliderSetting sliderSetting;
private ModuleComponent moduleComponent;
private int o;
private int x;
private int y;
private boolean heldDown = false;
private double w;
public SliderComponent(SliderSetting sliderSetting, ModuleComponent moduleComponent, int o) {
this.sliderSetting = sliderSetting;
this.moduleComponent = moduleComponent;
this.x = moduleComponent.categoryComponent.getX() + moduleComponent.categoryComponent.getWidth();
this.y = moduleComponent.categoryComponent.getY() + moduleComponent.yPos;
this.o = o;
}
public void render() {
RenderUtils.drawRoundedRectangle(this.moduleComponent.categoryComponent.getX() + 4, this.moduleComponent.categoryComponent.getY() + this.o + 11, this.moduleComponent.categoryComponent.getX() + 4 + this.moduleComponent.categoryComponent.getWidth() - 8, this.moduleComponent.categoryComponent.getY() + this.o + 15, 4, -12302777);
int l = this.moduleComponent.categoryComponent.getX() + 4;
int r = this.moduleComponent.categoryComponent.getX() + 4 + (int) this.w;
if (r - l > 84) {
r = l + 84;
}
RenderUtils.drawRoundedRectangle(l, this.moduleComponent.categoryComponent.getY() + this.o + 11, r, this.moduleComponent.categoryComponent.getY() + this.o + 15, 4, Color.getHSBColor((float) (System.currentTimeMillis() % 11000L) / 11000.0F, 0.75F, 0.9F).getRGB());
GL11.glPushMatrix();
GL11.glScaled(0.5D, 0.5D, 0.5D);
String value;
double input = this.sliderSetting.getInput();
String suffix = this.sliderSetting.getSuffix();
if (input == -1 && this.sliderSetting.canBeDisabled) {
value = "§cDisabled";
suffix = "";
}
else {
if (input != 1 && (suffix.equals(" second") || suffix.equals(" block") || suffix.equals(" tick")) && this.moduleComponent.mod.moduleCategory() != Module.category.scripts) {
suffix += "s";
}
if (this.sliderSetting.isString) {
value = this.sliderSetting.getOptions()[(int) this.sliderSetting.getInput()];
}
else {
value = Utils.isWholeNumber(input) ? (int) input + "" : String.valueOf(input);
}
}
Minecraft.getMinecraft().fontRendererObj.drawStringWithShadow(this.sliderSetting.getName() + ": " + (this.sliderSetting.isString ? "§e" : "§b") +value + suffix, (float) ((int) ((float) (this.moduleComponent.categoryComponent.getX() + 4) * 2.0F)), (float) ((int) ((float) (this.moduleComponent.categoryComponent.getY() + this.o + 3) * 2.0F)), -1);
GL11.glPopMatrix();
}
public void updateHeight(int n) {
this.o = n;
}
public void drawScreen(int x, int y) {
this.y = this.moduleComponent.categoryComponent.getModuleY() + this.o;
this.x = this.moduleComponent.categoryComponent.getX();
double d = Math.min(this.moduleComponent.categoryComponent.getWidth() - 8, Math.max(0, x - this.x));
if (this.heldDown) {
this.moduleComponent.mod.onSlide(this.sliderSetting);
if (d == 0.0D && this.sliderSetting.canBeDisabled) {
this.sliderSetting.setValueRaw(-1);
}
else {
double n = roundToInterval(d / (double) (this.moduleComponent.categoryComponent.getWidth() - 8) * (this.sliderSetting.getMax() - this.sliderSetting.getMin()) + this.sliderSetting.getMin(), 4);
this.sliderSetting.setValue(n);
}
if (this.sliderSetting.getInput() != this.sliderSetting.getMin() && ModuleManager.hud != null && ModuleManager.hud.isEnabled() && !ModuleManager.organizedModules.isEmpty()) {
ModuleManager.sort();
}
if (Raven.currentProfile != null) {
((ProfileModule) Raven.currentProfile.getModule()).saved = false;
}
}
this.w = this.sliderSetting.getInput() == -1 ? 0 : (double) (this.moduleComponent.categoryComponent.getWidth() - 8) * (this.sliderSetting.getInput() - this.sliderSetting.getMin()) / (this.sliderSetting.getMax() - this.sliderSetting.getMin());
}
private static double roundToInterval(double v, int p) {
if (p < 0) {
return 0.0D;
} else {
BigDecimal bd = new BigDecimal(v);
bd = bd.setScale(p, RoundingMode.HALF_UP);
return bd.doubleValue();
}
}
public boolean onClick(int x, int y, int b) {
if ((this.u(x, y) || this.i(x, y)) && b == 0 && this.moduleComponent.isOpened) {
this.heldDown = true;
}
return false;
}
public void mouseReleased(int x, int y, int m) {
this.heldDown = false;
}
public boolean u(int x, int y) {
return x > this.x && x < this.x + this.moduleComponent.categoryComponent.getWidth() / 2 + 1 && y > this.y && y < this.y + 16;
}
public boolean i(int x, int y) {
return x > this.x + this.moduleComponent.categoryComponent.getWidth() / 2 && x < this.x + this.moduleComponent.categoryComponent.getWidth() && y > this.y && y < this.y + 16;
}
@Override
public void onGuiClosed() {
this.heldDown = false;
}
}

View File

@ -0,0 +1,16 @@
package keystrokesmod.event;
import net.minecraft.network.Packet;
import net.minecraftforge.fml.common.eventhandler.Event;
public class AllPacketsEvent extends Event {
private Packet<?> packet;
public AllPacketsEvent(Packet<?> packet) {
this.packet = packet;
}
public Packet<?> getPacket() {
return packet;
}
}

View File

@ -0,0 +1,14 @@
package keystrokesmod.event;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.fml.common.eventhandler.Event;
public class GuiUpdateEvent extends Event {
public GuiScreen guiScreen;
public boolean opened;
public GuiUpdateEvent(GuiScreen guiScreen, boolean opened) {
this.guiScreen = guiScreen;
this.opened = opened;
}
}

View File

@ -0,0 +1,40 @@
package keystrokesmod.event;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;
@Cancelable
public class JumpEvent extends Event {
private float motionY, yaw;
private boolean applySprint;
public JumpEvent(float motionY, float yaw, boolean applySprint) {
this.motionY = motionY;
this.yaw = yaw;
this.applySprint = applySprint;
}
public float getMotionY() {
return motionY;
}
public void setMotionY(float motionY) {
this.motionY = motionY;
}
public float getYaw() {
return yaw;
}
public void setYaw(float yaw) {
this.yaw = yaw;
}
public boolean applySprint() {
return applySprint;
}
public void setSprint(boolean applySprint) {
this.applySprint = applySprint;
}
}

View File

@ -0,0 +1,6 @@
package keystrokesmod.event;
import net.minecraftforge.fml.common.eventhandler.Event;
public class PostMotionEvent extends Event {
}

View File

@ -0,0 +1,6 @@
package keystrokesmod.event;
import net.minecraftforge.fml.common.eventhandler.Event;
public class PostPlayerInputEvent extends Event {
}

View File

@ -0,0 +1,6 @@
package keystrokesmod.event;
import net.minecraftforge.fml.common.eventhandler.Event;
public class PostUpdateEvent extends Event {
}

View File

@ -0,0 +1,5 @@
package keystrokesmod.event;
import net.minecraftforge.fml.common.eventhandler.Event;
public class PreInputEvent extends Event {
}

View File

@ -0,0 +1,106 @@
package keystrokesmod.event;
import keystrokesmod.script.classes.PlayerState;
import net.minecraftforge.fml.common.eventhandler.Event;
public class PreMotionEvent extends Event {
private double posX;
public double posY;
private double posZ;
private float yaw;
private float pitch;
private boolean onGround;
private static boolean setRenderYaw;
private boolean isSprinting;
private boolean isSneaking;
public static boolean setRotations;
public PreMotionEvent(double posX, double posY, double posZ, float yaw, float pitch, boolean onGround, boolean isSprinting, boolean isSneaking) {
this.posX = posX;
this.posY = posY;
this.posZ = posZ;
this.yaw = yaw;
this.pitch = pitch;
this.onGround = onGround;
this.isSprinting = isSprinting;
this.isSneaking = isSneaking;
}
public double getPosX() {
return posX;
}
public double getPosY() {
return posY;
}
public double getPosZ() {
return posZ;
}
public float getYaw() {
return yaw;
}
public float getPitch() {
return pitch;
}
public boolean isOnGround() {
return onGround;
}
public void setPosX(double posX) {
this.posX = posX;
}
public void setPosY(double posY) {
this.posY = posY;
}
public void setPosZ(double posZ) {
this.posZ = posZ;
}
public void setYaw(float yaw) {
this.yaw = yaw;
this.setRenderYaw = true;
setRotations = true;
}
public void setPitch(float pitch) {
this.pitch = pitch;
setRotations = true;
}
public void setOnGround(boolean onGround) {
this.onGround = onGround;
}
public static boolean setRenderYaw() {
return setRenderYaw;
}
public void setRenderYaw(boolean setRenderYaw) {
this.setRenderYaw = setRenderYaw;
}
public boolean isSprinting() {
return isSprinting;
}
public void setSprinting(boolean sprinting) {
this.isSprinting = sprinting;
}
public boolean isSneaking() {
return isSneaking;
}
public void setSneaking(boolean sneaking) {
this.isSneaking = sneaking;
}
public boolean isEquals(PlayerState e) {
return e.x == this.posX && e.y == this.posY && e.z == this.posZ && e.yaw == this.yaw && e.pitch == this.pitch && e.onGround == this.onGround && e.isSprinting == this.isSprinting && e.isSneaking == this.isSneaking;
}
}

View File

@ -0,0 +1,57 @@
package keystrokesmod.event;
import net.minecraftforge.fml.common.eventhandler.Event;
public class PrePlayerInputEvent extends Event {
private float forward, strafe;
private boolean jump, sneak;
private double sneakSlowDownMultiplier;
public PrePlayerInputEvent(float forward, float strafe, boolean jump, boolean sneak, double sneakSlowDownMultiplier) {
this.forward = forward;
this.strafe = strafe;
this.jump = jump;
this.sneak = sneak;
this.sneakSlowDownMultiplier = sneakSlowDownMultiplier;
}
public float getForward() {
return forward;
}
public void setForward(float forward) {
this.forward = forward;
}
public float getStrafe() {
return strafe;
}
public void setStrafe(float strafe) {
this.strafe = strafe;
}
public boolean isJump() {
return jump;
}
public void setJump(boolean jump) {
this.jump = jump;
}
public boolean isSneak() {
return sneak;
}
public void setSneak(boolean sneak) {
this.sneak = sneak;
}
public double getSneakSlowDownMultiplier() {
return sneakSlowDownMultiplier;
}
public void setSneakSlowDownMultiplier(double sneakSlowDownMultiplier) {
this.sneakSlowDownMultiplier = sneakSlowDownMultiplier;
}
}

View File

@ -0,0 +1,6 @@
package keystrokesmod.event;
import net.minecraftforge.fml.common.eventhandler.Event;
public class PreUpdateEvent extends Event {
}

View File

@ -0,0 +1,18 @@
package keystrokesmod.event;
import net.minecraft.network.Packet;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;
@Cancelable
public class ReceivePacketEvent extends Event {
private Packet<?> packet;
public ReceivePacketEvent(Packet<?> packet) {
this.packet = packet;
}
public Packet<?> getPacket() {
return packet;
}
}

View File

@ -0,0 +1,18 @@
package keystrokesmod.event;
import net.minecraft.network.Packet;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;
@Cancelable
public class SendPacketEvent extends Event {
private Packet<?> packet;
public SendPacketEvent(Packet<?> packet) {
this.packet = packet;
}
public Packet<?> getPacket() {
return packet;
}
}

View File

@ -0,0 +1,49 @@
package keystrokesmod.event;
import net.minecraftforge.fml.common.eventhandler.Event;
public class StrafeEvent extends Event {
private float forward;
private float strafe;
private float friction;
private float yaw;
public StrafeEvent(float strafe, float forward, float friction, float yaw) {
this.strafe = strafe;
this.forward = forward;
this.friction = friction;
this.yaw = yaw;
}
public float getStrafe() {
return strafe;
}
public void setStrafe(float strafe) {
this.strafe = strafe;
}
public float getForward() {
return forward;
}
public void setForward(float forward) {
this.forward = forward;
}
public float getFriction() {
return friction;
}
public void setFriction(float friction) {
this.friction = friction;
}
public float getYaw() {
return yaw;
}
public void setYaw(float yaw) {
this.yaw = yaw;
}
}

View File

@ -0,0 +1,99 @@
package keystrokesmod.keystroke;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent;
import java.awt.*;
import java.io.IOException;
public class KeySrokeRenderer {
private static final int[] a = new int[]{16777215, 16711680, 65280, 255, 16776960, 11141290};
private Minecraft mc = Minecraft.getMinecraft();
private KeyStrokeKeyRenderer[] b = new KeyStrokeKeyRenderer[4];
private KeyStrokeMouse[] c = new KeyStrokeMouse[2];
public KeySrokeRenderer() {
this.b[0] = new KeyStrokeKeyRenderer(this.mc.gameSettings.keyBindForward, 26, 2);
this.b[1] = new KeyStrokeKeyRenderer(this.mc.gameSettings.keyBindBack, 26, 26);
this.b[2] = new KeyStrokeKeyRenderer(this.mc.gameSettings.keyBindLeft, 2, 26);
this.b[3] = new KeyStrokeKeyRenderer(this.mc.gameSettings.keyBindRight, 50, 26);
this.c[0] = new KeyStrokeMouse(0, 2, 50);
this.c[1] = new KeyStrokeMouse(1, 38, 50);
}
@SubscribeEvent
public void onRenderTick(RenderTickEvent e) {
if (this.mc.currentScreen != null) {
if (this.mc.currentScreen instanceof KeyStrokeConfigGui) {
try {
this.mc.currentScreen.handleInput();
} catch (IOException var3) {
}
}
} else if (this.mc.inGameHasFocus && !this.mc.gameSettings.showDebugInfo) {
this.renderKeystrokes();
}
}
public void renderKeystrokes() {
if (KeyStroke.e) {
int x = KeyStroke.x;
int y = KeyStroke.y;
int g = this.getColor(KeyStroke.currentColorNumber);
boolean h = KeyStroke.d;
ScaledResolution res = new ScaledResolution(this.mc);
int width = 74;
int height = h ? 74 : 50;
if (x < 0) {
KeyStroke.x = 0;
x = KeyStroke.x;
} else if (x > res.getScaledWidth() - width) {
KeyStroke.x = res.getScaledWidth() - width;
x = KeyStroke.x;
}
if (y < 0) {
KeyStroke.y = 0;
y = KeyStroke.y;
} else if (y > res.getScaledHeight() - height) {
KeyStroke.y = res.getScaledHeight() - height;
y = KeyStroke.y;
}
this.drawMovementKeys(x, y, g);
if (h) {
this.drawMouseButtons(x, y, g);
}
}
}
private int getColor(int index) {
return index == 6 ? Color.getHSBColor((float) (System.currentTimeMillis() % 3750L) / 3750.0F, 1.0F, 1.0F).getRGB() : a[index];
}
private void drawMovementKeys(int x, int y, int textColor) {
KeyStrokeKeyRenderer[] var4 = this.b;
int var5 = var4.length;
for (int var6 = 0; var6 < var5; ++var6) {
KeyStrokeKeyRenderer key = var4[var6];
key.renderKey(x, y, textColor);
}
}
private void drawMouseButtons(int x, int y, int textColor) {
KeyStrokeMouse[] var4 = this.c;
int var5 = var4.length;
for (int var6 = 0; var6 < var5; ++var6) {
KeyStrokeMouse button = var4[var6];
button.n(x, y, textColor);
}
}
}

View File

@ -0,0 +1,19 @@
package keystrokesmod.keystroke;
public class KeyStroke {
public static int x;
public static int y;
public static int currentColorNumber;
public static boolean d;
public static boolean e;
public static boolean f;
public KeyStroke() {
x = 0;
y = 0;
currentColorNumber = 0;
d = false;
e = true;
f = false;
}
}

View File

@ -0,0 +1,90 @@
package keystrokesmod.keystroke;
import java.io.IOException;
import keystrokesmod.utility.CPSCalculator;
import keystrokesmod.Raven;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
public class KeyStrokeConfigGui extends GuiScreen {
private static final String[] colors = new String[]{"White", "Red", "Green", "Blue", "Yellow", "Purple", "Rainbow"};
private GuiButton modeBtn;
private GuiButton textColorBtn;
private GuiButton showMouseBtn;
private GuiButton outlineBtn;
private boolean d = false;
private int lx;
private int ly;
public void initGui() {
this.buttonList.add(this.modeBtn = new GuiButton(0, this.width / 2 - 70, this.height / 2 - 28, 140, 20, "Mod: " + (KeyStroke.e ? "Enabled" : "Disabled")));
this.buttonList.add(this.textColorBtn = new GuiButton(1, this.width / 2 - 70, this.height / 2 - 6, 140, 20, "Text color: " + colors[KeyStroke.currentColorNumber]));
this.buttonList.add(this.showMouseBtn = new GuiButton(2, this.width / 2 - 70, this.height / 2 + 16, 140, 20, "Show mouse buttons: " + (KeyStroke.d ? "On" : "Off")));
this.buttonList.add(this.outlineBtn = new GuiButton(3, this.width / 2 - 70, this.height / 2 + 38, 140, 20, "Outline: " + (KeyStroke.f ? "On" : "Off")));
}
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
Raven.getKeyStrokeRenderer().renderKeystrokes();
super.drawScreen(mouseX, mouseY, partialTicks);
}
protected void actionPerformed(GuiButton button) {
if (button == this.modeBtn) {
KeyStroke.e = !KeyStroke.e;
this.modeBtn.displayString = "Mod: " + (KeyStroke.e ? "Enabled" : "Disabled");
} else if (button == this.textColorBtn) {
KeyStroke.currentColorNumber = KeyStroke.currentColorNumber == 6 ? 0 : KeyStroke.currentColorNumber + 1;
this.textColorBtn.displayString = "Text color: " + colors[KeyStroke.currentColorNumber];
} else if (button == this.showMouseBtn) {
KeyStroke.d = !KeyStroke.d;
this.showMouseBtn.displayString = "Show mouse buttons: " + (KeyStroke.d ? "On" : "Off");
} else if (button == this.outlineBtn) {
KeyStroke.f = !KeyStroke.f;
this.outlineBtn.displayString = "Outline: " + (KeyStroke.f ? "On" : "Off");
}
}
protected void mouseClicked(int mouseX, int mouseY, int button) {
try {
super.mouseClicked(mouseX, mouseY, button);
} catch (IOException var9) {
}
if (button == 0) {
CPSCalculator.aL();
int startX = KeyStroke.x;
int startY = KeyStroke.y;
int endX = startX + 74;
int endY = startY + (KeyStroke.d ? 74 : 50);
if (mouseX >= startX && mouseX <= endX && mouseY >= startY && mouseY <= endY) {
this.d = true;
this.lx = mouseX;
this.ly = mouseY;
}
} else if (button == 1) {
CPSCalculator.aR();
}
}
protected void mouseReleased(int mouseX, int mouseY, int action) {
super.mouseReleased(mouseX, mouseY, action);
this.d = false;
}
protected void mouseClickMove(int mouseX, int mouseY, int lastButtonClicked, long timeSinceMouseClick) {
super.mouseClickMove(mouseX, mouseY, lastButtonClicked, timeSinceMouseClick);
if (this.d) {
KeyStroke.x = KeyStroke.x + mouseX - this.lx;
KeyStroke.y = KeyStroke.y + mouseY - this.ly;
this.lx = mouseX;
this.ly = mouseY;
}
}
public boolean doesGuiPauseGame() {
return false;
}
}

View File

@ -0,0 +1,55 @@
package keystrokesmod.keystroke;
import java.awt.Color;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding;
import org.lwjgl.input.Keyboard;
public class KeyStrokeKeyRenderer {
private Minecraft a = Minecraft.getMinecraft();
private KeyBinding keyBinding;
private int c;
private int d;
private boolean e = true;
private long f = 0L;
private int g = 255;
private double h = 1.0D;
public KeyStrokeKeyRenderer(KeyBinding i, int j, int k) {
this.keyBinding = i;
this.c = j;
this.d = k;
}
public void renderKey(int l, int m, int color) {
boolean o = this.keyBinding.isKeyDown();
String p = Keyboard.getKeyName(this.keyBinding.getKeyCode());
if (o != this.e) {
this.e = o;
this.f = System.currentTimeMillis();
}
if (o) {
this.g = Math.min(255, (int) (2L * (System.currentTimeMillis() - this.f)));
this.h = Math.max(0.0D, 1.0D - (double) (System.currentTimeMillis() - this.f) / 20.0D);
} else {
this.g = Math.max(0, 255 - (int) (2L * (System.currentTimeMillis() - this.f)));
this.h = Math.min(1.0D, (double) (System.currentTimeMillis() - this.f) / 20.0D);
}
int q = color >> 16 & 255;
int r = color >> 8 & 255;
int s = color & 255;
int c = (new Color(q, r, s)).getRGB();
net.minecraft.client.gui.Gui.drawRect(l + this.c, m + this.d, l + this.c + 22, m + this.d + 22, 2013265920 + (this.g << 16) + (this.g << 8) + this.g);
if (KeyStroke.f) {
net.minecraft.client.gui.Gui.drawRect(l + this.c, m + this.d, l + this.c + 22, m + this.d + 1, c);
net.minecraft.client.gui.Gui.drawRect(l + this.c, m + this.d + 21, l + this.c + 22, m + this.d + 22, c);
net.minecraft.client.gui.Gui.drawRect(l + this.c, m + this.d, l + this.c + 1, m + this.d + 22, c);
net.minecraft.client.gui.Gui.drawRect(l + this.c + 21, m + this.d, l + this.c + 22, m + this.d + 22, c);
}
this.a.fontRendererObj.drawString(p, l + this.c + 8, m + this.d + 8, -16777216 + ((int) ((double) q * this.h) << 16) + ((int) ((double) r * this.h) << 8) + (int) ((double) s * this.h));
}
}

View File

@ -0,0 +1,72 @@
package keystrokesmod.keystroke;
import keystrokesmod.utility.CPSCalculator;
import net.minecraft.client.Minecraft;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
public class KeyStrokeMouse {
private static String[] a = new String[]{"LMB", "RMB"};
private Minecraft b = Minecraft.getMinecraft();
private int c;
private int d;
private int e;
private List<Long> f = new ArrayList();
private boolean g = true;
private long h = 0L;
private int i = 255;
private double j = 1.0D;
public KeyStrokeMouse(int k, int l, int m) {
this.c = k;
this.d = l;
this.e = m;
}
public void n(int o, int p, int color) {
boolean r = Mouse.isButtonDown(this.c);
String s = a[this.c];
if (r != this.g) {
this.g = r;
this.h = System.currentTimeMillis();
if (r) {
this.f.add(this.h);
}
}
if (r) {
this.i = Math.min(255, (int) (2L * (System.currentTimeMillis() - this.h)));
this.j = Math.max(0.0D, 1.0D - (double) (System.currentTimeMillis() - this.h) / 20.0D);
} else {
this.i = Math.max(0, 255 - (int) (2L * (System.currentTimeMillis() - this.h)));
this.j = Math.min(1.0D, (double) (System.currentTimeMillis() - this.h) / 20.0D);
}
int t = color >> 16 & 255;
int u = color >> 8 & 255;
int v = color & 255;
int c = (new Color(t, u, v)).getRGB();
net.minecraft.client.gui.Gui.drawRect(o + this.d, p + this.e, o + this.d + 34, p + this.e + 22, 2013265920 + (this.i << 16) + (this.i << 8) + this.i);
if (KeyStroke.f) {
net.minecraft.client.gui.Gui.drawRect(o + this.d, p + this.e, o + this.d + 34, p + this.e + 1, c);
net.minecraft.client.gui.Gui.drawRect(o + this.d, p + this.e + 21, o + this.d + 34, p + this.e + 22, c);
net.minecraft.client.gui.Gui.drawRect(o + this.d, p + this.e, o + this.d + 1, p + this.e + 22, c);
net.minecraft.client.gui.Gui.drawRect(o + this.d + 33, p + this.e, o + this.d + 34, p + this.e + 22, c);
}
this.b.fontRendererObj.drawString(s, o + this.d + 8, p + this.e + 4, -16777216 + ((int) ((double) t * this.j) << 16) + ((int) ((double) u * this.j) << 8) + (int) ((double) v * this.j));
String w = CPSCalculator.f() + " CPS";
String x = CPSCalculator.i() + " CPS";
int y = this.b.fontRendererObj.getStringWidth(w);
int z = this.b.fontRendererObj.getStringWidth(x);
boolean a2 = this.c == 0;
int b2 = a2 ? y : z;
GL11.glScalef(0.5F, 0.5F, 0.5F);
this.b.fontRendererObj.drawString(a2 ? w : x, (o + this.d + 17) * 2 - b2 / 2, (p + this.e + 14) * 2, -16777216 + ((int) (255.0D * this.j) << 16) + ((int) (255.0D * this.j) << 8) + (int) (255.0D * this.j));
GL11.glScalef(2.0F, 2.0F, 2.0F);
}
}

View File

@ -0,0 +1,27 @@
package keystrokesmod.keystroke;
import keystrokesmod.Raven;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
public class keystrokeCommand extends CommandBase {
public String getCommandName() {
return "keystrokesmod";
}
public void processCommand(ICommandSender sender, String[] args) {
Raven.toggleKeyStrokeConfigGui();
}
public String getCommandUsage(ICommandSender sender) {
return "/keystrokesmod";
}
public int getRequiredPermissionLevel() {
return 0;
}
public boolean canCommandSenderUseCommand(ICommandSender sender) {
return true;
}
}

View File

@ -0,0 +1,48 @@
package keystrokesmod.mixins;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.launch.MixinBootstrap;
import org.spongepowered.asm.mixin.MixinEnvironment;
import org.spongepowered.asm.mixin.Mixins;
import java.util.Map;
@IFMLLoadingPlugin.MCVersion("1.8.9")
public class MixinLoader implements IFMLLoadingPlugin {
public MixinLoader() {
MixinBootstrap.init();
Mixins.addConfiguration("mixins.raven.json");
MixinEnvironment.getDefaultEnvironment().setSide(MixinEnvironment.Side.CLIENT);
}
@NotNull
@Override
public String[] getASMTransformerClass() {
return new String[0];
}
@Nullable
@Override
public String getModContainerClass() {
return null;
}
@Nullable
@Override
public String getSetupClass() {
return null;
}
@Override
public void injectData(Map<String, Object> data) {
}
@Nullable
@Override
public String getAccessTransformerClass() {
return null;
}
}

View File

@ -0,0 +1,33 @@
package keystrokesmod.mixins.impl.client;
import keystrokesmod.event.GuiUpdateEvent;
import keystrokesmod.event.PreInputEvent;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.common.MinecraftForge;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(Minecraft.class)
public class MixinMinecraft {
@Inject(method = "runTick", at = @At(value = "INVOKE", target = "Lnet/minecraft/profiler/Profiler;endStartSection(Ljava/lang/String;)V", ordinal = 2))
private void onRunTick(CallbackInfo ci) {
MinecraftForge.EVENT_BUS.post(new PreInputEvent());
}
@Inject(method = "displayGuiScreen(Lnet/minecraft/client/gui/GuiScreen;)V", at = @At("HEAD"))
public void onDisplayGuiScreen(GuiScreen guiScreen, CallbackInfo ci) {
Minecraft mc = (Minecraft) (Object) this;
GuiScreen previousGui = mc.currentScreen;
GuiScreen setGui = guiScreen;
boolean opened = setGui != null;
if (!opened) {
setGui = previousGui;
}
GuiUpdateEvent event = new GuiUpdateEvent(setGui, opened);
MinecraftForge.EVENT_BUS.post(event);
}
}

View File

@ -0,0 +1,61 @@
package keystrokesmod.mixins.impl.client;
import keystrokesmod.event.PostPlayerInputEvent;
import keystrokesmod.event.PrePlayerInputEvent;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.util.MovementInput;
import net.minecraft.util.MovementInputFromOptions;
import net.minecraftforge.common.MinecraftForge;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
@Mixin(MovementInputFromOptions.class)
public class MixinMovementInputFromOptions extends MovementInput {
@Shadow
@Final
private GameSettings gameSettings;
@Overwrite
public void updatePlayerMoveState() {
this.moveStrafe = 0.0F;
this.moveForward = 0.0F;
if (this.gameSettings.keyBindForward.isKeyDown()) {
++this.moveForward;
}
if (this.gameSettings.keyBindBack.isKeyDown()) {
--this.moveForward;
}
if (this.gameSettings.keyBindLeft.isKeyDown()) {
++this.moveStrafe;
}
if (this.gameSettings.keyBindRight.isKeyDown()) {
--this.moveStrafe;
}
this.jump = this.gameSettings.keyBindJump.isKeyDown();
this.sneak = this.gameSettings.keyBindSneak.isKeyDown();
PrePlayerInputEvent moveInputEvent = new PrePlayerInputEvent(moveForward, moveStrafe, jump, sneak, 0.3D);
MinecraftForge.EVENT_BUS.post(moveInputEvent);
double sneakMultiplier = moveInputEvent.getSneakSlowDownMultiplier();
this.moveForward = moveInputEvent.getForward();
this.moveStrafe = moveInputEvent.getStrafe();
this.jump = moveInputEvent.isJump();
this.sneak = moveInputEvent.isSneak();
if (this.sneak) {
this.moveStrafe = (float) ((double) this.moveStrafe * sneakMultiplier);
this.moveForward = (float) ((double) this.moveForward * sneakMultiplier);
}
MinecraftForge.EVENT_BUS.post(new PostPlayerInputEvent());
}
}

View File

@ -0,0 +1,29 @@
package keystrokesmod.mixins.impl.client;
import keystrokesmod.module.ModuleManager;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@SideOnly(Side.CLIENT)
@Mixin(World.class)
public class MixinWorld {
@Inject(method = "getThunderStrength", at = @At("RETURN"), cancellable = true)
public void setThunderStrength(CallbackInfoReturnable<Float> clr) {
if (ModuleManager.weather != null && ModuleManager.weather.isEnabled() && ModuleManager.weather.lightning.getInput() > 0) {
clr.setReturnValue((float) ModuleManager.weather.lightning.getInput());
}
}
@Inject(method = "getRainStrength", at = @At("RETURN"), cancellable = true)
public void setPrecipitationStrength(CallbackInfoReturnable<Float> clr) {
if (ModuleManager.weather != null && ModuleManager.weather.isEnabled() && ModuleManager.weather.rain.isToggled()) {
clr.setReturnValue(1F);
}
}
}

View File

@ -0,0 +1,31 @@
package keystrokesmod.mixins.impl.client;
import keystrokesmod.module.ModuleManager;
import net.minecraft.world.storage.WorldInfo;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(WorldInfo.class)
public abstract class MixinWorldInfo {
@Shadow
private long worldTime;
@Overwrite
public long getWorldTime() {
if (ModuleManager.weather != null && ModuleManager.weather.isEnabled()) {
return (long) (ModuleManager.weather.time.getInput() * 1000);
}
return worldTime;
}
@Inject(method = "isRaining", at = @At("RETURN"), cancellable = true)
private void setPrecipitation(CallbackInfoReturnable<Boolean> clr) {
if (ModuleManager.weather != null && ModuleManager.weather.isEnabled() && ModuleManager.weather.rain.isToggled()) {
clr.setReturnValue(true);
}
}
}

View File

@ -0,0 +1,69 @@
package keystrokesmod.mixins.impl.entity;
import keystrokesmod.event.StrafeEvent;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.impl.player.Safewalk;
import keystrokesmod.utility.*;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;
import net.minecraftforge.common.MinecraftForge;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
@Mixin(Entity.class)
public abstract class MixinEntity {
@Shadow
public double motionX;
@Shadow
public double motionZ;
@Shadow
public float rotationYaw;
@ModifyVariable(method = "moveEntity", at = @At(value = "STORE", ordinal = 0), name = "flag")
private boolean injectSafeWalk(boolean flag) {
Entity entity = (Entity) (Object) this;
Minecraft mc = Minecraft.getMinecraft();
if (entity == mc.thePlayer && entity.onGround) {
if (Safewalk.canSafeWalk() || ModuleManager.scaffold.canSafewalk()) {
//Utils.print("Safewalking");
return true;
}
}
return flag;
}
@Overwrite
public void moveFlying(float strafe, float forward, float friction) {
StrafeEvent strafeEvent = new StrafeEvent(strafe, forward, friction, this.rotationYaw);
if((Object) this == Minecraft.getMinecraft().thePlayer) {
MinecraftForge.EVENT_BUS.post(strafeEvent);
}
strafe = strafeEvent.getStrafe();
forward = strafeEvent.getForward();
friction = strafeEvent.getFriction();
float yaw = strafeEvent.getYaw();
float f = (strafe * strafe) + (forward * forward);
if (f >= 1.0E-4F) {
f = MathHelper.sqrt_float(f);
if (f < 1.0F) {
f = 1.0F;
}
f = friction / f;
strafe *= f;
forward *= f;
float f1 = MathHelper.sin(yaw * (float)Math.PI / 180.0F);
float f2 = MathHelper.cos(yaw * (float)Math.PI / 180.0F);
this.motionX += strafe * f2 - forward * f1;
this.motionZ += forward * f2 + strafe * f1;
}
}
}

View File

@ -0,0 +1,129 @@
package keystrokesmod.mixins.impl.entity;
import com.google.common.collect.Maps;
import keystrokesmod.event.JumpEvent;
import keystrokesmod.event.PreMotionEvent;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.impl.client.Settings;
import keystrokesmod.utility.RotationUtils;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.Map;
@Mixin(EntityLivingBase.class)
public abstract class MixinEntityLivingBase extends Entity {
public MixinEntityLivingBase(World worldIn) {
super(worldIn);
}
private final Map<Integer, PotionEffect> activePotionsMap = Maps.<Integer, PotionEffect>newHashMap();
@Shadow
public PotionEffect getActivePotionEffect(Potion potionIn) {
return (PotionEffect) this.activePotionsMap.get(Integer.valueOf(potionIn.id));
}
@Shadow
public boolean isPotionActive(Potion potionIn) {
return this.activePotionsMap.containsKey(Integer.valueOf(potionIn.id));
}
@Shadow
public float rotationYawHead;
@Shadow
public float renderYawOffset;
@Shadow
public float swingProgress;
@Inject(method = "func_110146_f", at = @At("HEAD"), cancellable = true)
protected void injectFunc110146_f(float p_110146_1_, float p_110146_2_, CallbackInfoReturnable<Float> cir) {
float rotationYaw = this.rotationYaw;
if (Settings.fullBody != null && Settings.rotateBody != null && !Settings.fullBody.isToggled() && Settings.rotateBody.isToggled() && (EntityLivingBase) (Object) this instanceof EntityPlayerSP) {
if (this.swingProgress > 0F) {
p_110146_1_ = RotationUtils.renderYaw;
}
rotationYaw = RotationUtils.renderYaw;
rotationYawHead = RotationUtils.renderYaw;
}
float f = MathHelper.wrapAngleTo180_float(p_110146_1_ - this.renderYawOffset);
this.renderYawOffset += f * 0.3F;
float f1 = MathHelper.wrapAngleTo180_float(rotationYaw - this.renderYawOffset);
boolean flag = f1 < 90.0F || f1 >= 90.0F;
if (f1 < -75.0F) {
f1 = -75.0F;
}
if (f1 >= 75.0F) {
f1 = 75.0F;
}
this.renderYawOffset = rotationYaw - f1;
if (f1 * f1 > 2500.0F) {
this.renderYawOffset += f1 * 0.2F;
}
if (flag) {
p_110146_2_ *= -1.0F;
}
cir.setReturnValue(p_110146_2_);
}
@Shadow
protected float getJumpUpwardsMotion() {
return 0.42F;
}
@Overwrite
protected void jump() {
JumpEvent jumpEvent = new JumpEvent(this.getJumpUpwardsMotion(), this.rotationYaw, this.isSprinting());
net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(jumpEvent);
if (jumpEvent.isCanceled()) {
return;
}
if (Settings.movementFix != null && Settings.movementFix.isToggled() && PreMotionEvent.setRenderYaw()) {
jumpEvent.setYaw(RotationUtils.renderYaw);
}
this.motionY = jumpEvent.getMotionY();
if (this.isPotionActive(Potion.jump)) {
this.motionY += (double) ((float) (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F);
}
if (jumpEvent.applySprint()) {
float f = jumpEvent.getYaw() * 0.017453292F;
this.motionX -= (double) (MathHelper.sin(f) * 0.2F);
this.motionZ += (double) (MathHelper.cos(f) * 0.2F);
}
this.isAirBorne = true;
ForgeHooks.onLivingJump(((EntityLivingBase) (Object) this));
}
@Inject(method = "isPotionActive(Lnet/minecraft/potion/Potion;)Z", at = @At("HEAD"), cancellable = true)
private void isPotionActive(Potion p_isPotionActive_1_, final CallbackInfoReturnable<Boolean> callbackInfoReturnable) {
if (ModuleManager.potions != null && ModuleManager.potions.isEnabled() && ((p_isPotionActive_1_ == Potion.confusion && ModuleManager.potions.removeNausea.isToggled()) || (p_isPotionActive_1_ == Potion.blindness && ModuleManager.potions.removeBlindness.isToggled()))) {
callbackInfoReturnable.setReturnValue(false);
}
}
}

View File

@ -0,0 +1,182 @@
package keystrokesmod.mixins.impl.entity;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.impl.combat.Reduce;
import keystrokesmod.module.impl.movement.KeepSprint;
import net.minecraft.client.Minecraft;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.*;
import net.minecraft.entity.boss.EntityDragonPart;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.network.play.server.S12PacketEntityVelocity;
import net.minecraft.potion.Potion;
import net.minecraft.stats.AchievementList;
import net.minecraft.stats.StatBase;
import net.minecraft.stats.StatList;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(EntityPlayer.class)
public abstract class MixinEntityPlayer extends EntityLivingBase {
public MixinEntityPlayer(World p_i1594_1_) {
super(p_i1594_1_);
}
@Shadow
public abstract ItemStack getHeldItem();
@Shadow
public abstract void onCriticalHit(Entity p_onCriticalHit_1_);
@Shadow
public abstract void onEnchantmentCritical(Entity p_onEnchantmentCritical_1_);
@Shadow
public abstract void triggerAchievement(StatBase p_triggerAchievement_1_);
@Shadow
public abstract ItemStack getCurrentEquippedItem();
@Shadow
public abstract void destroyCurrentEquippedItem();
@Shadow
public abstract void addStat(StatBase p_addStat_1_, int p_addStat_2_);
@Shadow
public abstract void addExhaustion(float p_addExhaustion_1_);
@Shadow
private ItemStack itemInUse;
@Shadow
public abstract boolean isUsingItem();
@Overwrite
public void attackTargetEntityWithCurrentItem(Entity p_attackTargetEntityWithCurrentItem_1_) {
if (ForgeHooks.onPlayerAttackTarget(((EntityPlayer) (Object) this), p_attackTargetEntityWithCurrentItem_1_)) {
if (p_attackTargetEntityWithCurrentItem_1_.canAttackWithItem() && !p_attackTargetEntityWithCurrentItem_1_.hitByEntity(this)) {
float f = (float) this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue();
int i = 0;
float f1 = 0.0F;
if (p_attackTargetEntityWithCurrentItem_1_ instanceof EntityLivingBase) {
f1 = EnchantmentHelper.func_152377_a(this.getHeldItem(), ((EntityLivingBase) p_attackTargetEntityWithCurrentItem_1_).getCreatureAttribute());
} else {
f1 = EnchantmentHelper.func_152377_a(this.getHeldItem(), EnumCreatureAttribute.UNDEFINED);
}
i += EnchantmentHelper.getKnockbackModifier(this);
if (this.isSprinting()) {
++i;
}
if (f > 0.0F || f1 > 0.0F) {
boolean flag = this.fallDistance > 0.0F && !this.onGround && !this.isOnLadder() && !this.isInWater() && !this.isPotionActive(Potion.blindness) && this.ridingEntity == null && p_attackTargetEntityWithCurrentItem_1_ instanceof EntityLivingBase;
if (flag && f > 0.0F) {
f *= 1.5F;
}
f += f1;
boolean flag1 = false;
int j = EnchantmentHelper.getFireAspectModifier(this);
if (p_attackTargetEntityWithCurrentItem_1_ instanceof EntityLivingBase && j > 0 && !p_attackTargetEntityWithCurrentItem_1_.isBurning()) {
flag1 = true;
p_attackTargetEntityWithCurrentItem_1_.setFire(1);
}
double d0 = p_attackTargetEntityWithCurrentItem_1_.motionX;
double d1 = p_attackTargetEntityWithCurrentItem_1_.motionY;
double d2 = p_attackTargetEntityWithCurrentItem_1_.motionZ;
boolean flag2 = p_attackTargetEntityWithCurrentItem_1_.attackEntityFrom(DamageSource.causePlayerDamage(((EntityPlayer) (Object) this)), f);
if (flag2) {
if (i > 0) {
p_attackTargetEntityWithCurrentItem_1_.addVelocity((double) (-MathHelper.sin(this.rotationYaw * 3.1415927F / 180.0F) * (float) i * 0.5F), 0.1, (double) (MathHelper.cos(this.rotationYaw * 3.1415927F / 180.0F) * (float) i * 0.5F));
if (ModuleManager.reduce != null && ModuleManager.reduce.isEnabled()) {
Reduce.reduce(p_attackTargetEntityWithCurrentItem_1_);
}
else if (ModuleManager.keepSprint != null && ModuleManager.keepSprint.isEnabled()) {
KeepSprint.keepSprint(p_attackTargetEntityWithCurrentItem_1_);
}
else {
this.motionX *= 0.6D;
this.motionZ *= 0.6D;
this.setSprinting(false);
}
}
if (p_attackTargetEntityWithCurrentItem_1_ instanceof EntityPlayerMP && p_attackTargetEntityWithCurrentItem_1_.velocityChanged) {
((EntityPlayerMP) p_attackTargetEntityWithCurrentItem_1_).playerNetServerHandler.sendPacket(new S12PacketEntityVelocity(p_attackTargetEntityWithCurrentItem_1_));
p_attackTargetEntityWithCurrentItem_1_.velocityChanged = false;
p_attackTargetEntityWithCurrentItem_1_.motionX = d0;
p_attackTargetEntityWithCurrentItem_1_.motionY = d1;
p_attackTargetEntityWithCurrentItem_1_.motionZ = d2;
}
if (flag) {
this.onCriticalHit(p_attackTargetEntityWithCurrentItem_1_);
}
if (f1 > 0.0F) {
this.onEnchantmentCritical(p_attackTargetEntityWithCurrentItem_1_);
}
if (f >= 18.0F) {
this.triggerAchievement(AchievementList.overkill);
}
this.setLastAttacker(p_attackTargetEntityWithCurrentItem_1_);
if (p_attackTargetEntityWithCurrentItem_1_ instanceof EntityLivingBase) {
EnchantmentHelper.applyThornEnchantments((EntityLivingBase) p_attackTargetEntityWithCurrentItem_1_, this);
}
EnchantmentHelper.applyArthropodEnchantments(this, p_attackTargetEntityWithCurrentItem_1_);
ItemStack itemstack = this.getCurrentEquippedItem();
Entity entity = p_attackTargetEntityWithCurrentItem_1_;
if (p_attackTargetEntityWithCurrentItem_1_ instanceof EntityDragonPart) {
IEntityMultiPart ientitymultipart = ((EntityDragonPart) p_attackTargetEntityWithCurrentItem_1_).entityDragonObj;
if (ientitymultipart instanceof EntityLivingBase) {
entity = (EntityLivingBase) ientitymultipart;
}
}
if (itemstack != null && entity instanceof EntityLivingBase) {
itemstack.hitEntity((EntityLivingBase) entity, ((EntityPlayer) (Object) this));
if (itemstack.stackSize <= 0) {
this.destroyCurrentEquippedItem();
}
}
if (p_attackTargetEntityWithCurrentItem_1_ instanceof EntityLivingBase) {
this.addStat(StatList.damageDealtStat, Math.round(f * 10.0F));
if (j > 0) {
p_attackTargetEntityWithCurrentItem_1_.setFire(j * 4);
}
}
this.addExhaustion(0.3F);
} else if (flag1) {
p_attackTargetEntityWithCurrentItem_1_.extinguish();
}
}
}
}
}
@Inject(method = "isBlocking", at = @At("RETURN"), cancellable = true)
private void isBlocking(CallbackInfoReturnable<Boolean> cir) {
if (ModuleManager.killAura != null && ModuleManager.killAura.isEnabled() && ModuleManager.killAura.blockingClient && ((Object) this) == Minecraft.getMinecraft().thePlayer) {
cir.setReturnValue(true);
}
cir.setReturnValue(cir.getReturnValue());
}
}

View File

@ -0,0 +1,356 @@
package keystrokesmod.mixins.impl.entity;
import com.mojang.authlib.GameProfile;
import keystrokesmod.event.PostMotionEvent;
import keystrokesmod.event.PostUpdateEvent;
import keystrokesmod.event.PreMotionEvent;
import keystrokesmod.event.PreUpdateEvent;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.impl.combat.WTap;
import keystrokesmod.module.impl.movement.NoSlow;
import keystrokesmod.utility.RotationUtils;
import keystrokesmod.utility.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.network.play.client.C03PacketPlayer;
import net.minecraft.network.play.client.C0BPacketEntityAction;
import net.minecraft.network.play.client.C0CPacketInput;
import net.minecraft.potion.Potion;
import net.minecraft.util.BlockPos;
import net.minecraft.util.MovementInput;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
@Mixin(EntityPlayerSP.class)
public abstract class MixinEntityPlayerSP extends AbstractClientPlayer {
@Shadow
public int sprintingTicksLeft;
private boolean canSprint;
public MixinEntityPlayerSP(World p_i45074_1_, GameProfile p_i45074_2_) {
super(p_i45074_1_, p_i45074_2_);
}
@Override
@Shadow
public abstract void setSprinting(boolean p_setSprinting_1_);
@Shadow
protected int sprintToggleTimer;
@Shadow
public float prevTimeInPortal;
@Shadow
public float timeInPortal;
@Shadow
protected Minecraft mc;
@Shadow
public MovementInput movementInput;
@Override
@Shadow
public abstract void sendPlayerAbilities();
@Shadow
protected abstract boolean isCurrentViewEntity();
@Shadow
public abstract boolean isRidingHorse();
@Shadow
private int horseJumpPowerCounter;
@Shadow
private float horseJumpPower;
@Shadow
protected abstract void sendHorseJump();
@Shadow
private boolean serverSprintState;
@Shadow
@Final
public NetHandlerPlayClient sendQueue;
@Override
@Shadow
public abstract boolean isSneaking();
@Shadow
private boolean serverSneakState;
@Shadow
private double lastReportedPosX;
@Shadow
private double lastReportedPosY;
@Shadow
private double lastReportedPosZ;
@Shadow
private float lastReportedYaw;
@Shadow
private float lastReportedPitch;
@Shadow
private int positionUpdateTicks;
@Overwrite
public void onUpdate() {
if (this.worldObj.isBlockLoaded(new BlockPos(this.posX, 0.0, this.posZ))) {
RotationUtils.prevRenderPitch = RotationUtils.renderPitch;
RotationUtils.prevRenderYaw = RotationUtils.renderYaw;
net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new PreUpdateEvent());
super.onUpdate();
if (this.isRiding()) {
this.sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(this.rotationYaw, this.rotationPitch, this.onGround));
this.sendQueue.addToSendQueue(new C0CPacketInput(this.moveStrafing, this.moveForward, this.movementInput.jump, this.movementInput.sneak));
} else {
this.onUpdateWalkingPlayer();
}
net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new PostUpdateEvent());
}
}
@Overwrite
public void onUpdateWalkingPlayer() {
PreMotionEvent preMotionEvent = new PreMotionEvent(
this.posX,
this.getEntityBoundingBox().minY,
this.posZ,
this.rotationYaw,
this.rotationPitch,
this.onGround,
this.isSprinting(),
this.isSneaking()
);
net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(preMotionEvent);
RotationUtils.serverRotations = new float[] { preMotionEvent.getYaw(), preMotionEvent.getPitch() };
boolean flag = preMotionEvent.isSprinting();
if (flag != this.serverSprintState) {
if (flag) {
this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, C0BPacketEntityAction.Action.START_SPRINTING));
} else {
this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, C0BPacketEntityAction.Action.STOP_SPRINTING));
}
this.serverSprintState = flag;
}
boolean flag1 = preMotionEvent.isSneaking();
if (flag1 != this.serverSneakState) {
if (flag1) {
this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, C0BPacketEntityAction.Action.START_SNEAKING));
} else {
this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, C0BPacketEntityAction.Action.STOP_SNEAKING));
}
this.serverSneakState = flag1;
}
if (this.isCurrentViewEntity()) {
if (PreMotionEvent.setRenderYaw()) {
RotationUtils.setRenderYaw(preMotionEvent.getYaw());
preMotionEvent.setRenderYaw(false);
}
RotationUtils.renderPitch = preMotionEvent.getPitch();
RotationUtils.renderYaw = preMotionEvent.getYaw();
double d0 = preMotionEvent.getPosX() - this.lastReportedPosX;
double d1 = preMotionEvent.getPosY() - this.lastReportedPosY;
double d2 = preMotionEvent.getPosZ() - this.lastReportedPosZ;
double d3 = preMotionEvent.getYaw() - this.lastReportedYaw;
double d4 = preMotionEvent.getPitch() - this.lastReportedPitch;
boolean flag2 = d0 * d0 + d1 * d1 + d2 * d2 > 9.0E-4 || this.positionUpdateTicks >= 20;
boolean flag3 = d3 != 0.0 || d4 != 0.0;
if (this.ridingEntity == null) {
if (flag2 && flag3) {
this.sendQueue.addToSendQueue(new C03PacketPlayer.C06PacketPlayerPosLook(preMotionEvent.getPosX(), preMotionEvent.getPosY(), preMotionEvent.getPosZ(), preMotionEvent.getYaw(), preMotionEvent.getPitch(), preMotionEvent.isOnGround()));
} else if (flag2) {
this.sendQueue.addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(preMotionEvent.getPosX(), preMotionEvent.getPosY(), preMotionEvent.getPosZ(), preMotionEvent.isOnGround()));
} else if (flag3) {
this.sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(preMotionEvent.getYaw(), preMotionEvent.getPitch(), preMotionEvent.isOnGround()));
} else {
this.sendQueue.addToSendQueue(new C03PacketPlayer(preMotionEvent.isOnGround()));
}
} else {
this.sendQueue.addToSendQueue(new C03PacketPlayer.C06PacketPlayerPosLook(this.motionX, -999.0D, this.motionZ, preMotionEvent.getYaw(), preMotionEvent.getPitch(), preMotionEvent.isOnGround()));
flag2 = false;
}
++this.positionUpdateTicks;
if (flag2) {
this.lastReportedPosX = preMotionEvent.getPosX();
this.lastReportedPosY = preMotionEvent.getPosY();
this.lastReportedPosZ = preMotionEvent.getPosZ();
this.positionUpdateTicks = 0;
}
if (flag3) {
this.lastReportedYaw = preMotionEvent.getYaw();
this.lastReportedPitch = preMotionEvent.getPitch();
}
}
net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new PostMotionEvent());
}
@Overwrite
public void onLivingUpdate() {
if (this.sprintingTicksLeft > 0) {
--this.sprintingTicksLeft;
if (this.sprintingTicksLeft == 0) {
this.setSprinting(false);
}
}
if (this.sprintToggleTimer > 0) {
--this.sprintToggleTimer;
}
this.prevTimeInPortal = this.timeInPortal;
if (this.inPortal) {
if (this.mc.currentScreen != null && !this.mc.currentScreen.doesGuiPauseGame()) {
this.mc.displayGuiScreen((GuiScreen) null);
}
if (this.timeInPortal == 0.0F) {
this.mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("portal.trigger"), this.rand.nextFloat() * 0.4F + 0.8F));
}
this.timeInPortal += 0.0125F;
if (this.timeInPortal >= 1.0F) {
this.timeInPortal = 1.0F;
}
this.inPortal = false;
} else if (this.isPotionActive(Potion.confusion) && this.getActivePotionEffect(Potion.confusion).getDuration() > 60) {
this.timeInPortal += 0.006666667F;
if (this.timeInPortal > 1.0F) {
this.timeInPortal = 1.0F;
}
} else {
if (this.timeInPortal > 0.0F) {
this.timeInPortal -= 0.05F;
}
if (this.timeInPortal < 0.0F) {
this.timeInPortal = 0.0F;
}
}
if (this.timeUntilPortal > 0) {
--this.timeUntilPortal;
}
boolean flag = this.movementInput.jump;
boolean flag1 = this.movementInput.sneak;
float f = 0.8F;
boolean flag2 = this.movementInput.moveForward >= f;
this.movementInput.updatePlayerMoveState();
boolean stopSprint = ModuleManager.noSlow == null || !ModuleManager.noSlow.isEnabled() || NoSlow.slowed.getInput() == 80;
if (this.isUsingItem() && !this.isRiding()) {
MovementInput var10000 = this.movementInput;
float slowed = NoSlow.getSlowed();
var10000.moveStrafe *= slowed;
var10000 = this.movementInput;
var10000.moveForward *= slowed;
if (stopSprint) {
this.sprintToggleTimer = 0;
}
}
this.pushOutOfBlocks(this.posX - (double) this.width * 0.35, this.getEntityBoundingBox().minY + 0.5, this.posZ + (double) this.width * 0.35);
this.pushOutOfBlocks(this.posX - (double) this.width * 0.35, this.getEntityBoundingBox().minY + 0.5, this.posZ - (double) this.width * 0.35);
this.pushOutOfBlocks(this.posX + (double) this.width * 0.35, this.getEntityBoundingBox().minY + 0.5, this.posZ - (double) this.width * 0.35);
this.pushOutOfBlocks(this.posX + (double) this.width * 0.35, this.getEntityBoundingBox().minY + 0.5, this.posZ + (double) this.width * 0.35);
boolean flag3 = (float) this.getFoodStats().getFoodLevel() > 6.0F || this.capabilities.allowFlying;
if (this.onGround && !flag1 && !flag2 && this.movementInput.moveForward >= f && !this.isSprinting() && flag3 && (!this.isUsingItem() || !stopSprint) && !this.isPotionActive(Potion.blindness)) {
if (this.sprintToggleTimer <= 0 && !this.mc.gameSettings.keyBindSprint.isKeyDown()) {
this.sprintToggleTimer = 7;
} else {
this.setSprinting(true);
}
}
if (!this.isSprinting() && this.mc.gameSettings.keyBindSprint.isKeyDown() && (ModuleManager.sprint.omniSprint() || NoSlow.groundSpeed() || this.movementInput.moveForward >= f && flag3) && (!(this.isUsingItem() || mc.thePlayer.isBlocking()) || !stopSprint) && !this.isPotionActive(Potion.blindness)) {
this.setSprinting(true);
}
if (this.isSprinting() && (!ModuleManager.sprint.omniSprint() && !NoSlow.groundSpeed() && (this.movementInput.moveForward < f || !flag3)) || this.isCollidedHorizontally || (ModuleManager.scaffold != null && ModuleManager.scaffold.isEnabled && (!ModuleManager.scaffold.sprint() || ModuleManager.tower.canTower())) || (ModuleManager.wTap.isEnabled() && WTap.stopSprint)) {
this.setSprinting(false);
WTap.stopSprint = false;
}
if (this.capabilities.allowFlying) {
if (this.mc.playerController.isSpectatorMode()) {
if (!this.capabilities.isFlying) {
this.capabilities.isFlying = true;
this.sendPlayerAbilities();
}
} else if (!flag && this.movementInput.jump) {
if (this.flyToggleTimer == 0) {
this.flyToggleTimer = 7;
} else {
this.capabilities.isFlying = !this.capabilities.isFlying;
this.sendPlayerAbilities();
this.flyToggleTimer = 0;
}
}
}
if (this.capabilities.isFlying && this.isCurrentViewEntity()) {
if (this.movementInput.sneak) {
this.motionY -= (double) (this.capabilities.getFlySpeed() * 3.0F);
}
if (this.movementInput.jump) {
this.motionY += (double) (this.capabilities.getFlySpeed() * 3.0F);
}
}
if (this.isRidingHorse()) {
if (this.horseJumpPowerCounter < 0) {
++this.horseJumpPowerCounter;
if (this.horseJumpPowerCounter == 0) {
this.horseJumpPower = 0.0F;
}
}
if (flag && !this.movementInput.jump) {
this.horseJumpPowerCounter = -10;
this.sendHorseJump();
} else if (!flag && this.movementInput.jump) {
this.horseJumpPowerCounter = 0;
this.horseJumpPower = 0.0F;
} else if (flag) {
++this.horseJumpPowerCounter;
if (this.horseJumpPowerCounter < 10) {
this.horseJumpPower = (float) this.horseJumpPowerCounter * 0.1F;
} else {
this.horseJumpPower = 0.8F + 2.0F / (float) (this.horseJumpPowerCounter - 9) * 0.1F;
}
}
} else {
this.horseJumpPower = 0.0F;
}
super.onLivingUpdate();
if (this.onGround && this.capabilities.isFlying && !this.mc.playerController.isSpectatorMode()) {
this.capabilities.isFlying = false;
this.sendPlayerAbilities();
}
}
}

View File

@ -0,0 +1,44 @@
package keystrokesmod.mixins.impl.network;
import io.netty.buffer.ByteBuf;
import net.minecraft.client.Minecraft;
import net.minecraftforge.fml.common.network.ByteBufUtils;
import net.minecraftforge.fml.common.network.handshake.FMLHandshakeMessage;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@Mixin(FMLHandshakeMessage.ModList.class)
public abstract class MixinModList {
private static final List<String> exemptMods = Arrays.asList("FML", "mcp", "Forge");
@Shadow(remap = false)
private Map<String, String> modTags;
@Inject(method = "toBytes", at = @At(value = "HEAD"), cancellable = true, remap = false)
public void toBytes(ByteBuf buffer, CallbackInfo callbackInfo) {
if (Minecraft.getMinecraft().isSingleplayer()) return;
callbackInfo.cancel();
ArrayList<Map.Entry<String, String>> shownTags = new ArrayList<>();
for (Map.Entry<String, String> modTag : this.modTags.entrySet()) {
if (exemptMods.contains(modTag.getKey())) {
shownTags.add(modTag);
}
}
ByteBufUtils.writeVarInt(buffer, shownTags.size(), 2);
for (Map.Entry<String, String> modTag : shownTags) {
ByteBufUtils.writeUTF8String(buffer, modTag.getKey());
ByteBufUtils.writeUTF8String(buffer, modTag.getValue());
}
}
}

View File

@ -0,0 +1,46 @@
package keystrokesmod.mixins.impl.network;
import io.netty.channel.ChannelHandlerContext;
import keystrokesmod.event.AllPacketsEvent;
import keystrokesmod.event.ReceivePacketEvent;
import keystrokesmod.event.SendPacketEvent;
import keystrokesmod.utility.PacketUtils;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(NetworkManager.class)
public class MixinNetworkManager {
@Inject(method = "sendPacket(Lnet/minecraft/network/Packet;)V", at = @At("HEAD"), cancellable = true)
public void sendPacket(Packet p_sendPacket_1_, CallbackInfo ci) {
net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new AllPacketsEvent(p_sendPacket_1_));
if (PacketUtils.skipSendEvent.contains(p_sendPacket_1_)) {
PacketUtils.skipSendEvent.remove(p_sendPacket_1_);
return;
}
SendPacketEvent sendPacketEvent = new SendPacketEvent(p_sendPacket_1_);
net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(sendPacketEvent);
if (sendPacketEvent.isCanceled()) {
ci.cancel();
}
}
@Inject(method = "channelRead0(Lio/netty/channel/ChannelHandlerContext;Lnet/minecraft/network/Packet;)V", at = @At("HEAD"), cancellable = true)
public void receivePacket(ChannelHandlerContext p_channelRead0_1_, Packet p_channelRead0_2_, CallbackInfo ci) {
if (PacketUtils.skipReceiveEvent.contains(p_channelRead0_2_)) {
PacketUtils.skipReceiveEvent.remove(p_channelRead0_2_);
return;
}
ReceivePacketEvent receivePacketEvent = new ReceivePacketEvent(p_channelRead0_2_);
net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(receivePacketEvent);
if (receivePacketEvent.isCanceled()) {
ci.cancel();
}
}
}

View File

@ -0,0 +1,28 @@
package keystrokesmod.mixins.impl.render;
import keystrokesmod.module.ModuleManager;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.Vec3;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(EntityRenderer.class)
public class MixinEntityRenderer {
@Redirect(method = "hurtCameraEffect", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;rotate(FFFF)V"))
public void injectNoHurtCam(float angle, float x, float y, float z) {
if (ModuleManager.noHurtCam != null && ModuleManager.noHurtCam.isEnabled()) {
angle = (float) (angle / 14 * ModuleManager.noHurtCam.multiplier.getInput());
}
GlStateManager.rotate(angle, x, y, z);
}
@Redirect(method = "orientCamera", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Vec3;distanceTo(Lnet/minecraft/util/Vec3;)D"))
public double injectNoCameraClip(Vec3 raytrace, Vec3 original) {
if (ModuleManager.noCameraClip != null && ModuleManager.noCameraClip.isEnabled()) {
return ModuleManager.extendCamera != null && ModuleManager.extendCamera.isEnabled() ? ModuleManager.extendCamera.distance.getInput() : 4;
}
return raytrace.distanceTo(original);
}
}

View File

@ -0,0 +1,40 @@
package keystrokesmod.mixins.impl.render;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.impl.other.NameHider;
import keystrokesmod.module.impl.render.AntiShuffle;
import net.minecraft.client.gui.FontRenderer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
@Mixin(FontRenderer.class)
public class MixinFontRenderer {
@ModifyVariable(method = "renderString", at = @At("HEAD"), require = 1, ordinal = 0, argsOnly = true)
private String renderString(String string) {
if (string == null)
return null;
if ((ModuleManager.nameHider != null) && ModuleManager.nameHider.isEnabled()) {
string = NameHider.getFakeName(string);
}
if ((ModuleManager.antiShuffle != null) && ModuleManager.antiShuffle.isEnabled()) {
string = AntiShuffle.removeObfuscation(string);
}
return string;
}
@ModifyVariable(method = "getStringWidth", at = @At("HEAD"), require = 1, ordinal = 0, argsOnly = true)
private String getStringWidth(String string) {
if (string == null)
return null;
if ((ModuleManager.nameHider != null) && ModuleManager.nameHider.isEnabled()) {
string = NameHider.getFakeName(string);
}
if ((ModuleManager.antiShuffle != null) && ModuleManager.antiShuffle.isEnabled()) {
string = AntiShuffle.removeObfuscation(string);
}
return string;
}
}

View File

@ -0,0 +1,55 @@
package keystrokesmod.mixins.impl.render;
import keystrokesmod.Raven;
import keystrokesmod.module.ModuleManager;
import net.minecraft.client.gui.GuiChat;
import net.minecraft.client.gui.GuiTextField;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.util.List;
@Mixin(GuiChat.class)
public abstract class MixinGuiChat extends MixinGuiScreen
{
@Shadow
protected GuiTextField inputField;
@Shadow
private List<String> foundPlayerNames;
@Shadow
private boolean waitingOnAutocomplete;
@Shadow
public abstract void onAutocompleteResponse(String[] p_onAutocompleteResponse_1_);
@Inject(method = "keyTyped", at = @At("RETURN"))
private void updateLength(CallbackInfo callbackInfo) {
if (inputField.getText().startsWith((".")) && ModuleManager.canExecuteChatCommand()) {
Raven.commandManager.autoComplete(inputField.getText());
}
else {
inputField.setMaxStringLength(100);
}
}
@Inject(method = "sendAutocompleteRequest", at = @At("HEAD"), cancellable = true)
private void handleClientCommandCompletion(String full, final String ignored, CallbackInfo callbackInfo) {
if (Raven.commandManager.autoComplete(full) && ModuleManager.canExecuteChatCommand()) {
waitingOnAutocomplete = true;
String[] latestAutoComplete = Raven.commandManager.latestAutoComplete;
if (full.toLowerCase().endsWith(latestAutoComplete[latestAutoComplete.length - 1].toLowerCase())) {
return;
}
this.onAutocompleteResponse(latestAutoComplete);
callbackInfo.cancel();
}
}
}

View File

@ -0,0 +1,28 @@
package keystrokesmod.mixins.impl.render;
import keystrokesmod.Raven;
import keystrokesmod.module.ModuleManager;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(GuiScreen.class)
public abstract class MixinGuiScreen
{
@Shadow
public Minecraft mc;
@Inject(method = "sendChatMessage(Ljava/lang/String;Z)V", at = @At("HEAD"), cancellable = true)
private void messageSend(String msg, boolean addToChat, final CallbackInfo callbackInfo) {
if (msg.startsWith(".") && addToChat && ModuleManager.canExecuteChatCommand()) {
this.mc.ingameGUI.getChatGUI().addToSentMessages(msg);
Raven.commandManager.executeCommand(msg);
callbackInfo.cancel();
}
}
}

View File

@ -0,0 +1,75 @@
package keystrokesmod.mixins.impl.render;
import keystrokesmod.mixins.interfaces.IMixinItemRenderer;
import keystrokesmod.utility.Utils;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(ItemRenderer.class)
public class MixinItemRenderer implements IMixinItemRenderer {
private ItemStack originalItemToRender;
@Shadow
private ItemStack itemToRender;
public boolean cancelUpdate = false;
public boolean cancelReset = false;
@Shadow
private float equippedProgress;
@Shadow
private float prevEquippedProgress;
@Inject(method = "renderItemInFirstPerson", at = @At("HEAD"))
private void modifyRenderItemPre(float p_renderItemInFirstPerson_1_, CallbackInfo info) {
originalItemToRender = itemToRender;
itemToRender = Utils.getSpoofedItem(originalItemToRender);
}
@Inject(method = "renderItemInFirstPerson", at = @At("RETURN"))
private void modifyRenderItemPost(float p_renderItemInFirstPerson_1_, CallbackInfo info) {
itemToRender = originalItemToRender;
}
@Inject(method = "updateEquippedItem", at = @At("HEAD"), cancellable = true)
private void onUpdateEquippedItem(CallbackInfo ci) {
if (cancelUpdate) {
cancelUpdate = false;
equippedProgress = 1.0F;
prevEquippedProgress = 1.0f;
ci.cancel();
}
}
@Inject(method = "resetEquippedProgress", at = @At("HEAD"), cancellable = true)
public void injectResetEquippedProgress(CallbackInfo ci) {
if (cancelReset) {
cancelReset = false;
equippedProgress = 1.0F;
prevEquippedProgress = 1.0f;
ci.cancel();
}
}
@Inject(method = "resetEquippedProgress2", at = @At("HEAD"), cancellable = true)
public void injectResetEquippedProgress2(CallbackInfo ci) {
if (cancelReset) {
cancelReset = false;
equippedProgress = 1.0F;
prevEquippedProgress = 1.0f;
ci.cancel();
}
}
@Override
public void setCancelUpdate(boolean cancel) {
this.cancelUpdate = cancel;
}
@Override
public void setCancelReset(boolean reset) {
this.cancelReset = reset;
}
}

View File

@ -0,0 +1,39 @@
package keystrokesmod.mixins.impl.render;
import keystrokesmod.module.impl.client.Settings;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.client.renderer.entity.layers.LayerCape;
import net.minecraft.entity.player.EnumPlayerModelParts;
import net.minecraft.util.ResourceLocation;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(LayerCape.class)
public class MixinLayerCape {
@Shadow
private final RenderPlayer playerRenderer;
public MixinLayerCape(RenderPlayer playerRendererIn) {
this.playerRenderer = playerRendererIn;
}
@Redirect(method = "doRenderLayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/entity/AbstractClientPlayer;isWearing(Lnet/minecraft/entity/player/EnumPlayerModelParts;)Z"))
private boolean modifyIsWearing(AbstractClientPlayer player, EnumPlayerModelParts part) {
if (player.equals(Minecraft.getMinecraft().thePlayer) && Settings.customCapes.getInput() > 0) {
return true;
}
return player.isWearing(part);
}
@Redirect(method = "doRenderLayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/entity/AbstractClientPlayer;getLocationCape()Lnet/minecraft/util/ResourceLocation;"))
private ResourceLocation modifyGetLocationCape(AbstractClientPlayer player) {
if (player.equals(Minecraft.getMinecraft().thePlayer) && Settings.customCapes.getInput() > 0) {
return Settings.loadedCapes.get((int) (Settings.customCapes.getInput() - 1));
}
return player.getLocationCape();
}
}

View File

@ -0,0 +1,38 @@
package keystrokesmod.mixins.impl.render;
import keystrokesmod.utility.RotationUtils;
import keystrokesmod.utility.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(ModelBiped.class)
public class MixinModelBiped {
@Shadow
public ModelRenderer bipedRightArm;
@Shadow
public int heldItemRight;
@Shadow
public ModelRenderer bipedHead;
@Inject(method = "setRotationAngles", at = @At(value = "FIELD", target = "Lnet/minecraft/client/model/ModelBiped;swingProgress:F"))
private void revertSwordAnimation(float p_setRotationAngles_1_, float p_setRotationAngles_2_, float p_setRotationAngles_3_, float p_setRotationAngles_4_, float p_setRotationAngles_5_, float p_setRotationAngles_6_, Entity p_setRotationAngles_7_, CallbackInfo callbackInfo) {
if (heldItemRight == 3)
this.bipedRightArm.rotateAngleY = 0F;
if (p_setRotationAngles_7_ instanceof EntityPlayer
&& p_setRotationAngles_7_.equals(Minecraft.getMinecraft().thePlayer)) {
this.bipedHead.rotateAngleX = (float) Math.toRadians(RotationUtils.interpolateValue(Utils.getTimer().renderPartialTicks, RotationUtils.prevRenderPitch, RotationUtils.renderPitch));
}
}
}

View File

@ -0,0 +1,84 @@
package keystrokesmod.mixins.impl.render;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.impl.world.AntiBot;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.renderer.RenderGlobal;
import net.minecraft.client.renderer.culling.ICamera;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(RenderGlobal.class)
public class MixinRenderGlobal { // credit: pablolnmak
@Shadow
@Final
private Minecraft mc;
@Unique
private boolean shouldRender() {
return ModuleManager.playerESP != null && ModuleManager.playerESP.isEnabled() && ModuleManager.playerESP.outline.isToggled();
}
@Redirect(method = "isRenderEntityOutlines", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/entity/EntityPlayerSP;isSpectator()Z"))
private boolean forceIsSpectator(EntityPlayerSP instance) {
if (shouldRender()) {
return true;
}
else {
return instance.isSpectator();
}
}
@Redirect(method = "isRenderEntityOutlines", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/settings/KeyBinding;isKeyDown()Z"))
private boolean forceIsKeyDown(KeyBinding instance) {
if (shouldRender()) {
return true;
}
else {
return instance.isKeyDown();
}
}
@Redirect(method = "renderEntities", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;shouldRenderInPass(I)Z", ordinal = 1))
private boolean forceShouldRenderInPass(Entity instance, int pass, Entity renderViewEntity, ICamera camera, float partialTicks) {
if (pass == 1) {
return true;
}
else {
return instance.shouldRenderInPass(pass);
}
}
@Redirect(method = "renderEntities", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;isInRangeToRender3d(DDD)Z", ordinal = 1))
private boolean forceIsInRangeToRender(Entity instance, double x, double y, double z, Entity renderViewEntity, ICamera camera, float partialTicks) {
return instance.isInRangeToRender3d(x, y, z) && isOutlineActive(instance, renderViewEntity, camera);
}
@Unique
private boolean isOutlineActive(Entity entityIn, Entity viewer, ICamera camera) {
boolean flag = viewer instanceof EntityLivingBase && ((EntityLivingBase) viewer).isPlayerSleeping();
if (entityIn == viewer && this.mc.gameSettings.thirdPersonView == 0 && !flag) {
return false;
}
else if (shouldRender()) {
return (entityIn != viewer && !AntiBot.isBot(entityIn)) || (entityIn == viewer && ModuleManager.playerESP.renderSelf.isToggled());
}
else {
if (this.mc.thePlayer.isSpectator() && this.mc.gameSettings.keyBindSpectatorOutlines.isKeyDown() && entityIn instanceof EntityPlayer) {
return entityIn.ignoreFrustumCheck || camera.isBoundingBoxInFrustum(entityIn.getEntityBoundingBox()) || entityIn.isRiding();
}
else {
return false;
}
}
}
}

View File

@ -0,0 +1,89 @@
package keystrokesmod.mixins.impl.render;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.impl.world.AntiBot;
import keystrokesmod.utility.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.RendererLivingEntity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.scoreboard.ScorePlayerTeam;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
import org.spongepowered.asm.mixin.injection.Redirect;
import java.awt.*;
@Mixin(RendererLivingEntity.class)
public abstract class MixinRendererLivingEntity<T extends EntityLivingBase> extends Render<T> { // credit: pablolnmak
@Shadow
protected boolean renderOutlines;
protected MixinRendererLivingEntity(RenderManager renderManager) {
super(renderManager);
}
@Unique
private boolean shouldRender() {
return ModuleManager.playerESP != null && ModuleManager.playerESP.isEnabled() && ModuleManager.playerESP.outline.isToggled();
}
@Redirect(method = "doRender(Lnet/minecraft/entity/EntityLivingBase;DDDFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/RendererLivingEntity;setScoreTeamColor(Lnet/minecraft/entity/EntityLivingBase;)Z"))
private boolean setOutlineColor(RendererLivingEntity instance, T entityLivingBaseIn) {
int i = 16777215;
boolean drawOutline = shouldRender() && ((entityLivingBaseIn != Minecraft.getMinecraft().thePlayer && !AntiBot.isBot(entityLivingBaseIn)) || (entityLivingBaseIn == Minecraft.getMinecraft().thePlayer && ModuleManager.playerESP.renderSelf.isToggled()));
if (!drawOutline || ModuleManager.playerESP.teamColor.isToggled())
{
if (entityLivingBaseIn instanceof EntityPlayer)
{
ScorePlayerTeam scoreplayerteam = (ScorePlayerTeam)entityLivingBaseIn.getTeam();
if (scoreplayerteam != null)
{
String s = FontRenderer.getFormatFromString(scoreplayerteam.getColorPrefix());
if (s.length() >= 2)
{
i = this.getFontRendererFromRenderManager().getColorCode(s.charAt(1));
}
}
}
}
else if (ModuleManager.playerESP.rainbow.isToggled()) {
i = Utils.getChroma(2L, 0L);
}
else {
i = (new Color((int) ModuleManager.playerESP.red.getInput(), (int) ModuleManager.playerESP.green.getInput(), (int) ModuleManager.playerESP.blue.getInput())).getRGB();
}
if (drawOutline && ModuleManager.playerESP.redOnDamage.isToggled() && entityLivingBaseIn.hurtTime != 0) {
i = Color.RED.getRGB();
}
float f1 = (float)(i >> 16 & 255) / 255.0F;
float f2 = (float)(i >> 8 & 255) / 255.0F;
float f = (float)(i & 255) / 255.0F;
GlStateManager.disableLighting();
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
GlStateManager.color(f1, f2, f, 1.0F);
GlStateManager.disableTexture2D();
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.disableTexture2D();
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
return true;
}
@ModifyVariable(method = "renderModel", at = @At(value = "STORE"), ordinal = 0)
private boolean modifyInvisibleFlag(boolean flag) {
return flag || (this.renderOutlines && shouldRender() && ModuleManager.playerESP.showInvis.isToggled());
}
}

View File

@ -0,0 +1,6 @@
package keystrokesmod.mixins.interfaces;
public interface IMixinItemRenderer {
void setCancelUpdate(boolean cancel);
void setCancelReset(boolean reset);
}

View File

@ -0,0 +1,226 @@
package keystrokesmod.module;
import keystrokesmod.Raven;
import keystrokesmod.module.setting.Setting;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.script.Script;
import keystrokesmod.utility.Utils;
import keystrokesmod.utility.profile.ProfileModule;
import net.minecraft.client.Minecraft;
import net.minecraftforge.fml.common.FMLCommonHandler;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import java.util.ArrayList;
import java.util.Iterator;
public class Module {
public boolean alwaysOn;
protected ArrayList<Setting> settings;
private String moduleName;
private Module.category moduleCategory;
private boolean enabled;
private int keycode;
protected static Minecraft mc;
private boolean isToggled = false;
public boolean canBeEnabled = true;
public boolean ignoreOnSave = false;
public boolean hidden = false;
public Script script = null;
public boolean closetModule = false;
public Module(String moduleName, Module.category moduleCategory, int keycode) {
this.moduleName = moduleName;
this.moduleCategory = moduleCategory;
this.keycode = keycode;
this.enabled = false;
mc = Minecraft.getMinecraft();
this.settings = new ArrayList();
}
public static Module getModule(Class<? extends Module> a) {
Iterator var1 = ModuleManager.modules.iterator();
Module module;
do {
if (!var1.hasNext()) {
return null;
}
module = (Module) var1.next();
} while (module.getClass() != a);
return module;
}
public Module(String name, Module.category moduleCategory) {
this.moduleName = name;
this.moduleCategory = moduleCategory;
this.keycode = 0;
this.enabled = false;
mc = Minecraft.getMinecraft();
this.settings = new ArrayList();
}
public Module(Script script) {
super();
this.enabled = false;
this.moduleName = script.name;
this.script = script;
this.keycode = 0;
this.moduleCategory = category.scripts;
this.settings = new ArrayList<>();
}
public void keybind() {
if (this.keycode != 0) {
try {
if (!this.isToggled && (this.keycode >= 1000 ? Mouse.isButtonDown(this.keycode - 1000) : Keyboard.isKeyDown(this.keycode))) {
this.toggle();
this.isToggled = true;
}
else if ((this.keycode >= 1000 ? !Mouse.isButtonDown(this.keycode - 1000) : !Keyboard.isKeyDown(this.keycode))) {
this.isToggled = false;
}
}
catch (Exception e) {
e.printStackTrace();
Utils.sendMessage("&cFailed to check keybinding. Setting to none");
this.keycode = 0;
}
}
}
public boolean canBeEnabled() {
if (this.script != null && script.error) {
return false;
}
return this.canBeEnabled;
}
public boolean isHidden() {
return hidden;
}
public void setHidden(boolean hidden) {
this.hidden = hidden;
}
public void enable() {
if (!this.canBeEnabled() || this.isEnabled()) {
return;
}
this.setEnabled(true);
ModuleManager.organizedModules.add(this);
if (ModuleManager.hud.isEnabled()) {
ModuleManager.sort();
}
if (this.script != null) {
Raven.scriptManager.onEnable(script);
}
else {
if (!alwaysOn) {
FMLCommonHandler.instance().bus().register(this);
}
this.onEnable();
}
}
public void disable() {
if (!this.isEnabled()) {
return;
}
this.setEnabled(false);
ModuleManager.organizedModules.remove(this);
if (this.script != null) {
Raven.scriptManager.onDisable(script);
}
else {
if (!alwaysOn) {
FMLCommonHandler.instance().bus().unregister(this);
}
this.onDisable();
}
}
public String getInfo() {
return "";
}
public int getInfoType() {
return 0;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public String getName() {
return this.moduleName;
}
public ArrayList<Setting> getSettings() {
return this.settings;
}
public void registerSetting(Setting Setting) {
this.settings.add(Setting);
}
public Module.category moduleCategory() {
return this.moduleCategory;
}
public boolean isEnabled() {
return this.enabled;
}
public void onEnable() {
}
public void onDisable() {
}
public void toggle() {
if (this.isEnabled()) {
this.disable();
} else {
this.enable();
}
if (Raven.currentProfile != null) {
((ProfileModule) Raven.currentProfile.getModule()).saved = false;
}
}
public void onUpdate() {}
public void guiUpdate() {}
public void guiButtonToggled(ButtonSetting b) {}
public void onSlide(SliderSetting setting) {}
public int getKeycode() {
return this.keycode;
}
public void setBind(int keybind) {
this.keycode = keybind;
}
public static enum category {
combat,
movement,
player,
world,
render,
minigames,
fun,
other,
client,
profiles,
scripts;
}
}

View File

@ -0,0 +1,230 @@
package keystrokesmod.module;
import keystrokesmod.module.impl.client.ChatCommands;
import keystrokesmod.module.impl.client.CommandLine;
import keystrokesmod.module.impl.client.Gui;
import keystrokesmod.module.impl.client.Settings;
import keystrokesmod.module.impl.combat.*;
import keystrokesmod.module.impl.fun.Fun;
import keystrokesmod.module.impl.minigames.*;
import keystrokesmod.module.impl.movement.*;
import keystrokesmod.module.impl.other.*;
import keystrokesmod.module.impl.player.*;
import keystrokesmod.module.impl.render.*;
import keystrokesmod.module.impl.world.*;
import keystrokesmod.utility.Utils;
import keystrokesmod.utility.ModuleUtils;
import keystrokesmod.utility.profile.Manager;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
public class ModuleManager {
public static List<Module> modules = new ArrayList<>();
public static List<Module> organizedModules = new ArrayList<>();
public static Module nameHider;
public static Module fastPlace;
public static MurderMystery murderMystery;
public static InvMove invmove;
public static SkyWars skyWars;
public static AntiFireball antiFireball;
public static AutoSwap autoSwap;
public static BedAura bedAura;
public static FastMine fastMine;
public static Module antiShuffle;
public static Module commandLine;
public static Module antiBot;
public static NoSlow noSlow;
public static KillAura killAura;
public static Module autoClicker;
public static Module hitBox;
public static Module reach;
public static BedESP bedESP;
public static Chams chams;
public static HUD hud;
public static Module timer;
public static Module fly;
public static Module wTap;
public static Potions potions;
public static TargetHUD targetHUD;
public static NoFall noFall;
public static Disabler disabler;
public static NoRotate noRotate;
public static PlayerESP playerESP;
public static Module reduce;
public static Safewalk safeWalk;
public static Module keepSprint;
public static ExtendCamera extendCamera;
public static InvManager invManager;
public static Tower tower;
public static NoCameraClip noCameraClip;
public static Module bedwars;
public static Bhop bhop;
public static NoHurtCam noHurtCam;
public static Scaffold scaffold;
public static AutoTool autoTool;
public static Sprint sprint;
public static Weather weather;
public static ChatCommands chatCommands;
public static LongJump LongJump;
public static Blink blink;
public static Velocity velocity;
public void register() {
this.addModule(autoClicker = new AutoClicker());
this.addModule(LongJump = new LongJump());
this.addModule(new AimAssist());
this.addModule(new BurstClicker());
this.addModule(weather = new Weather());
this.addModule(chatCommands = new ChatCommands());
this.addModule(new ClickAssist());
this.addModule(tower = new Tower());
this.addModule(skyWars = new SkyWars());
this.addModule(new DebugAC());
this.addModule(new DelayRemover());
this.addModule(hitBox = new HitBox());
this.addModule(new Radar());
this.addModule(new Settings());
this.addModule(reach = new Reach());
this.addModule(extendCamera = new ExtendCamera());
this.addModule(new RodAimbot());
this.addModule(velocity = new Velocity());
this.addModule(bhop = new Bhop());
this.addModule(invManager = new InvManager());
this.addModule(new ChatBypass());
this.addModule(scaffold = new Scaffold());
this.addModule(blink = new Blink());
this.addModule(new AutoRequeue());
this.addModule(new AntiAFK());
this.addModule(new Boost());
this.addModule(autoTool = new AutoTool());
this.addModule(noHurtCam = new NoHurtCam());
this.addModule(new SpeedBuilders());
this.addModule(new Teleport());
this.addModule(fly = new Fly());
this.addModule(invmove = new InvMove());
this.addModule(new TPAura());
this.addModule(new Trajectories());
this.addModule(potions = new Potions());
this.addModule(autoSwap = new AutoSwap());
this.addModule(keepSprint = new KeepSprint());
this.addModule(bedAura = new BedAura());
this.addModule(noSlow = new NoSlow());
this.addModule(new Indicators());
this.addModule(new Speed());
this.addModule(new LatencyAlerts());
this.addModule(noCameraClip = new NoCameraClip());
this.addModule(sprint = new Sprint());
this.addModule(new StopMotion());
this.addModule(timer = new Timer());
this.addModule(new VClip());
this.addModule(new AutoJump());
this.addModule(new AutoPlace());
this.addModule(fastPlace = new FastPlace());
this.addModule(new Freecam());
this.addModule(noFall = new NoFall());
this.addModule(disabler = new Disabler());
this.addModule(safeWalk = new Safewalk());
this.addModule(reduce = new Reduce());
this.addModule(antiBot = new AntiBot());
this.addModule(antiShuffle = new AntiShuffle());
this.addModule(chams = new Chams());
this.addModule(new ChestESP());
this.addModule(new Nametags());
this.addModule(playerESP = new PlayerESP());
this.addModule(new Tracers());
this.addModule(hud = new HUD());
this.addModule(new Anticheat());
this.addModule(new BreakProgress());
this.addModule(wTap = new WTap());
this.addModule(new Xray());
this.addModule(new BridgeInfo());
this.addModule(targetHUD = new TargetHUD());
this.addModule(new DuelsStats());
this.addModule(antiFireball = new AntiFireball());
this.addModule(bedESP = new BedESP());
this.addModule(murderMystery = new MurderMystery());
this.addModule(new keystrokesmod.script.Manager());
this.addModule(new SumoFences());
this.addModule(new Fun.ExtraBobbing());
this.addModule(killAura = new KillAura());
this.addModule(new Fun.FlameTrail());
this.addModule(new Fun.SlyPort());
this.addModule(new ItemESP());
this.addModule(new MobESP());
this.addModule(new Fun.Spin());
this.addModule(noRotate = new NoRotate());
this.addModule(new FakeChat());
this.addModule(nameHider = new NameHider());
this.addModule(new FakeLag());
this.addModule(new Test());
this.addModule(new WaterBucket());
this.addModule(commandLine = new CommandLine());
this.addModule(bedwars = new BedWars());
this.addModule(fastMine = new FastMine());
this.addModule(new JumpReset());
this.addModule(new Manager());
this.addModule(new ViewPackets());
this.addModule(new AutoWho());
this.addModule(new Gui());
this.addModule(new Shaders());
antiBot.enable();
Collections.sort(this.modules, Comparator.comparing(Module::getName));
}
public void addModule(Module m) {
modules.add(m);
}
public List<Module> getModules() {
return modules;
}
public List<Module> inCategory(Module.category categ) {
ArrayList<Module> categML = new ArrayList<>();
for (Module mod : this.getModules()) {
if (mod.moduleCategory().equals(categ)) {
categML.add(mod);
}
}
return categML;
}
public Module getModule(String moduleName) {
for (Module module : modules) {
if (module.getName().equals(moduleName)) {
return module;
}
}
return null;
}
public Module getModule(Class clazz) {
for (Module module : modules) {
if (module.getClass().equals(clazz)) {
return module;
}
}
return null;
}
public static void sort() {
if (HUD.alphabeticalSort.isToggled()) {
Collections.sort(organizedModules, Comparator.comparing(Module::getName));
} else {
organizedModules.sort((o1, o2) -> Utils.mc.fontRendererObj.getStringWidth(o2.getName() + ((HUD.showInfo.isToggled() && !o2.getInfo().isEmpty()) ? " " + o2.getInfo() : "")) - Utils.mc.fontRendererObj.getStringWidth(o1.getName() + (HUD.showInfo.isToggled() && !o1.getInfo().isEmpty() ? " " + o1.getInfo() : "")));
}
}
public static boolean canExecuteChatCommand() {
return ModuleManager.chatCommands != null && ModuleManager.chatCommands.isEnabled();
}
public static boolean lowercaseChatCommands() {
return ModuleManager.chatCommands != null && ModuleManager.chatCommands.isEnabled() && ModuleManager.chatCommands.lowercase();
}
}

View File

@ -0,0 +1,18 @@
package keystrokesmod.module.impl.client;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.DescriptionSetting;
public class ChatCommands extends Module {
public ButtonSetting lowercase;
public ChatCommands() {
super("Chat Commands", category.client);
this.registerSetting(new DescriptionSetting("Use §o§e.help§r for help."));
this.registerSetting(lowercase = new ButtonSetting("Lowercase", false));
}
public boolean lowercase() {
return this.lowercase != null && this.lowercase.isToggled();
}
}

View File

@ -0,0 +1,34 @@
package keystrokesmod.module.impl.client;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.utility.Commands;
import keystrokesmod.utility.Timer;
public class CommandLine extends Module {
public static boolean a = false;
public static boolean b = false;
public static Timer an;
public static ButtonSetting animate;
public CommandLine() {
super("Command line", Module.category.client, 0);
this.registerSetting(animate = new ButtonSetting("Animate", true));
}
public void onEnable() {
Commands.setccs();
a = true;
b = false;
(an = new Timer(500.0F)).start();
}
public void onDisable() {
b = true;
if (an != null) {
an.start();
}
Commands.od();
}
}

View File

@ -0,0 +1,37 @@
package keystrokesmod.module.impl.client;
import keystrokesmod.Raven;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.Utils;
public class Gui extends Module {
public static SliderSetting guiScale;
public static SliderSetting backgroundBlur;
public static SliderSetting scrollSpeed;
public static ButtonSetting removePlayerModel;
public static ButtonSetting darkBackground;
public static ButtonSetting removeWatermark;
public static ButtonSetting rainBowOutlines;
public Gui() {
super("Gui", category.client, 54);
this.registerSetting(guiScale = new SliderSetting("Gui scale", 2, new String[]{ "Small", "Normal", "Large" }));
this.registerSetting(backgroundBlur = new SliderSetting("Background blur", "%", 0, 0, 100, 1));
this.registerSetting(scrollSpeed = new SliderSetting("Scroll speed", 50, 2, 90, 1));
this.registerSetting(darkBackground = new ButtonSetting("Dark background", true));
this.registerSetting(rainBowOutlines = new ButtonSetting("Rainbow outlines", true));
this.registerSetting(removePlayerModel = new ButtonSetting("Remove player model", false));
this.registerSetting(removeWatermark = new ButtonSetting("Remove watermark", false));
}
public void onEnable() {
if (Utils.nullCheck() && mc.currentScreen != Raven.clickGui) {
mc.displayGuiScreen(Raven.clickGui);
Raven.clickGui.initMain();
}
this.disable();
}
}

View File

@ -0,0 +1,88 @@
package keystrokesmod.module.impl.client;
import keystrokesmod.Raven;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import net.minecraft.client.gui.GuiChat;
import net.minecraft.client.gui.inventory.GuiInventory;
import net.minecraft.client.renderer.texture.DynamicTexture;
import net.minecraft.util.ResourceLocation;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
public class Settings extends Module {
public static SliderSetting customCapes;
public static ButtonSetting weaponAxe;
public static ButtonSetting weaponRod;
public static ButtonSetting weaponStick;
public static ButtonSetting middleClickFriends;
public static ButtonSetting setChatAsInventory;
public static ButtonSetting rotateBody;
public static ButtonSetting fullBody;
public static ButtonSetting movementFix;
public static SliderSetting randomYawFactor;
public static SliderSetting offset;
public static SliderSetting timeMultiplier;
public static ButtonSetting sendMessage;
private String[] capes = new String[]{"None", "Anime", "Aqua", "Green", "Purple", "Red", "White", "Yellow"};
public static List<ResourceLocation> loadedCapes = new ArrayList<>();
public Settings() {
super("Settings", category.client, 0);
this.registerSetting(new DescriptionSetting("General"));
this.registerSetting(customCapes = new SliderSetting("Custom cape", 0, capes));
this.registerSetting(weaponAxe = new ButtonSetting("Set axe as weapon", false));
this.registerSetting(weaponRod = new ButtonSetting("Set rod as weapon", false));
this.registerSetting(weaponStick = new ButtonSetting("Set stick as weapon", false));
this.registerSetting(middleClickFriends = new ButtonSetting("Middle click friends", false));
this.registerSetting(setChatAsInventory = new ButtonSetting("Set chat as inventory", false));
this.registerSetting(new DescriptionSetting("Rotations"));
this.registerSetting(rotateBody = new ButtonSetting("Rotate body", true));
this.registerSetting(fullBody = new ButtonSetting("Full body", false));
this.registerSetting(movementFix = new ButtonSetting("Movement fix", false));
this.registerSetting(randomYawFactor = new SliderSetting("Random yaw factor", 1.0, 0.0, 10.0, 1.0));
this.registerSetting(new DescriptionSetting("Profiles"));
this.registerSetting(sendMessage = new ButtonSetting("Send message on enable", true));
this.registerSetting(new DescriptionSetting("Theme colors"));
this.registerSetting(offset = new SliderSetting("Offset", 0.5, -3.0, 3.0, 0.1));
this.registerSetting(timeMultiplier = new SliderSetting("Time multiplier", 0.5, 0.1, 4.0, 0.1));
this.canBeEnabled = false;
loadCapes();
}
public void loadCapes() {
try {
for (int i = 1; i < capes.length; i++) {
String name = capes[i].toLowerCase();
if (i > 1) {
name = "rvn_" + name;
}
InputStream stream = Raven.class.getResourceAsStream("/assets/keystrokesmod/textures/capes/" + name + ".png");
if (stream == null) {
continue;
}
BufferedImage bufferedImage = ImageIO.read(stream);
loadedCapes.add(mc.renderEngine.getDynamicTextureLocation(name, new DynamicTexture(bufferedImage)));
}
}
catch (Exception e) {
e.printStackTrace();
}
}
public static boolean inInventory() {
if (mc.currentScreen instanceof GuiInventory) {
return true;
}
if (mc.currentScreen instanceof GuiChat && setChatAsInventory.isToggled()) {
return true;
}
return false;
}
}

View File

@ -0,0 +1,85 @@
package keystrokesmod.module.impl.combat;
import keystrokesmod.Raven;
import keystrokesmod.module.Module;
import keystrokesmod.module.impl.world.AntiBot;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.Utils;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
public class AimAssist extends Module {
private SliderSetting speed;
private SliderSetting fov;
private SliderSetting distance;
private ButtonSetting clickAim;
private ButtonSetting weaponOnly;
private ButtonSetting aimInvis;
private ButtonSetting blatantMode;
private ButtonSetting ignoreTeammates;
public AimAssist() {
super("AimAssist", category.combat, 0);
this.registerSetting(speed = new SliderSetting("Speed", 45.0D, 1.0D, 100.0D, 1.0D));
this.registerSetting(fov = new SliderSetting("FOV", 90.0D, 15.0D, 180.0D, 1.0D));
this.registerSetting(distance = new SliderSetting("Distance", 4.5D, 1.0D, 10.0D, 0.5D));
this.registerSetting(clickAim = new ButtonSetting("Click aim", true));
this.registerSetting(weaponOnly = new ButtonSetting("Weapon only", false));
this.registerSetting(aimInvis = new ButtonSetting("Aim invis", false));
this.registerSetting(blatantMode = new ButtonSetting("Blatant mode", false));
this.registerSetting(ignoreTeammates = new ButtonSetting("Ignore teammates", false));
}
public void onUpdate() {
if (mc.currentScreen == null && mc.inGameHasFocus) {
if (!weaponOnly.isToggled() || Utils.holdingWeapon()) {
if (!clickAim.isToggled() || Utils.isClicking()) {
Entity en = this.getEnemy();
if (en != null) {
if (Raven.debug) {
Utils.sendMessage(this.getName() + " &e" + en.getName());
}
if (blatantMode.isToggled()) {
Utils.aim(en, 0.0F, false);
} else {
double n = Utils.n(en);
if (n > 1.0D || n < -1.0D) {
float val = (float) (-(n / (101.0D - (speed.getInput()))));
mc.thePlayer.rotationYaw += val;
}
}
}
}
}
}
}
private Entity getEnemy() {
final int n = (int)fov.getInput();
for (final EntityPlayer entityPlayer : mc.theWorld.playerEntities) {
if (entityPlayer != mc.thePlayer && entityPlayer.deathTime == 0) {
if (Utils.isFriended(entityPlayer)) {
continue;
}
if (ignoreTeammates.isToggled() && Utils.isTeamMate(entityPlayer)) {
continue;
}
if (!aimInvis.isToggled() && entityPlayer.isInvisible()) {
continue;
}
if (mc.thePlayer.getDistanceToEntity(entityPlayer) > distance.getInput()) {
continue;
}
if (AntiBot.isBot(entityPlayer)) {
continue;
}
if (!blatantMode.isToggled() && n != 360 && !Utils.inFov((float)n, entityPlayer)) {
continue;
}
return entityPlayer;
}
}
return null;
}
}

View File

@ -0,0 +1,260 @@
package keystrokesmod.module.impl.combat;
import keystrokesmod.module.Module;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.Reflection;
import keystrokesmod.utility.Utils;
import net.minecraft.block.Block;
import net.minecraft.block.BlockLiquid;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.inventory.GuiInventory;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemBlock;
import net.minecraft.util.BlockPos;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.Phase;
import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Random;
public class AutoClicker extends Module {
public SliderSetting minCPS;
public SliderSetting maxCPS;
public SliderSetting jitter;
public SliderSetting blockHitChance;
public static ButtonSetting leftClick;
public ButtonSetting rightClick;
public ButtonSetting breakBlocks;
public ButtonSetting inventoryFill;
public ButtonSetting weaponOnly;
public ButtonSetting blocksOnly;
public ButtonSetting disableCreative;
private Random rand = null;
private Method gs;
private long i;
private long j;
private long k;
private long l;
private double m;
private boolean n;
private boolean hol;
private boolean blocked;
public AutoClicker() {
super("AutoClicker", Module.category.combat, 0);
this.registerSetting(new DescriptionSetting("Best with delay remover."));
this.registerSetting(minCPS = new SliderSetting("Min CPS", 9.0, 1.0, 20.0, 0.5));
this.registerSetting(maxCPS = new SliderSetting("Max CPS", 12.0, 1.0, 20.0, 0.5));
this.registerSetting(jitter = new SliderSetting("Jitter", 0.0, 0.0, 3.0, 0.1));
this.registerSetting(blockHitChance = new SliderSetting("Block hit chance", "%", 0.0, 0.0, 100.0, 1.0));
this.registerSetting(leftClick = new ButtonSetting("Left click", true));
this.registerSetting(rightClick = new ButtonSetting("Right click", false));
this.registerSetting(breakBlocks = new ButtonSetting("Break blocks", false));
this.registerSetting(inventoryFill = new ButtonSetting("Inventory fill", false));
this.registerSetting(weaponOnly = new ButtonSetting("Weapon only", false));
this.registerSetting(blocksOnly = new ButtonSetting("Blocks only", true));
this.registerSetting(disableCreative = new ButtonSetting("Disable in creative", false));
this.closetModule = true;
try {
this.gs = GuiScreen.class.getDeclaredMethod("func_73864_a", Integer.TYPE, Integer.TYPE, Integer.TYPE);
} catch (Exception var4) {
try {
this.gs = GuiScreen.class.getDeclaredMethod("mouseClicked", Integer.TYPE, Integer.TYPE, Integer.TYPE);
} catch (Exception var3) {
}
}
if (this.gs != null) {
this.gs.setAccessible(true);
}
}
public void onEnable() {
if (this.gs == null) {
this.disable();
}
this.blocked = Mouse.isButtonDown(1);
this.rand = new Random();
}
public void onDisable() {
this.i = 0L;
this.j = 0L;
this.hol = false;
this.blocked = false;
}
public void guiUpdate() {
Utils.correctValue(minCPS, maxCPS);
}
@SubscribeEvent
public void onRenderTick(RenderTickEvent ev) {
if (ev.phase != Phase.END && Utils.nullCheck() && !mc.thePlayer.isEating()) {
if (disableCreative.isToggled() && mc.thePlayer.capabilities.isCreativeMode) {
return;
}
if (ModuleManager.scaffold.isEnabled) {
return;
}
if (mc.currentScreen == null && mc.inGameHasFocus) {
if (weaponOnly.isToggled() && !Utils.holdingWeapon()) {
return;
}
if (leftClick.isToggled() && Mouse.isButtonDown(0)) {
this.dc(mc.gameSettings.keyBindAttack.getKeyCode(), 0);
}
else if (rightClick.isToggled() && Mouse.isButtonDown(1)) {
if (blocksOnly.isToggled() && (mc.thePlayer.getCurrentEquippedItem() == null || !(mc.thePlayer.getCurrentEquippedItem().getItem() instanceof ItemBlock))) {
return;
}
this.dc(mc.gameSettings.keyBindUseItem.getKeyCode(), 1);
}
else {
this.i = 0L;
this.j = 0L;
}
}
else if (inventoryFill.isToggled() && mc.currentScreen instanceof GuiInventory) {
if (!Mouse.isButtonDown(0) || !Keyboard.isKeyDown(54) && !Keyboard.isKeyDown(42)) {
this.i = 0L;
this.j = 0L;
} else if (this.i != 0L && this.j != 0L) {
if (System.currentTimeMillis() > this.j) {
this.gd();
this.inventoryClick(mc.currentScreen);
}
} else {
this.gd();
}
}
}
}
public void dc(int key, int mouse) {
if (breakBlocks.isToggled() && mouse == 0 && mc.objectMouseOver != null) {
BlockPos p = mc.objectMouseOver.getBlockPos();
if (p != null) {
Block bl = mc.theWorld.getBlockState(p).getBlock();
if (bl != Blocks.air && !(bl instanceof BlockLiquid)) {
if (!this.hol && (!ModuleManager.killAura.isEnabled() || KillAura.target == null)) {
KeyBinding.setKeyBindState(key, true);
KeyBinding.onTick(key);
this.hol = true;
}
return;
}
if (this.hol) {
KeyBinding.setKeyBindState(key, false);
this.hol = false;
}
}
}
if (jitter.getInput() > 0.0D) {
double a = jitter.getInput() * 0.45D;
EntityPlayerSP var10000;
if (this.rand.nextBoolean()) {
var10000 = mc.thePlayer;
var10000.rotationYaw = (float) ((double) var10000.rotationYaw + (double) this.rand.nextFloat() * a);
} else {
var10000 = mc.thePlayer;
var10000.rotationYaw = (float) ((double) var10000.rotationYaw - (double) this.rand.nextFloat() * a);
}
if (this.rand.nextBoolean()) {
var10000 = mc.thePlayer;
var10000.rotationPitch = (float) ((double) var10000.rotationPitch + (double) this.rand.nextFloat() * a * 0.45D);
} else {
var10000 = mc.thePlayer;
var10000.rotationPitch = (float) ((double) var10000.rotationPitch - (double) this.rand.nextFloat() * a * 0.45D);
}
}
if (this.j > 0L && this.i > 0L) {
double blockHitC = blockHitChance.getInput();
if (System.currentTimeMillis() > this.j && (!ModuleManager.killAura.isEnabled() || KillAura.target == null)) {
KeyBinding.setKeyBindState(key, true);
KeyBinding.onTick(key);
Reflection.setButton(mouse, true);
if (mouse == 0 && blockHitC > 0.0 && Mouse.isButtonDown(1) && Math.random() >= (100.0 - blockHitC) / 100.0) {
final int getKeyCode = mc.gameSettings.keyBindUseItem.getKeyCode();
KeyBinding.setKeyBindState(getKeyCode, true);
KeyBinding.onTick(getKeyCode);
Reflection.setButton(1, true);
blocked = true;
}
this.gd();
}
else if (System.currentTimeMillis() > this.i || blocked) {
KeyBinding.setKeyBindState(key, false);
Reflection.setButton(mouse, false);
if (mouse == 0 && blockHitC > 0.0) {
KeyBinding.setKeyBindState(mc.gameSettings.keyBindUseItem.getKeyCode(), false);
Reflection.setButton(1, false);
blocked = false;
}
}
}
else {
this.gd();
}
}
public void gd() {
double c = Utils.getRandomValue(minCPS, maxCPS, this.rand) + 0.4D * this.rand.nextDouble();
long d = (long) ((int) Math.round(1000.0D / c));
if (System.currentTimeMillis() > this.k) {
if (!this.n && this.rand.nextInt(100) >= 85) {
this.n = true;
this.m = 1.1D + this.rand.nextDouble() * 0.15D;
} else {
this.n = false;
}
this.k = System.currentTimeMillis() + 500L + (long) this.rand.nextInt(1500);
}
if (this.n) {
d = (long) ((double) d * this.m);
}
if (System.currentTimeMillis() > this.l) {
if (this.rand.nextInt(100) >= 80) {
d += 50L + (long) this.rand.nextInt(100);
}
this.l = System.currentTimeMillis() + 500L + (long) this.rand.nextInt(1500);
}
this.j = System.currentTimeMillis() + d;
this.i = System.currentTimeMillis() + d / 2L - (long) this.rand.nextInt(10);
}
private void inventoryClick(GuiScreen s) {
int x = Mouse.getX() * s.width / mc.displayWidth;
int y = s.height - Mouse.getY() * s.height / mc.displayHeight - 1;
try {
this.gs.invoke(s, x, y, 0);
} catch (IllegalAccessException | InvocationTargetException var5) {
}
}
}

View File

@ -0,0 +1,101 @@
package keystrokesmod.module.impl.combat;
import keystrokesmod.Raven;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.Reflection;
import keystrokesmod.utility.Utils;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.item.ItemBlock;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent;
public class BurstClicker extends Module {
private SliderSetting clicks;
private SliderSetting delay;
private ButtonSetting delayRandomizer;
private ButtonSetting placeWhenBlock;
private boolean l_c = false;
private boolean l_r = false;
public BurstClicker() {
super("BurstClicker", category.combat, 0);
this.registerSetting(new DescriptionSetting("Artificial dragclicking."));
this.registerSetting(clicks = new SliderSetting("Clicks", 0.0D, 0.0D, 50.0D, 1.0D));
this.registerSetting(delay = new SliderSetting("Delay (ms)", 5.0D, 1.0D, 40.0D, 1.0D));
this.registerSetting(delayRandomizer = new ButtonSetting("Delay randomizer", true));
this.registerSetting(placeWhenBlock = new ButtonSetting("Place when block", false));
}
public void onEnable() {
if (clicks.getInput() != 0.0D && mc.currentScreen == null && mc.inGameHasFocus) {
Raven.getExecutor().execute(() -> {
try {
int cl = (int) clicks.getInput();
int del = (int) delay.getInput();
for (int i = 0; i < cl * 2 && this.isEnabled() && Utils.nullCheck() && mc.currentScreen == null && mc.inGameHasFocus; ++i) {
if (i % 2 == 0) {
this.l_c = true;
if (del != 0) {
int realDel = del;
if (delayRandomizer.isToggled()) {
realDel = del + Utils.getRandom().nextInt(25) * (Utils.getRandom().nextBoolean() ? -1 : 1);
if (realDel <= 0) {
realDel = del / 3 - realDel;
}
}
Thread.sleep(realDel);
}
} else {
this.l_r = true;
}
}
this.disable();
} catch (InterruptedException var5) {
}
});
} else {
this.disable();
}
}
public void onDisable() {
this.l_c = false;
this.l_r = false;
}
@SubscribeEvent
public void r(RenderTickEvent ev) {
if (Utils.nullCheck()) {
if (this.l_c) {
this.c(true);
this.l_c = false;
} else if (this.l_r) {
this.c(false);
this.l_r = false;
}
}
}
private void c(boolean st) {
boolean r = placeWhenBlock.isToggled() && mc.thePlayer.getHeldItem() != null && mc.thePlayer.getHeldItem().getItem() instanceof ItemBlock;
if (r) {
Reflection.rightClick();
} else {
int key = mc.gameSettings.keyBindAttack.getKeyCode();
KeyBinding.setKeyBindState(key, st);
if (st) {
KeyBinding.onTick(key);
}
}
Reflection.setButton(r ? 1 : 0, st);
}
}

View File

@ -0,0 +1,143 @@
package keystrokesmod.module.impl.combat;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.CPSCalculator;
import keystrokesmod.utility.Utils;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.event.MouseEvent;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.lwjgl.input.Mouse;
import java.awt.*;
public class ClickAssist extends Module {
private SliderSetting chanceLeft, chanceRight;
private ButtonSetting rightClick, blocksOnly, weaponOnly, onlyWhileTargeting, aboveCPS, leftClick, disableInCreative;
private Robot bot;
private boolean ignNL = false;
private boolean ignNR = false;
public ClickAssist() {
super("ClickAssist", Module.category.combat, 0);
this.registerSetting(new DescriptionSetting("Boost your CPS."));
this.registerSetting(disableInCreative = new ButtonSetting("Disable in creative", true));
this.registerSetting(leftClick = new ButtonSetting("Left click", true));
this.registerSetting(chanceLeft = new SliderSetting("Chance left", 80.0D, 0.0D, 100.0D, 1.0D));
this.registerSetting(weaponOnly = new ButtonSetting("Weapon only", true));
this.registerSetting(onlyWhileTargeting = new ButtonSetting("Only while targeting", false));
this.registerSetting(rightClick = new ButtonSetting("Right click", false));
this.registerSetting(chanceRight = new SliderSetting("Chance right", 80.0D, 0.0D, 100.0D, 1.0D));
this.registerSetting(blocksOnly = new ButtonSetting("Blocks only", true));
this.registerSetting(aboveCPS = new ButtonSetting("Above 5 cps", false));
this.closetModule = true;
}
public void onEnable() {
try {
this.bot = new Robot();
} catch (AWTException var2) {
this.disable();
}
}
public void onDisable() {
this.ignNL = false;
this.ignNR = false;
this.bot = null;
}
@SubscribeEvent(priority = EventPriority.HIGH)
public void onMouseUpdate(MouseEvent ev) {
if (disableInCreative.isToggled() && mc.thePlayer.capabilities.isCreativeMode) {
return;
}
if (ev.button >= 0 && ev.buttonstate && Utils.nullCheck()) {
if (mc.currentScreen == null && !mc.thePlayer.isEating()) {
double ch;
if (ev.button == 0 && leftClick.isToggled() && chanceLeft.getInput() != 0.0D) {
if (this.ignNL) {
this.ignNL = false;
}
else {
if (chanceLeft.getInput() == 0) {
return;
}
if (weaponOnly.isToggled() && !Utils.holdingWeapon()) {
return;
}
if (onlyWhileTargeting.isToggled() && (mc.objectMouseOver == null || mc.objectMouseOver.entityHit == null)) {
return;
}
if (chanceLeft.getInput() != 100.0D) {
ch = Math.random();
if (ch >= chanceLeft.getInput() / 100.0D) {
this.fix(0);
return;
}
}
this.bot.mouseRelease(16);
this.bot.mousePress(16);
this.ignNL = true;
}
}
else if (ev.button == 1 && rightClick.isToggled()) {
if (this.ignNR) {
this.ignNR = false;
}
else {
if (chanceRight.getInput() == 0) {
return;
}
if (blocksOnly.isToggled()) {
ItemStack item = mc.thePlayer.getHeldItem();
if (item == null || !(item.getItem() instanceof ItemBlock)) {
this.fix(1);
return;
}
}
if (aboveCPS.isToggled() && CPSCalculator.i() <= 5) {
this.fix(1);
return;
}
if (chanceRight.getInput() != 100.0D) {
ch = Math.random();
if (ch >= chanceRight.getInput() / 100.0D) {
this.fix(1);
return;
}
}
this.bot.mouseRelease(4);
this.bot.mousePress(4);
this.ignNR = true;
}
}
}
this.fix(0);
this.fix(1);
}
}
private void fix(int t) {
if (t == 0) {
if (this.ignNL && !Mouse.isButtonDown(0)) {
this.bot.mouseRelease(16);
}
}
else if (t == 1 && this.ignNR && !Mouse.isButtonDown(1)) {
this.bot.mouseRelease(4);
}
}
}

View File

@ -0,0 +1,172 @@
package keystrokesmod.module.impl.combat;
import keystrokesmod.module.Module;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.Utils;
import net.minecraft.client.renderer.RenderGlobal;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityArmorStand;
import net.minecraft.entity.item.EntityItemFrame;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraftforge.client.event.MouseEvent;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.lwjgl.opengl.GL11;
import java.awt.*;
import java.util.List;
public class HitBox extends Module {
public static SliderSetting multiplier;
public ButtonSetting showHitbox;
public ButtonSetting playersOnly;
public ButtonSetting weaponOnly;
private Entity pointedEntity;
private MovingObjectPosition mv;
public HitBox() {
super("HitBox", category.combat, 0);
this.registerSetting(multiplier = new SliderSetting("Multiplier", "x", 1.2, 1.0, 5.0, 0.05));
this.registerSetting(playersOnly = new ButtonSetting("Players only", true));
this.registerSetting(showHitbox = new ButtonSetting("Show new hitbox", false));
this.registerSetting(weaponOnly = new ButtonSetting("Weapon only", false));
this.closetModule = true;
}
@Override
public String getInfo() {
return ((int) multiplier.getInput() == multiplier.getInput() ? (int) multiplier.getInput() + "" : multiplier.getInput()) + multiplier.getSuffix();
}
@Override
public int getInfoType() {
return 1;
}
@SubscribeEvent
public void onMouse(MouseEvent e) {
if (e.button != 0 || !e.buttonstate || !Utils.nullCheck() || multiplier.getInput() == 1 || mc.thePlayer.isBlocking() || mc.currentScreen != null) {
return;
}
if (weaponOnly.isToggled() && !Utils.holdingWeapon()) {
return;
}
Entity c = getEntity(1.0F);
if (c == null) {
return;
}
if (c instanceof EntityPlayer) {
if (Utils.isFriended((EntityPlayer) c)) {
return;
}
}
else if (playersOnly.isToggled()) {
return;
}
mc.objectMouseOver = mv;
}
@SubscribeEvent
public void onRenderWorld(RenderWorldLastEvent e) {
if (showHitbox.isToggled() && Utils.nullCheck()) {
for (Entity en : mc.theWorld.loadedEntityList) {
if (en != mc.thePlayer && en instanceof EntityLivingBase && ((EntityLivingBase) en).deathTime == 0 && !(en instanceof EntityArmorStand) && !en.isInvisible()) {
this.rh(en, Color.WHITE);
}
}
}
}
public static double getExpand(Entity en) {
return multiplier.getInput();
}
public Entity getEntity(float partialTicks) {
if (mc.getRenderViewEntity() != null && mc.theWorld != null) {
mc.pointedEntity = null;
pointedEntity = null;
double d0 = mc.playerController.extendedReach() ? 6.0 : (ModuleManager.reach.isEnabled() ? Utils.getRandomValue(Reach.min, Reach.max, Utils.getRandom()) : 3.0);
mv = mc.getRenderViewEntity().rayTrace(d0, partialTicks);
double d2 = d0;
Vec3 vec3 = mc.getRenderViewEntity().getPositionEyes(partialTicks);
if (mv != null) {
d2 = mv.hitVec.distanceTo(vec3);
}
Vec3 vec4 = mc.getRenderViewEntity().getLook(partialTicks);
Vec3 vec5 = vec3.addVector(vec4.xCoord * d0, vec4.yCoord * d0, vec4.zCoord * d0);
Vec3 vec6 = null;
float f1 = 1.0F;
List list = mc.theWorld.getEntitiesWithinAABBExcludingEntity(mc.getRenderViewEntity(), mc.getRenderViewEntity().getEntityBoundingBox().addCoord(vec4.xCoord * d0, vec4.yCoord * d0, vec4.zCoord * d0).expand((double) f1, (double) f1, (double) f1));
double d3 = d2;
for (Object o : list) {
Entity entity = (Entity) o;
if (entity.canBeCollidedWith()) {
float ex = (float) ((double) entity.getCollisionBorderSize() * getExpand(entity));
AxisAlignedBB ax = entity.getEntityBoundingBox().expand((double) ex, (double) ex, (double) ex);
MovingObjectPosition mop = ax.calculateIntercept(vec3, vec5);
if (ax.isVecInside(vec3)) {
if (0.0D < d3 || d3 == 0.0D) {
pointedEntity = entity;
vec6 = mop == null ? vec3 : mop.hitVec;
d3 = 0.0D;
}
} else if (mop != null) {
double d4 = vec3.distanceTo(mop.hitVec);
if (d4 < d3 || d3 == 0.0D) {
if (entity == mc.getRenderViewEntity().ridingEntity && !entity.canRiderInteract()) {
if (d3 == 0.0D) {
pointedEntity = entity;
vec6 = mop.hitVec;
}
} else {
pointedEntity = entity;
vec6 = mop.hitVec;
d3 = d4;
}
}
}
}
}
if (pointedEntity != null && (d3 < d2 || mv == null)) {
mv = new MovingObjectPosition(pointedEntity, vec6);
if (pointedEntity instanceof EntityLivingBase || pointedEntity instanceof EntityItemFrame) {
return pointedEntity;
}
}
}
return null;
}
private void rh(Entity e, Color c) {
if (e instanceof EntityLivingBase) {
double x = e.lastTickPosX + (e.posX - e.lastTickPosX) * (double) Utils.getTimer().renderPartialTicks - mc.getRenderManager().viewerPosX;
double y = e.lastTickPosY + (e.posY - e.lastTickPosY) * (double) Utils.getTimer().renderPartialTicks - mc.getRenderManager().viewerPosY;
double z = e.lastTickPosZ + (e.posZ - e.lastTickPosZ) * (double) Utils.getTimer().renderPartialTicks - mc.getRenderManager().viewerPosZ;
float ex = (float) ((double) e.getCollisionBorderSize() * multiplier.getInput());
AxisAlignedBB bbox = e.getEntityBoundingBox().expand((double) ex, (double) ex, (double) ex);
AxisAlignedBB axis = new AxisAlignedBB(bbox.minX - e.posX + x, bbox.minY - e.posY + y, bbox.minZ - e.posZ + z, bbox.maxX - e.posX + x, bbox.maxY - e.posY + y, bbox.maxZ - e.posZ + z);
GL11.glBlendFunc(770, 771);
GL11.glEnable(3042);
GL11.glDisable(3553);
GL11.glDisable(2929);
GL11.glDepthMask(false);
GL11.glLineWidth(2.0F);
GL11.glColor3d((double) c.getRed(), (double) c.getGreen(), (double) c.getBlue());
RenderGlobal.drawSelectionBoundingBox(axis);
GL11.glEnable(3553);
GL11.glEnable(2929);
GL11.glDepthMask(true);
GL11.glDisable(3042);
}
}
}

View File

@ -0,0 +1,66 @@
package keystrokesmod.module.impl.combat;
import keystrokesmod.event.JumpEvent;
import keystrokesmod.event.PreInputEvent;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.Utils;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
public class JumpReset extends Module {
private SliderSetting chance;
private SliderSetting motion;
private boolean jump;
public JumpReset() {
super("Jump Reset", category.combat);
this.registerSetting(chance = new SliderSetting("Chance", "%", 80, 0, 100, 1));
this.registerSetting(motion = new SliderSetting("Jump motion", 0.42, 0, 1, 0.01));
this.closetModule = true;
}
public void onDisable() {
jump = false;
}
@SubscribeEvent
public void onPreInput(PreInputEvent e) {
if (Utils.nullCheck()) {
if (chance.getInput() == 0) {
return;
}
if (mc.thePlayer.maxHurtTime <= 0) {
jump = false;
return;
}
if (mc.thePlayer.hurtTime == mc.thePlayer.maxHurtTime) {
jump = true;
}
if (!jump || mc.thePlayer.hurtTime == 0) {
jump = false;
return;
}
if (chance.getInput() != 100.0D) {
double ch = Math.random();
if (ch >= chance.getInput() / 100.0D) {
return;
}
}
if (jump && mc.thePlayer.onGround) {
mc.thePlayer.jump();
jump = false;
}
}
}
@SubscribeEvent
public void onJump(JumpEvent e) {
if (!Utils.nullCheck() || !jump) {
return;
}
if (motion.getInput() != 0.42) {
e.setMotionY((float) motion.getInput());
}
jump = false;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,155 @@
package keystrokesmod.module.impl.combat;
import keystrokesmod.module.Module;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.RotationUtils;
import keystrokesmod.utility.Utils;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItemFrame;
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 net.minecraftforge.client.event.MouseEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.lwjgl.input.Mouse;
import java.util.List;
public class Reach extends Module {
public static SliderSetting min;
public static SliderSetting max;
public static ButtonSetting weaponOnly;
public static ButtonSetting movingOnly;
public static ButtonSetting sprintOnly;
public static ButtonSetting hitThroughBlocks;
public Reach() {
super("Reach", Module.category.combat, 0);
this.registerSetting(min = new SliderSetting("Min", 3.1D, 3.0D, 6.0D, 0.05D));
this.registerSetting(max = new SliderSetting("Max", 3.3D, 3.0D, 6.0D, 0.05D));
this.registerSetting(weaponOnly = new ButtonSetting("Weapon only", false));
this.registerSetting(movingOnly = new ButtonSetting("Moving only", false));
this.registerSetting(sprintOnly = new ButtonSetting("Sprint only", false));
this.registerSetting(hitThroughBlocks = new ButtonSetting("Hit through blocks", false));
this.closetModule = true;
}
public void guiUpdate() {
Utils.correctValue(min, max);
}
@SubscribeEvent
public void e(MouseEvent ev) {
if (ev.button >= 0 && ev.buttonstate && Utils.nullCheck() && (!ModuleManager.autoClicker.isEnabled() || !AutoClicker.leftClick.isToggled() || !Mouse.isButtonDown(0))) {
call();
}
}
public static boolean call() {
if (!Utils.nullCheck()) {
return false;
} else if (weaponOnly.isToggled() && !Utils.holdingWeapon()) {
return false;
} else if (movingOnly.isToggled() && (double) mc.thePlayer.moveForward == 0.0D && (double) mc.thePlayer.moveStrafing == 0.0D) {
return false;
} else if (sprintOnly.isToggled() && !mc.thePlayer.isSprinting()) {
return false;
} else {
if (!hitThroughBlocks.isToggled() && mc.objectMouseOver != null) {
BlockPos p = mc.objectMouseOver.getBlockPos();
if (p != null && mc.theWorld.getBlockState(p).getBlock() != Blocks.air) {
return false;
}
}
double r = Utils.getRandomValue(min, max, Utils.getRandom());
Object[] o = getEntity(r, 0.0D);
if (o == null) {
return false;
} else {
Entity en = (Entity) o[0];
mc.objectMouseOver = new MovingObjectPosition(en, (Vec3) o[1]);
mc.pointedEntity = en;
return true;
}
}
}
private static Object[] getEntity(double reach, double expand) {
if (!ModuleManager.reach.isEnabled()) {
reach = mc.playerController.extendedReach() ? 6.0D : 3.0D;
}
return getEntity(reach, expand, null);
}
public static Object[] getEntity(double reach, double expand, float[] rotations) {
Entity zz2 = mc.getRenderViewEntity();
Entity entity = null;
if (zz2 == null) {
return null;
} else {
mc.mcProfiler.startSection("pick");
Vec3 zz3 = zz2.getPositionEyes(1.0F);
Vec3 zz4;
if (rotations != null) {
zz4 = RotationUtils.getVectorForRotation(rotations[1], rotations[0]);
}
else {
zz4 = zz2.getLook(1.0F);
}
Vec3 zz5 = zz3.addVector(zz4.xCoord * reach, zz4.yCoord * reach, zz4.zCoord * reach);
Vec3 hitVec = null;
List zz8 = mc.theWorld.getEntitiesWithinAABBExcludingEntity(zz2, zz2.getEntityBoundingBox().addCoord(zz4.xCoord * reach, zz4.yCoord * reach, zz4.zCoord * reach).expand(1.0D, 1.0D, 1.0D));
double zz9 = reach;
for (int zz10 = 0; zz10 < zz8.size(); ++zz10) {
Entity zz11 = (Entity) zz8.get(zz10);
if (zz11.canBeCollidedWith()) {
float ex = (float) ((double) zz11.getCollisionBorderSize() * HitBox.getExpand(zz11));
AxisAlignedBB zz13 = zz11.getEntityBoundingBox().expand(ex, ex, ex);
zz13 = zz13.expand(expand, expand, expand);
MovingObjectPosition zz14 = zz13.calculateIntercept(zz3, zz5);
if (zz13.isVecInside(zz3)) {
if (0.0D < zz9 || zz9 == 0.0D) {
entity = zz11;
hitVec = zz14 == null ? zz3 : zz14.hitVec;
zz9 = 0.0D;
}
} else if (zz14 != null) {
double zz15 = zz3.distanceTo(zz14.hitVec);
if (zz15 < zz9 || zz9 == 0.0D) {
if (zz11 == zz2.ridingEntity) {
if (zz9 == 0.0D) {
entity = zz11;
hitVec = zz14.hitVec;
}
} else {
entity = zz11;
hitVec = zz14.hitVec;
zz9 = zz15;
}
}
}
}
}
if (zz9 < reach && !(entity instanceof EntityLivingBase) && !(entity instanceof EntityItemFrame)) {
entity = null;
}
mc.mcProfiler.endSection();
if (entity != null && hitVec != null) {
return new Object[]{entity, hitVec};
}
else {
return null;
}
}
}
}

View File

@ -0,0 +1,33 @@
package keystrokesmod.module.impl.combat;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import net.minecraft.entity.Entity;
public class Reduce extends Module {
private static SliderSetting chance;
private static SliderSetting reduction;
public Reduce() {
super("Reduce", category.combat);
this.registerSetting(new DescriptionSetting("Overrides KeepSprint."));
this.registerSetting(reduction = new SliderSetting("Attack reduction %", 60.0, 60.0, 100.0, 0.5));
this.registerSetting(chance = new SliderSetting("Chance", "%", 100.0, 0.0, 100.0, 1.0));
this.closetModule = true;
}
public static void reduce(Entity entity) {
if (chance.getInput() == 0) {
return;
}
if (chance.getInput() != 100.0 && Math.random() >= chance.getInput() / 100.0) {
mc.thePlayer.motionX *= 0.6;
mc.thePlayer.motionZ *= 0.6;
return;
}
double n = (100.0 - (float)reduction.getInput()) / 100.0;
mc.thePlayer.motionX *= n;
mc.thePlayer.motionZ *= n;
}
}

View File

@ -0,0 +1,113 @@
package keystrokesmod.module.impl.combat;
import keystrokesmod.event.PreMotionEvent;
import keystrokesmod.module.Module;
import keystrokesmod.module.impl.world.AntiBot;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.Reflection;
import keystrokesmod.utility.RotationUtils;
import keystrokesmod.utility.Utils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemFishingRod;
import net.minecraftforge.client.event.MouseEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
public class RodAimbot extends Module {
private SliderSetting fov;
private SliderSetting predicatedTicks;
private SliderSetting distance;
private ButtonSetting aimInvis;
private ButtonSetting ignoreTeammates;
public boolean rotate;
private boolean rightClick;
private EntityPlayer entity;
public RodAimbot() {
super("RodAimbot", Module.category.combat, 0);
this.registerSetting(fov = new SliderSetting("FOV", 180, 30, 360, 4));
this.registerSetting(predicatedTicks = new SliderSetting("Predicted ticks", 5.0, 0.0, 20.0, 1.0));
this.registerSetting(distance = new SliderSetting("Distance", 6, 3, 30, 0.5));
this.registerSetting(aimInvis = new ButtonSetting("Aim invis", false));
this.registerSetting(ignoreTeammates = new ButtonSetting("Ignore teammates", false));
}
public void onDisable() {
rotate = false;
rightClick = false;
entity = null;
}
@SubscribeEvent
public void onMouse(final MouseEvent mouseEvent) {
if (mouseEvent.button != 1 || !mouseEvent.buttonstate || !Utils.nullCheck() || mc.currentScreen != null) {
return;
}
if (mc.thePlayer.getCurrentEquippedItem() == null || !(mc.thePlayer.getCurrentEquippedItem().getItem() instanceof ItemFishingRod) || mc.thePlayer.fishEntity != null) {
return;
}
entity = this.getEntity();
if (entity == null) {
return;
}
mouseEvent.setCanceled(true);
rightClick = true;
rotate = true;
}
@SubscribeEvent
public void onPreMotion(PreMotionEvent event) {
if (!Utils.nullCheck()) {
return;
}
if (rightClick || rotate) {
if (mc.thePlayer.getCurrentEquippedItem() == null || !(mc.thePlayer.getCurrentEquippedItem().getItem() instanceof ItemFishingRod)) {
return;
}
float[] rotations = RotationUtils.getRotationsPredicated(entity, (int)predicatedTicks.getInput());
if (rotations == null) {
return;
}
event.setYaw(rotations[0]);
event.setPitch(rotations[1]);
if (!rightClick && rotate) {
rotate = false;
}
if (rightClick) {
Reflection.rightClick();
rightClick = false;
}
}
}
private EntityPlayer getEntity() {
for (final EntityPlayer entityPlayer : mc.theWorld.playerEntities) {
if (entityPlayer != mc.thePlayer) {
if (entityPlayer.deathTime != 0) {
continue;
}
if (!aimInvis.isToggled() && entityPlayer.isInvisible()) {
continue;
}
if (mc.thePlayer.getDistanceSqToEntity(entityPlayer) > distance.getInput() * distance.getInput()) {
continue;
}
if (Utils.isFriended(entityPlayer)) {
continue;
}
final float n = (float)fov.getInput();
if (n != 360.0f && !Utils.inFov(n, entityPlayer)) {
continue;
}
if (AntiBot.isBot(entityPlayer)) {
continue;
}
if (ignoreTeammates.isToggled() && Utils.isTeamMate(entityPlayer)) {
continue;
}
return entityPlayer;
}
}
return null;
}
}

View File

@ -0,0 +1,66 @@
package keystrokesmod.module.impl.combat;
import keystrokesmod.module.Module;
import keystrokesmod.module.impl.world.AntiBot;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.Utils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.event.entity.living.LivingEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
public class TPAura extends Module {
private SliderSetting range;
private ButtonSetting weaponOnly;
private double x = 0;
private double z = 0;
private double y = 0;
public TPAura() {
super("TPAura", category.combat);
this.registerSetting(range = new SliderSetting("Range", 0, 0, 50, 1));
this.registerSetting(weaponOnly = new ButtonSetting("Weapon only", false));
}
@SubscribeEvent
public void onLivingUpdate(LivingEvent.LivingUpdateEvent e) {
if (Utils.nullCheck() && mc.thePlayer.maxHurtTime > 0 && mc.thePlayer.hurtTime == mc.thePlayer.maxHurtTime) {
this.updatePosition();
}
}
private void updatePosition() {
this.x = Utils.randomizeInt(-15, 15) / 10.0;
this.y = Utils.randomizeInt(10, 15) / 10.0;
this.z = Utils.randomizeInt(-15, 15) / 10.0;
}
@Override
public void onEnable() {
if (range.getInput() == 0.0) {
Utils.sendMessage("&cTPAura range values are set to 0.");
this.disable();
return;
}
this.updatePosition();
}
public void onUpdate() {
if (weaponOnly.isToggled() && !Utils.holdingWeapon()) {
return;
}
double rangeSq = range.getInput() * range.getInput();
for (EntityPlayer entityPlayer : mc.theWorld.playerEntities) {
if (entityPlayer != mc.thePlayer && entityPlayer.deathTime == 0) {
if (mc.thePlayer.getDistanceSqToEntity(entityPlayer) > rangeSq) {
continue;
}
if (AntiBot.isBot(entityPlayer) || Utils.isFriended(entityPlayer)) {
continue;
}
mc.thePlayer.setPosition(entityPlayer.posX + this.x, entityPlayer.posY + this.y, entityPlayer.posZ + this.z);
Utils.attackEntity(entityPlayer, true, false);
break;
}
}
}
}

View File

@ -0,0 +1,160 @@
package keystrokesmod.module.impl.combat;
import keystrokesmod.event.ReceivePacketEvent;
import keystrokesmod.event.SendPacketEvent;
import keystrokesmod.module.Module;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.impl.movement.LongJump;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.Utils;
import keystrokesmod.utility.ModuleUtils;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement;
import net.minecraft.network.play.server.S12PacketEntityVelocity;
import net.minecraft.network.play.server.S27PacketExplosion;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
import org.lwjgl.input.Keyboard;
public class Velocity extends Module {
private SliderSetting velocityModes;
private SliderSetting horizontal;
private SliderSetting vertical;
private SliderSetting chance;
private ButtonSetting onlyWhileTargeting;
private ButtonSetting disableS;
private ButtonSetting zzWhileNotTargeting;
private ButtonSetting disableExplosions;
private ButtonSetting allowSelfFireball;
private boolean stopFBvelo;
public boolean disableVelo;
private String[] velocityModesString = new String[] { "Normal", "Hypixel" };
public Velocity() {
super("Velocity", category.combat);
this.registerSetting(velocityModes = new SliderSetting("Modes", 0, velocityModesString));
this.registerSetting(horizontal = new SliderSetting("Horizontal", 0.0, 0.0, 100.0, 1.0));
this.registerSetting(vertical = new SliderSetting("Vertical", 0.0, 0.0, 100.0, 1.0));
this.registerSetting(chance = new SliderSetting("Chance", "%", 100.0D, 0.0D, 100.0D, 1.0D));
this.registerSetting(onlyWhileTargeting = new ButtonSetting("Only while targeting", false));
this.registerSetting(disableS = new ButtonSetting("Disable while holding S", false));
this.registerSetting(zzWhileNotTargeting = new ButtonSetting("00 while not targeting", false));
this.registerSetting(disableExplosions = new ButtonSetting("Disable explosions", false));
this.registerSetting(allowSelfFireball = new ButtonSetting("Allow self fireball", false));
}
@SubscribeEvent
public void onReceivePacket(ReceivePacketEvent e) {
if (velocityModes.getInput() == 1) {
if (!Utils.nullCheck() || LongJump.stopVelocity || e.isCanceled()) {
return;
}
if (e.getPacket() instanceof S27PacketExplosion) {
Packet packet = e.getPacket();
S27PacketExplosion s27PacketExplosion = (S27PacketExplosion) e.getPacket();
S27PacketExplosion s27 = (S27PacketExplosion) packet;
if (allowSelfFireball.isToggled() && ModuleUtils.threwFireball) {
if ((mc.thePlayer.getPosition().distanceSq(s27.getX(), s27.getY(), s27.getZ()) <= ModuleUtils.MAX_EXPLOSION_DIST_SQ) || disableVelo) {
disableVelo = true;
ModuleUtils.threwFireball = false;
e.setCanceled(false);
return;
}
}
if (!dontEditMotion() && !disableVelo && !disableExplosions.isToggled() && !ModuleManager.bedAura.cancelKnockback()) {
if (horizontal.getInput() == 0 && vertical.getInput() > 0) {
mc.thePlayer.motionY += s27PacketExplosion.func_149144_d() * vertical.getInput() / 100.0;
} else if (horizontal.getInput() > 0 && vertical.getInput() == 0) {
mc.thePlayer.motionX += s27PacketExplosion.func_149149_c() * horizontal.getInput() / 100.0;
mc.thePlayer.motionZ += s27PacketExplosion.func_149147_e() * horizontal.getInput() / 100.0;
} else if (horizontal.getInput() > 0 && vertical.getInput() > 0) {
mc.thePlayer.motionX += s27PacketExplosion.func_149149_c() * horizontal.getInput() / 100.0;
mc.thePlayer.motionY += s27PacketExplosion.func_149144_d() * vertical.getInput() / 100.0;
mc.thePlayer.motionZ += s27PacketExplosion.func_149147_e() * horizontal.getInput() / 100.0;
}
}
if (disableExplosions.isToggled()) stopFBvelo = true;
e.setCanceled(true);
disableVelo = false;
}
if (e.getPacket() instanceof S12PacketEntityVelocity) {
if (((S12PacketEntityVelocity) e.getPacket()).getEntityID() == mc.thePlayer.getEntityId()) {
S12PacketEntityVelocity s12PacketEntityVelocity = (S12PacketEntityVelocity) e.getPacket();
if (!dontEditMotion() && !disableVelo && !stopFBvelo && !ModuleManager.bedAura.cancelKnockback()) {
if (horizontal.getInput() == 0 && vertical.getInput() > 0) {
mc.thePlayer.motionY = ((double) s12PacketEntityVelocity.getMotionY() / 8000) * vertical.getInput() / 100.0;
} else if (horizontal.getInput() > 0 && vertical.getInput() == 0) {
mc.thePlayer.motionX = ((double) s12PacketEntityVelocity.getMotionX() / 8000) * horizontal.getInput() / 100.0;
mc.thePlayer.motionZ = ((double) s12PacketEntityVelocity.getMotionZ() / 8000) * horizontal.getInput() / 100.0;
} else if (horizontal.getInput() > 0 && vertical.getInput() > 0) {
mc.thePlayer.motionX = ((double) s12PacketEntityVelocity.getMotionX() / 8000) * horizontal.getInput() / 100.0;
mc.thePlayer.motionY = ((double) s12PacketEntityVelocity.getMotionY() / 8000) * vertical.getInput() / 100.0;
mc.thePlayer.motionZ = ((double) s12PacketEntityVelocity.getMotionZ() / 8000) * horizontal.getInput() / 100.0;
}
}
stopFBvelo = false;
if (!disableVelo) {
e.setCanceled(true);
}
}
}
}
}
@Override
public String getInfo() {
return (int) horizontal.getInput() + "%" + " " + (int) vertical.getInput() + "%";
}
@Override
public int getInfoType() {
return 1;
}
@SubscribeEvent
public void onLivingUpdate(LivingUpdateEvent ev) {
if (velocityModes.getInput() == 0) {
if (Utils.nullCheck() && !LongJump.stopVelocity && !ModuleManager.bedAura.cancelKnockback()) {
if (mc.thePlayer.maxHurtTime <= 0 || mc.thePlayer.hurtTime != mc.thePlayer.maxHurtTime) {
return;
}
if (onlyWhileTargeting.isToggled() && (mc.objectMouseOver == null || mc.objectMouseOver.entityHit == null)) {
return;
}
if (disableS.isToggled() && Keyboard.isKeyDown(mc.gameSettings.keyBindBack.getKeyCode())) {
return;
}
if (chance.getInput() == 0) {
return;
}
if (chance.getInput() != 100) {
double ch = Math.random();
if (ch >= chance.getInput() / 100.0D) {
return;
}
}
if (horizontal.getInput() != 100.0D) {
mc.thePlayer.motionX *= horizontal.getInput() / 100;
mc.thePlayer.motionZ *= horizontal.getInput() / 100;
}
if (vertical.getInput() != 100.0D) {
mc.thePlayer.motionY *= vertical.getInput() / 100;
}
}
}
}
private boolean dontEditMotion() {
if (zzWhileNotTargeting.isToggled() && !ModuleManager.killAura.isTargeting) {
return true;
}
return false;
}
}

View File

@ -0,0 +1,68 @@
package keystrokesmod.module.impl.combat;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.Utils;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.event.entity.player.AttackEntityEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import java.util.HashMap;
public class WTap extends Module {
private SliderSetting chance;
private ButtonSetting playersOnly;
private final HashMap<Integer, Long> targets = new HashMap<>();
public static boolean stopSprint = false;
public WTap() {
super("WTap", category.combat);
this.registerSetting(chance = new SliderSetting("Chance", "%", 100, 0, 100, 1));
this.registerSetting(playersOnly = new ButtonSetting("Players only", true));
this.closetModule = true;
}
@SubscribeEvent
public void onAttack(AttackEntityEvent event) {
if (!Utils.nullCheck() || event.entityPlayer != mc.thePlayer || !mc.thePlayer.isSprinting()) {
return;
}
if (chance.getInput() == 0) {
return;
}
if (playersOnly.isToggled()) {
if (!(event.target instanceof EntityPlayer)) {
return;
}
final EntityPlayer entityPlayer = (EntityPlayer)event.target;
if (entityPlayer.maxHurtTime == 0 || entityPlayer.hurtTime > 3) {
return;
}
}
else if (!(event.target instanceof EntityLivingBase)) {
return;
}
if (((EntityLivingBase)event.target).deathTime != 0) {
return;
}
final long currentTimeMillis = System.currentTimeMillis();
final Long n = this.targets.get(event.target.getEntityId());
if (n != null && Utils.timeBetween(n, currentTimeMillis) <= 200L) {
return;
}
if (chance.getInput() != 100.0D) {
double ch = Math.random();
if (ch >= chance.getInput() / 100.0D) {
return;
}
}
this.targets.put(event.target.getEntityId(), currentTimeMillis);
stopSprint = true;
}
public void onDisable() {
stopSprint = false;
this.targets.clear();
}
}

View File

@ -0,0 +1,176 @@
package keystrokesmod.module.impl.fun;
import keystrokesmod.module.Module;
import keystrokesmod.module.impl.world.AntiBot;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.Utils;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.Vec3;
import java.util.Iterator;
public class Fun {
public static class Spin extends Module {
public SliderSetting rotation;
public SliderSetting speed;
private float yaw;
public Spin() {
super("Spin", category.fun, 0);
this.registerSetting(rotation = new SliderSetting("Rotation", 360.0D, 30.0D, 360.0D, 1.0D));
this.registerSetting(speed = new SliderSetting("Speed", 25.0D, 1.0D, 60.0D, 1.0D));
}
public void onEnable() {
this.yaw = mc.thePlayer.rotationYaw;
}
public void onDisable() {
this.yaw = 0.0F;
}
public void onUpdate() {
double left = (double) this.yaw + rotation.getInput() - (double) mc.thePlayer.rotationYaw;
EntityPlayerSP var10000;
if (left < speed.getInput()) {
var10000 = mc.thePlayer;
var10000.rotationYaw = (float) ((double) var10000.rotationYaw + left);
this.disable();
} else {
var10000 = mc.thePlayer;
var10000.rotationYaw = (float) ((double) var10000.rotationYaw + speed.getInput());
if ((double) mc.thePlayer.rotationYaw >= (double) this.yaw + rotation.getInput()) {
this.disable();
}
}
}
}
public static class SlyPort extends Module {
public SliderSetting range;
public ButtonSetting playSound;
public ButtonSetting playersOnly;
public ButtonSetting aim;
public SlyPort() {
super("SlyPort", Module.category.fun, 0);
this.registerSetting(new DescriptionSetting("Teleport behind enemies."));
this.registerSetting(range = new SliderSetting("Range", 6.0D, 2.0D, 15.0D, 1.0D));
this.registerSetting(aim = new ButtonSetting("Aim", true));
this.registerSetting(playSound = new ButtonSetting("Play sound", true));
this.registerSetting(playersOnly = new ButtonSetting("Players only", true));
}
public void onEnable() {
Entity en = this.ge();
if (en != null) {
this.tp(en);
}
this.disable();
}
private void tp(Entity en) {
if (playSound.isToggled()) {
mc.thePlayer.playSound("mob.endermen.portal", 1.0F, 1.0F);
}
Vec3 vec = en.getLookVec();
double x = en.posX - vec.xCoord * 2.5D;
double z = en.posZ - vec.zCoord * 2.5D;
mc.thePlayer.setPosition(x, mc.thePlayer.posY, z);
if (aim.isToggled()) {
Utils.aim(en, 0.0F, false);
}
}
private Entity ge() {
Entity en = null;
double r = Math.pow(this.range.getInput(), 2.0D);
double dist = r + 1.0D;
Iterator var6 = mc.theWorld.loadedEntityList.iterator();
while (true) {
Entity ent;
do {
do {
do {
do {
if (!var6.hasNext()) {
return en;
}
ent = (Entity) var6.next();
} while (ent == mc.thePlayer);
} while (!(ent instanceof EntityLivingBase));
} while (((EntityLivingBase) ent).deathTime != 0);
} while (this.playersOnly.isToggled() && !(ent instanceof EntityPlayer));
if (!AntiBot.isBot(ent)) {
double d = mc.thePlayer.getDistanceSqToEntity(ent);
if (!(d > r) && !(dist < d)) {
dist = d;
en = ent;
}
}
}
}
}
public static class FlameTrail extends Module {
public SliderSetting a;
public FlameTrail() {
super("Flame Trail", category.fun, 0);
}
public void onUpdate() {
Vec3 vec = mc.thePlayer.getLookVec();
double x = mc.thePlayer.posX - vec.xCoord * 2.0D;
double y = mc.thePlayer.posY + ((double) mc.thePlayer.getEyeHeight() - 0.2D);
double z = mc.thePlayer.posZ - vec.zCoord * 2.0D;
mc.thePlayer.worldObj.spawnParticle(EnumParticleTypes.FLAME, x, y, z, 0.0D, 0.0D, 0.0D, new int[]{0});
}
}
public static class ExtraBobbing extends Module {
public SliderSetting level;
private boolean b;
public ExtraBobbing() {
super("Extra Bobbing", category.fun, 0);
this.registerSetting(level = new SliderSetting("Level", 1.0D, 0.0D, 8.0D, 0.1D));
}
public void onEnable() {
this.b = mc.gameSettings.viewBobbing;
if (!this.b) {
mc.gameSettings.viewBobbing = true;
}
}
public void onDisable() {
mc.gameSettings.viewBobbing = this.b;
}
public void onUpdate() {
if (!mc.gameSettings.viewBobbing) {
mc.gameSettings.viewBobbing = true;
}
if (mc.thePlayer.movementInput.moveForward != 0.0F || mc.thePlayer.movementInput.moveStrafe != 0.0F) {
EntityPlayerSP var10000 = mc.thePlayer;
var10000.cameraYaw = (float) ((double) var10000.cameraYaw + level.getInput() / 2.0D);
}
}
}
}

View File

@ -0,0 +1,56 @@
package keystrokesmod.module.impl.minigames;
import keystrokesmod.event.PreUpdateEvent;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.Utils;
import net.minecraft.util.IChatComponent;
import net.minecraftforge.client.event.ClientChatReceivedEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
public class AutoRequeue extends Module {
private SliderSetting delay;
private String receivedMessage = "";
private long receiveTime = 0;
public AutoRequeue() {
super("AutoRequeue", category.minigames);
this.registerSetting(new DescriptionSetting("Automatically requeues games."));
this.registerSetting(delay = new SliderSetting("Delay", " second", 0.5, 0, 5, 0.1));
this.closetModule = true;
}
@Override
public void onDisable() {
receivedMessage = "";
}
@SubscribeEvent
public void onPreUpdate(PreUpdateEvent e) {
if (!receivedMessage.isEmpty() && System.currentTimeMillis() - receiveTime >= delay.getInput() * 1000) {
mc.thePlayer.sendChatMessage(receivedMessage);
receivedMessage = "";
}
}
@SubscribeEvent
public void onChat(ClientChatReceivedEvent e) {
if (e.type == 2 || !Utils.nullCheck()) {
return;
}
String stripped = Utils.stripColor(e.message.getUnformattedText());
if (stripped.isEmpty() || !stripped.contains("play again")) {
return;
}
if (e.message != null) {
for (IChatComponent component : e.message.getSiblings()) {
if (component != null && component.getFormattedText().contains("Click here")) {
if (component.getChatStyle() != null && component.getChatStyle().getChatClickEvent() != null && component.getChatStyle().getChatClickEvent().getValue().startsWith("/")) {
this.receivedMessage = component.getChatStyle().getChatClickEvent().getValue();
this.receiveTime = System.currentTimeMillis();
}
}
}
}
}
}

View File

@ -0,0 +1,68 @@
package keystrokesmod.module.impl.minigames;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.utility.Utils;
import net.minecraft.client.network.NetworkPlayerInfo;
import net.minecraft.scoreboard.ScorePlayerTeam;
import net.minecraftforge.client.event.ClientChatReceivedEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
public class AutoWho extends Module {
private ButtonSetting artifical;
private ButtonSetting hideMessage;
private ButtonSetting removeBots;
private ButtonSetting onGameStart;
public AutoWho() {
super("AutoWho", category.minigames);
this.registerSetting(new DescriptionSetting("Automatically execute /who."));
this.registerSetting(new DescriptionSetting(Utils.formatColor("Use '&enick [nick]&r' when nicked.")));
this.registerSetting(artifical = new ButtonSetting("Artificial", false));
this.registerSetting(hideMessage = new ButtonSetting("Hide message", false));
this.registerSetting(removeBots = new ButtonSetting("Remove bots", true));
this.registerSetting(onGameStart = new ButtonSetting("On game start", false));
}
@SubscribeEvent
public void onChatReceive(ClientChatReceivedEvent e) {
if (e.type == 2 || !Utils.nullCheck()) {
return;
}
final String r = Utils.stripColor(e.message.getUnformattedText());
if (r.isEmpty()) {
return;
}
if (!onGameStart.isToggled() && (r.replace("!", "").trim().startsWith(Utils.getServerName()) && ((r.contains("(") && r.contains(")")) || r.contains("/"))) || onGameStart.isToggled() && r.contains("Protect your bed and destroy the enemy beds.")) {
this.artificial();
}
else if (hideMessage.isToggled() && r.startsWith("ONLINE: ")) {
e.setCanceled(true);
Utils.log.info("[CHAT] " + r);
}
}
private void artificial() {
if (artifical.isToggled()) {
String online = hideMessage.isToggled() ? "ONLINE: " : "&b&lONLINE: &r";
for (NetworkPlayerInfo networkPlayerInfo : Utils.getTablist(true)) {
if (removeBots.isToggled() && networkPlayerInfo.getResponseTime() > 1) {
continue;
}
if (hideMessage.isToggled()) {
online = online + networkPlayerInfo.getGameProfile().getName() + ", ";
} else {
online = online + ScorePlayerTeam.formatPlayerName(networkPlayerInfo.getPlayerTeam(), networkPlayerInfo.getGameProfile().getName()) + "<EFBFBD>" + "7, ";
}
}
if (hideMessage.isToggled()) {
Utils.log.info("[CHAT] " + (online + mc.thePlayer.getName()));
return;
}
Utils.sendRawMessage(online + mc.thePlayer.getDisplayName().getFormattedText());
} else {
mc.thePlayer.sendChatMessage("/who");
}
}
}

View File

@ -0,0 +1,190 @@
package keystrokesmod.module.impl.minigames;
import keystrokesmod.module.Module;
import keystrokesmod.module.impl.world.AntiBot;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.utility.RenderUtils;
import keystrokesmod.utility.Utils;
import net.minecraft.block.BlockObsidian;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemEnderPearl;
import net.minecraft.item.ItemFireball;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraftforge.client.event.ClientChatReceivedEvent;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import java.awt.*;
import java.util.*;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
public class BedWars extends Module {
public static ButtonSetting whitelistOwnBed;
private ButtonSetting diamondArmor;
private ButtonSetting fireball;
private ButtonSetting enderPearl;
private ButtonSetting obsidian;
private ButtonSetting shouldPing;
private BlockPos spawnPos;
private boolean check;
public static boolean outsideSpawn = true;
private List<String> armoredPlayer = new ArrayList<>();
private Map<String, String> lastHeldMap = new ConcurrentHashMap<>();
private Set<BlockPos> obsidianPos = new HashSet<>();
private int obsidianColor = new Color(0, 0,0).getRGB();
public BedWars() {
super("Bed Wars", category.minigames);
this.registerSetting(whitelistOwnBed = new ButtonSetting("Whitelist own bed", true));
this.registerSetting(new DescriptionSetting("Game alerts"));
this.registerSetting(diamondArmor = new ButtonSetting("Diamond armor", true));
this.registerSetting(fireball = new ButtonSetting("Fireball", false));
this.registerSetting(obsidian = new ButtonSetting("Obsidian", true));
this.registerSetting(enderPearl = new ButtonSetting("Ender pearl", true));
this.registerSetting(shouldPing = new ButtonSetting("Should ping", true));
this.closetModule = true;
}
public void onEnable() {
check = false;
outsideSpawn = true;
}
public void onDisable() {
outsideSpawn = true;
}
@SubscribeEvent
public void onRenderWorld(RenderWorldLastEvent e) {
if (Utils.nullCheck()) {
if (this.obsidianPos.isEmpty()) {
return;
}
try {
Iterator<BlockPos> iterator = this.obsidianPos.iterator();
while (iterator.hasNext()) {
BlockPos blockPos = iterator.next();
if (!(mc.theWorld.getBlockState(blockPos).getBlock() instanceof BlockObsidian)) {
iterator.remove();
continue;
}
RenderUtils.renderBlock(blockPos, obsidianColor, false, true);
}
}
catch (Exception exception) {}
}
}
@SubscribeEvent
public void onEntityJoinWorld(EntityJoinWorldEvent e) {
if (!Utils.nullCheck() || e.entity == null) {
return;
}
if (e.entity == mc.thePlayer) {
armoredPlayer.clear();
lastHeldMap.clear();
obsidianPos.clear();
}
}
public void onUpdate() {
if (Utils.getBedwarsStatus() == 2) {
if (diamondArmor.isToggled() || enderPearl.isToggled() || obsidian.isToggled()) {
for (EntityPlayer p : mc.theWorld.playerEntities) {
if (p == null) {
continue;
}
if (p == mc.thePlayer) {
continue;
}
if (AntiBot.isBot(p)) {
continue;
}
String name = p.getName();
ItemStack item = p.getHeldItem();
if (diamondArmor.isToggled()) {
ItemStack leggings = p.inventory.armorInventory[1];
if (!armoredPlayer.contains(name) && p.inventory != null && leggings != null && leggings.getItem() != null && leggings.getItem() == Items.diamond_leggings) {
armoredPlayer.add(name);
Utils.sendMessage("&eAlert: &r" + p.getDisplayName().getFormattedText() + " &7has purchased &bDiamond Armor");
ping();
}
}
if (item != null && !lastHeldMap.containsKey(name)) {
String itemType = getItemType(item);
if (itemType != null) {
lastHeldMap.put(name, itemType);
double distance = Math.round(mc.thePlayer.getDistanceToEntity(p));
handleAlert(itemType, p.getDisplayName().getFormattedText(), Utils.isWholeNumber(distance) ? (int) distance + "" : String.valueOf(distance));
}
} else if (lastHeldMap.containsKey(name)) {
String itemType = lastHeldMap.get(name);
if (!itemType.equals(getItemType(item))) {
lastHeldMap.remove(name);
}
}
}
}
if (whitelistOwnBed.isToggled()) {
if (check) {
spawnPos = mc.thePlayer.getPosition();
check = false;
}
if (spawnPos == null) {
outsideSpawn = true;
}
else {
outsideSpawn = mc.thePlayer.getDistanceSq(spawnPos) > 800;
}
}
else {
outsideSpawn = true;
}
}
}
@SubscribeEvent
public void onChat(ClientChatReceivedEvent c) {
if (!Utils.nullCheck()) {
return;
}
String strippedMessage = Utils.stripColor(c.message.getUnformattedText());
if (strippedMessage.startsWith(" ") && strippedMessage.contains("Protect your bed and destroy the enemy beds.")) {
check = true;
}
}
private String getItemType(ItemStack item) {
if (item == null || item.getItem() == null) {
return null;
}
String unlocalizedName = item.getItem().getUnlocalizedName();
if (item.getItem() instanceof ItemEnderPearl && enderPearl.isToggled()) {
return "&7an §3Ender Pearl";
}
else if (unlocalizedName.contains("tile.obsidian") && obsidian.isToggled()) {
return "§dObsidian";
}
else if (item.getItem() instanceof ItemFireball && fireball.isToggled()) {
return "&7a §6Fireball";
}
return null;
}
private void handleAlert(String itemType, String name, String info) {
String alert = "&eAlert: &r" + name + " &7is holding " + itemType + " &7(" + "§d" + info + "m" + "&7)";
Utils.sendMessage(alert);
ping();
}
private void ping() {
if (shouldPing.isToggled()) {
mc.thePlayer.playSound("note.pling", 1.0f, 1.0f);
}
}
}

View File

@ -0,0 +1,276 @@
package keystrokesmod.module.impl.minigames;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.utility.RenderUtils;
import keystrokesmod.utility.Utils;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityArmorStand;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraftforge.client.event.ClientChatReceivedEvent;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import net.minecraftforge.fml.client.config.GuiButtonExt;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.Phase;
import net.minecraftforge.fml.common.gameevent.TickEvent.RenderTickEvent;
import java.awt.*;
import java.io.IOException;
import java.util.Iterator;
public class BridgeInfo extends Module {
private static final int rgb = (new Color(0, 200, 200)).getRGB();
private final String bd = new String("the brid");
private final String g1t = new String("Defend!");
private final String g2t = new String("Jump in to score!");
private final String qt = new String("First player to score 5 goals wins");
private final String t1 = new String("Enemy: ");
private final String t2 = new String("Distance to goal: ");
private final String t3 = new String("Enemy distance to goal: ");
private final String t4 = new String("Blocks: ");
private static int hudX = 5;
private static int hudY = 70;
private String en = "";
private BlockPos g1p = null;
private BlockPos g2p = null;
private boolean q = false;
private double d1 = 0.0D;
private double d2 = 0.0D;
private int blc = 0;
public BridgeInfo() {
super("Bridge Info", Module.category.minigames, 0);
this.registerSetting(new DescriptionSetting(new String("Only for solos.")));
this.registerSetting(new ButtonSetting("Edit position", () -> {
mc.displayGuiScreen(new BridgeInfo.eh());
}));
}
public void onDisable() {
this.reset();
}
public void onUpdate() {
if (!this.en.isEmpty() && this.isBridge()) {
EntityPlayer enem = null;
Iterator var2 = mc.theWorld.loadedEntityList.iterator();
while (var2.hasNext()) {
Entity e = (Entity) var2.next();
if (e instanceof EntityPlayer) {
if (e.getName().equals(this.en)) {
enem = (EntityPlayer) e;
}
} else if (e instanceof EntityArmorStand) {
if (e.getName().contains(this.g1t)) {
this.g1p = e.getPosition();
} else if (e.getName().contains(this.g2t)) {
this.g2p = e.getPosition();
}
}
}
if (this.g1p != null && this.g2p != null) {
this.d1 = Utils.round(mc.thePlayer.getDistance((double) this.g2p.getX(), (double) this.g2p.getY(), (double) this.g2p.getZ()) - 1.4D, 1);
if (this.d1 < 0.0D) {
this.d1 = 0.0D;
}
this.d2 = enem == null ? 0.0D : Utils.round(enem.getDistance((double) this.g1p.getX(), (double) this.g1p.getY(), (double) this.g1p.getZ()) - 1.4D, 1);
if (this.d2 < 0.0D) {
this.d2 = 0.0D;
}
}
int blc2 = 0;
for (int i = 0; i < 9; ++i) {
ItemStack stack = mc.thePlayer.inventory.getStackInSlot(i);
if (stack != null && stack.getItem() instanceof ItemBlock && ((ItemBlock) stack.getItem()).block.equals(Blocks.stained_hardened_clay)) {
blc2 += stack.stackSize;
}
}
this.blc = blc2;
}
}
@SubscribeEvent
public void a(RenderTickEvent ev) {
if (ev.phase == Phase.END && Utils.nullCheck() && this.isBridge()) {
if (mc.currentScreen != null || mc.gameSettings.showDebugInfo) {
return;
}
mc.fontRendererObj.drawString(this.t1 + this.en, (float) hudX, (float) hudY, rgb, true);
mc.fontRendererObj.drawString(this.t2 + this.d1, (float) hudX, (float) (hudY + 11), rgb, true);
mc.fontRendererObj.drawString(this.t3 + this.d2, (float) hudX, (float) (hudY + 22), rgb, true);
mc.fontRendererObj.drawString(this.t4 + this.blc, (float) hudX, (float) (hudY + 33), rgb, true);
}
}
@SubscribeEvent
public void onChat(ClientChatReceivedEvent c) {
if (Utils.nullCheck()) {
String s = Utils.stripColor(c.message.getUnformattedText());
if (s.startsWith(" ")) {
if (s.contains(this.qt)) {
this.q = true;
} else if (this.q && s.contains("Opponent:")) {
String n = s.split(":")[1].trim();
if (n.contains("[")) {
n = n.split("] ")[1];
}
this.en = n;
this.q = false;
}
}
}
}
@SubscribeEvent
public void w(EntityJoinWorldEvent j) {
if (j.entity == mc.thePlayer) {
this.reset();
}
}
private boolean isBridge() {
if (Utils.isHypixel()) {
Iterator var1 = Utils.gsl().iterator();
while (var1.hasNext()) {
String s = (String) var1.next();
String s2 = s.toLowerCase();
if (s2.contains("mode") && s2.contains(this.bd)) {
return true;
}
}
}
return false;
}
private void reset() {
this.en = "";
this.q = false;
this.g1p = null;
this.g2p = null;
this.d1 = 0.0D;
this.d2 = 0.0D;
this.blc = 0;
}
static class eh extends GuiScreen {
final String a = new String("Enemy: Player123-Distance to goal: 17.2-Enemy distance to goal: 16.3-Blocks: 98");
GuiButtonExt rp;
boolean d = false;
int miX = 0;
int miY = 0;
int maX = 0;
int maY = 0;
int aX = 5;
int aY = 70;
int laX = 0;
int laY = 0;
int lmX = 0;
int lmY = 0;
public void initGui() {
super.initGui();
this.buttonList.add(this.rp = new GuiButtonExt(1, this.width - 90, 5, 85, 20, new String("Reset position")));
this.aX = BridgeInfo.hudX;
this.aY = BridgeInfo.hudY;
}
public void drawScreen(int mX, int mY, float pt) {
drawRect(0, 0, this.width, this.height, -1308622848);
int miX = this.aX;
int miY = this.aY;
int maX = miX + 140;
int maY = miY + 41;
this.d(this.mc.fontRendererObj, this.a);
this.miX = miX;
this.miY = miY;
this.maX = maX;
this.maY = maY;
BridgeInfo.hudX = miX;
BridgeInfo.hudY = miY;
ScaledResolution res = new ScaledResolution(this.mc);
int x = res.getScaledWidth() / 2 - 84;
int y = res.getScaledHeight() / 2 - 20;
RenderUtils.drawColoredString("Edit the HUD position by dragging.", '-', x, y, 2L, 0L, true, this.mc.fontRendererObj);
try {
this.handleInput();
} catch (IOException var12) {
}
super.drawScreen(mX, mY, pt);
}
private void d(FontRenderer fr, String t) {
int x = this.miX;
int y = this.miY;
String[] var5 = t.split("-");
int var6 = var5.length;
for (int var7 = 0; var7 < var6; ++var7) {
String s = var5[var7];
fr.drawString(s, (float) x, (float) y, BridgeInfo.rgb, true);
y += fr.FONT_HEIGHT + 2;
}
}
protected void mouseClickMove(int mX, int mY, int b, long t) {
super.mouseClickMove(mX, mY, b, t);
if (b == 0) {
if (this.d) {
this.aX = this.laX + (mX - this.lmX);
this.aY = this.laY + (mY - this.lmY);
} else if (mX > this.miX && mX < this.maX && mY > this.miY && mY < this.maY) {
this.d = true;
this.lmX = mX;
this.lmY = mY;
this.laX = this.aX;
this.laY = this.aY;
}
}
}
protected void mouseReleased(int mX, int mY, int s) {
super.mouseReleased(mX, mY, s);
if (s == 0) {
this.d = false;
}
}
public void actionPerformed(GuiButton b) {
if (b == this.rp) {
this.aX = BridgeInfo.hudX = 5;
this.aY = BridgeInfo.hudY = 70;
}
}
public boolean doesGuiPauseGame() {
return false;
}
}
}

View File

@ -0,0 +1,226 @@
package keystrokesmod.module.impl.minigames;
import keystrokesmod.Raven;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.ProfileUtils;
import keystrokesmod.utility.NetworkUtils;
import keystrokesmod.utility.Utils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.client.event.ClientChatReceivedEvent;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import java.util.ArrayList;
import java.util.List;
public class DuelsStats extends Module {
public static SliderSetting mode;
public static ButtonSetting a;
public static ButtonSetting threatLevel;
public static String nick = "";
private String ign = "";
private String en = "";
private static final String[] thr_lvl = new String[]{"§4VERY HIGH", "§cHIGH", "§6MODERATE", "§aLOW", "§2VERY LOW"};
private List<String> q = new ArrayList();
public DuelsStats() {
super("Duels Stats", Module.category.minigames, 0);
this.registerSetting(mode = new SliderSetting("Mode", 0, thr_lvl));
this.registerSetting(a = new ButtonSetting("Send ign on join", false));
this.registerSetting(threatLevel = new ButtonSetting("Threat Level", true));
}
public void onEnable() {
if (mc.thePlayer != null) {
this.ign = mc.thePlayer.getName();
}
else {
this.disable();
}
}
public void onDisable() {
this.en = "";
this.q.clear();
}
public void onUpdate() {
if (this.id() && this.en.isEmpty()) {
List<EntityPlayer> pl = mc.theWorld.playerEntities;
pl.remove(mc.thePlayer);
for (EntityPlayer p : pl) {
String n = p.getName();
if (!n.equals(this.ign) && !n.equals(nick) && !this.q.contains(n) && p.getDisplayName().getUnformattedText().contains("§k")) {
this.ef(n);
break;
}
}
}
}
@SubscribeEvent
public void onMessageReceived(ClientChatReceivedEvent c) {
if (Utils.nullCheck() && this.id()) {
String s = Utils.stripColor(c.message.getUnformattedText());
if (s.contains(" ")) {
String[] sp = s.split(" ");
String n;
if (sp.length == 4 && sp[1].equals("has") && sp[2].equals("joined") && sp[3].equals("(2/2)!")) {
n = sp[0];
if (!n.equals(this.ign) && !n.equals(nick) && this.en.isEmpty()) {
this.q.remove(n);
this.ef(n);
}
} else if (sp.length == 3 && sp[1].equals("has") && sp[2].equals("quit!")) {
n = sp[0];
if (this.en.equals(n)) {
this.en = "";
}
this.q.add(n);
}
}
}
}
@SubscribeEvent
public void onEntityJoin(EntityJoinWorldEvent j) {
if (j.entity == mc.thePlayer) {
this.en = "";
this.q.clear();
}
}
private void ef(String n) {
this.en = n;
if (a.isToggled()) {
Utils.sendMessage("&eOpponent found: " + "&3" + n);
}
if (NetworkUtils.API_KEY.isEmpty()) {
Utils.sendMessage("&cAPI Key is empty!");
} else {
ProfileUtils.DM dm = ProfileUtils.DM.values()[(int) (mode.getInput() - 1.0D)];
Raven.getExecutor().execute(() -> {
int[] s = ProfileUtils.getHypixelStats(n, dm);
if (s != null) {
if (s[0] == -1) {
Utils.sendMessage("&3" + n + " " + "&eis nicked!");
return;
}
double wlr = s[1] != 0 ? Utils.round((double) s[0] / (double) s[1], 2) : (double) s[0];
Utils.sendMessage("&7&m-------------------------");
if (dm != ProfileUtils.DM.OVERALL) {
Utils.sendMessage("&eMode: &3" + dm.name());
}
Utils.sendMessage("&eOpponent: &3" + n);
Utils.sendMessage("&eWins: &3" + s[0]);
Utils.sendMessage("&eLosses: &3" + s[1]);
Utils.sendMessage("&eWLR: &3" + wlr);
Utils.sendMessage("&eWS: &3" + s[2]);
if (threatLevel.isToggled()) {
Utils.sendMessage("&eThreat: &3" + gtl(s[0], s[1], wlr, s[2]));
}
Utils.sendMessage("&7&m-------------------------");
} else {
Utils.sendMessage("&cThere was an error.");
}
});
}
}
private boolean id() {
if (Utils.isHypixel()) {
int l = 0;
for (String s : Utils.gsl()) {
if (s.contains("Map:")) {
++l;
} else if (s.contains("Players:") && s.contains("/2")) {
++l;
}
}
return l == 2;
} else {
return false;
}
}
public static String gtl(int w, int l, double wlr, int ws) {
int t = 0;
int m = w + l;
if (m <= 13) {
t += 2;
}
if (ws >= 30) {
t += 9;
} else if (ws >= 15) {
t += 7;
} else if (ws >= 8) {
t += 5;
} else if (ws >= 4) {
t += 3;
} else if (ws >= 1) {
++t;
}
if (wlr >= 20.0D) {
t += 8;
} else if (wlr >= 10.0D) {
t += 5;
} else if (wlr >= 5.0D) {
t += 4;
} else if (wlr >= 3.0D) {
t += 2;
} else if (wlr >= 0.8D) {
++t;
}
if (w >= 20000) {
t += 4;
} else if (w >= 10000) {
t += 3;
} else if (w >= 5000) {
t += 2;
} else if (w >= 1000) {
++t;
}
if (l == 0) {
if (w == 0) {
t += 3;
} else {
t += 4;
}
} else if (l <= 10 && wlr >= 4.0D) {
t += 2;
}
String thr;
if (t == 0) {
thr = thr_lvl[4];
} else if (t <= 3) {
thr = thr_lvl[3];
} else if (t <= 6) {
thr = thr_lvl[2];
} else if (t <= 10) {
thr = thr_lvl[1];
} else {
thr = thr_lvl[0];
}
return thr;
}
}

View File

@ -0,0 +1,200 @@
package keystrokesmod.module.impl.minigames;
import keystrokesmod.module.Module;
import keystrokesmod.module.impl.world.AntiBot;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.utility.RenderUtils;
import keystrokesmod.utility.Utils;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemAxe;
import net.minecraft.item.ItemBow;
import net.minecraft.item.ItemSword;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.lwjgl.opengl.GL11;
import java.awt.*;
import java.util.*;
import java.util.List;
public class MurderMystery extends Module {
private ButtonSetting alert;
private ButtonSetting highlightMurderer;
private ButtonSetting highlightBow;
private ButtonSetting highlightInnocent;
private ButtonSetting highlightDead;
private ButtonSetting goldEsp;
private final List<EntityPlayer> murderers = new ArrayList();
private final List<EntityPlayer> hasBow = new ArrayList();
private boolean override;
public MurderMystery() {
super("Murder Mystery", category.minigames);
this.registerSetting(alert = new ButtonSetting("Alert murderer", true));
this.registerSetting(highlightMurderer = new ButtonSetting("Highlight murderer", true));
this.registerSetting(highlightBow = new ButtonSetting("Highlight bow", true));
this.registerSetting(highlightInnocent = new ButtonSetting("Highlight innocent", true));
this.registerSetting(highlightDead = new ButtonSetting("Highlight dead", true));
this.registerSetting(goldEsp = new ButtonSetting("Gold ESP", true));
}
public void onDisable() {
this.clear();
}
@SubscribeEvent
public void onRenderWordLast(RenderWorldLastEvent e) {
if (Utils.nullCheck()) {
if (!this.isMurderMystery()) {
this.clear();
}
else {
override = false;
for (EntityPlayer en : mc.theWorld.playerEntities) {
if (en != mc.thePlayer && !en.isInvisible()) {
if (AntiBot.isBot(en) && !highlightDead.isToggled()) {
continue;
}
if (en.getHeldItem() != null && en.getHeldItem().hasDisplayName()) {
Item heldItem = en.getHeldItem().getItem();
if (heldItem instanceof ItemSword || heldItem instanceof ItemAxe || en.getHeldItem().getDisplayName().contains("aKnife")) {
if (!murderers.contains(en)) {
murderers.add(en);
if (alert.isToggled()) {
mc.thePlayer.playSound("note.pling", 1.0F, 1.0F);
Utils.sendMessage("&eAlert: &b" + en.getName() + " &7is the &cmurderer&7! (&d" + (int) mc.thePlayer.getDistanceToEntity(en) + "m&7)");
}
}
}
else if (heldItem instanceof ItemBow && highlightBow.isToggled() && !hasBow.contains(en)) {
hasBow.add(en);
}
}
override = true;
int rgb = Color.green.getRGB();
if (murderers.contains(en) && highlightMurderer.isToggled()) {
rgb = Color.red.getRGB();
}
else if (hasBow.contains(en) && highlightBow.isToggled()) {
rgb = Color.orange.getRGB();
}
else if (!highlightInnocent.isToggled()) {
continue;
}
if (!highlightDead.isToggled() && getBoundingBoxVolume(en) <= 0.009) {
continue;
}
RenderUtils.renderEntity(en, 2, 0.0D, 0.0D, rgb, false);
}
}
if (!goldEsp.isToggled()) {
return;
}
float renderPartialTicks = Utils.getTimer().renderPartialTicks;
int n4 = -331703;
for (Entity entity : mc.theWorld.loadedEntityList) {
if (entity instanceof EntityItem) {
if (entity.ticksExisted < 3) {
continue;
}
EntityItem entityItem = (EntityItem) entity;
if (entityItem.getEntityItem().stackSize == 0) {
continue;
}
Item getItem = entityItem.getEntityItem().getItem();
if (getItem == null) {
continue;
}
double n5 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * renderPartialTicks;
double n6 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * renderPartialTicks;
double n7 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * renderPartialTicks;
double n8 = mc.thePlayer.lastTickPosX + (mc.thePlayer.posX - mc.thePlayer.lastTickPosX) * renderPartialTicks - n5;
double n9 = mc.thePlayer.lastTickPosY + (mc.thePlayer.posY - mc.thePlayer.lastTickPosY) * renderPartialTicks - n6;
double n10 = mc.thePlayer.lastTickPosZ + (mc.thePlayer.posZ - mc.thePlayer.lastTickPosZ) * renderPartialTicks - n7;
GlStateManager.pushMatrix();
drawBox(n4, n5, n6, n7, MathHelper.sqrt_double(n8 * n8 + n9 * n9 + n10 * n10));
GlStateManager.popMatrix();
}
}
}
}
}
public void drawBox(int n, double n4, double n5, double n6, double n7) {
n4 -= mc.getRenderManager().viewerPosX;
n5 -= mc.getRenderManager().viewerPosY;
n6 -= mc.getRenderManager().viewerPosZ;
GL11.glPushMatrix();
GL11.glBlendFunc(770, 771);
GL11.glEnable(3042);
GL11.glLineWidth(2.0f);
GL11.glDisable(3553);
GL11.glDisable(2929);
GL11.glDepthMask(false);
float n8 = (n >> 16 & 0xFF) / 255.0f;
float n9 = (n >> 8 & 0xFF) / 255.0f;
float n10 = (n & 0xFF) / 255.0f;
float min = Math.min(Math.max(0.2f, (float) (0.009999999776482582 * n7)), 0.4f);
RenderUtils.drawBoundingBox(new AxisAlignedBB(n4 - min, n5, n6 - min, n4 + min, n5 + min * 2.0f, n6 + min), n8, n9, n10, 0.35f);
GL11.glEnable(3553);
GL11.glEnable(2929);
GL11.glDepthMask(true);
GL11.glDisable(3042);
GL11.glPopMatrix();
}
private boolean isMurderMystery() {
if (Utils.isHypixel()) {
if (mc.thePlayer.getWorldScoreboard() == null || mc.thePlayer.getWorldScoreboard().getObjectiveInDisplaySlot(1) == null) {
return false;
}
String d = mc.thePlayer.getWorldScoreboard().getObjectiveInDisplaySlot(1).getDisplayName();
if (!d.contains("MURDER") && !d.contains("MYSTERY")) {
return false;
}
Iterator var2 = Utils.gsl().iterator();
while (var2.hasNext()) {
String l = (String) var2.next();
String s = Utils.stripColor(l);
if (s.contains("Role:") || s.contains("Innocents Left:")) {
return true;
}
}
}
return false;
}
public boolean isEmpty() {
return murderers.isEmpty() && hasBow.isEmpty() && !override;
}
private void clear() {
override = false;
murderers.clear();
hasBow.clear();
}
private double getBoundingBoxVolume(Entity entity) {
AxisAlignedBB boundingBox = entity.getEntityBoundingBox();
if (boundingBox == null) {
return 0;
}
double length = boundingBox.maxX - boundingBox.minX;
double width = boundingBox.maxZ - boundingBox.minZ;
double height = boundingBox.maxY - boundingBox.minY;
return length * width * height;
}
}

View File

@ -0,0 +1,87 @@
package keystrokesmod.module.impl.minigames;
import keystrokesmod.event.PreUpdateEvent;
import keystrokesmod.module.Module;
import keystrokesmod.module.impl.world.AntiBot;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.utility.RenderUtils;
import keystrokesmod.utility.Utils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.client.event.ClientChatReceivedEvent;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import java.awt.*;
import java.util.*;
public class SkyWars extends Module {
public ButtonSetting strengthIndicator;
public Map<EntityPlayer, Long> strengthPlayers = new HashMap<>();
private int strengthColor = new Color(255, 0, 0).getRGB();
private String[] killMessages = new String[] {" by ", " to ", " with ", " of ", " from ", " knight ", " for "};
public SkyWars() {
super("Sky Wars", category.minigames);
this.registerSetting(strengthIndicator = new ButtonSetting("Strength indicator", true));
}
@Override
public void onDisable() {
strengthPlayers.clear();
}
@SubscribeEvent
public void onPreUpdate(PreUpdateEvent e) {
if (!strengthIndicator.isToggled() || !Utils.nullCheck() || strengthPlayers.isEmpty() || Utils.getSkyWarsStatus() != 2) {
return;
}
ArrayList<EntityPlayer> keysList = new ArrayList<>(strengthPlayers.keySet());
for (EntityPlayer entityPlayer : keysList) {
long storedTime = strengthPlayers.get(entityPlayer);
long timePassed = System.currentTimeMillis() - storedTime;
if (timePassed < 5000 && !AntiBot.isBot(entityPlayer)) {
continue;
}
strengthPlayers.remove(entityPlayer);
}
}
@SubscribeEvent
public void onChat(ClientChatReceivedEvent e) {
if (e.type == 2 || !Utils.nullCheck() || !strengthIndicator.isToggled() || Utils.getSkyWarsStatus() != 2) {
return;
}
String stripped = Utils.stripColor(e.message.getUnformattedText());
if (stripped.isEmpty()) {
return;
}
if (stripped.endsWith(".") && Arrays.stream(killMessages).anyMatch(stripped::contains)) {
String[] parts = stripped.split(" ");
for (String part : parts) {
if (!part.endsWith(".")) {
continue;
}
String name = part.substring(0, part.length() - 1);
for (EntityPlayer entity : mc.theWorld.playerEntities) {
if (!entity.getName().trim().equals(name) || entity == mc.thePlayer) {
continue;
}
strengthPlayers.put(entity, System.currentTimeMillis());
break;
}
}
}
}
@SubscribeEvent
public void onRenderWorld(RenderWorldLastEvent renderWorldLastEvent) {
if (!strengthIndicator.isToggled() || !Utils.nullCheck() || strengthPlayers.isEmpty() || Utils.getSkyWarsStatus() != 2) {
return;
}
for (EntityPlayer entityPlayer : strengthPlayers.keySet()) {
if (AntiBot.isBot(entityPlayer)) {
continue;
}
RenderUtils.renderEntity(entityPlayer, 2, 0, 0, strengthColor, false);
}
}
}

View File

@ -0,0 +1,574 @@
package keystrokesmod.module.impl.minigames;
import keystrokesmod.event.PreUpdateEvent;
import keystrokesmod.event.ReceivePacketEvent;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.BlockUtils;
import keystrokesmod.utility.Reflection;
import keystrokesmod.utility.RenderUtils;
import keystrokesmod.utility.Utils;
import net.minecraft.block.*;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.network.play.server.S08PacketPlayerPosLook;
import net.minecraft.util.*;
import net.minecraftforge.client.event.ClientChatReceivedEvent;
import net.minecraftforge.client.event.DrawBlockHighlightEvent;
import net.minecraftforge.client.event.MouseEvent;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import org.lwjgl.input.Mouse;
import java.awt.*;
import java.util.*;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
public class SpeedBuilders extends Module {
private SliderSetting placeDelay;
private ButtonSetting antiMiss;
private ButtonSetting autoPlace;
private ButtonSetting autoSwap;
private ButtonSetting hoverPlace;
private ButtonSetting infoHud;
private ButtonSetting renderBlocks;
private ButtonSetting renderOnlyPlaceable;
private ConcurrentHashMap<BlockPos, BuildBlockInfo> buildInfo = new ConcurrentHashMap<>();
private BlockPos platformCenter;
private boolean listenForPacket;
public List<BlockPos> platformPositions = Arrays.asList(
new BlockPos(45, 71, -18),
new BlockPos(-16, 71, 45),
new BlockPos(18, 71, 45),
new BlockPos(45, 71, 16),
new BlockPos(-18, 71, -45),
new BlockPos(-45, 71, -16),
new BlockPos(-45, 71, 18),
new BlockPos(16, 71, -45)
);
private int highlightColor = new Color(31, 255, 22, 44).getRGB();
private int notPlaceableColor = new Color(184, 255, 183, 30).getRGB();
private boolean doneCollecting;
private double blockCount;
private long lastPlace = 0L;
private BlockPos lastPlacePos = null;
private int lastPlaceTick = 0;
private boolean eliminated;
public SpeedBuilders() {
super("Speed Builders", category.minigames);
this.registerSetting(new DescriptionSetting("Middle click to toggle auto."));
this.registerSetting(placeDelay = new SliderSetting("Place delay", " tick", 0.5, 0, 10, 0.5));
this.registerSetting(antiMiss = new ButtonSetting("Anti miss", false));
this.registerSetting(autoPlace = new ButtonSetting("Auto place", false));
this.registerSetting(autoSwap = new ButtonSetting("Auto swap", true));
this.registerSetting(hoverPlace = new ButtonSetting("Hover place", true));
this.registerSetting(infoHud = new ButtonSetting("Info HUD", true));
this.registerSetting(renderBlocks = new ButtonSetting("Render blocks", true));
this.registerSetting(renderOnlyPlaceable = new ButtonSetting("Render only placeable", false));
}
@Override
public void onDisable() {
lastPlaceTick = 0;
}
@SubscribeEvent
public void onPreUpdate(PreUpdateEvent e) {
int gameStatus = getGameStatus();
if (gameStatus == -1 || platformCenter == null) {
return;
}
if (gameStatus == 4) {
doneCollecting = true;
}
if (gameStatus == 1 && !doneCollecting) {
buildInfo = getBuildInfo(platformCenter);
if (!buildInfo.isEmpty()) {
blockCount = buildInfo.size();
}
}
if (gameStatus == 2) {
doneCollecting = false;
for (Map.Entry<BlockPos, BuildBlockInfo> entry : buildInfo.entrySet()) {
IBlockState currentState = mc.theWorld.getBlockState(entry.getKey());
IBlockState requiredState = entry.getValue().requiredState;
if (currentState == null || requiredState == null) {
entry.getValue().isPlaced = false;
continue;
}
if (currentState.equals(requiredState) ||(requiredState.getBlock() instanceof BlockLeaves && (currentState.getBlock().equals(requiredState.getBlock())))) {
entry.getValue().isPlaced = true;
}
else {
entry.getValue().isPlaced = false;
}
}
if (getLookInfo() != null) {
MovingObjectPosition mop = getLookInfo();
if (mop.sideHit != null) {
BlockPos targetPos = mop.getBlockPos();
BlockPos facePos = targetPos.offset(mop.sideHit);
BuildBlockInfo info = buildInfo.get(facePos);
if (info != null && !info.isPlaced) {
if (autoSwap.isToggled()) {
int requiredMeta = info.requiredState.getBlock().getMetaFromState(info.requiredState);
int slot = getSlot(info.requiredState.getBlock(), requiredMeta);
if (slot != -1 && slot != mc.thePlayer.inventory.currentItem) {
mc.thePlayer.inventory.currentItem = slot;
}
}
if ((hoverPlace.isToggled()) && holdingSameBlock(info.requiredState) && !autoPlace.isToggled() && correctPlaceState(info.requiredState, targetPos, mop.sideHit, mop.hitVec, mc.thePlayer.getHeldItem())) {
if (lastPlaceTick++ < placeDelay.getInput()) {
return;
}
Reflection.rightClick();
lastPlaceTick = 0;
}
}
}
}
}
}
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onBlockHighlight(DrawBlockHighlightEvent ev) {
if (autoPlace.isToggled() && hoverPlace.isToggled() && Utils.nullCheck() && mc.currentScreen == null && getGameStatus() == 2) {
ItemStack i = mc.thePlayer.getHeldItem();
if (i != null && i.getItem() instanceof ItemBlock) {
MovingObjectPosition m = mc.objectMouseOver;
if (m != null && m.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
if (getLookInfo() != null) {
MovingObjectPosition mop = getLookInfo();
if (mop.sideHit != null) {
BlockPos targetPos = mop.getBlockPos();
BlockPos facePos = targetPos.offset(mop.sideHit);
BuildBlockInfo info = buildInfo.get(facePos);
if (info != null && !info.isPlaced && correctPlaceState(info.requiredState, targetPos, mop.sideHit, mop.hitVec, mc.thePlayer.getHeldItem())) {
BlockPos pos = m.getBlockPos();
if (this.lastPlacePos == null || pos.getX() != this.lastPlacePos.getX() || pos.getY() != this.lastPlacePos.getY() || pos.getZ() != this.lastPlacePos.getZ()) {
Block b = mc.theWorld.getBlockState(pos).getBlock();
if (b != null && b != Blocks.air && !(b instanceof BlockLiquid)) {
if (Mouse.isButtonDown(1) || hoverPlace.isToggled()) {
long n = System.currentTimeMillis();
if (n - this.lastPlace >= placeDelay.getInput() * 50) {
this.lastPlace = n;
if (mc.playerController.onPlayerRightClick(mc.thePlayer, mc.theWorld, i, pos, m.sideHit, m.hitVec)) {
Reflection.setButton(1, true);
mc.thePlayer.swingItem();
mc.getItemRenderer().resetEquippedProgress();
Reflection.setButton(1, false);
this.lastPlacePos = pos;
}
}
}
}
}
}
}
}
}
}
}
}
@SubscribeEvent
public void onMouse(MouseEvent e) {
if (!e.buttonstate || !Utils.nullCheck() || mc.currentScreen != null) {
return;
}
if (e.button == 1 && antiMiss.isToggled() && getLookInfo() != null && getGameStatus() == 2) {
MovingObjectPosition mop = getLookInfo();
if (mop.sideHit != null) {
BlockPos targetPos = mop.getBlockPos();
BlockPos facePos = targetPos.offset(mop.sideHit);
BuildBlockInfo info = buildInfo.get(facePos);
if (info == null || !holdingSameBlock(info.requiredState) || !correctPlaceState(info.requiredState, targetPos, mop.sideHit, mop.hitVec, mc.thePlayer.getHeldItem())) {
e.setCanceled(true);
}
}
}
else if (e.button == 2) {
if (autoSwap.isToggled()) {
autoSwap.disable();
hoverPlace.disable();
}
else {
autoSwap.enable();
hoverPlace.enable();
}
}
}
@SubscribeEvent
public void onRenderWorld(RenderWorldLastEvent ev) {
if (!Utils.nullCheck() || getGameStatus() != 2 || !renderBlocks.isToggled()) {
return;
}
for (Map.Entry<BlockPos, BuildBlockInfo> buildData : buildInfo.entrySet()) {
BuildBlockInfo info = buildData.getValue();
if (info.isPlaced) {
continue;
}
if (!holdingSameBlock(info.requiredState)) {
continue;
}
BlockPos pos = buildData.getKey();
boolean useWhite = true;
for (EnumFacing dir : EnumFacing.values()) {
BlockPos neighborPos = pos.offset(dir);
if (BlockUtils.getBlock(neighborPos) != Blocks.air) {
useWhite = false;
}
}
if (renderOnlyPlaceable.isToggled() && useWhite) {
continue;
}
RenderUtils.renderBlockModel(buildData.getValue().requiredState, pos.getX(), pos.getY(), pos.getZ(), useWhite ? notPlaceableColor : highlightColor);
}
}
@SubscribeEvent
public void onRenderTick(TickEvent.RenderTickEvent e) {
if (e.phase != TickEvent.Phase.END || !Utils.nullCheck() || !infoHud.isToggled() || mc.currentScreen != null) {
return;
}
int gameStatus = getGameStatus();
List<String> lines = new ArrayList<>();
lines.add("§6Speed Builders");
lines.add("§7Status: §b" + ((gameStatus == 1 || gameStatus == 4)
? "Showing" : (gameStatus == 2)
? "Building" : (gameStatus == 3)
? "Judging" : "§cDisabled"));
if (gameStatus == 2 && !eliminated) {
double placedCount = 0;
for (BuildBlockInfo info : buildInfo.values()) {
if (info.isPlaced) placedCount++;
}
double percentage = 0.0;
if (buildInfo.isEmpty()) {
percentage = 100.0;
placedCount = blockCount;
}
else if (blockCount > 0) {
percentage = ((placedCount) / blockCount) * 100.0;
}
lines.add("§7Progress: §b" + (int) placedCount + "§7/§b" + (int) blockCount + " " + Math.round(percentage) + "%");
}
lines.add("§7Auto: " + (autoEnabled() ? "§aENABLED" : "§cDISABLED"));
int padding = 4;
int maxWidth = 0;
for (String line : lines) {
int lineWidth = mc.fontRendererObj.getStringWidth(line);
if (lineWidth > maxWidth) {
maxWidth = lineWidth;
}
}
int lineHeight = mc.fontRendererObj.FONT_HEIGHT;
int lineSpacing = 3;
int totalHeight = lines.size() * lineHeight + (lines.size() - 1) * lineSpacing + padding * 2;
int totalWidth = maxWidth + padding * 2;
float x = -5;
float y = 110;
RenderUtils.drawRoundedRectangle(x, y, x + totalWidth + 7, y + totalHeight - 2, 7, Utils.mergeAlpha(Color.black.getRGB(), 120));
float textX = x + padding;
float textY = y + padding;
for (int i = 0; i < lines.size(); i++) {
mc.fontRendererObj.drawString(lines.get(i), (int) (textX + 5), (int) (textY + i * (lineHeight + lineSpacing)), -1);
}
}
@SubscribeEvent
public void onEntityJoin(EntityJoinWorldEvent e) {
if (!Utils.nullCheck() || e.entity == null) {
return;
}
if (e.entity == mc.thePlayer) {
buildInfo.clear();
platformCenter = null;
listenForPacket = false;
doneCollecting = false;
eliminated = false;
}
}
@SubscribeEvent
public void onChat(ClientChatReceivedEvent e) {
if (e.type == 2 || !Utils.nullCheck() || getGameStatus() == -1 || listenForPacket) {
return;
}
String stripped = Utils.stripColor(e.message.getUnformattedText());
if (stripped.isEmpty()) {
return;
}
if (stripped.contains("Perfectly recreate the build you are shown each") || stripped.contains("The game starts in 1 second!")) {
listenForPacket = true;
}
if (stripped.startsWith(Utils.getServerName()) && stripped.contains(" got a perfect build in ") && stripped.endsWith("s!")) {
buildInfo.clear();
doneCollecting = false;
}
if (stripped.startsWith("Player eliminated: " + Utils.getServerName()) && stripped.endsWith("%)")) {
eliminated = true;
}
}
@SubscribeEvent
public void onReceivePacket(ReceivePacketEvent e) {
if (listenForPacket && Utils.nullCheck() && e.getPacket() instanceof S08PacketPlayerPosLook) {
Vec3 setPos = new Vec3(((S08PacketPlayerPosLook) e.getPacket()).getX(), ((S08PacketPlayerPosLook) e.getPacket()).getY(), ((S08PacketPlayerPosLook) e.getPacket()).getZ());
if (platformCenter == null) {
platformCenter = findCenter(setPos);
}
listenForPacket = false;
}
}
public int getGameStatus() {
List<String> sidebar = Utils.getSidebarLines();
if (sidebar == null || sidebar.isEmpty()) {
return -1;
}
if (!Utils.stripColor(sidebar.get(0)).startsWith("BUILD BATTLE")) {
return -1;
}
for (int i = 0; i < sidebar.size() - 1; i++) {
String currentLine = Utils.stripColor(sidebar.get(i));
String nextLine = Utils.stripColor(sidebar.get(i + 1));
if (currentLine.startsWith("Round:")) {
if (nextLine.startsWith("Starts In: 00:03") && Utils.stripColor(sidebar.get(i + 3)).startsWith("Theme:")) {
return 4;
}
if (nextLine.startsWith("Starts In:")) {
return 1;
}
if (nextLine.startsWith("Time Left:")) {
return 2;
}
if (nextLine.startsWith("Judging:")) {
return 3;
}
}
}
return 0;
}
public BlockPos findCenter(Vec3 position) {
BlockPos closestPos = null;
double closestDistSq = Double.MAX_VALUE;
double maxDistance = 30.0;
double maxDistSq = maxDistance * maxDistance;
for (BlockPos pos : platformPositions) {
double dx = pos.getX() - position.xCoord;
double dy = pos.getY() - position.yCoord;
double dz = pos.getZ() - position.zCoord;
double distSq = Math.abs(dx * dx + dy * dy + dz * dz);
if (distSq <= maxDistSq && distSq < closestDistSq) {
closestDistSq = distSq;
closestPos = pos;
}
}
return closestPos;
}
public ConcurrentHashMap<BlockPos, BuildBlockInfo> getBuildInfo(BlockPos centerPos) {
ConcurrentHashMap<BlockPos, BuildBlockInfo> blockInfo = new ConcurrentHashMap<>();
int startX = centerPos.getX() - 3;
int endX = centerPos.getX() + 3;
int startZ = centerPos.getZ() - 3;
int endZ = centerPos.getZ() + 3;
int startY = centerPos.getY() + 1;
int endY = startY + 30;
for (int x = startX; x <= endX; x++) {
for (int z = startZ; z <= endZ; z++) {
for (int y = startY; y <= endY; y++) {
BlockPos currentPos = new BlockPos(x, y, z);
IBlockState state = mc.theWorld.getBlockState(currentPos);
if (state.getBlock() == Blocks.air) {
continue;
}
blockInfo.put(currentPos, new BuildBlockInfo(state));
}
}
}
return blockInfo;
}
public boolean autoEnabled() {
return autoSwap.isToggled() && hoverPlace.isToggled();
}
public boolean holdingSameBlock(IBlockState requiredState) {
if (mc.thePlayer == null || requiredState == null) {
return false;
}
ItemStack heldItem = mc.thePlayer.getHeldItem();
if (heldItem == null) {
return false;
}
Item item = heldItem.getItem();
Block requiredBlock = requiredState.getBlock();
if ((requiredBlock == Blocks.water || requiredBlock == Blocks.flowing_water) && item == Items.water_bucket) {
return true;
}
if (!(item instanceof ItemBlock)) {
return false;
}
Block heldBlock = ((ItemBlock) item).getBlock();
int heldMeta = heldItem.getItemDamage();
int requiredMeta = requiredBlock.getMetaFromState(requiredState);
if (requiredBlock == Blocks.leaves || requiredBlock == Blocks.leaves2) {
requiredMeta = requiredMeta & 3;
heldMeta = heldMeta & 3;
}
if (removeMeta(heldBlock)) {
heldMeta = 0;
requiredMeta = 0;
}
return heldBlock == requiredBlock && heldMeta == requiredMeta;
}
public MovingObjectPosition getLookInfo() {
MovingObjectPosition movingObjectPosition = mc.objectMouseOver;
if (movingObjectPosition == null || movingObjectPosition.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK || movingObjectPosition.getBlockPos() == null) {
return null;
}
return mc.objectMouseOver;
}
private int getSlot(Block block, int meta) {
if (removeMeta(block)) {
meta = 0;
}
if (block == Blocks.leaves || block == Blocks.leaves2) {
meta &= 3;
}
for (int i = 0; i < 9; ++i) {
ItemStack itemStack = mc.thePlayer.inventory.mainInventory[i];
if (itemStack != null && itemStack.getItem() instanceof ItemBlock && itemStack.stackSize > 0) {
Block invBlock = ((ItemBlock) itemStack.getItem()).getBlock();
int invMeta = itemStack.getItemDamage();
if (removeMeta(block)) {
invMeta = 0;
}
if (invBlock == Blocks.leaves || invBlock == Blocks.leaves2) {
invMeta &= 3;
}
if (invBlock == block && invMeta == meta) {
return i;
}
}
}
return -1;
}
private boolean removeMeta(Block block) {
return (block instanceof BlockStairs || block instanceof BlockDoublePlant || block instanceof BlockFlower || block instanceof BlockSkull || block instanceof BlockLadder || block instanceof BlockPumpkin || block instanceof BlockCauldron || block instanceof BlockRail || block instanceof BlockRailBase || block instanceof BlockTripWireHook || block instanceof BlockTripWire || block instanceof BlockDispenser || block instanceof BlockDropper || block instanceof BlockHopper || block instanceof BlockTorch || block instanceof BlockButton || block instanceof BlockLever || block instanceof BlockTrapDoor || block instanceof BlockSlab);
}
private boolean correctPlaceState(IBlockState requiredState, BlockPos blockPos, EnumFacing enumFacing, Vec3 hitVec, ItemStack heldItem) {
if (requiredState == null || blockPos == null || enumFacing == null || hitVec == null || heldItem == null || !(heldItem.getItem() instanceof ItemBlock)) {
return false;
}
if (requiredState.getBlock() instanceof BlockLeaves || requiredState.getBlock() instanceof BlockButton) {
return true;
}
ItemBlock itemBlock = (ItemBlock) heldItem.getItem();
Block block = itemBlock.getBlock();
int meta = heldItem.getItemDamage();
Vec3 relativeHitVec = hitVec.subtract(new Vec3(blockPos.getX(), blockPos.getY(), blockPos.getZ()));
IBlockState simulatedState = block.onBlockPlaced(mc.theWorld, blockPos, enumFacing,
(float) relativeHitVec.xCoord, (float) relativeHitVec.yCoord, (float) relativeHitVec.zCoord, meta, mc.thePlayer);
if (simulatedState == null) {
return false;
}
if (simulatedState.getBlock() != requiredState.getBlock()) {
return false;
}
int simulatedMeta = simulatedState.getBlock().getMetaFromState(simulatedState);
int requiredMeta = requiredState.getBlock().getMetaFromState(requiredState);
if (simulatedMeta != requiredMeta) {
return false;
}
if (simulatedState.getProperties().containsKey(BlockDirectional.FACING) && requiredState.getProperties().containsKey(BlockDirectional.FACING)) {
EnumFacing simulatedFacing = simulatedState.getValue(BlockDirectional.FACING);
EnumFacing requiredFacing = requiredState.getValue(BlockDirectional.FACING);
if (simulatedFacing != requiredFacing) {
return false;
}
}
if (simulatedState.getBlock() instanceof BlockStairs && requiredState.getBlock() instanceof BlockStairs) {
EnumFacing simulatedFacing = simulatedState.getValue(BlockStairs.FACING);
EnumFacing requiredFacing = requiredState.getValue(BlockStairs.FACING);
BlockStairs.EnumHalf simulatedHalf = simulatedState.getValue(BlockStairs.HALF);
BlockStairs.EnumHalf requiredHalf = requiredState.getValue(BlockStairs.HALF);
if (simulatedFacing != requiredFacing || simulatedHalf != requiredHalf) {
return false;
}
}
return true;
}
class BuildBlockInfo {
public IBlockState requiredState;
public boolean isPlaced;
public BuildBlockInfo(IBlockState state) {
this.requiredState = state;
this.isPlaced = false;
}
}
}

View File

@ -0,0 +1,130 @@
package keystrokesmod.module.impl.minigames;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.Utils;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.util.BlockPos;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
import net.minecraftforge.client.event.MouseEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.lwjgl.input.Mouse;
import java.util.Arrays;
import java.util.List;
import java.util.TimerTask;
public class SumoFences extends Module {
public static SliderSetting fenceHeight;
public SliderSetting blockType;
private java.util.Timer t;
private final List<String> maps = Arrays.asList("Sumo", "Space Mine", "White Crystal", "Fort");
private IBlockState f;
private static final List<BlockPos> f_p = Arrays.asList(new BlockPos(9, 65, -2), new BlockPos(9, 65, -1), new BlockPos(9, 65, 0), new BlockPos(9, 65, 1), new BlockPos(9, 65, 2), new BlockPos(9, 65, 3), new BlockPos(8, 65, 3), new BlockPos(8, 65, 4), new BlockPos(8, 65, 5), new BlockPos(7, 65, 5), new BlockPos(7, 65, 6), new BlockPos(7, 65, 7), new BlockPos(6, 65, 7), new BlockPos(5, 65, 7), new BlockPos(5, 65, 8), new BlockPos(4, 65, 8), new BlockPos(3, 65, 8), new BlockPos(3, 65, 9), new BlockPos(2, 65, 9), new BlockPos(1, 65, 9), new BlockPos(0, 65, 9), new BlockPos(-1, 65, 9), new BlockPos(-2, 65, 9), new BlockPos(-3, 65, 9), new BlockPos(-3, 65, 8), new BlockPos(-4, 65, 8), new BlockPos(-5, 65, 8), new BlockPos(-5, 65, 7), new BlockPos(-6, 65, 7), new BlockPos(-7, 65, 7), new BlockPos(-7, 65, 6), new BlockPos(-7, 65, 5), new BlockPos(-8, 65, 5), new BlockPos(-8, 65, 4), new BlockPos(-8, 65, 3), new BlockPos(-9, 65, 3), new BlockPos(-9, 65, 2), new BlockPos(-9, 65, 1), new BlockPos(-9, 65, 0), new BlockPos(-9, 65, -1), new BlockPos(-9, 65, -2), new BlockPos(-9, 65, -3), new BlockPos(-8, 65, -3), new BlockPos(-8, 65, -4), new BlockPos(-8, 65, -5), new BlockPos(-7, 65, -5), new BlockPos(-7, 65, -6), new BlockPos(-7, 65, -7), new BlockPos(-6, 65, -7), new BlockPos(-5, 65, -7), new BlockPos(-5, 65, -8), new BlockPos(-4, 65, -8), new BlockPos(-3, 65, -8), new BlockPos(-3, 65, -9), new BlockPos(-2, 65, -9), new BlockPos(-1, 65, -9), new BlockPos(0, 65, -9), new BlockPos(1, 65, -9), new BlockPos(2, 65, -9), new BlockPos(3, 65, -9), new BlockPos(3, 65, -8), new BlockPos(4, 65, -8), new BlockPos(5, 65, -8), new BlockPos(5, 65, -7), new BlockPos(6, 65, -7), new BlockPos(7, 65, -7), new BlockPos(7, 65, -6), new BlockPos(7, 65, -5), new BlockPos(8, 65, -5), new BlockPos(8, 65, -4), new BlockPos(8, 65, -3), new BlockPos(9, 65, -3));
private String[] mode = new String[]{"Oak fence", "Leaves", "Glass", "Barrier"};
public SumoFences() {
super("Sumo Fences", category.minigames, 0);
this.f = Blocks.oak_fence.getDefaultState();
this.registerSetting(new DescriptionSetting("Fences for Hypixel sumo."));
this.registerSetting(fenceHeight = new SliderSetting("Fence height", 4.0D, 1.0D, 6.0D, 1.0D));
this.registerSetting(blockType = new SliderSetting("Block type", 0, mode));
}
public void onEnable() {
(this.t = new java.util.Timer()).scheduleAtFixedRate(this.t(), 0L, 500L);
}
public void onDisable() {
if (this.t != null) {
this.t.cancel();
this.t.purge();
this.t = null;
}
for (BlockPos p : f_p) {
for (int i = 0; (double) i < fenceHeight.getInput(); ++i) {
BlockPos p2 = new BlockPos(p.getX(), p.getY() + i, p.getZ());
if (mc.theWorld.getBlockState(p2).getBlock() == this.f) {
mc.theWorld.setBlockState(p2, Blocks.air.getDefaultState());
}
}
}
}
@SubscribeEvent
public void onMouse(MouseEvent e) {
if (e.buttonstate && (e.button == 0 || e.button == 1) && Utils.nullCheck() && this.isSumo()) {
MovingObjectPosition mop = mc.objectMouseOver;
if (mop != null && mop.typeOfHit == MovingObjectType.BLOCK) {
int x = mop.getBlockPos().getX();
int z = mop.getBlockPos().getZ();
for (BlockPos pos : f_p) {
if (pos.getX() == x && pos.getZ() == z) {
e.setCanceled(true);
if (e.button == 0) {
Utils.rsa();
}
Mouse.poll();
break;
}
}
}
}
}
public TimerTask t() {
return new TimerTask() {
public void run() {
if (SumoFences.this.isSumo()) {
for (BlockPos p : SumoFences.f_p) {
for (int i = 0; (double) i < SumoFences.fenceHeight.getInput(); ++i) {
BlockPos p2 = new BlockPos(p.getX(), p.getY() + i, p.getZ());
if (mc.theWorld.getBlockState(p2).getBlock() == Blocks.air) {
mc.theWorld.setBlockState(p2, SumoFences.this.f);
}
}
}
}
}
};
}
private boolean isSumo() {
if (Utils.isHypixel()) {
for (String l : Utils.gsl()) {
String s = Utils.stripColor(l);
if (s.startsWith("Map:")) {
if (this.maps.contains(s.substring(5))) {
return true;
}
} else if (s.equals("Mode: Sumo Duel")) {
return true;
}
}
}
return false;
}
public void guiUpdate() {
switch ((int) blockType.getInput()) {
case 0:
this.f = Blocks.oak_fence.getDefaultState();
break;
case 1:
this.f = Blocks.leaves.getDefaultState();
break;
case 2:
this.f = Blocks.glass.getDefaultState();
break;
case 3:
this.f = Blocks.barrier.getDefaultState();
}
}
}

View File

@ -0,0 +1,149 @@
package keystrokesmod.module.impl.movement;
import keystrokesmod.event.PostPlayerInputEvent;
import keystrokesmod.event.PreMotionEvent;
import keystrokesmod.module.Module;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.impl.client.Settings;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.RotationUtils;
import keystrokesmod.utility.Utils;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.lwjgl.input.Keyboard;
public class Bhop extends Module {
public SliderSetting mode;
public static SliderSetting speedSetting;
private ButtonSetting liquidDisable;
private ButtonSetting sneakDisable;
public ButtonSetting rotateYawOption;
public String[] modes = new String[]{"Strafe", "Ground", "8 tick", "7 tick"};
public boolean hopping, lowhop, didMove, collided, setRotation;
public Bhop() {
super("Bhop", Module.category.movement);
this.registerSetting(mode = new SliderSetting("Mode", 0, modes));
this.registerSetting(speedSetting = new SliderSetting("Speed", 2.0, 0.5, 8.0, 0.1));
this.registerSetting(liquidDisable = new ButtonSetting("Disable in liquid", true));
this.registerSetting(sneakDisable = new ButtonSetting("Disable while sneaking", true));
this.registerSetting(rotateYawOption = new ButtonSetting("Rotate Yaw", false));
}
@Override
public String getInfo() {
return modes[(int) mode.getInput()];
}
@SubscribeEvent
public void onPostPlayerInput(PostPlayerInputEvent e) {
if (hopping) {
mc.thePlayer.movementInput.jump = false;
}
}
@SubscribeEvent
public void onPreMotion(PreMotionEvent e) {
if (((mc.thePlayer.isInWater() || mc.thePlayer.isInLava()) && liquidDisable.isToggled()) || (mc.thePlayer.isSneaking() && sneakDisable.isToggled())) {
return;
}
if (ModuleManager.bedAura.isEnabled() && ModuleManager.bedAura.disableBHop.isToggled() && ModuleManager.bedAura.currentBlock != null && RotationUtils.inRange(ModuleManager.bedAura.currentBlock, ModuleManager.bedAura.range.getInput())) {
return;
}
if (ModuleManager.scaffold.moduleEnabled && (ModuleManager.tower.canTower() || ModuleManager.scaffold.fastScaffoldKeepY)) {
return;
}
if (mode.getInput() >= 1) {
if (mc.thePlayer.isCollidedHorizontally) {
collided = true;
} else if (mc.thePlayer.onGround) {
collided = false;
}
if (mc.thePlayer.onGround) {
mc.thePlayer.jump();
double horizontalSpeed = Utils.getHorizontalSpeed();
double speedModifier = 0.4847;
final int speedAmplifier = Utils.getSpeedAmplifier();
switch (speedAmplifier) {
case 1:
speedModifier = 0.5152;
break;
case 2:
speedModifier = 0.587;
break;
case 3:
speedModifier = 0.6289;
break;
}
double additionalSpeed = speedModifier * ((speedSetting.getInput() - 1.0) / 3.0 + 1.0);
if (horizontalSpeed < additionalSpeed) {
horizontalSpeed = additionalSpeed;
}
if (Utils.isMoving() && !Utils.noSlowingBackWithBow()) {
mc.thePlayer.setSprinting(true);
Utils.setSpeed(horizontalSpeed);
didMove = true;
}
hopping = true;
}
}
switch ((int) mode.getInput()) {
case 0:
if (Utils.isMoving()) {
if (mc.thePlayer.onGround) {
mc.thePlayer.jump();
}
mc.thePlayer.setSprinting(true);
Utils.setSpeed(Utils.getHorizontalSpeed() + 0.005 * speedSetting.getInput());
hopping = true;
break;
}
break;
case 1:
break;
case 2:
if (mode.getInput() == 2 && didMove) {
int simpleY = (int) Math.round((e.posY % 1) * 10000);
if (mc.thePlayer.hurtTime == 0 && !collided) {
switch (simpleY) {
case 13:
mc.thePlayer.motionY = mc.thePlayer.motionY - 0.02483;
break;
case 2000:
mc.thePlayer.motionY = mc.thePlayer.motionY - 0.1913;
didMove = false;
break;
}
}
}
break;
case 3:
if (mode.getInput() == 3 && didMove) {
int simpleY = (int) Math.round((e.posY % 1) * 10000);
if (mc.thePlayer.hurtTime == 0 && !collided) {
switch (simpleY) {
case 4200:
mc.thePlayer.motionY = 0.39;
lowhop = true;
break;
case 1138:
mc.thePlayer.motionY = mc.thePlayer.motionY - 0.13;
lowhop = false;
break;
case 2031:
mc.thePlayer.motionY = mc.thePlayer.motionY - 0.2;
didMove = false;
break;
}
}
}
break;
}
}
public void onDisable() {
hopping = false;
}
}

View File

@ -0,0 +1,56 @@
package keystrokesmod.module.impl.movement;
import keystrokesmod.module.Module;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.Utils;
public class Boost extends Module {
public static DescriptionSetting c;
public static SliderSetting a;
public static SliderSetting b;
private int i = 0;
private boolean t = false;
public Boost() {
super("Boost", Module.category.movement, 0);
this.registerSetting(c = new DescriptionSetting("20 ticks are in 1 second"));
this.registerSetting(a = new SliderSetting("Multiplier", 2.0D, 1.0D, 3.0D, 0.05D));
this.registerSetting(b = new SliderSetting("Time (ticks)", 15.0D, 1.0D, 80.0D, 1.0D));
}
public void onEnable() {
if (ModuleManager.timer.isEnabled()) {
this.t = true;
ModuleManager.timer.disable();
}
}
public void onDisable() {
this.i = 0;
if (Utils.getTimer().timerSpeed != 1.0F) {
Utils.resetTimer();
}
if (this.t) {
ModuleManager.timer.enable();
}
this.t = false;
}
public void onUpdate() {
if (this.i == 0) {
this.i = mc.thePlayer.ticksExisted;
}
Utils.getTimer().timerSpeed = (float) a.getInput();
if ((double) this.i == (double) mc.thePlayer.ticksExisted - b.getInput()) {
Utils.resetTimer();
this.disable();
}
}
}

View File

@ -0,0 +1,150 @@
package keystrokesmod.module.impl.movement;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.RenderUtils;
import keystrokesmod.utility.Utils;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import org.apache.commons.lang3.RandomUtils;
public class Fly extends Module {
private SliderSetting mode;
public static SliderSetting horizontalSpeed;
private SliderSetting verticalSpeed;
private ButtonSetting showBPS;
private ButtonSetting stopMotion;
private boolean d;
private boolean a = false;
private String[] modes = new String[]{"Vanilla", "Fast", "Fast 2"};
public Fly() {
super("Fly", category.movement);
this.registerSetting(mode = new SliderSetting("Fly", 0, modes));
this.registerSetting(horizontalSpeed = new SliderSetting("Horizontal speed", 2.0, 1.0, 9.0, 0.1));
this.registerSetting(verticalSpeed = new SliderSetting("Vertical speed", 2.0, 1.0, 9.0, 0.1));
this.registerSetting(showBPS = new ButtonSetting("Show BPS", false));
this.registerSetting(stopMotion = new ButtonSetting("Stop motion", false));
}
public void onEnable() {
this.d = mc.thePlayer.capabilities.isFlying;
}
public void onUpdate() {
switch ((int) mode.getInput()) {
case 0:
mc.thePlayer.motionY = 0.0;
mc.thePlayer.capabilities.setFlySpeed((float)(0.05000000074505806 * horizontalSpeed.getInput()));
mc.thePlayer.capabilities.isFlying = true;
break;
case 1:
mc.thePlayer.onGround = true;
if (mc.currentScreen == null) {
if (Utils.jumpDown()) {
mc.thePlayer.motionY = 0.3 * verticalSpeed.getInput();
}
else if (Utils.jumpDown()) {
mc.thePlayer.motionY = -0.3 * verticalSpeed.getInput();
}
else {
mc.thePlayer.motionY = 0.0;
}
}
else {
mc.thePlayer.motionY = 0.0;
}
mc.thePlayer.capabilities.setFlySpeed(0.2f);
mc.thePlayer.capabilities.isFlying = true;
setSpeed(0.85 * horizontalSpeed.getInput());
break;
case 2:
double nextDouble = RandomUtils.nextDouble(1.0E-7, 1.2E-7);
if (mc.thePlayer.ticksExisted % 2 == 0) {
nextDouble = -nextDouble;
}
if (!mc.thePlayer.onGround) {
mc.thePlayer.setPosition(mc.thePlayer.posX, mc.thePlayer.posY + nextDouble, mc.thePlayer.posZ);
}
mc.thePlayer.motionY = 0.0;
setSpeed(0.4 * horizontalSpeed.getInput());
break;
}
}
public void onDisable() {
if (mc.thePlayer.capabilities.allowFlying) {
mc.thePlayer.capabilities.isFlying = this.d;
}
else {
mc.thePlayer.capabilities.isFlying = false;
}
this.d = false;
switch ((int) mode.getInput()) {
case 0:
case 1: {
mc.thePlayer.capabilities.setFlySpeed(0.05F);
break;
}
case 2: {
a = false;
break;
}
}
if (stopMotion.isToggled()) {
mc.thePlayer.motionZ = 0;
mc.thePlayer.motionY = 0;
mc.thePlayer.motionX = 0;
}
}
@SubscribeEvent
public void onRenderTick(TickEvent.RenderTickEvent e) {
if (!showBPS.isToggled() || e.phase != TickEvent.Phase.END || !Utils.nullCheck()) {
return;
}
if (mc.currentScreen != null || mc.gameSettings.showDebugInfo) {
return;
}
RenderUtils.renderBPS(true, false);
}
public static void setSpeed(final double n) {
if (n == 0.0) {
mc.thePlayer.motionZ = 0;
mc.thePlayer.motionX = 0;
return;
}
double n3 = mc.thePlayer.movementInput.moveForward;
double n4 = mc.thePlayer.movementInput.moveStrafe;
float rotationYaw = mc.thePlayer.rotationYaw;
if (n3 == 0.0 && n4 == 0.0) {
mc.thePlayer.motionZ = 0;
mc.thePlayer.motionX = 0;
}
else {
if (n3 != 0.0) {
if (n4 > 0.0) {
rotationYaw += ((n3 > 0.0) ? -45 : 45);
}
else if (n4 < 0.0) {
rotationYaw += ((n3 > 0.0) ? 45 : -45);
}
n4 = 0.0;
if (n3 > 0.0) {
n3 = 1.0;
}
else if (n3 < 0.0) {
n3 = -1.0;
}
}
final double radians = Math.toRadians(rotationYaw + 90.0f);
final double sin = Math.sin(radians);
final double cos = Math.cos(radians);
mc.thePlayer.motionX = n3 * n * cos + n4 * n * sin;
mc.thePlayer.motionZ = n3 * n * sin - n4 * n * cos;
}
}
}

View File

@ -0,0 +1,131 @@
package keystrokesmod.module.impl.movement;
import keystrokesmod.clickgui.ClickGui;
import net.minecraft.client.gui.GuiChat;
import keystrokesmod.event.JumpEvent;
import keystrokesmod.event.PreUpdateEvent;
import keystrokesmod.event.SendPacketEvent;
import keystrokesmod.module.Module;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.impl.client.Settings;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.PacketUtils;
import keystrokesmod.utility.Utils;
import net.minecraft.client.gui.GuiChat;
import net.minecraft.client.gui.inventory.GuiInventory;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.C0DPacketCloseWindow;
import net.minecraft.network.play.client.C0EPacketClickWindow;
import net.minecraft.network.play.client.C16PacketClientStatus;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.lwjgl.input.Keyboard;
import java.util.concurrent.ConcurrentLinkedQueue;
public class InvMove extends Module {
private SliderSetting modes;
private int ticks;
private boolean stopMoving;
private String[] modesString = new String[] { "Vanilla", "Stop movement" };
public InvMove() {
super("InvMove", Module.category.movement);
this.registerSetting(modes = new SliderSetting("Modes", 1, modesString));
}
public void onDisable() {
reset();
}
@SubscribeEvent
public void onSendPacket(SendPacketEvent e) {
if (e.getPacket() instanceof C0EPacketClickWindow) {
if (modes.getInput() == 1) {
stopMoving = true;
ticks = 0;
}
}
}
@SubscribeEvent
public void onPreUpdate(PreUpdateEvent e) {
if (!guiCheck()) {
reset();
return;
}
allowBinds(true);
if (modes.getInput() == 1) {
if (!(mc.currentScreen instanceof ClickGui)) {
if (stopMoving) {
ticks++;
allowBinds(false);
if (ticks >= 9) {
ticks = 0;
stopMoving = false;
}
}
} else {
reset();
}
}
boolean foodLvlMet = (float)mc.thePlayer.getFoodStats().getFoodLevel() > 6.0F || mc.thePlayer.capabilities.allowFlying; // from mc
if (((Keyboard.isKeyDown(mc.gameSettings.keyBindSprint.getKeyCode()) || ModuleManager.sprint.isEnabled()) && mc.thePlayer.movementInput.moveForward >= 0.8F && foodLvlMet && !mc.thePlayer.isSprinting())) {
mc.thePlayer.setSprinting(true);
}
if (Keyboard.isKeyDown(208) && mc.thePlayer.rotationPitch < 90.0F) {
mc.thePlayer.rotationPitch += 6.0F;
}
if (Keyboard.isKeyDown(200) && mc.thePlayer.rotationPitch > -90.0F) {
mc.thePlayer.rotationPitch -= 6.0F;
}
if (Keyboard.isKeyDown(205)) {
mc.thePlayer.rotationYaw += 6.0F;
}
if (Keyboard.isKeyDown(203)) {
mc.thePlayer.rotationYaw -= 6.0F;
}
}
private void reset() {
ticks = 0;
stopMoving = false;
}
private boolean guiCheck() {
//Utils.sendModuleMessage(this, "&7screen " + mc.currentScreen);
if (mc.currentScreen == null) {
return false;
}
if (mc.currentScreen instanceof ClickGui) {
return true;
}
if (mc.currentScreen instanceof GuiChat) {
return false;
}
return true;
}
private void allowBinds(boolean allowKeys) {
if (allowKeys) {
KeyBinding.setKeyBindState(mc.gameSettings.keyBindForward.getKeyCode(), Keyboard.isKeyDown(mc.gameSettings.keyBindForward.getKeyCode()));
KeyBinding.setKeyBindState(mc.gameSettings.keyBindBack.getKeyCode(), Keyboard.isKeyDown(mc.gameSettings.keyBindBack.getKeyCode()));
KeyBinding.setKeyBindState(mc.gameSettings.keyBindRight.getKeyCode(), Keyboard.isKeyDown(mc.gameSettings.keyBindRight.getKeyCode()));
KeyBinding.setKeyBindState(mc.gameSettings.keyBindLeft.getKeyCode(), Keyboard.isKeyDown(mc.gameSettings.keyBindLeft.getKeyCode()));
KeyBinding.setKeyBindState(mc.gameSettings.keyBindJump.getKeyCode(), Utils.jumpDown());
KeyBinding.setKeyBindState(mc.gameSettings.keyBindSprint.getKeyCode(), Keyboard.isKeyDown(mc.gameSettings.keyBindSprint.getKeyCode()));
} else {
KeyBinding.setKeyBindState(mc.gameSettings.keyBindForward.getKeyCode(),false);
KeyBinding.setKeyBindState(mc.gameSettings.keyBindBack.getKeyCode(), false);
KeyBinding.setKeyBindState(mc.gameSettings.keyBindRight.getKeyCode(),false);
KeyBinding.setKeyBindState(mc.gameSettings.keyBindLeft.getKeyCode(),false);
KeyBinding.setKeyBindState(mc.gameSettings.keyBindJump.getKeyCode(),false);
KeyBinding.setKeyBindState(mc.gameSettings.keyBindSprint.getKeyCode(),false);
}
}
}

View File

@ -0,0 +1,53 @@
package keystrokesmod.module.impl.movement;
import keystrokesmod.module.Module;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.impl.combat.KillAura;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import net.minecraft.entity.Entity;
import net.minecraft.util.Vec3;
public class KeepSprint extends Module {
private DescriptionSetting description;
public static SliderSetting slow;
public static ButtonSetting disableWhileJump;
public static ButtonSetting reduceReachHits;
public KeepSprint() {
super("KeepSprint", Module.category.movement, 0);
this.registerSetting(new DescriptionSetting(new String("Default is 40% motion reduction.")));
this.registerSetting(slow = new SliderSetting("Slow %", 40.0D, 0.0D, 40.0D, 1.0D));
this.registerSetting(disableWhileJump = new ButtonSetting("Disable while jumping", false));
this.registerSetting(reduceReachHits = new ButtonSetting("Only reduce reach hits", false));
}
public static void keepSprint(Entity en) {
boolean vanilla = false;
if (disableWhileJump.isToggled() && !mc.thePlayer.onGround) {
vanilla = true;
}
else if (reduceReachHits.isToggled() && !mc.thePlayer.capabilities.isCreativeMode) {
double n = -1.0;
final Vec3 getPositionEyes = mc.thePlayer.getPositionEyes(1.0f);
if (ModuleManager.killAura != null && ModuleManager.killAura.isEnabled() && KillAura.target != null) {
n = getPositionEyes.distanceTo(KillAura.target.getPositionEyes(1.0f));
}
else if (ModuleManager.reach != null && ModuleManager.reach.isEnabled()) {
n = getPositionEyes.distanceTo(mc.objectMouseOver.hitVec);
}
if (n != -1.0 && n <= 3.0) {
vanilla = true;
}
}
if (vanilla) {
mc.thePlayer.motionX *= 0.6;
mc.thePlayer.motionZ *= 0.6;
} else {
float n2 = (100.0f - (float) slow.getInput()) / 100.0f;
mc.thePlayer.motionX *= n2;
mc.thePlayer.motionZ *= n2;
}
}
}

View File

@ -0,0 +1,431 @@
package keystrokesmod.module.impl.movement;
import keystrokesmod.event.PrePlayerInputEvent;
import keystrokesmod.event.*;
import keystrokesmod.module.Module;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.Reflection;
import keystrokesmod.utility.Utils;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.*;
import net.minecraft.potion.PotionEffect;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
public class LongJump extends Module {
private SliderSetting boostSetting;
private SliderSetting motionTicks;
private SliderSetting verticalMotion;
private SliderSetting motionDecay;
private ButtonSetting allowStrafe;
private ButtonSetting invertYaw;
private ButtonSetting stopMovement;
private ButtonSetting hideExplosion;
private SliderSetting temporaryFlightKey;
private SliderSetting pitchVal;
private float yaw;
private float pitch;
private boolean notMoving;
private boolean enabled;
private int boostTicks;
private int lastSlot = -1;
private int stopTime;
private int rotateTick;
private int motionDecayVal;
private long fireballTime;
private long MAX_EXPLOSION_DIST_SQ = 9;
private long FIREBALL_TIMEOUT = 750L;
public static boolean stopVelocity;
public static boolean stopKillAura;
public static boolean stopScaffold;
public static boolean slotReset;
public static int slotResetTicks;
private String[] modes = new String[]{"Fireball", "Fireball Auto"};
public LongJump() {
super("Long Jump", category.movement);
this.registerSetting(boostSetting = new SliderSetting("Horizontal boost", 1.7, 0.0, 2.0, 0.1));
this.registerSetting(verticalMotion = new SliderSetting("Vertical motion", 0, 0.4, 0.9, 0.01));
this.registerSetting(motionDecay = new SliderSetting("Motion decay", 17, 1, 40, 1));
this.registerSetting(allowStrafe = new ButtonSetting("Allow strafe", false));
this.registerSetting(invertYaw = new ButtonSetting("Invert yaw", true));
this.registerSetting(stopMovement = new ButtonSetting("Stop movement", false));
this.registerSetting(hideExplosion = new ButtonSetting("Hide explosion", false));
this.registerSetting(temporaryFlightKey = new SliderSetting("Vertical key", 91, keyNames));
//this.registerSetting(new DescriptionSetting("Dev:"));
//this.registerSetting(pitchVal = new SliderSetting("Stop movement Pitch", 55, 55, 80, 0.1));
}
String[] keyNames = {
"LMB", "RMB", "MMB",
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
"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",
"BACK", "CAPITAL", "COMMA", "DELETE", "DOWN", "END", "ESCAPE", "F1", "F2", "F3", "F4", "F5",
"F6", "F7", "HOME", "INSERT", "LBRACKET", "LCONTROL", "LMENU", "LMETA", "LSHIFT", "MINUS",
"NUMPAD0", "NUMPAD1", "NUMPAD2", "NUMPAD3", "NUMPAD4", "NUMPAD5", "NUMPAD6", "NUMPAD7",
"NUMPAD8", "NUMPAD9", "PERIOD", "RETURN", "RCONTROL", "RSHIFT", "RBRACKET", "SEMICOLON",
"SLASH", "SPACE", "TAB", "GRAVE"
};
public void onEnable() {
slotReset = false;
slotResetTicks = 0;
enabled = true;
ModuleManager.bhop.disable();
stopKillAura = true;
stopScaffold = true;
}
public void onDisable() {
fireballTime = rotateTick = stopTime = 0;
boostTicks = -1;
resetSlot();
enabled = notMoving = stopVelocity = false;
}
/*public boolean onChat(String chatMessage) {
String msg = util.strip(chatMessage);
if (msg.equals("Build height limit reached!")) {
client.print("fb fly build height");
modules.disable(scriptName);
return false;
}
return true;
}*/
@SubscribeEvent
public void onPreUpdate(PreUpdateEvent e) {
if (enabled) {
if (!Utils.isMoving()) notMoving = true;
if (boostSetting.getInput() == 0 && verticalMotion.getInput() == 0) {
Utils.print("&cValues are set to 0!");
disable();
return;
}
int fireballSlot = setupFireballSlot(true);
if (fireballSlot != -1) {
lastSlot = mc.thePlayer.inventory.currentItem;
mc.thePlayer.inventory.currentItem = fireballSlot;
//("Set fireball slot");
rotateTick = 1;
if (stopMovement.isToggled()) {
stopTime = 1;
}
} // auto disables if -1
enabled = false;
}
if (notMoving) {
motionDecayVal = 21;
} else {
motionDecayVal = (int) motionDecay.getInput();
}
if (stopTime == -1 && ++boostTicks > (!temporaryFlightKey() ? 33/*flat motion ticks*/ : (!notMoving ? 32/*normal motion ticks*/ : 33/*vertical motion ticks*/))) {
disable();
return;
}
if (fireballTime > 0 && (System.currentTimeMillis() - fireballTime) > FIREBALL_TIMEOUT) {
Utils.print("&cFireball timed out.");
disable();
return;
}
if (boostTicks > 0) {
modifyVertical(); // has to be onPreUpdate
//Utils.print("Modifying vertical");
if (allowStrafe.isToggled()) {
Utils.setSpeed(Utils.getHorizontalSpeed(mc.thePlayer));
//Utils.print("Speed");
}
}
if (stopMovement.isToggled() && !notMoving) {
if (stopTime > 0) {
++stopTime;
}
}
}
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onPreMotion(PreMotionEvent e) {
if (!Utils.nullCheck()) {
return;
}
if (rotateTick > 0) {
if ((invertYaw.isToggled() || stopMovement.isToggled()) && !notMoving) {
if (!stopMovement.isToggled()) {
if (rotateTick == 1) {
yaw = mc.thePlayer.rotationYaw - 180f;
pitch = 90f;
}
} else {
if (rotateTick == 1) {
yaw = mc.thePlayer.rotationYaw - 180f;
pitch = 66.3f;//(float) pitchVal.getInput();
}
}
} else {
if (rotateTick == 1) {
yaw = mc.thePlayer.rotationYaw;
pitch = 90f;
}
}
if (rotateTick > 1) {
yaw = mc.thePlayer.rotationYaw;
pitch = mc.thePlayer.rotationPitch;
}
e.setYaw(yaw);
e.setPitch(pitch);
}
if (rotateTick > 0 && ++rotateTick >= 3) {
rotateTick = 0;
int fireballSlot = setupFireballSlot(false);
if (fireballSlot != -1) {
mc.thePlayer.inventory.currentItem = fireballSlot; // we are probably already on the slot but make sure
fireballTime = System.currentTimeMillis();
Reflection.rightClick();
stopVelocity = true;
//Utils.print("Right click");
}
}
if (boostTicks == 1) {
if (invertYaw.isToggled()) {
//client.setMotion(client.getMotion().x, client.getMotion().y + 0.035d, client.getMotion().z);
}
modifyHorizontal();
stopVelocity = false;
}
}
@SubscribeEvent(priority = EventPriority.LOWEST) // called last in order to apply fix
public void onMoveInput(PrePlayerInputEvent e) {
mc.thePlayer.movementInput.jump = false;
if (rotateTick > 0 || fireballTime > 0) {
if (Utils.isMoving()) e.setForward(1);
e.setStrafe(0);
}
if (notMoving && boostTicks < 3) {
e.setForward(0);
e.setStrafe(0);
Utils.setSpeed(0);
}
if (stopMovement.isToggled() && !notMoving && stopTime >= 1) {
e.setForward(0);
e.setStrafe(0);
Utils.setSpeed(0);
}
}
@SubscribeEvent
public void onReceivePacket(ReceivePacketEvent e) {
Packet packet = e.getPacket();
if (packet instanceof S27PacketExplosion) {
S27PacketExplosion s27 = (S27PacketExplosion) packet;
if (fireballTime == 0 || mc.thePlayer.getPosition().distanceSq(s27.getX(), s27.getY(), s27.getZ()) > MAX_EXPLOSION_DIST_SQ) {
e.setCanceled(true);
//Utils.print("0 fb time / out of dist");
}
stopTime = -1;
fireballTime = 0;
resetSlot();
boostTicks = 0; // +1 on next pre update
//Utils.print("set start vals");
//client.print(client.getPlayer().getTicksExisted() + " s27 " + boostTicks + " " + client.getPlayer().getHurtTime() + " " + client.getPlayer().getSpeed());
} else if (packet instanceof S08PacketPlayerPosLook) {
Utils.print("&cReceived setback, disabling.");
disable();
}
if (hideExplosion.isToggled() && fireballTime != 0 && (packet instanceof S0EPacketSpawnObject || packet instanceof S2APacketParticles || packet instanceof S29PacketSoundEffect)) {
e.setCanceled(true);
}
}
private int getFireballSlot() {
int n = -1;
for (int i = 0; i < 9; ++i) {
final ItemStack getStackInSlot = mc.thePlayer.inventory.getStackInSlot(i);
if (getStackInSlot != null && getStackInSlot.getItem() == Items.fire_charge) {
n = i;
break;
}
}
return n;
}
private int setupFireballSlot(boolean pre) {
// only cancel bad packet right click on the tick we are sending it
int fireballSlot = getFireballSlot();
if (fireballSlot == -1) {
Utils.print("&cFireball not found.");
disable();
} else if (ModuleManager.scaffold.isEnabled || (pre && Utils.distanceToGround(mc.thePlayer) > 3)/* || (!pre && !PacketUtil.canRightClickItem())*/) { //needs porting
Utils.print("&cCan't throw fireball right now.");
disable();
fireballSlot = -1;
}
return fireballSlot;
}
private void resetSlot() {
if (lastSlot != -1) {
mc.thePlayer.inventory.currentItem = lastSlot;
lastSlot = -1;
}
slotReset = true;
}
private int getSpeedLevel() {
for (PotionEffect potionEffect : mc.thePlayer.getActivePotionEffects()) {
if (potionEffect.getEffectName().equals("potion.moveSpeed")) {
return potionEffect.getAmplifier() + 1;
}
return 0;
}
return 0;
}
// only apply horizontal boost once
void modifyHorizontal() {
if (boostSetting.getInput() != 0) {
//client.print("&7horizontal &b" + boostTicks + " " + client.getPlayer().getHurtTime());
double speed = boostSetting.getInput() - Utils.randomizeDouble(0.0001, 0);
if (Utils.isMoving()) {
Utils.setSpeed(speed);
//Utils.print("og speed");
}
}
}
private void modifyVertical() {
if (verticalMotion.getInput() != 0) {
double ver = ((!notMoving ? verticalMotion.getInput() : 1.16 /*vertical*/) * (1.0 / (1.0 + (0.05 * getSpeedLevel())))) + Utils.randomizeDouble(0.0001, 0.1);
double decay = motionDecay.getInput() / 1000;
if (boostTicks > 1 && !temporaryFlightKey()) {
if (boostTicks > 1 || boostTicks <= (!notMoving ? 32/*horizontal motion ticks*/ : 33/*vertical motion ticks*/)) {
mc.thePlayer.motionY = Utils.randomizeDouble(0.0101, 0.01);
}
} else {
if (boostTicks >= 1 && boostTicks <= (!notMoving ? 32/*horizontal motion ticks*/ : 33/*vertical motion ticks*/)) {
mc.thePlayer.motionY = ver - boostTicks * decay;
} else if (boostTicks >= (!notMoving ? 32/*horizontal motion ticks*/ : 33/*vertical motion ticks*/) + 3) {
mc.thePlayer.motionY = mc.thePlayer.motionY + 0.028;
Utils.print("?");
}
}
}
}
private boolean temporaryFlightKey() {
if (notMoving) return true;
if (temporaryFlightKey.getInput() > 2) {
return Utils.keybinds.isKeyDown(getKeyCode(keyNames[(int) temporaryFlightKey.getInput()]));
} else {
return Utils.keybinds.isMouseDown((int) temporaryFlightKey.getInput());
}
}
private int getKeyCode(String keyName) {
switch (keyName) {
case "0": return 11;
case "1": return 2;
case "2": return 3;
case "3": return 4;
case "4": return 5;
case "5": return 6;
case "6": return 7;
case "7": return 8;
case "8": return 9;
case "9": return 10;
case "A": return 30;
case "B": return 48;
case "C": return 46;
case "D": return 32;
case "E": return 18;
case "F": return 33;
case "G": return 34;
case "H": return 35;
case "I": return 23;
case "J": return 36;
case "K": return 37;
case "L": return 38;
case "M": return 50;
case "N": return 49;
case "O": return 24;
case "P": return 25;
case "Q": return 16;
case "R": return 19;
case "S": return 31;
case "T": return 20;
case "U": return 22;
case "V": return 47;
case "W": return 17;
case "X": return 45;
case "Y": return 21;
case "Z": return 44;
case "BACK": return 14;
case "CAPITAL": return 58;
case "COMMA": return 51;
case "DELETE": return 211;
case "DOWN": return 208;
case "END": return 207;
case "ESCAPE": return 1;
case "F1": return 59;
case "F2": return 60;
case "F3": return 61;
case "F4": return 62;
case "F5": return 63;
case "F6": return 64;
case "F7": return 65;
case "HOME": return 199;
case "INSERT": return 210;
case "LBRACKET": return 26;
case "LCONTROL": return 29;
case "LMENU": return 56;
case "LMETA": return 219;
case "LSHIFT": return 42;
case "MINUS": return 12;
case "NUMPAD0": return 82;
case "NUMPAD1": return 79;
case "NUMPAD2": return 80;
case "NUMPAD3": return 81;
case "NUMPAD4": return 75;
case "NUMPAD5": return 76;
case "NUMPAD6": return 77;
case "NUMPAD7": return 71;
case "NUMPAD8": return 72;
case "NUMPAD9": return 73;
case "PERIOD": return 52;
case "RETURN": return 28;
case "RCONTROL": return 157;
case "RSHIFT": return 54;
case "RBRACKET": return 27;
case "SEMICOLON": return 39;
case "SLASH": return 53;
case "SPACE": return 57;
case "TAB": return 15;
case "GRAVE": return 41;
default: return -1;
}
}
}

View File

@ -0,0 +1,256 @@
package keystrokesmod.module.impl.movement;
import keystrokesmod.Raven;
import keystrokesmod.event.*;
import keystrokesmod.module.Module;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.BlockUtils;
import keystrokesmod.utility.Reflection;
import keystrokesmod.utility.Utils;
import net.minecraft.item.*;
import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement;
import net.minecraft.util.BlockPos;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.lwjgl.input.Mouse;
public class NoSlow extends Module {
public static SliderSetting mode;
public static SliderSetting slowed;
public static ButtonSetting disableBow;
public static ButtonSetting disablePotions;
public static ButtonSetting swordOnly;
public static ButtonSetting vanillaSword;
public static ButtonSetting groundSpeedOption;
private String[] modes = new String[]{"Vanilla", "Pre", "Post", "Alpha", "Float"};
private boolean postPlace;
private boolean canFloat;
private boolean reSendConsume;
private boolean setRotation;
public static boolean noSlowing;
public NoSlow() {
super("NoSlow", category.movement, 0);
this.registerSetting(new DescriptionSetting("Default is 80% motion reduction."));
this.registerSetting(mode = new SliderSetting("Mode", 0, modes));
this.registerSetting(slowed = new SliderSetting("Slow %", 80.0D, 0.0D, 80.0D, 1.0D));
this.registerSetting(disableBow = new ButtonSetting("Disable bow", false));
this.registerSetting(disablePotions = new ButtonSetting("Disable potions", false));
this.registerSetting(swordOnly = new ButtonSetting("Sword only", false));
this.registerSetting(vanillaSword = new ButtonSetting("Vanilla sword", false));
this.registerSetting(groundSpeedOption = new ButtonSetting("Ground Speed", false));
}
@Override
public void onDisable() {
resetFloat();
}
public void onUpdate() {
if (ModuleManager.bedAura.stopAutoblock) {
return;
}
postPlace = false;
if (vanillaSword.isToggled() && Utils.holdingSword()) {
return;
}
boolean apply = getSlowed() != 0.2f;
if (!apply || !mc.thePlayer.isUsingItem()) {
return;
}
switch ((int) mode.getInput()) {
case 1:
if (mc.thePlayer.ticksExisted % 3 == 0 && !Raven.packetsHandler.C07.get()) {
mc.thePlayer.sendQueue.addToSendQueue(new C08PacketPlayerBlockPlacement(mc.thePlayer.getHeldItem()));
}
break;
case 2:
postPlace = true;
break;
case 3:
if (mc.thePlayer.ticksExisted % 3 == 0 && !Raven.packetsHandler.C07.get()) {
mc.thePlayer.sendQueue.addToSendQueue(new C08PacketPlayerBlockPlacement(new BlockPos(-1, -1, -1), 1, null, 0, 0, 0));
}
break;
case 4:
if (reSendConsume) {
if (mc.thePlayer.onGround) {
mc.thePlayer.jump();
break;
} else {
mc.playerController.sendUseItem(mc.thePlayer, mc.theWorld, mc.thePlayer.getHeldItem());
canFloat = true;
reSendConsume = false;
}
}
break;
}
}
@SubscribeEvent
public void onPostMotion(PostMotionEvent e) {
if (postPlace && mode.getInput() == 2) {
if (mc.thePlayer.ticksExisted % 3 == 0 && !Raven.packetsHandler.C07.get()) {
mc.thePlayer.sendQueue.addToSendQueue(new C08PacketPlayerBlockPlacement(mc.thePlayer.getHeldItem()));
}
postPlace = false;
}
}
@SubscribeEvent
public void onPostPlayerInput(PostPlayerInputEvent e) {
if ((canFloat && mc.thePlayer.onGround)) {
if (groundSpeedOption.isToggled() && !Utils.jumpDown() && !ModuleManager.bhop.isEnabled() && Utils.isMoving() && !Utils.bowBackwards()) {
Utils.setSpeed(getSpeedModifier());
}
}
}
@SubscribeEvent
public void onPreMotion(PreMotionEvent e) {
if (ModuleManager.bedAura.stopAutoblock || mode.getInput() != 4) {
resetFloat();
return;
}
postPlace = false;
if (!Mouse.isButtonDown(1)) {
resetFloat();
noSlowing = false;
//Utils.print("!Noslowing");
return;
}
if (!canFloat) {
return;
}
if (canFloat) {
e.setPosY(e.getPosY() + 1E-14);
noSlowing = true;
//Utils.print("Noslowing");
}
if (mc.thePlayer.onGround) {
if (mc.thePlayer.moveStrafing == 0 && mc.thePlayer.moveForward <= 0 && Utils.isMoving()) {
setRotation = true;
} else {
setRotation = false;
}
}
if (Utils.noSlowingBackWithBow()) setRotation = false;
if (groundSpeedOption.isToggled()) {
if (setRotation) {
if (!ModuleManager.killAura.isTargeting && !Utils.noSlowingBackWithBow()) {
float playerYaw = mc.thePlayer.rotationYaw;
e.setYaw(playerYaw -= 55);
}
}
}
}
@SubscribeEvent
public void onPacketSend(SendPacketEvent e) {
if (e.getPacket() instanceof C08PacketPlayerBlockPlacement && mode.getInput() == 4 && getSlowed() != 0.2f && holdingConsumable(((C08PacketPlayerBlockPlacement) e.getPacket()).getStack()) && !BlockUtils.isInteractable(mc.objectMouseOver) && holdingEdible(((C08PacketPlayerBlockPlacement) e.getPacket()).getStack())) {
if (ModuleManager.skyWars.isEnabled() && Utils.getSkyWarsStatus() == 1) {
return;
}
if (!canFloat) {
if (!mc.thePlayer.onGround) {
canFloat = true;
} else {
if (mc.thePlayer.onGround) {
mc.thePlayer.jump();
}
reSendConsume = true;
e.setCanceled(true);
}
}
}
}
@SubscribeEvent
public void onJump(JumpEvent e) {
if (reSendConsume) {
e.setSprint(false);
}
}
public static float getSlowed() {
if (mc.thePlayer.getHeldItem() == null || ModuleManager.noSlow == null || !ModuleManager.noSlow.isEnabled()) {
return 0.2f;
}
else {
if (swordOnly.isToggled() && !(mc.thePlayer.getHeldItem().getItem() instanceof ItemSword)) {
return 0.2f;
}
if (mc.thePlayer.getHeldItem().getItem() instanceof ItemBow && disableBow.isToggled()) {
return 0.2f;
}
else if (mc.thePlayer.getHeldItem().getItem() instanceof ItemPotion && !ItemPotion.isSplash(mc.thePlayer.getHeldItem().getItemDamage()) && disablePotions.isToggled()) {
return 0.2f;
}
}
float val = (100.0F - (float) slowed.getInput()) / 100.0F;
return val;
}
public static boolean groundSpeed() {
return groundSpeedOption.isToggled() && noSlowing;
}
@Override
public String getInfo() {
return modes[(int) mode.getInput()];
}
private void resetFloat() {
reSendConsume = false;
canFloat = setRotation = false;
}
private double getSpeedModifier() {
double speedModifier = 0.2;
final int speedAmplifier = Utils.getSpeedAmplifier();
switch (speedAmplifier) {
case 0:
speedModifier = 0.2;
break;
case 1:
speedModifier = 0.23;
break;
case 2:
speedModifier = 0.28;
break;
case 3:
speedModifier = 0.32;
break;
case 4:
speedModifier = 0.37;
break;
}
return speedModifier;
}
private boolean holdingConsumable(ItemStack itemStack) {
Item heldItem = itemStack.getItem();
if (heldItem instanceof ItemFood || heldItem instanceof ItemBow || (heldItem instanceof ItemPotion && !ItemPotion.isSplash(mc.thePlayer.getHeldItem().getItemDamage())) || (heldItem instanceof ItemSword && !vanillaSword.isToggled())) {
return true;
}
return false;
}
private boolean holdingEdible(ItemStack stack) {
if (stack.getItem() instanceof ItemFood && mc.thePlayer.getFoodStats().getFoodLevel() == 20) {
ItemFood food = (ItemFood) stack.getItem();
boolean alwaysEdible = false;
try {
alwaysEdible = Reflection.alwaysEdible.getBoolean(food);
}
catch (Exception e) {
Utils.sendMessage("&cError checking food edibility, check logs.");
e.printStackTrace();
}
return alwaysEdible;
}
return true;
}
}

View File

@ -0,0 +1,33 @@
package keystrokesmod.module.impl.movement;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.Utils;
public class Speed extends Module {
public static SliderSetting speed;
private ButtonSetting strafeOnly;
public Speed() {
super("Speed", Module.category.movement, 0);
this.registerSetting(speed = new SliderSetting("Speed", 1.2D, 1.0D, 1.5D, 0.01D));
this.registerSetting(strafeOnly = new ButtonSetting("Strafe only", false));
}
public void onUpdate() {
double csp = Utils.getHorizontalSpeed();
if (csp != 0.0D) {
if (mc.thePlayer.onGround && !mc.thePlayer.capabilities.isFlying) {
if (!strafeOnly.isToggled() || mc.thePlayer.moveStrafing != 0.0F) {
if (mc.thePlayer.hurtTime != mc.thePlayer.maxHurtTime || mc.thePlayer.maxHurtTime <= 0) {
if (!Utils.jumpDown()) {
double val = speed.getInput() - (speed.getInput() - 1.0D) * 0.5D;
Utils.ss(csp * val, true);
}
}
}
}
}
}
}

View File

@ -0,0 +1,178 @@
package keystrokesmod.module.impl.movement;
import keystrokesmod.event.PreMotionEvent;
import keystrokesmod.module.Module;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.RenderUtils;
import keystrokesmod.utility.Utils;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.settings.KeyBinding;
import net.minecraftforge.fml.client.config.GuiButtonExt;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import java.io.IOException;
public class Sprint extends Module {
private ButtonSetting displayText;
private ButtonSetting rainbow;
public SliderSetting omniDirectional;
public String text = "[Sprint (Toggled)]";
public float posX = 5;
public float posY = 5;
private String[] omniDirectionalModes = new String[] { "Disabled", "Vanilla", "Hypixel" };
public Sprint() {
super("Sprint", category.movement, 0);
this.registerSetting(new DescriptionSetting("Command: '§esprint [msg]§r'"));
this.registerSetting(new ButtonSetting("Edit text position", () -> {
mc.displayGuiScreen(new EditScreen());
}));
this.registerSetting(displayText = new ButtonSetting("Display text", false));
this.registerSetting(rainbow = new ButtonSetting("Rainbow", false));
this.registerSetting(omniDirectional = new SliderSetting("Omni-Directional", 0, omniDirectionalModes));
this.closetModule = true;
}
@SubscribeEvent
public void onPreMotion(PreMotionEvent e) {
if (Utils.noSlowingBackWithBow()) {
ModuleManager.bhop.setRotation = false;
return;
}
if (ModuleManager.sprint.isEnabled() && ModuleManager.sprint.omniDirectional.getInput() == 2) {
if (mc.thePlayer.onGround && mc.thePlayer.moveStrafing == 0 && mc.thePlayer.moveForward <= -0.5 && !Utils.jumpDown()) {
if (!ModuleManager.killAura.isTargeting && !Utils.noSlowingBackWithBow() && !ModuleManager.safeWalk.canSafeWalk()) {
float playerYaw = mc.thePlayer.rotationYaw;
e.setYaw(playerYaw -= 55);
}
}
}
}
public void onUpdate() {
if (Utils.nullCheck() && mc.inGameHasFocus) {
KeyBinding.setKeyBindState(mc.gameSettings.keyBindSprint.getKeyCode(), true);
}
}
@SubscribeEvent
public void onRenderTick(TickEvent.RenderTickEvent e) {
if (e.phase != TickEvent.Phase.END || !displayText.isToggled() || !Utils.nullCheck()) {
return;
}
if (mc.currentScreen != null || mc.gameSettings.showDebugInfo) {
return;
}
mc.fontRendererObj.drawStringWithShadow(text, posX, posY, rainbow.isToggled() ? Utils.getChroma(2, 0) : -1);
}
public boolean omniSprint() {
if (Utils.noSlowingBackWithBow() || Utils.safeWalkBackwards() || !Utils.isMoving()) {
return false;
}
if (mc.thePlayer.moveForward <= 0.5 && Utils.jumpDown()) {
return false;
}
if (ModuleManager.sprint.omniDirectional.getInput() > 0) {
return true;
}
return false;
}
static class EditScreen extends GuiScreen {
GuiButtonExt resetPosition;
boolean d = false;
int miX = 0;
int miY = 0;
int maX = 0;
int maY = 0;
float aX = 5;
float aY = 5;
int laX = 0;
int laY = 0;
int lmX = 0;
int lmY = 0;
int clickMinX = 0;
public void initGui() {
super.initGui();
this.buttonList.add(this.resetPosition = new GuiButtonExt(1, this.width - 90, this.height - 25, 85, 20, "Reset position"));
this.aX = ModuleManager.sprint.posX;
this.aY =ModuleManager.sprint.posY;
}
public void drawScreen(int mX, int mY, float pt) {
drawRect(0, 0, this.width, this.height, -1308622848);
int miX = (int) this.aX;
int miY = (int) this.aY;
String text = ModuleManager.sprint.text;
int maX = miX + this.mc.fontRendererObj.getStringWidth(text);
int maY = miY + this.mc.fontRendererObj.FONT_HEIGHT;
this.mc.fontRendererObj.drawStringWithShadow(text, this.aX, this.aY, -1);
this.miX = miX;
this.miY = miY;
this.maX = maX;
this.maY = maY;
this.clickMinX = miX;
ModuleManager.sprint.posX = miX;
ModuleManager.sprint.posY = miY;
ScaledResolution res = new ScaledResolution(this.mc);
int x = res.getScaledWidth() / 2 - 84;
int y = res.getScaledHeight() / 2 - 20;
RenderUtils.drawColoredString("Edit the HUD position by dragging.", '-', x, y, 2L, 0L, true, this.mc.fontRendererObj);
try {
this.handleInput();
}
catch (IOException var12) {
}
super.drawScreen(mX, mY, pt);
}
protected void mouseClickMove(int mX, int mY, int b, long t) {
super.mouseClickMove(mX, mY, b, t);
if (b == 0) {
if (this.d) {
this.aX = this.laX + (mX - this.lmX);
this.aY = this.laY + (mY - this.lmY);
}
else if (mX > this.clickMinX && mX < this.maX && mY > this.miY && mY < this.maY) {
this.d = true;
this.lmX = mX;
this.lmY = mY;
this.laX = (int) this.aX;
this.laY = (int) this.aY;
}
}
}
protected void mouseReleased(int mX, int mY, int s) {
super.mouseReleased(mX, mY, s);
if (s == 0) {
this.d = false;
}
}
public void actionPerformed(GuiButton b) {
if (b == this.resetPosition) {
this.aX = ModuleManager.sprint.posX = 5;
this.aY = ModuleManager.sprint.posY = 5;
}
}
public boolean doesGuiPauseGame() {
return false;
}
}
}

View File

@ -0,0 +1,30 @@
package keystrokesmod.module.impl.movement;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
public class StopMotion extends Module {
private ButtonSetting stopX;
private ButtonSetting stopY;
private ButtonSetting stopZ;
public StopMotion() {
super("Stop Motion", Module.category.movement, 0);
this.registerSetting(stopX = new ButtonSetting("Stop X", true));
this.registerSetting(stopY = new ButtonSetting("Stop Y", true));
this.registerSetting(stopZ = new ButtonSetting("Stop Z", true));
}
public void onEnable() {
if (stopX.isToggled()) {
mc.thePlayer.motionX = 0;
}
if (stopY.isToggled()) {
mc.thePlayer.motionY = 0;
}
if (stopZ.isToggled()) {
mc.thePlayer.motionZ = 0;
}
this.disable();
}
}

View File

@ -0,0 +1,112 @@
package keystrokesmod.module.impl.movement;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.utility.RenderUtils;
import keystrokesmod.utility.RotationUtils;
import keystrokesmod.utility.Utils;
import net.minecraft.network.play.client.C03PacketPlayer;
import net.minecraft.util.BlockPos;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraftforge.client.event.MouseEvent;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import java.awt.*;
import java.util.ArrayList;
public class Teleport extends Module {
private ButtonSetting rightClick;
private ButtonSetting highlightTarget;
private ButtonSetting highlightPath;
private BlockPos targetPos;
private ArrayList<Vec3> path = new ArrayList<>();
public Teleport() {
super("Teleport", category.movement);
this.registerSetting(rightClick = new ButtonSetting("Right click teleport", true));
this.registerSetting(highlightTarget = new ButtonSetting("Highlight target", true));
this.registerSetting(highlightPath = new ButtonSetting("Highlight path", false));
}
public void teleport(BlockPos targetBlock, boolean sendMessage) {
targetBlock = targetBlock.up(1);
ArrayList<Vec3> pathList = this.path = getPath(targetBlock);
int packetsSent = 0;
for (Vec3 pathPos : pathList) {
mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(pathPos.xCoord, pathPos.yCoord, pathPos.zCoord, true));
if (++packetsSent >= 175) {
if (sendMessage) {
Utils.sendMessage("&eToo many packets, ending loop.");
break;
}
break;
}
}
mc.thePlayer.setPosition(targetBlock.getX(), targetBlock.getY(), targetBlock.getZ());
if (sendMessage) {
Utils.sendMessage("&eTeleported to &d(" + targetBlock.getX() + ", " + targetBlock.getY() + ", " + targetBlock.getZ() + ") &ewith &b" + packetsSent + " &epackets.");
}
}
@SubscribeEvent
public void onRenderWorld(RenderWorldLastEvent e) {
if (!rightClick.isToggled() || !highlightTarget.isToggled() || this.targetPos == null || !Utils.nullCheck()) {
return;
}
RenderUtils.renderBlock(targetPos, Color.orange.getRGB(), true, true);
if (highlightPath.isToggled()) {
int positions = 0;
for (Vec3 pos : this.path) {
if (positions >= 175) {
break;
}
RenderUtils.renderBlock(new BlockPos(pos.xCoord, pos.yCoord, pos.zCoord), Color.yellow.getRGB(), false, true);
++positions;
}
}
}
private ArrayList getPath(BlockPos target) {
ArrayList<Vec3> path = new ArrayList<>();
double newX = (double)target.getX() + 0.5;
double newY = target.getY() + 1;
double newZ = (double)target.getZ() + 0.5;
double distance = this.mc.thePlayer.getDistance(newX, newY, newZ);
double d = 0;
while (d < distance) {
path.add(new Vec3(this.mc.thePlayer.posX + (newX - (double)this.mc.thePlayer.getHorizontalFacing().getFrontOffsetX() - this.mc.thePlayer.posX) * d / distance, this.mc.thePlayer.posY + (newY - this.mc.thePlayer.posY) * d / distance, this.mc.thePlayer.posZ + (newZ - (double)this.mc.thePlayer.getHorizontalFacing().getFrontOffsetZ() - this.mc.thePlayer.posZ) * d / distance));
d += 2.0;
}
return path;
}
@SubscribeEvent
public void onMouse(MouseEvent mouseEvent) {
if (mouseEvent.button != 1 || !mouseEvent.buttonstate || !rightClick.isToggled() || !Utils.nullCheck()) {
return;
}
MovingObjectPosition rayCast = RotationUtils.rayCast(150.0, mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch, true);
if (rayCast == null || rayCast.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK) {
return;
}
final BlockPos getBlockPos = rayCast.getBlockPos();
this.targetPos = getBlockPos;
teleport(getBlockPos, true);
}
@Override
public void onEnable() {
this.targetPos = null;
this.path.clear();
if (rightClick.isToggled()) {
return;
}
MovingObjectPosition rayCast = RotationUtils.rayCast(150.0, mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch, true);
if (rayCast == null || rayCast.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK) {
return;
}
teleport(rayCast.getBlockPos(), true);
this.disable();
}
}

View File

@ -0,0 +1,40 @@
package keystrokesmod.module.impl.movement;
import keystrokesmod.clickgui.ClickGui;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.Utils;
public class Timer extends Module {
private SliderSetting speed;
private ButtonSetting strafeOnly;
public Timer() {
super("Timer", Module.category.movement, 0);
this.registerSetting(speed = new SliderSetting("Speed", 1.0D, 0.5D, 2.5D, 0.01D));
this.registerSetting(strafeOnly = new ButtonSetting("Strafe only", false));
}
@Override
public String getInfo() {
return Utils.isWholeNumber(speed.getInput()) ? (int) speed.getInput() + "" : speed.getInput() + "";
}
public void onUpdate() {
if (!(mc.currentScreen instanceof ClickGui)) {
if (strafeOnly.isToggled() && mc.thePlayer.moveStrafing == 0) {
Utils.resetTimer();
return;
}
Utils.getTimer().timerSpeed = (float) speed.getInput();
}
else {
Utils.resetTimer();
}
}
public void onDisable() {
Utils.resetTimer();
}
}

View File

@ -0,0 +1,29 @@
package keystrokesmod.module.impl.movement;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.Utils;
public class VClip extends Module {
private SliderSetting distance;
private ButtonSetting sendMessage;
public VClip() {
super("VClip", Module.category.movement, 0);
this.registerSetting(distance = new SliderSetting("Distance", 3.0, -20.0, 20.0, 0.5));
this.registerSetting(sendMessage = new ButtonSetting("Send message", true));
}
public void onEnable() {
final double distance = this.distance.getInput();
if (this.distance.getInput() != 0.0D) {
mc.thePlayer.setPosition(mc.thePlayer.posX, mc.thePlayer.posY + distance, mc.thePlayer.posZ);
if (sendMessage.isToggled()) {
Utils.sendMessage("&7Teleported you " + ((distance > 0.0) ? "upwards" : "downwards") + " by &b" + distance + " &7blocks.");
}
}
this.disable();
}
}

View File

@ -0,0 +1,180 @@
package keystrokesmod.module.impl.other;
import keystrokesmod.module.Module;
import keystrokesmod.module.impl.world.AntiBot;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.DescriptionSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.BlockUtils;
import keystrokesmod.utility.PlayerData;
import keystrokesmod.utility.Utils;
import net.minecraft.block.BlockAir;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.event.ClickEvent;
import net.minecraft.item.ItemBlock;
import net.minecraft.util.BlockPos;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatStyle;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import java.util.HashMap;
import java.util.UUID;
public class Anticheat extends Module {
private SliderSetting interval;
private ButtonSetting enemyAdd;
private ButtonSetting autoReport;
private ButtonSetting ignoreTeammates;
private ButtonSetting atlasSuspect;
private ButtonSetting shouldPing;
private ButtonSetting autoBlock;
private ButtonSetting noFall;
private ButtonSetting noSlow;
private ButtonSetting scaffold;
private ButtonSetting legitScaffold;
private HashMap<UUID, HashMap<ButtonSetting, Long>> flags = new HashMap<>();
private HashMap<UUID, PlayerData> players = new HashMap<>();
private long lastAlert;
public Anticheat() {
super("Anticheat", category.other);
this.registerSetting(new DescriptionSetting("Tries to detect cheaters."));
this.registerSetting(interval = new SliderSetting("Flag interval", " second", 20.0, 0.0, 60.0, 1.0));
this.registerSetting(enemyAdd = new ButtonSetting("Add cheaters as enemy", false));
this.registerSetting(autoReport = new ButtonSetting("Auto report", false));
this.registerSetting(ignoreTeammates = new ButtonSetting("Ignore teammates", false));
this.registerSetting(atlasSuspect = new ButtonSetting("Only atlas suspect", false));
this.registerSetting(shouldPing = new ButtonSetting("Should ping", true));
this.registerSetting(new DescriptionSetting("Detected cheats"));
this.registerSetting(autoBlock = new ButtonSetting("Autoblock", true));
this.registerSetting(noFall = new ButtonSetting("NoFall", true));
this.registerSetting(noSlow = new ButtonSetting("NoSlow", true));
this.registerSetting(scaffold = new ButtonSetting("Scaffold", true));
this.registerSetting(legitScaffold = new ButtonSetting("Legit scaffold", true));
this.closetModule = true;
}
private void alert(final EntityPlayer entityPlayer, ButtonSetting mode) {
if (Utils.isFriended(entityPlayer) || (ignoreTeammates.isToggled() && Utils.isTeamMate(entityPlayer))) {
return;
}
if (atlasSuspect.isToggled()) {
if (!entityPlayer.getName().equals("Suspect§r")) {
return;
}
}
else if (enemyAdd.isToggled()) {
Utils.addEnemy(entityPlayer.getName());
}
final long currentTimeMillis = System.currentTimeMillis();
if (interval.getInput() > 0.0) {
HashMap<ButtonSetting, Long> hashMap = flags.get(entityPlayer.getUniqueID());
if (hashMap == null) {
hashMap = new HashMap<>();
}
else {
final Long n = hashMap.get(mode);
if (n != null && Utils.timeBetween(n, currentTimeMillis) <= interval.getInput() * 1000.0) {
return;
}
}
hashMap.put(mode, currentTimeMillis);
flags.put(entityPlayer.getUniqueID(), hashMap);
}
final ChatComponentText chatComponentText = new ChatComponentText(Utils.formatColor("&7[&dR&7]&r " + entityPlayer.getDisplayName().getUnformattedText() + " &7detected for &d" + mode.getName()));
final ChatStyle chatStyle = new ChatStyle();
chatStyle.setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/wdr " + entityPlayer.getName()));
chatComponentText.appendSibling(new ChatComponentText(Utils.formatColor(" §7[§cWDR§7]")).setChatStyle(chatStyle));
mc.thePlayer.addChatMessage(chatComponentText);
if (shouldPing.isToggled() && Utils.timeBetween(lastAlert, currentTimeMillis) >= 1500L) {
mc.thePlayer.playSound("note.pling", 1.0f, 1.0f);
lastAlert = currentTimeMillis;
}
if (autoReport.isToggled() && !Utils.isFriended(entityPlayer)) {
mc.thePlayer.sendChatMessage("/wdr " + Utils.stripColor(entityPlayer.getGameProfile().getName()));
}
}
public void onUpdate() {
if (mc.isSingleplayer()) {
return;
}
for (EntityPlayer entityPlayer : mc.theWorld.playerEntities) {
if (entityPlayer == null) {
continue;
}
if (entityPlayer == mc.thePlayer) {
continue;
}
if (AntiBot.isBot(entityPlayer)) {
continue;
}
PlayerData data = players.get(entityPlayer.getUniqueID());
if (data == null) {
data = new PlayerData();
}
data.update(entityPlayer);
this.performCheck(entityPlayer, data);
data.updateServerPos(entityPlayer);
data.updateSneak(entityPlayer);
players.put(entityPlayer.getUniqueID(), data);
}
}
@SubscribeEvent
public void onEntityJoin(EntityJoinWorldEvent e) {
if (e.entity == mc.thePlayer) {
players.clear();
flags.clear();
}
}
public void onDisable() {
players.clear();
flags.clear();
lastAlert = 0L;
}
private void performCheck(EntityPlayer entityPlayer, PlayerData playerData) {
if (autoBlock.isToggled() && playerData.autoBlockTicks >= 10) {
alert(entityPlayer, autoBlock);
return;
}
if (legitScaffold.isToggled() && playerData.sneakTicks >= 3) {
alert(entityPlayer, legitScaffold);
return;
}
if (noSlow.isToggled() && playerData.noSlowTicks >= 11 && playerData.speed >= 0.08) {
alert(entityPlayer, noSlow);
return;
}
if (scaffold.isToggled() && entityPlayer.isSwingInProgress && entityPlayer.rotationPitch >= 70.0f && entityPlayer.getHeldItem() != null && entityPlayer.getHeldItem().getItem() instanceof ItemBlock && playerData.fastTick >= 20 && entityPlayer.ticksExisted - playerData.lastSneakTick >= 30 && entityPlayer.ticksExisted - playerData.aboveVoidTicks >= 20) {
boolean overAir = true;
BlockPos blockPos = entityPlayer.getPosition().down(2);
for (int i = 0; i < 4; ++i) {
if (!(BlockUtils.getBlock(blockPos) instanceof BlockAir)) {
overAir = false;
break;
}
blockPos = blockPos.down();
}
if (overAir) {
alert(entityPlayer, scaffold);
return;
}
}
if (noFall.isToggled() && !entityPlayer.capabilities.isFlying) {
double serverPosX = entityPlayer.serverPosX / 32;
double serverPosY = entityPlayer.serverPosY / 32;
double serverPosZ= entityPlayer.serverPosZ / 32;
double deltaX = Math.abs(playerData.serverPosX - serverPosX);
double deltaY = playerData.serverPosY - serverPosY;
double deltaZ = Math.abs(playerData.serverPosZ - serverPosZ);
if (deltaY >= 5 && deltaX <= 10 && deltaZ <= 10 && deltaY <= 40) {
if (!Utils.overVoid(serverPosX, serverPosY, serverPosZ) && Utils.distanceToGround(entityPlayer) > 3 && !Utils.onLadder(entityPlayer) && !entityPlayer.isInWater() && !entityPlayer.isInLava()) {
alert(entityPlayer, noFall);
}
}
}
}
}

View File

@ -0,0 +1,119 @@
package keystrokesmod.module.impl.other;
import keystrokesmod.event.SendPacketEvent;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.utility.PacketUtils;
import keystrokesmod.utility.Reflection;
import keystrokesmod.utility.Utils;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.C01PacketChatMessage;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import java.util.Arrays;
import java.util.List;
public class ChatBypass extends Module {
private ButtonSetting filterKnownWords;
List<String> filteredWords = Arrays.asList(
// blocked words
"kill", "retard", "anal", "beaner", "bestiality", "blowjob", "cameltoe", "chink", "clit", "cock", "coon", "cunnilingus", "cunt", "dick", "dildo", "dilf", "dyke", "ejaculate", "ejaculati" /*ing & ion*/,
"fag", "foreskin", "gilf", "hentai", "jerkoff", "jizz", "kike", "kill yourself", "kill urself", "kys", "loli", "masturbate", "masturbati" /*ing & ion*/, "milf", "nazi", "nigga", "nigger",
"orgy", "pedo", "penis", "porn", "pussy", "rape", "raping", "redtube", "retard", "schlong", "shemale", "sex", "swastika", "tits", "titties", "trannie", "tranny", "vagina", "whore", "xhamster",
"xvideos", "end",
// censored words
"arse", "ass", "bastard", "bitch", "boob", "douche", "fuck", "hitler", "shit", "twat", "wank"
);
List<String> allowedCommands = Arrays.asList(
"ac", "achat", "pc", "pchat", "gc", "gchat", "shout", "msg", "message", "r", "reply", "t", "tell", "w", "whisper"
);
public ChatBypass() {
super("Chat Bypass", category.other);
this.registerSetting(filterKnownWords = new ButtonSetting("Only filter known words", true));
}
@SubscribeEvent
public void onSendPacket(SendPacketEvent e) {
if (!Utils.nullCheck()) {
return;
}
if (!(e.getPacket() instanceof C01PacketChatMessage)) return;
Packet packet = e.getPacket();
C01PacketChatMessage c01 = (C01PacketChatMessage) e.getPacket();
String msg = c01.getMessage();
String[] split = splitCommand(msg);
if (split == null || split[1].isEmpty()) {
return; // filter commands
}
msg = split[1]; // set msg to just message to ignore command
if (filterKnownWords.isToggled()) {
StringBuilder newMsg = new StringBuilder();
String[] words = msg.split(" ");
for (String word : words) {
String lowerCaseWord = word.toLowerCase();
for (String filteredWord : filteredWords) {
int index = lowerCaseWord.indexOf(filteredWord.toLowerCase());
if (index != -1) {
String matched = word.substring(index, index + filteredWord.length()),
replaced = doReplace(matched);
word = word.substring(0, index) + replaced + word.substring(index + filteredWord.length());
}
}
newMsg.append(word).append(" ");
}
msg = newMsg.toString().trim();
} else {
msg = doReplace(msg);
}
if (split[0] != null) { // if command existed, re-add
msg = split[0] + " " + msg;
}
PacketUtils.sendPacketNoEvent(new C01PacketChatMessage(msg));
e.setCanceled(true); // cancel original packet
}
private String[] splitCommand(String msg) {
if (msg.startsWith("/")) {
if (!isValidCommand(msg)) {
return null;
}
int spaceIndex = msg.indexOf(" ");
if (spaceIndex != -1) { // command arguments found
return new String[]{
msg.substring(0, spaceIndex), // command
msg.substring(spaceIndex + 1) // args
};
}
}
return new String[]{null, msg};
}
private String doReplace(String text) {
return text
.replace("a", replace_a).replace("e", replace_e).replace("i", replace_i)
.replace("o", replace_o).replace("u", replace_u).replace("y", replace_y)
.replace("A", replace_A).replace("E", replace_E).replace("I", replace_I)
.replace("O", replace_O).replace("U", replace_U).replace("Y", replace_Y);
}
// assumes its already a command (starts with /)
private boolean isValidCommand(String msg) {
for (String cmd : allowedCommands) {
String _cmd = "/" + cmd + " ";
if (msg.startsWith(_cmd)) {
return true;
}
}
return false;
}
String replace_a = "\u00E1", replace_e = "\u00E9", replace_i = "\u00A1", replace_o = "\u00F3", replace_u = "\u00FA", replace_y = "\u00FF",
replace_A = "\u00C1", replace_E = "\u00C9", replace_I = replace_i, replace_O = "\u00D3", replace_U = "\u00DA", replace_Y = replace_y;
}

View File

@ -0,0 +1,134 @@
package keystrokesmod.module.impl.other;
import keystrokesmod.event.AllPacketsEvent;
import keystrokesmod.module.Module;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.utility.BlockUtils;
import keystrokesmod.utility.RotationUtils;
import keystrokesmod.utility.Utils;
import net.minecraft.block.Block;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityCreature;
import net.minecraft.init.Blocks;
import net.minecraft.network.play.client.*;
import net.minecraft.util.BlockPos;
import net.minecraft.util.MovingObjectPosition;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
public class DebugAC extends Module {
private ButtonSetting debugMob;
private ButtonSetting debugBlock;
private ButtonSetting alertPost;
public static long lastC03;
public DebugAC() {
super("Debug AC", category.other);
this.registerSetting(debugBlock = new ButtonSetting("Debug block", true));
this.registerSetting(debugMob = new ButtonSetting("Debug mob", true));
this.registerSetting(alertPost = new ButtonSetting("Alert post", false));
}
public void onDisable() {
}
@SubscribeEvent
public void onRenderTick(TickEvent.RenderTickEvent ev) {
if (ev.phase != TickEvent.Phase.END || !Utils.nullCheck()) {
return;
}
if (debugBlock.isToggled()) {
MovingObjectPosition mouse = RotationUtils.rayCast(mc.playerController.getBlockReachDistance(), mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch, false);
if (mouse == null || mouse.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK || mouse.getBlockPos() == null) {
return;
}
BlockPos pos = mouse.getBlockPos();
Block block = BlockUtils.getBlock(pos);
if (block == null || block == Blocks.air) {
return;
}
IBlockState state = mc.theWorld.getBlockState(pos);
mc.fontRendererObj.drawStringWithShadow("§7BlockPos: §b" + pos.getX() + "§7, §b" + pos.getY() + "§7, §b" + pos.getZ(), 30, 20, -1);
mc.fontRendererObj.drawStringWithShadow("§7HitVec: §b" + Utils.round(mouse.hitVec.xCoord, 3) + "§7, §b" + Utils.round(mouse.hitVec.yCoord, 3) + "§7, §b" + Utils.round(mouse.hitVec.zCoord, 3), 30, 30, -1);
mc.fontRendererObj.drawStringWithShadow("§7Face: §b" + mouse.sideHit.name(), 30, 40, -1);
mc.fontRendererObj.drawStringWithShadow("§7Unlocalized Name: §b" + block.getUnlocalizedName(), 30, 50, -1);
mc.fontRendererObj.drawStringWithShadow("§7Registry Name: §b" + block.getRegistryName(), 30, 60, -1);
int y = 70;
for (IProperty<?> property : block.getBlockState().getProperties()) {
Class<?> valueClass = property.getValueClass();
String propName = property.getName();
Object currentValue = state.getValue(property);
Collection<?> allowedValues = property.getAllowedValues();
mc.fontRendererObj.drawStringWithShadow("§7Property Name: §b" + propName, 30, y, -1);
y += 10;
mc.fontRendererObj.drawStringWithShadow("§7Value Type: §b" + valueClass.getName(), 30, y, -1);
y += 10;
if (currentValue != null) {
mc.fontRendererObj.drawStringWithShadow("§7Current Value: §b" + currentValue, 30, y, -1);
y += 10;
if (valueClass.isEnum()) {
Enum<?> enumValue = (Enum<?>) currentValue;
mc.fontRendererObj.drawStringWithShadow("§7Current Enum Name: §b" + enumValue.name(), 30, y, -1);
y += 10;
mc.fontRendererObj.drawStringWithShadow("§7Current Enum Ordinal: §b" + enumValue.ordinal(), 30, y, -1);
y += 10;
}
}
mc.fontRendererObj.drawStringWithShadow("§7Allowed Values: §b" + allowedValues, 30, y, -1);
y += 10;
if (valueClass.isEnum()) {
Object[] enumConstants = valueClass.getEnumConstants();
if (Arrays.toString(enumConstants).equals(allowedValues.toString())) {
break;
}
mc.fontRendererObj.drawStringWithShadow("§7Enum Constants: §b" + Arrays.toString(enumConstants), 30, y, -1);
y += 10;
}
y += 5;
}
}
if (debugMob.isToggled()) {
MovingObjectPosition movingObjectPosition = mc.objectMouseOver;
if (movingObjectPosition == null || movingObjectPosition.typeOfHit != MovingObjectPosition.MovingObjectType.ENTITY || movingObjectPosition.entityHit == null || !(movingObjectPosition.entityHit instanceof EntityCreature)) {
return;
}
int xPos = 30;
int yPos = 20;
EntityCreature mob = (EntityCreature) movingObjectPosition.entityHit;
String mobName = mob.getName();
String attackerName = mob.getAttackTarget() == null ? "&7null" : mob.getAttackTarget().getDisplayName().getFormattedText();
List<String> info = Arrays.asList(mobName, attackerName);
for (String data : info) {
mc.fontRendererObj.drawStringWithShadow(data, xPos, yPos, -1);
yPos += mc.fontRendererObj.FONT_HEIGHT + 3;
}
}
}
@SubscribeEvent
public void onAllPacketSent(AllPacketsEvent e) {
if (e.getPacket() instanceof C03PacketPlayer) {
lastC03 = System.currentTimeMillis();
}
}
}

Some files were not shown because too many files have changed in this diff Show More