use method for printing module name into chat

This commit is contained in:
Bella 2020-03-01 20:48:05 -05:00
parent f28ffcc3f4
commit a004e799f7
17 changed files with 62 additions and 58 deletions

View File

@ -123,6 +123,10 @@ public class Module {
return name.getValue();
}
public String getChatName() {
return "[" + name.getValue() + "] ";
}
public String getDescription() {
return description;
}

View File

@ -78,84 +78,84 @@ public class AntiSpam extends Module {
if (greenText.getValue() && findPatterns(FilterPatterns.GREEN_TEXT, message)) {
if (showBlocked.getValue()) {
Command.sendChatMessage("[AntiSpam] Green Text: " + message);
Command.sendChatMessage(this.getChatName() + "Green Text: " + message);
}
return true;
}
if (discordLinks.getValue() && findPatterns(FilterPatterns.DISCORD, message)) {
if (showBlocked.getValue()) {
Command.sendChatMessage("[AntiSpam] Discord Link: " + message);
Command.sendChatMessage(this.getChatName() + "Discord Link: " + message);
}
return true;
}
if (webLinks.getValue() && findPatterns(FilterPatterns.WEB_LINK, message)) {
if (showBlocked.getValue()) {
Command.sendChatMessage("[AntiSpam] Web Link: " + message);
Command.sendChatMessage(this.getChatName() + "Web Link: " + message);
}
return true;
}
if (ips.getValue() && findPatterns(FilterPatterns.IP_ADDR, message)) {
if (showBlocked.getValue()) {
Command.sendChatMessage("[AntiSpam] IP Address: " + message);
Command.sendChatMessage(this.getChatName() + "IP Address: " + message);
}
return true;
}
if (ipsAgr.getValue() && findPatterns(FilterPatterns.IP_ADDR_AGR, message)) {
if (showBlocked.getValue()) {
Command.sendChatMessage("[AntiSpam] IP Aggressive: " + message);
Command.sendChatMessage(this.getChatName() + "IP Aggressive: " + message);
}
return true;
}
if (tradeChat.getValue() && findPatterns(FilterPatterns.TRADE_CHAT, message)) {
if (showBlocked.getValue()) {
Command.sendChatMessage("[AntiSpam] Trade Chat: " + message);
Command.sendChatMessage(this.getChatName() + "Trade Chat: " + message);
}
return true;
}
if (numberSuffix.getValue() && findPatterns(FilterPatterns.NUMBER_SUFFIX, message)) {
if (showBlocked.getValue()) {
Command.sendChatMessage("[AntiSpam] Number Suffix: " + message);
Command.sendChatMessage(this.getChatName() + "Number Suffix: " + message);
}
return true;
}
if (announcers.getValue() && findPatterns(FilterPatterns.ANNOUNCER, message)) {
if (showBlocked.getValue()) {
Command.sendChatMessage("[AntiSpam] Announcer: " + message);
Command.sendChatMessage(this.getChatName() + "Announcer: " + message);
}
return true;
}
if (spammers.getValue() && findPatterns(FilterPatterns.SPAMMER, message)) {
if (showBlocked.getValue()) {
Command.sendChatMessage("[AntiSpam] Spammers: " + message);
Command.sendChatMessage(this.getChatName() + "Spammers: " + message);
}
return true;
}
if (insulters.getValue() && findPatterns(FilterPatterns.INSULTER, message)) {
if (showBlocked.getValue()) {
Command.sendChatMessage("[AntiSpam] Insulter: " + message);
Command.sendChatMessage(this.getChatName() + "Insulter: " + message);
}
return true;
}
if (greeters.getValue() && findPatterns(FilterPatterns.GREETER, message)) {
if (showBlocked.getValue()) {
Command.sendChatMessage("[AntiSpam] Greeter: " + message);
Command.sendChatMessage(this.getChatName() + "Greeter: " + message);
}
return true;
}
if (hypixelShills.getValue() && findPatterns(FilterPatterns.HYPIXEL_SHILLS, message)) {
if (showBlocked.getValue()) {
Command.sendChatMessage("[AntiSpam] Hypixel Shills: ");
Command.sendChatMessage(this.getChatName() + "Hypixel Shills: ");
}
return true;
}
@ -171,7 +171,7 @@ public class AntiSpam extends Module {
messageHistory.put(message, System.currentTimeMillis());
if (isDuplicate) {
if (showBlocked.getValue()) {
Command.sendChatMessage("[AntiSpam] Duplicate: " + message);
Command.sendChatMessage(this.getChatName() + "Duplicate: " + message);
}
return true;
}

View File

@ -43,15 +43,15 @@ public class AutoQMain extends Module {
}
if (Minecraft.getMinecraft().getCurrentServerData() == null) {
Command.sendWarningMessage("[AutoQMain] &l&6Warning: &r&6You are on singleplayer");
Command.sendWarningMessage(this.getChatName() + "&l&6Warning: &r&6You are on singleplayer");
return;
}
if (!Minecraft.getMinecraft().getCurrentServerData().serverIP.equalsIgnoreCase("2b2t.org") && debugWarn.getValue()) {
Command.sendWarningMessage("[AutoQMain] &l&6Warning: &r&6You are not connected to 2b2t.org");
Command.sendWarningMessage(this.getChatName() + "&l&6Warning: &r&6You are not connected to 2b2t.org");
}
if (mc.player.dimension != 1 && endDi.getValue()) {
Command.sendWarningMessage("[AutoQMain] &l&6Warning: &r&6You are not in the end. Not running &b/queue main&7.");
// Command.sendWarningMessage("[AutoQMain] " + mc.player.dimension);
Command.sendWarningMessage(this.getChatName() + "&l&6Warning: &r&6You are not in the end. Not running &b/queue main&7.");
// Command.sendWarningMessage(this.getFormatName() + "" + mc.player.dimension);
return;
}
if (debug.getValue()) {

View File

@ -20,11 +20,11 @@ public class FormatChat extends Module {
@Override
public void onEnable() {
if (Minecraft.getMinecraft().getCurrentServerData() == null) {
Command.sendWarningMessage("[FormatChat] &6&lWarning: &r&6This does not work in singleplayer");
Command.sendWarningMessage(this.getChatName() + " &6&lWarning: &r&6This does not work in singleplayer");
this.disable();
}
else {
Command.sendWarningMessage("[FormatChat] &6&lWarning: &r&6This will kick you on most servers!");
Command.sendWarningMessage(this.getChatName() + " &6&lWarning: &r&6This will kick you on most servers!");
}
}

View File

@ -59,7 +59,7 @@ public class Aura extends Module {
return;
}
if (autoWait.getValue() && infoMsg.getValue()) {
Command.sendWarningMessage("[Aura] When Auto Tick Delay is turned on whatever you give Tick Delay doesn't matter, it uses the current TPS instead");
Command.sendWarningMessage(this.getChatName() + " When Auto Tick Delay is turned on whatever you give Tick Delay doesn't matter, it uses the current TPS instead");
}
}

View File

@ -126,7 +126,7 @@ public class Auto32k extends Module {
if (hopperSlot == -1) {
if (debugMessages.getValue()) {
Command.sendChatMessage("[Auto32k] Hopper missing, disabling.");
Command.sendChatMessage(this.getChatName() + "Hopper missing, disabling.");
}
this.disable();
return;
@ -134,7 +134,7 @@ public class Auto32k extends Module {
if (shulkerSlot == -1) {
if (debugMessages.getValue()) {
Command.sendChatMessage("[Auto32k] Shulker missing, disabling.");
Command.sendChatMessage(this.getChatName() + "Shulker missing, disabling.");
}
this.disable();
return;
@ -199,13 +199,13 @@ public class Auto32k extends Module {
if (placeCloseToEnemy.getValue()) {
if (debugMessages.getValue()) {
Command.sendChatMessage("[Auto32k] Placing close to Enemy");
Command.sendChatMessage(this.getChatName() + "Placing close to Enemy");
}
// Get Key with lowest Value (closest to enemies)
placeTarget = Collections.min(placeTargetMap.entrySet(), Map.Entry.comparingByValue()).getKey();
} else {
if (debugMessages.getValue()) {
Command.sendChatMessage("[Auto32k] Placing far from Enemy");
Command.sendChatMessage(this.getChatName() + "Placing far from Enemy");
}
// Get Key with highest Value (furthest away from enemies)
placeTarget = Collections.max(placeTargetMap.entrySet(), Map.Entry.comparingByValue()).getKey();
@ -214,7 +214,7 @@ public class Auto32k extends Module {
} else {
if (debugMessages.getValue()) {
Command.sendChatMessage("[Auto32k] No enemy nearby, placing at first valid position.");
Command.sendChatMessage(this.getChatName() + "No enemy nearby, placing at first valid position.");
}
// Use any place target position if no enemies are around
@ -229,14 +229,14 @@ public class Auto32k extends Module {
if (placeTarget == null) {
if (debugMessages.getValue()) {
Command.sendChatMessage("[Auto32k] No valid position in range to place!");
Command.sendChatMessage(this.getChatName() + "No valid position in range to place!");
}
this.disable();
return;
}
if (debugMessages.getValue()) {
Command.sendChatMessage("[Auto32k] Place Target: " + placeTarget.x + " " + placeTarget.y + " " + placeTarget.z + " Distance: " + df.format(mc.player.getPositionVector().distanceTo(new Vec3d(placeTarget))));
Command.sendChatMessage(this.getChatName() + "Place Target: " + placeTarget.x + " " + placeTarget.y + " " + placeTarget.z + " Distance: " + df.format(mc.player.getPositionVector().distanceTo(new Vec3d(placeTarget))));
}
mc.player.inventory.currentItem = hopperSlot;

View File

@ -69,7 +69,7 @@ public class AutoExp extends Module {
int xpSlot = findXpPots();
if (xpSlot == -1) {
if (autoDisable.getValue()) {
Command.sendWarningMessage("[AutoExp] No XP in hotbar, disabling");
Command.sendWarningMessage(this.getChatName() + " No XP in hotbar, disabling");
this.disable();
}
return;

View File

@ -181,7 +181,7 @@ public class AutoFeetPlace extends Module {
if (missingObiDisable && disableNone.getValue()) {
missingObiDisable = false;
if (infoMessage.getValue()) {
Command.sendChatMessage("[AutoFeetPlace] " + ChatFormatting.RED + "Disabled" + ChatFormatting.RESET + ", Obsidian missing!");
Command.sendChatMessage(this.getChatName() + " " + ChatFormatting.RED + "Disabled" + ChatFormatting.RESET + ", Obsidian missing!");
}
this.disable();
}

View File

@ -121,7 +121,7 @@ public class AutoTrap extends Module {
if (firstRun) {
if (findObiInHotbar() == -1) {
if (infoMessage.getValue()) {
Command.sendChatMessage("[AutoTrap] " + ChatFormatting.RED + "Disabled" + ChatFormatting.RESET + ", Obsidian missing!");
Command.sendChatMessage(this.getChatName() + " " + ChatFormatting.RED + "Disabled" + ChatFormatting.RESET + ", Obsidian missing!");
}
this.disable();
return;
@ -189,7 +189,7 @@ public class AutoTrap extends Module {
if (missingObiDisable) {
missingObiDisable = false;
if (infoMessage.getValue()) {
Command.sendChatMessage("[AutoTrap] " + ChatFormatting.RED + "Disabled" + ChatFormatting.RESET + ", Obsidian missing!");
Command.sendChatMessage(this.getChatName() + " " + ChatFormatting.RED + "Disabled" + ChatFormatting.RESET + ", Obsidian missing!");
}
this.disable();
}

View File

@ -79,8 +79,8 @@ public class CrystalAura extends Module {
antiWeakness.setValue(false);
checkAbsorption.setValue(true);
defaultSetting.setValue(false);
Command.sendChatMessage("[CrystalAura] Set to defaults!");
Command.sendChatMessage("[CrystalAura] Close and reopen the CrystalAura settings menu to see changes");
Command.sendChatMessage(this.getChatName() + " Set to defaults!");
Command.sendChatMessage(this.getChatName() + " Close and reopen the CrystalAura settings menu to see changes");
}
EntityEnderCrystal crystal = mc.world.loadedEntityList.stream()

View File

@ -62,7 +62,7 @@ public class Surround extends Module {
basePos = (new BlockPos(mc.player.getPositionVector())).down();
playerHotbarSlot = Wrapper.getPlayer().inventory.currentItem;
if (debugMsgs.getValue().equals(DebugMsgs.ALL)) {
Command.sendChatMessage("[Surround] Starting Loop, current Player Slot: " + playerHotbarSlot);
Command.sendChatMessage(this.getChatName() + " Starting Loop, current Player Slot: " + playerHotbarSlot);
}
if (!spoofHotbar.getValue()) {
@ -72,7 +72,7 @@ public class Surround extends Module {
for (int i = 0; i < (int) Math.floor(blockPerTick.getValue()); ++i) {
if (debugMsgs.getValue().equals(DebugMsgs.ALL)) {
Command.sendChatMessage("[Surround] Loop iteration: " + offsetStep);
Command.sendChatMessage(this.getChatName() + " Loop iteration: " + offsetStep);
}
if (offsetStep >= surroundTargets.length) {
@ -90,10 +90,10 @@ public class Surround extends Module {
/* Autocenter */
private void centerPlayer(double x, double y, double z) {
if (debugMsgs.getValue().equals(DebugMsgs.ALL) && playerPos != null) {
Command.sendChatMessage("[Surround: AutoCenter] Player position is " + playerPos.toString());
Command.sendChatMessage(this.getChatName() + " Player position is " + playerPos.toString());
}
else if (debugMsgs.getValue().equals(DebugMsgs.ALL)) {
Command.sendChatMessage("[Surround: AutoCenter] Player position is null");
Command.sendChatMessage(this.getChatName() + " Player position is null");
}
mc.player.connection.sendPacket(new CPacketPlayer.Position(x, y, z, true));
mc.player.setPosition(x, y, z);
@ -141,14 +141,14 @@ public class Surround extends Module {
playerHotbarSlot = Wrapper.getPlayer().inventory.currentItem;
lastHotbarSlot = -1;
if (debugMsgs.getValue().equals(DebugMsgs.ALL)) {
Command.sendChatMessage("[Surround] Saving initial Slot = " + playerHotbarSlot);
Command.sendChatMessage(this.getChatName() + " Saving initial Slot = " + playerHotbarSlot);
}
}
public void onDisable() {
if (mc.player != null) {
if (debugMsgs.getValue().equals(DebugMsgs.ALL)) {
Command.sendChatMessage("[Surround] Disabling");
Command.sendChatMessage(this.getChatName() + " Disabling");
}
if (lastHotbarSlot != playerHotbarSlot && playerHotbarSlot != -1) {
@ -166,11 +166,11 @@ public class Surround extends Module {
private void endLoop() {
offsetStep = 0;
if (debugMsgs.getValue().equals(DebugMsgs.ALL)) {
Command.sendChatMessage("[Surround] Ending Loop");
Command.sendChatMessage(this.getChatName() + " Ending Loop");
}
if (lastHotbarSlot != playerHotbarSlot && playerHotbarSlot != -1) {
if (debugMsgs.getValue().equals(DebugMsgs.ALL)) {
Command.sendChatMessage("[Surround] Setting Slot back to = " + playerHotbarSlot);
Command.sendChatMessage(this.getChatName() + " Setting Slot back to = " + playerHotbarSlot);
}
if (spoofHotbar.getValue()) {
@ -189,10 +189,10 @@ public class Surround extends Module {
private void placeBlock(BlockPos blockPos) {
if (!Wrapper.getWorld().getBlockState(blockPos).getMaterial().isReplaceable()) {
if (debugMsgs.getValue().equals(DebugMsgs.ALL)) {
Command.sendChatMessage("[Surround] Block is already placed, skipping");
Command.sendChatMessage(this.getChatName() + " Block is already placed, skipping");
}
} else if (!BlockInteractionHelper.checkForNeighbours(blockPos) && debugMsgs.getValue().equals(DebugMsgs.ALL)) {
Command.sendChatMessage("[Surround] !checkForNeighbours(blockPos), disabling! ");
Command.sendChatMessage(this.getChatName() + " !checkForNeighbours(blockPos), disabling! ");
} else {
if (placeAnimation.getValue()) mc.player.connection.sendPacket(new CPacketAnimation(mc.player.getActiveHand()));
placeBlockExecute(blockPos);
@ -226,7 +226,7 @@ public class Surround extends Module {
EnumFacing side2 = side.getOpposite();
if (!canBeClicked(neighbor)) {
if (debugMsgs.getValue().equals(DebugMsgs.ALL)) {
Command.sendChatMessage("[Surround] No neighbor to click at!");
Command.sendChatMessage(this.getChatName() + " No neighbor to click at!");
}
} else {
Vec3d hitVec = (new Vec3d(neighbor)).add(0.5D, 0.5D, 0.5D).add((new Vec3d(side2.getDirectionVec())).scale(0.5D));
@ -238,7 +238,7 @@ public class Surround extends Module {
Block blockBelow = mc.world.getBlockState(neighbor).getBlock();
if (BlockInteractionHelper.blackList.contains(blockBelow) || BlockInteractionHelper.shulkerList.contains(blockBelow)) {
if (debugMsgs.getValue().equals(DebugMsgs.IMPORTANT)) {
Command.sendChatMessage("[Surround] Sneak enabled!");
Command.sendChatMessage(this.getChatName() + " Sneak enabled!");
}
needSneak = true;
}
@ -249,7 +249,7 @@ public class Surround extends Module {
int obiSlot = findObiInHotbar();
if (obiSlot == -1) {
if (debugMsgs.getValue().equals(DebugMsgs.IMPORTANT)) {
Command.sendChatMessage("[Surround] No obsidian in hotbar, disabling!");
Command.sendChatMessage(this.getChatName() + " No obsidian in hotbar, disabling!");
}
disable();
return;
@ -257,7 +257,7 @@ public class Surround extends Module {
if (lastHotbarSlot != obiSlot) {
if (debugMsgs.getValue().equals(DebugMsgs.ALL)) {
Command.sendChatMessage("[Surround] Setting Slot to obsidian at = " + obiSlot);
Command.sendChatMessage(this.getChatName() + " Setting Slot to obsidian at = " + obiSlot);
}
if (spoofHotbar.getValue()) {
mc.player.connection.sendPacket(new CPacketHeldItemChange(obiSlot));
@ -271,7 +271,7 @@ public class Surround extends Module {
mc.player.connection.sendPacket(new CPacketAnimation(EnumHand.MAIN_HAND));
if (needSneak) {
if (debugMsgs.getValue().equals(DebugMsgs.IMPORTANT)) {
Command.sendChatMessage("[Surround] Sneak disabled!");
Command.sendChatMessage(this.getChatName() + " Sneak disabled!");
}
mc.player.connection.sendPacket(new CPacketEntityAction(mc.player, Action.STOP_SNEAKING));
}
@ -279,7 +279,7 @@ public class Surround extends Module {
}
if (debugMsgs.getValue().equals(DebugMsgs.ALL)) {
Command.sendChatMessage("[Surround] Distance > 4.25 blocks!");
Command.sendChatMessage(this.getChatName() + " Distance > 4.25 blocks!");
}
}
}

View File

@ -37,7 +37,7 @@ public class AntiChunkBan extends Module {
public void onEnable() {
if (mc.player == null) return;
Command.sendChatMessage("[AntiChunkBan] Note: this disables chunks loading in. If you want to be able to play normally you have to disable it");
Command.sendChatMessage(this.getChatName() + " Note: this disables chunks loading in. If you want to be able to play normally you have to disable it");
}
@Override

View File

@ -405,7 +405,7 @@ public class AutoSpawner extends Module {
if (!checkBlocksInHotbar()) {
if (!party.getValue()) {
if (notifications.getValue()) {
Command.sendChatMessage("[AutoSpawner] " + ChatFormatting.RED.toString() + "Blocks missing for: " + ChatFormatting.RESET.toString() + entityMode.getValue().toString() + ChatFormatting.RED.toString() + ", disabling.");
Command.sendChatMessage(this.getChatName() + " " + ChatFormatting.RED.toString() + "Blocks missing for: " + ChatFormatting.RESET.toString() + entityMode.getValue().toString() + ChatFormatting.RED.toString() + ", disabling.");
}
this.disable();
}
@ -428,7 +428,7 @@ public class AutoSpawner extends Module {
if (noPositionInArea) {
if (useMode.getValue().equals(UseMode.SINGLE)) {
if (notifications.getValue()) {
Command.sendChatMessage("[AutoSpawner] " + ChatFormatting.RED.toString() + "Position not valid, disabling.");
Command.sendChatMessage(this.getChatName() + " " + ChatFormatting.RED.toString() + "Position not valid, disabling.");
}
this.disable();
}

View File

@ -20,8 +20,8 @@ public class ConsoleSpam extends Module {
@Override
public void onEnable() {
Command.sendChatMessage("[ConsoleSpam] Every time you right click a sign, a warning will appear in console.");
Command.sendChatMessage("[ConsoleSpam] Use an autoclicker to automate this process.");
Command.sendChatMessage(this.getChatName() + " Every time you right click a sign, a warning will appear in console.");
Command.sendChatMessage(this.getChatName() + " Use an autoclicker to automate this process.");
}
@EventHandler

View File

@ -60,7 +60,7 @@ public class DiscordSettings extends Module {
if (startTime + 10000 <= System.currentTimeMillis()) { // 10 seconds in milliseconds
if (line1Setting.getValue().equals(LineInfo.COORDS) || line2Setting.getValue().equals(LineInfo.COORDS) || line3Setting.getValue().equals(LineInfo.COORDS) || line4Setting.getValue().equals(LineInfo.COORDS)) {
if (!coordsConfirm.getValue() && mc.player != null) {
Command.sendWarningMessage("[DiscordRPC] Warning: In order to use the coords option please enable the coords confirmation option. This will display your coords on the discord rpc. Do NOT use this if you do not want your coords displayed");
Command.sendWarningMessage(this.getChatName() + " Warning: In order to use the coords option please enable the coords confirmation option. This will display your coords on the discord rpc. Do NOT use this if you do not want your coords displayed");
}
}
startTime = System.currentTimeMillis();

View File

@ -23,7 +23,7 @@ public class FakeGamemode extends Module {
if (Minecraft.getMinecraft().getCurrentServerData() == null || (Minecraft.getMinecraft().getCurrentServerData() != null && Minecraft.getMinecraft().getCurrentServerData().serverIP.equalsIgnoreCase("2b2t.org"))) {
if (mc.player.dimension == 1) {
if (disable2b.getValue()) {
Command.sendWarningMessage("[FakeGamemode] Using this on 2b2t queue might get you kicked, please disable the AntiKick option if you're sure");
Command.sendWarningMessage(this.getFormatName() + " Using this on 2b2t queue might get you kicked, please disable the AntiKick option if you're sure");
this.disable();
}
}

View File

@ -39,8 +39,8 @@ public class ElytraFlight extends Module {
upSpeedBoost.setValue(0.08f);
downSpeedBoost.setValue(0.04f);
defaultSetting.setValue(false);
Command.sendChatMessage("[ElytraFlight] Set to defaults!");
Command.sendChatMessage("[ElytraFlight] Close and reopen the ElytraFlight settings menu to see changes");
Command.sendChatMessage(this.getChatName() + " Set to defaults!");
Command.sendChatMessage(this.getChatName() + " Close and reopen the ElytraFlight settings menu to see changes");
}
if (mc.player.capabilities.isFlying) {