This commit is contained in:
parent
9a2eff4c42
commit
fc15d1856c
|
|
@ -29,7 +29,6 @@ public abstract class MixinEntity {
|
||||||
|
|
||||||
if (entity == mc.thePlayer && entity.onGround) {
|
if (entity == mc.thePlayer && entity.onGround) {
|
||||||
if (Safewalk.canSafeWalk() || ModuleManager.scaffold.canSafewalk()) {
|
if (Safewalk.canSafeWalk() || ModuleManager.scaffold.canSafewalk()) {
|
||||||
//Utils.print("Safewalking");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ public class Gui extends Module {
|
||||||
|
|
||||||
public Gui() {
|
public Gui() {
|
||||||
super("Gui", category.client, 54);
|
super("Gui", category.client, 54);
|
||||||
this.registerSetting(guiScale = new SliderSetting("Gui scale", 2, new String[]{ "Small", "Normal", "Large" }));
|
this.registerSetting(guiScale = new SliderSetting("Gui scale", 1, new String[]{ "Small", "Normal", "Large" }));
|
||||||
this.registerSetting(backgroundBlur = new SliderSetting("Background blur", "%", 0, 0, 100, 1));
|
this.registerSetting(backgroundBlur = new SliderSetting("Background blur", "%", 0, 0, 100, 1));
|
||||||
this.registerSetting(scrollSpeed = new SliderSetting("Scroll speed", 50, 2, 90, 1));
|
this.registerSetting(scrollSpeed = new SliderSetting("Scroll speed", 50, 2, 90, 1));
|
||||||
this.registerSetting(darkBackground = new ButtonSetting("Dark background", true));
|
this.registerSetting(darkBackground = new ButtonSetting("Dark background", true));
|
||||||
|
|
|
||||||
|
|
@ -401,7 +401,7 @@ public class KillAura extends Module {
|
||||||
mc.thePlayer.rotationPitch = smoothedRotations[1];
|
mc.thePlayer.rotationPitch = smoothedRotations[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (attackingEntity != null && inRange(target, attackRange.getInput())) {
|
if (target != null && attackingEntity != null && inRange(target, attackRange.getInput())) {
|
||||||
isTargeting = true;
|
isTargeting = true;
|
||||||
}
|
}
|
||||||
else if (isTargeting) {
|
else if (isTargeting) {
|
||||||
|
|
@ -882,14 +882,14 @@ public class KillAura extends Module {
|
||||||
interactTicks++;
|
interactTicks++;
|
||||||
if (firstCycle) {
|
if (firstCycle) {
|
||||||
switch (interactTicks) {
|
switch (interactTicks) {
|
||||||
case 2:
|
case 1:
|
||||||
blinking.set(true);
|
blinking.set(true);
|
||||||
if (blocked) {
|
if (blocked) {
|
||||||
mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, DOWN));
|
mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, DOWN));
|
||||||
blocked = false;
|
blocked = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 2:
|
||||||
handleInteractAndAttack(distance, true, true, swung);
|
handleInteractAndAttack(distance, true, true, swung);
|
||||||
sendBlockPacket();
|
sendBlockPacket();
|
||||||
blocked = true;
|
blocked = true;
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import keystrokesmod.event.PreUpdateEvent;
|
||||||
import keystrokesmod.event.SendPacketEvent;
|
import keystrokesmod.event.SendPacketEvent;
|
||||||
import keystrokesmod.module.Module;
|
import keystrokesmod.module.Module;
|
||||||
import keystrokesmod.module.ModuleManager;
|
import keystrokesmod.module.ModuleManager;
|
||||||
|
import keystrokesmod.module.impl.render.HUD;
|
||||||
import keystrokesmod.module.setting.impl.ButtonSetting;
|
import keystrokesmod.module.setting.impl.ButtonSetting;
|
||||||
import keystrokesmod.module.setting.impl.DescriptionSetting;
|
import keystrokesmod.module.setting.impl.DescriptionSetting;
|
||||||
import keystrokesmod.module.setting.impl.SliderSetting;
|
import keystrokesmod.module.setting.impl.SliderSetting;
|
||||||
|
|
@ -43,7 +44,7 @@ public class Blink extends Module {
|
||||||
private ConcurrentLinkedQueue<Packet> blinkedPackets = new ConcurrentLinkedQueue<>();
|
private ConcurrentLinkedQueue<Packet> blinkedPackets = new ConcurrentLinkedQueue<>();
|
||||||
private Vec3 pos;
|
private Vec3 pos;
|
||||||
//final private int color = Theme.getGradient((int) theme.getInput(), 255);
|
//final private int color = Theme.getGradient((int) theme.getInput(), 255);
|
||||||
final private int color = new Color(0, 187, 255, 255).getRGB();
|
private int color = new Color(0, 187, 255, 255).getRGB();
|
||||||
private int blinkTicks;
|
private int blinkTicks;
|
||||||
private boolean started;
|
private boolean started;
|
||||||
public Blink() {
|
public Blink() {
|
||||||
|
|
@ -80,7 +81,7 @@ public class Blink extends Module {
|
||||||
this.disable();
|
this.disable();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (ModuleManager.killAura.lag || ModuleManager.killAura.justUnTargeted || ModuleManager.killAura.target != null) {
|
if (ModuleManager.killAura.isTargeting || ModuleManager.killAura.justUnTargeted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (disableOnBreak.isToggled() && (Utils.usingBedAura() || ModuleUtils.isBreaking)) {
|
if (disableOnBreak.isToggled() && (Utils.usingBedAura() || ModuleUtils.isBreaking)) {
|
||||||
|
|
@ -119,7 +120,7 @@ public class Blink extends Module {
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onRenderTick(TickEvent.RenderTickEvent ev) {
|
public void onRenderTick(TickEvent.RenderTickEvent ev) {
|
||||||
if (!Utils.nullCheck() || !renderTimer.isToggled()) {
|
if (!Utils.nullCheck() || !renderTimer.isToggled() || blinkTicks == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (ev.phase == TickEvent.Phase.END) {
|
if (ev.phase == TickEvent.Phase.END) {
|
||||||
|
|
@ -127,13 +128,13 @@ public class Blink extends Module {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
color = Theme.getGradient((int) HUD.theme.getInput(), 0);
|
||||||
int widthOffset = (blinkTicks < 10) ? 4 : (blinkTicks >= 10 && blinkTicks < 100) ? 7 : (blinkTicks >= 100 && blinkTicks < 1000) ? 10 : (blinkTicks >= 1000) ? 13 : 16;
|
int widthOffset = (blinkTicks < 10) ? 4 : (blinkTicks >= 10 && blinkTicks < 100) ? 7 : (blinkTicks >= 100 && blinkTicks < 1000) ? 10 : (blinkTicks >= 1000) ? 13 : 16;
|
||||||
String text = ("" + blinkTicks);
|
String text = ("" + blinkTicks);
|
||||||
int width = mc.fontRendererObj.getStringWidth(text) + Utils.getBoldWidth(text) / 2;
|
int width = mc.fontRendererObj.getStringWidth(text) + Utils.getBoldWidth(text) / 2;
|
||||||
final ScaledResolution scaledResolution = new ScaledResolution(mc);
|
final ScaledResolution scaledResolution = new ScaledResolution(mc);
|
||||||
int[] display = {scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight(), scaledResolution.getScaleFactor()};
|
int[] display = {scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight(), scaledResolution.getScaleFactor()};
|
||||||
mc.fontRendererObj.drawString(text, display[0] / 2 - width + widthOffset, display[1] / 2 + 8, color, true);
|
mc.fontRendererObj.drawString(text, display[0] / 2 - width + widthOffset, display[1] / 2 + 8, color, true);
|
||||||
//render.text(text, disp[0] / 2 - wid, disp[1] / 2 + 8, 1, -1, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
|
@ -146,6 +147,7 @@ public class Blink extends Module {
|
||||||
|
|
||||||
private void drawBox(Vec3 pos) {
|
private void drawBox(Vec3 pos) {
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
|
color = Theme.getGradient((int) HUD.theme.getInput(), 0);
|
||||||
double x = pos.xCoord - mc.getRenderManager().viewerPosX;
|
double x = pos.xCoord - mc.getRenderManager().viewerPosX;
|
||||||
double y = pos.yCoord - mc.getRenderManager().viewerPosY;
|
double y = pos.yCoord - mc.getRenderManager().viewerPosY;
|
||||||
double z = pos.zCoord - mc.getRenderManager().viewerPosZ;
|
double z = pos.zCoord - mc.getRenderManager().viewerPosZ;
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ public class NoFall extends Module {
|
||||||
}
|
}
|
||||||
if (isFalling && mode.getInput() == 3) {
|
if (isFalling && mode.getInput() == 3) {
|
||||||
if (mc.thePlayer.ticksExisted % 2 == 0) {
|
if (mc.thePlayer.ticksExisted % 2 == 0) {
|
||||||
Utils.getTimer().timerSpeed = (float) Utils.randomizeDouble(0.5, 0.6);
|
Utils.getTimer().timerSpeed = (float) Utils.randomizeDouble(0.5, 0.50201);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Utils.getTimer().timerSpeed = (float) 1;
|
Utils.getTimer().timerSpeed = (float) 1;
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,8 @@ public class Scaffold extends Module {
|
||||||
private int disableTicks;
|
private int disableTicks;
|
||||||
private int scaffoldTicks;
|
private int scaffoldTicks;
|
||||||
|
|
||||||
|
private long firstStroke;
|
||||||
|
|
||||||
public Scaffold() {
|
public Scaffold() {
|
||||||
super("Scaffold", category.player);
|
super("Scaffold", category.player);
|
||||||
this.registerSetting(motion = new SliderSetting("Motion", "x", 1.0, 0.5, 1.2, 0.01));
|
this.registerSetting(motion = new SliderSetting("Motion", "x", 1.0, 0.5, 1.2, 0.01));
|
||||||
|
|
@ -237,25 +239,22 @@ public class Scaffold extends Module {
|
||||||
case 1:
|
case 1:
|
||||||
e.setRotations(MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw(), 82);
|
e.setRotations(MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw(), 82);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
if (blockRotations != null) {
|
if (blockRotations != null) {
|
||||||
blockYaw = blockRotations[0];
|
blockYaw = blockRotations[0];
|
||||||
pitch = blockRotations[1];
|
pitch = blockRotations[1];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
firstStroke = System.currentTimeMillis();
|
||||||
blockYaw = 0;
|
blockYaw = 0;
|
||||||
pitch = 82F;
|
pitch = 80F;
|
||||||
|
}
|
||||||
|
if (firstStroke > 0 && (System.currentTimeMillis() - firstStroke) > 250) {
|
||||||
|
firstStroke = 0;
|
||||||
}
|
}
|
||||||
float side = MathHelper.wrapAngleTo180_float(getMotionYaw() - yaw);
|
float side = MathHelper.wrapAngleTo180_float(getMotionYaw() - yaw);
|
||||||
float offset = 137.625F;
|
float offset = (!Utils.scaffoldDiagonal(false)) ? 125.500F : 140.500F;
|
||||||
float minOffset = (!Utils.scaffoldDiagonal(false)) ? 30 : 0;
|
float minOffset = (!Utils.scaffoldDiagonal(false)) ? 25 : 0;
|
||||||
float yawBackwards = MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw();
|
float yawBackwards = MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw();
|
||||||
float yawOffset = MathHelper.wrapAngleTo180_float(yawBackwards - blockYaw);
|
float yawOffset = MathHelper.wrapAngleTo180_float(yawBackwards - blockYaw);
|
||||||
|
|
||||||
|
|
@ -273,13 +272,11 @@ public class Scaffold extends Module {
|
||||||
yaw = applyGcd(
|
yaw = applyGcd(
|
||||||
lastYaw + MathHelper.wrapAngleTo180_float(newYaw - lastYaw)
|
lastYaw + MathHelper.wrapAngleTo180_float(newYaw - lastYaw)
|
||||||
);
|
);
|
||||||
|
double minSwitch = (!Utils.scaffoldDiagonal(false)) ? 0 : 15;
|
||||||
double minSwitch = (!Utils.scaffoldDiagonal(false)) ? 0 : 13;
|
if (side >= 0 && firstStroke == 0) {
|
||||||
if (side >= 0) {
|
|
||||||
if (yawOffset <= -minSwitch) {
|
if (yawOffset <= -minSwitch) {
|
||||||
set2 = false;
|
set2 = false;
|
||||||
}
|
} else if (yawOffset >= 0) {
|
||||||
else if (yawOffset >= 0) {
|
|
||||||
if (yawOffset >= minSwitch) {
|
if (yawOffset >= minSwitch) {
|
||||||
set2 = true;
|
set2 = true;
|
||||||
}
|
}
|
||||||
|
|
@ -290,13 +287,12 @@ public class Scaffold extends Module {
|
||||||
e.setRotations((yaw + offset * 2) - yawOffset, pitch);
|
e.setRotations((yaw + offset * 2) - yawOffset, pitch);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (side <= -0) {
|
} else if (side <= -0 && firstStroke == 0) {
|
||||||
if (yawOffset >= minSwitch) {
|
if (yawOffset >= minSwitch) {
|
||||||
set2 = false;
|
set2 = false;
|
||||||
}
|
} else if (yawOffset <= 0) {
|
||||||
else if (yawOffset <= 0) {
|
|
||||||
if (yawOffset <= -minSwitch) {
|
if (yawOffset <= -minSwitch) {
|
||||||
set2 = true;
|
set2 = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (set2) {
|
if (set2) {
|
||||||
|
|
@ -315,8 +311,8 @@ public class Scaffold extends Module {
|
||||||
if (yawOffset >= minOffset) yawOffset = minOffset;
|
if (yawOffset >= minOffset) yawOffset = minOffset;
|
||||||
}
|
}
|
||||||
e.setRotations(yaw - yawOffset, pitch);
|
e.setRotations(yaw - yawOffset, pitch);
|
||||||
|
set2 = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
if (blockRotations != null) {
|
if (blockRotations != null) {
|
||||||
e.setRotations(blockRotations[0], blockRotations[1]);
|
e.setRotations(blockRotations[0], blockRotations[1]);
|
||||||
|
|
@ -326,8 +322,8 @@ public class Scaffold extends Module {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
float yv = MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw();
|
||||||
|
Utils.print("" + MathHelper.wrapAngleTo180_float(yv - e.getYaw()));
|
||||||
|
|
||||||
//jump facing forward
|
//jump facing forward
|
||||||
if (rotateForward && jumpFacingForward.isToggled()) {
|
if (rotateForward && jumpFacingForward.isToggled()) {
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ public class Tower extends Module {
|
||||||
else if (setLowMotion) {
|
else if (setLowMotion) {
|
||||||
++cMotionTicks;
|
++cMotionTicks;
|
||||||
if (cMotionTicks == 1) {
|
if (cMotionTicks == 1) {
|
||||||
mc.thePlayer.motionY = 0.05F;
|
mc.thePlayer.motionY = 0.06F;
|
||||||
}
|
}
|
||||||
else if (cMotionTicks == 3) {
|
else if (cMotionTicks == 3) {
|
||||||
cMotionTicks = 0;
|
cMotionTicks = 0;
|
||||||
|
|
|
||||||
|
|
@ -269,7 +269,7 @@ public class Indicators extends Module {
|
||||||
return new Color(210, 0, 255);
|
return new Color(210, 0, 255);
|
||||||
}
|
}
|
||||||
else if (itemStack.getItem() == Items.fire_charge) {
|
else if (itemStack.getItem() == Items.fire_charge) {
|
||||||
return new Color(255, 150, 0);
|
return new Color(255, 115, 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return Color.WHITE;
|
return Color.WHITE;
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@ public class ItemESP extends Module { // entirely skidded from raven b4 source l
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
GlStateManager.translate((float) n4, (float) n5 + 0.3, (float) n6);
|
GlStateManager.translate((float) n4, (float) n5 + 0.3, (float) n6);
|
||||||
GlStateManager.rotate(-mc.getRenderManager().playerViewY, 0.0f, 1.0f, 0.0f);
|
GlStateManager.rotate(-mc.getRenderManager().playerViewY, 0.0f, 1.0f, 0.0f);
|
||||||
GlStateManager.rotate(mc.getRenderManager().playerViewX, 1.0f, 0.0f, 0.0f);
|
GlStateManager.rotate((mc.gameSettings.thirdPersonView == 2 ? -1 : 1) * mc.getRenderManager().playerViewX, 1.0f, 0.0f, 0.0f);
|
||||||
float min2 = Math.min(Math.max(0.02266667f, (float) (0.001500000013038516 * n7)), 0.07f);
|
float min2 = Math.min(Math.max(0.02266667f, (float) (0.001500000013038516 * n7)), 0.07f);
|
||||||
GlStateManager.scale(-min2, -min2, -min2);
|
GlStateManager.scale(-min2, -min2, -min2);
|
||||||
GlStateManager.depthMask(false);
|
GlStateManager.depthMask(false);
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,10 @@ public abstract class Command {
|
||||||
Utils.sendMessage(ModuleManager.lowercaseChatCommands() ? msg.toLowerCase() : msg);
|
Utils.sendMessage(ModuleManager.lowercaseChatCommands() ? msg.toLowerCase() : msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void chatWithPrefix(String msg) {
|
||||||
|
Utils.sendMessage("&7[&f" + this.command + "&7] &r" + (ModuleManager.lowercaseChatCommands() ? msg.toLowerCase() : msg));
|
||||||
|
}
|
||||||
|
|
||||||
protected void syntaxError() {
|
protected void syntaxError() {
|
||||||
Utils.sendMessage("§csyntax error");
|
Utils.sendMessage("§csyntax error");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,11 @@ import keystrokesmod.module.Module;
|
||||||
import keystrokesmod.module.ModuleManager;
|
import keystrokesmod.module.ModuleManager;
|
||||||
import keystrokesmod.utility.command.Command;
|
import keystrokesmod.utility.command.Command;
|
||||||
import keystrokesmod.utility.profile.Profile;
|
import keystrokesmod.utility.profile.Profile;
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.lwjgl.input.Keyboard;
|
import org.lwjgl.input.Keyboard;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class Binds extends Command {
|
public class Binds extends Command {
|
||||||
|
|
@ -19,22 +20,34 @@ public class Binds extends Command {
|
||||||
@Override
|
@Override
|
||||||
public void onExecute(String[] args) {
|
public void onExecute(String[] args) {
|
||||||
if (args.length <= 1) {
|
if (args.length <= 1) {
|
||||||
HashMap<String, String> binds = getBindsModulesMap(0);
|
Map<String, List<String>> binds = getBindsModulesMap(0);
|
||||||
chat("&7[&fbinds&7] &b" + binds.size() + " &7module" + (binds.size() == 1 ? "" : "s") + " have keybinds.");
|
int size = getTotalModules(binds);
|
||||||
for (Map.Entry<String, String> bindsMap : binds.entrySet()) {
|
chatWithPrefix("&b" + size + " &7module" + (size == 1 ? "" : "s") + " have keybinds.");
|
||||||
chat(" &b" + bindsMap.getKey() + " &7" + bindsMap.getValue());
|
for (Map.Entry<String, List<String>> entry : binds.entrySet()) {
|
||||||
|
String key = entry.getKey();
|
||||||
|
List<String> moduleNames = entry.getValue();
|
||||||
|
for (String moduleName : moduleNames) {
|
||||||
|
chatWithPrefix(" &b" + key + " &7" + moduleName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (args.length == 2) {
|
else if (args.length == 2) {
|
||||||
int keycode = Keyboard.getKeyIndex(args[1].toUpperCase());
|
int keycode = Keyboard.getKeyIndex(args[1].toUpperCase());
|
||||||
if (keycode == 0) {
|
if (keycode == 0) {
|
||||||
chat("&7[&fbinds&7] &7Invalid key.");
|
chatWithPrefix("&7Invalid key.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
HashMap<String, String> binds = getBindsModulesMap(keycode);
|
|
||||||
chat("&7[&fbinds&7] &b" + binds.size() + " &7module" + (binds.size() == 1 ? "" : "s") + " has keybind &b" + args[1].toUpperCase() + "&7.");
|
Map<String, List<String>> binds = getBindsModulesMap(keycode);
|
||||||
for (Map.Entry<String, String> bindsMap : binds.entrySet()) {
|
int size = getTotalModules(binds);
|
||||||
chat(" &b" + bindsMap.getKey() + " &7" + bindsMap.getValue());
|
chatWithPrefix("&b" + size + " &7module" + (size == 1 ? "" : "s") + " has keybind &b" + args[1].toUpperCase() + "&7.");
|
||||||
|
|
||||||
|
for (Map.Entry<String, List<String>> entry : binds.entrySet()) {
|
||||||
|
String key = entry.getKey();
|
||||||
|
List<String> moduleNames = entry.getValue();
|
||||||
|
for (String moduleName : moduleNames) {
|
||||||
|
chatWithPrefix(" &b" + key + " &7" + moduleName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -42,36 +55,42 @@ public class Binds extends Command {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private HashMap<String, String> getBindsModulesMap(int keycode) {
|
private Map<String, List<String>> getBindsModulesMap(int keycode) {
|
||||||
HashMap<String, String> binds = new HashMap<>();
|
Map<String, List<String>> binds = new HashMap<>();
|
||||||
for (Module module : ModuleManager.modules) {
|
for (Module module : ModuleManager.modules) {
|
||||||
if (module.getKeycode() == 0) {
|
addModuleIfMatches(binds, module, keycode);
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (keycode != 0 && module.getKeycode() != keycode) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
binds.put((module.getKeycode() >= 1000 ? "M" + (module.getKeycode() - 1000) : Keyboard.getKeyName(module.getKeycode())), module.getName());
|
|
||||||
}
|
}
|
||||||
for (Profile profile : Raven.profileManager.profiles) {
|
for (Profile profile : Raven.profileManager.profiles) {
|
||||||
Module module = profile.getModule();
|
Module module = profile.getModule();
|
||||||
if (module.getKeycode() == 0) {
|
addModuleIfMatches(binds, module, keycode);
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (keycode != 0 && module.getKeycode() != keycode) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
binds.put((module.getKeycode() >= 1000 ? "M" + (module.getKeycode() - 1000) : Keyboard.getKeyName(module.getKeycode())), module.getName());
|
|
||||||
}
|
}
|
||||||
for (Module module : Raven.scriptManager.scripts.values()) {
|
for (Module scriptModule : Raven.scriptManager.scripts.values()) {
|
||||||
if (module.getKeycode() == 0) {
|
addModuleIfMatches(binds, scriptModule, keycode);
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (keycode != 0 && module.getKeycode() != keycode) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
binds.put((module.getKeycode() >= 1000 ? "M" + (module.getKeycode() - 1000) : Keyboard.getKeyName(module.getKeycode())), module.getName());
|
|
||||||
}
|
}
|
||||||
return binds;
|
return binds;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
private void addModuleIfMatches(Map<String, List<String>> bindsMap, Module module, int keycode) {
|
||||||
|
if (module.getKeycode() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (keycode != 0 && module.getKeycode() != keycode) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String keyName = (module.getKeycode() >= 1000) ? "M" + (module.getKeycode() - 1000) : Keyboard.getKeyName(module.getKeycode());
|
||||||
|
List<String> moduleNames = bindsMap.get(keyName);
|
||||||
|
if (moduleNames == null) {
|
||||||
|
moduleNames = new ArrayList<>();
|
||||||
|
bindsMap.put(keyName, moduleNames);
|
||||||
|
}
|
||||||
|
moduleNames.add(module.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getTotalModules(Map<String, List<String>> binds) {
|
||||||
|
int total = 0;
|
||||||
|
for (List<String> modules : binds.values()) {
|
||||||
|
total += modules.size();
|
||||||
|
}
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue