diff --git a/src/main/java/keystrokesmod/client/main/Raven.java b/src/main/java/keystrokesmod/client/main/Raven.java index 4df9d77..552d296 100644 --- a/src/main/java/keystrokesmod/client/main/Raven.java +++ b/src/main/java/keystrokesmod/client/main/Raven.java @@ -55,7 +55,7 @@ public class Raven { public static CommandManager commandManager; public static final String sourceLocation = "https://github.com/Coccocoahelper/Raven-BLITE"; public static final String downloadLocation = "https://github.com/Coccocoahelper/Raven-BLITE/raw/main/build/libs/%5B1.8.9%5D%20BetterKeystrokes%20V-1.2.jar"; - public static String[] updateText = {"Your version of Raven B+ (" + versionManager.getClientVersion().toString() + ") is outdated!", "Enter the command update into client CommandLine to open the download page", "or just enable the update module to get a message in chat.", "", "Newest version: " + versionManager.getLatestVersion().toString()}; + public static String[] updateText = {"Your version of Raven BLITE (" + versionManager.getClientVersion().toString() + ") is outdated!", "Enter the command update into client CommandLine to open the download page", "or just enable the update module to get a message in chat.", "", "Newest version: " + versionManager.getLatestVersion().toString()}; public static ConfigManager configManager; public static ClientConfig clientConfig; diff --git a/src/main/java/keystrokesmod/client/module/modules/combat/BlockHit.java b/src/main/java/keystrokesmod/client/module/modules/combat/BlockHit.java deleted file mode 100644 index e4ec4c2..0000000 --- a/src/main/java/keystrokesmod/client/module/modules/combat/BlockHit.java +++ /dev/null @@ -1,186 +0,0 @@ -package keystrokesmod.client.module.modules.combat; - -import keystrokesmod.client.module.*; -import keystrokesmod.client.module.setting.impl.DescriptionSetting; -import keystrokesmod.client.module.setting.impl.DoubleSliderSetting; -import keystrokesmod.client.module.setting.impl.SliderSetting; -import keystrokesmod.client.module.setting.impl.TickSetting; -import keystrokesmod.client.utils.CoolDown; -import keystrokesmod.client.utils.Utils; -import net.minecraft.client.settings.KeyBinding; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent; -import org.lwjgl.input.Keyboard; -import org.lwjgl.input.Mouse; - -import java.util.concurrent.ThreadLocalRandom; - -public class BlockHit extends Module { - public static SliderSetting range, eventType, chance; - public static DescriptionSetting eventTypeDesc; - public static TickSetting onlyPlayers, onRightMBHold; - public static DoubleSliderSetting waitMs, hitPer, postDelay; - public static boolean executingAction, hitCoolDown, alreadyHit, safeGuard; - public static int hitTimeout, hitsWaited; - private CoolDown actionTimer = new CoolDown(0), postDelayTimer = new CoolDown(0); - private boolean waitingForPostDelay; - - public BlockHit() { - super("BlockHit", ModuleCategory.combat); - - this.registerSetting(onlyPlayers = new TickSetting("Only combo players", true)); - this.registerSetting(onRightMBHold = new TickSetting("When holding down rmb", true)); - this.registerSetting(waitMs = new DoubleSliderSetting("Action Time (MS)", 110, 150, 1, 500, 1)); - this.registerSetting(hitPer = new DoubleSliderSetting("Once every ... hits", 1, 1, 1, 10, 1)); - this.registerSetting(postDelay = new DoubleSliderSetting("Post Delay (MS)", 10, 40, 0, 500, 1)); - this.registerSetting(chance = new SliderSetting("Chance %", 100, 0, 100, 1)); - this.registerSetting(range = new SliderSetting("Range: ", 3, 1, 6, 0.05)); - this.registerSetting(eventType = new SliderSetting("Value: ", 2, 1, 2, 1)); - this.registerSetting(eventTypeDesc = new DescriptionSetting("Mode: POST")); - } - - public void guiUpdate() { - eventTypeDesc.setDesc(Utils.md + Utils.Modes.SprintResetTimings.values()[(int) eventType.getInput() - 1]); - } - - - @SubscribeEvent - public void onTick(TickEvent.RenderTickEvent e) { - if (!Utils.Player.isPlayerInGame()) - return; - - if (onRightMBHold.isToggled() && !Utils.Player.tryingToCombo()) { - if (!safeGuard || Utils.Player.isPlayerHoldingWeapon() && Mouse.isButtonDown(0)) { - safeGuard = true; - finishCombo(); - } - return; - } - if (waitingForPostDelay) { - if (postDelayTimer.hasFinished()) { - executingAction = true; - startCombo(); - waitingForPostDelay = false; - if (safeGuard) safeGuard = false; - actionTimer.start(); - } - return; - } - - if (executingAction) { - if (actionTimer.hasFinished()) { - executingAction = false; - finishCombo(); - return; - }else { - return; - } - } - - if (onRightMBHold.isToggled() && Utils.Player.tryingToCombo()) { - if (mc.objectMouseOver == null || mc.objectMouseOver.entityHit == null) { - if (!safeGuard || Utils.Player.isPlayerHoldingWeapon() && Mouse.isButtonDown(0)) { - safeGuard = true; - finishCombo(); - } - return; - } else { - Entity target = mc.objectMouseOver.entityHit; - if (target.isDead) { - if (!safeGuard || Utils.Player.isPlayerHoldingWeapon() && Mouse.isButtonDown(0)) { - safeGuard = true; - finishCombo(); - } - return; - } - } - } - - if (mc.objectMouseOver != null && mc.objectMouseOver.entityHit instanceof Entity && Mouse.isButtonDown(0)) { - Entity target = mc.objectMouseOver.entityHit; - if (target.isDead) { - if (onRightMBHold.isToggled() && Mouse.isButtonDown(1) && Mouse.isButtonDown(0)) { - if (!safeGuard || Utils.Player.isPlayerHoldingWeapon() && Mouse.isButtonDown(0)) { - safeGuard = true; - finishCombo(); - } - } - return; - } - - if (mc.thePlayer.getDistanceToEntity(target) <= range.getInput()) { - if ((target.hurtResistantTime >= 10 && Utils.Modes.SprintResetTimings.values()[(int) eventType.getInput() - 1] == Utils.Modes.SprintResetTimings.POST) || (target.hurtResistantTime <= 10 && Utils.Modes.SprintResetTimings.values()[(int) eventType.getInput() - 1] == Utils.Modes.SprintResetTimings.PRE)) { - - if (onlyPlayers.isToggled()) { - if (!(target instanceof EntityPlayer)) { - return; - } - } - - if (hitCoolDown && !alreadyHit) { - hitsWaited++; - if (hitsWaited >= hitTimeout) { - hitCoolDown = false; - hitsWaited = 0; - } else { - alreadyHit = true; - return; - } - } - - if (!(chance.getInput() == 100 || Math.random() <= chance.getInput() / 100)) - return; - - if (!alreadyHit) { - guiUpdate(); - if (hitPer.getInputMin() == hitPer.getInputMax()) { - hitTimeout = (int) hitPer.getInputMin(); - } else { - - hitTimeout = ThreadLocalRandom.current().nextInt((int) hitPer.getInputMin(), (int) hitPer.getInputMax()); - } - hitCoolDown = true; - hitsWaited = 0; - - actionTimer.setCooldown((long)ThreadLocalRandom.current().nextDouble(waitMs.getInputMin(), waitMs.getInputMax()+0.01)); - if (postDelay.getInputMax() != 0) { - postDelayTimer.setCooldown((long)ThreadLocalRandom.current().nextDouble(postDelay.getInputMin(), postDelay.getInputMax()+0.01)); - postDelayTimer.start(); - waitingForPostDelay = true; - } else { - executingAction = true; - startCombo(); - actionTimer.start(); - alreadyHit = true; - if (safeGuard) safeGuard = false; - } - alreadyHit = true; - } - } else { - if (alreadyHit) { - alreadyHit = false; - } - - if (safeGuard) safeGuard = false; - } - } - } - } - - private static void finishCombo() { - int key = mc.gameSettings.keyBindUseItem.getKeyCode(); - KeyBinding.setKeyBindState(key, false); - Utils.Client.setMouseButtonState(1, false); - } - - private static void startCombo() { - if (Keyboard.isKeyDown(mc.gameSettings.keyBindForward.getKeyCode())) { - int key = mc.gameSettings.keyBindUseItem.getKeyCode(); - KeyBinding.setKeyBindState(key, true); - KeyBinding.onTick(key); - Utils.Client.setMouseButtonState(1, true); - } - } -} diff --git a/src/main/java/keystrokesmod/client/module/modules/combat/ShiftTap.java b/src/main/java/keystrokesmod/client/module/modules/combat/ShiftTap.java deleted file mode 100644 index 92a328e..0000000 --- a/src/main/java/keystrokesmod/client/module/modules/combat/ShiftTap.java +++ /dev/null @@ -1,148 +0,0 @@ -package keystrokesmod.client.module.modules.combat; - -import keystrokesmod.client.module.*; -import keystrokesmod.client.module.setting.impl.DescriptionSetting; -import keystrokesmod.client.module.setting.impl.DoubleSliderSetting; -import keystrokesmod.client.module.setting.impl.SliderSetting; -import keystrokesmod.client.module.setting.impl.TickSetting; -import keystrokesmod.client.utils.CoolDown; -import keystrokesmod.client.utils.Utils; -import net.minecraft.client.settings.KeyBinding; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent; -import org.lwjgl.input.Keyboard; -import org.lwjgl.input.Mouse; - -import java.util.concurrent.ThreadLocalRandom; - -public class ShiftTap extends Module { - public static SliderSetting range, eventType, chance; - public static DescriptionSetting eventTypeDesc; - public static TickSetting onlyPlayers; - public static DoubleSliderSetting actionTicks, onceEvery, postDelay; - public static boolean comboing, hitCoolDown, alreadyHit, waitingForPostDelay; - public static int hitTimeout, hitsWaited; - public static CoolDown actionTimer = new CoolDown(0), postDelayTimer = new CoolDown(0); - - public ShiftTap() { - super("ShiftTap", ModuleCategory.combat); - this.registerSetting(onlyPlayers = new TickSetting("Only combo players", true)); - this.registerSetting(actionTicks = new DoubleSliderSetting("Action Time (MS)", 25, 55, 1, 500, 1)); - this.registerSetting(onceEvery = new DoubleSliderSetting("Once every ... hits", 1, 1, 1, 10, 1)); - this.registerSetting(postDelay = new DoubleSliderSetting("Post delay (MS)", 25, 55, 1, 500, 1)); - this.registerSetting(chance = new SliderSetting("Chance %", 100, 0, 100, 1)); - this.registerSetting(range = new SliderSetting("Range: ", 3, 1, 6, 0.05)); - this.registerSetting(eventType = new SliderSetting("Value: ", 2, 1, 2, 1)); - this.registerSetting(eventTypeDesc = new DescriptionSetting("Mode: POST")); - } - - - public void guiUpdate() { - eventTypeDesc.setDesc(Utils.md + Utils.Modes.SprintResetTimings.values()[(int) eventType.getInput() - 1]); - } - - - @SubscribeEvent - public void onTick(TickEvent.RenderTickEvent e) { - if (!Utils.Player.isPlayerInGame()) - return; - - if (waitingForPostDelay) { - if (postDelayTimer.hasFinished()) { - waitingForPostDelay = false; - comboing = true; - startCombo(); - actionTimer.start(); - } - return; - } - - if (comboing) { - if (actionTimer.hasFinished()) { - comboing = false; - finishCombo(); - return; - }else { - return; - } - } - - - - if (mc.objectMouseOver != null && mc.objectMouseOver.entityHit instanceof Entity && Mouse.isButtonDown(0)) { - Entity target = mc.objectMouseOver.entityHit; - if (target.isDead) { - return; - } - - if (mc.thePlayer.getDistanceToEntity(target) <= range.getInput()) { - if ((target.hurtResistantTime >= 10 && Utils.Modes.SprintResetTimings.values()[(int) eventType.getInput() - 1] == Utils.Modes.SprintResetTimings.POST) || (target.hurtResistantTime <= 10 && Utils.Modes.SprintResetTimings.values()[(int) eventType.getInput() - 1] == Utils.Modes.SprintResetTimings.PRE)) { - - if (onlyPlayers.isToggled()) { - if (!(target instanceof EntityPlayer)) { - return; - } - } - - if (hitCoolDown && !alreadyHit) { - hitsWaited++; - if (hitsWaited >= hitTimeout) { - hitCoolDown = false; - hitsWaited = 0; - } else { - alreadyHit = true; - return; - } - } - - if (!(chance.getInput() == 100 || Math.random() <= chance.getInput() / 100)) - return; - - if (!alreadyHit) { - guiUpdate(); - if (onceEvery.getInputMin() == onceEvery.getInputMax()) { - hitTimeout = (int)onceEvery.getInputMin(); - } else { - - hitTimeout = ThreadLocalRandom.current().nextInt((int)onceEvery.getInputMin(), (int)onceEvery.getInputMax()); - } - hitCoolDown = true; - hitsWaited = 0; - - actionTimer.setCooldown((long)ThreadLocalRandom.current().nextDouble(actionTicks.getInputMin(), actionTicks.getInputMax()+0.01)); - - if (postDelay.getInputMax() != 0) { - postDelayTimer.setCooldown((long)ThreadLocalRandom.current().nextDouble(postDelay.getInputMin(), postDelay.getInputMax()+0.01)); - postDelayTimer.start(); - waitingForPostDelay = true; - } else { - comboing = true; - startCombo(); - actionTimer.start(); - alreadyHit = true; - } - alreadyHit = true; - } - } else { - if (alreadyHit) { - } - alreadyHit = false; - } - } - } - } - - private static void finishCombo() { - if (!Keyboard.isKeyDown(mc.gameSettings.keyBindSneak.getKeyCode())) - KeyBinding.setKeyBindState(mc.gameSettings.keyBindSneak.getKeyCode(), false); - } - - private static void startCombo() { - if (Keyboard.isKeyDown(mc.gameSettings.keyBindForward.getKeyCode())) { - KeyBinding.setKeyBindState(mc.gameSettings.keyBindSneak.getKeyCode(), true); - KeyBinding.onTick(mc.gameSettings.keyBindSneak.getKeyCode()); - } - } -}