From 9a81e6f0870256a3922b18b5940296c0eb789fe6 Mon Sep 17 00:00:00 2001 From: kirillsaint Date: Thu, 30 May 2024 00:57:51 +0600 Subject: [PATCH] (feature) copy chat --- .../java/net/silentclient/client/Client.java | 6 +- .../event/impl/ConnectToServerEvent.java | 1 - .../client/gui/GuiScreenServerListInGame.java | 27 -------- .../silentclient/client/gui/SplashScreen.java | 63 ------------------- .../client/mods/render/ChatMod.java | 25 +++++++- .../client/mods/render/skins/Direction.java | 2 +- .../mods/render/skins/SkullRendererCache.java | 31 --------- .../BodyLayerFeatureRenderer.java | 2 - .../HeadLayerFeatureRenderer.java | 2 +- .../client/mods/settings/GeneralMod.java | 4 +- .../client/mods/settings/RenderMod.java | 1 - .../client/mods/staff/RadmirMod.java | 27 -------- .../silentclient/client/mods/util/Server.java | 2 - .../client/mods/world/WeatherChangerMod.java | 6 +- .../client/skillissue/SkillIssue.java | 60 ------------------ .../skillissue/detections/AutoClicker.java | 27 -------- .../skillissue/detections/Detection.java | 34 ---------- .../client/skillissue/detections/Reach.java | 29 --------- .../client/utils/ScreenshotManager.java | 29 +++++---- 19 files changed, 46 insertions(+), 332 deletions(-) delete mode 100644 src/main/java/net/silentclient/client/gui/GuiScreenServerListInGame.java delete mode 100644 src/main/java/net/silentclient/client/gui/SplashScreen.java delete mode 100644 src/main/java/net/silentclient/client/mods/render/skins/SkullRendererCache.java delete mode 100644 src/main/java/net/silentclient/client/mods/staff/RadmirMod.java delete mode 100644 src/main/java/net/silentclient/client/skillissue/SkillIssue.java delete mode 100644 src/main/java/net/silentclient/client/skillissue/detections/AutoClicker.java delete mode 100644 src/main/java/net/silentclient/client/skillissue/detections/Detection.java delete mode 100644 src/main/java/net/silentclient/client/skillissue/detections/Reach.java diff --git a/src/main/java/net/silentclient/client/Client.java b/src/main/java/net/silentclient/client/Client.java index 851d39b..d4efe1b 100644 --- a/src/main/java/net/silentclient/client/Client.java +++ b/src/main/java/net/silentclient/client/Client.java @@ -42,7 +42,6 @@ import net.silentclient.client.mods.util.Utils; import net.silentclient.client.nanovg.UI; import net.silentclient.client.premium.PremiumCosmeticsGui; import net.silentclient.client.premium.PremiumUtils; -import net.silentclient.client.skillissue.SkillIssue; import net.silentclient.client.utils.*; import net.silentclient.client.utils.animations.AnimationHandler; import net.silentclient.client.utils.animations.SneakHandler; @@ -65,7 +64,7 @@ import java.util.List; public class Client { public static final Logger logger = LogManager.getLogger("SC"); - private final String version = "2.2.0"; + private final String version = "2.2.1"; private static final Client INSTANCE = new Client(); public static final Client getInstance() { @@ -104,7 +103,6 @@ public class Client { private AccountManager accountManager; public ServerData lastServerData; public TextUtils textUtils; - private SkillIssue skillIssue; private PlayerResponse.BanInfo banInfo; public static void memoryDebug(String paramString) { @@ -397,7 +395,6 @@ public class Client { this.textUtils = new TextUtils(Minecraft.getMinecraft().fontRendererObj); logger.info("STARTING > skillissue"); - this.skillIssue = new SkillIssue(); logger.info("-------------------------------------------------"); memoryDebug("CLIENT_POST_INIT"); } @@ -405,7 +402,6 @@ public class Client { public void shutdown() { logger.info("---------[ Silent Client Stopping ]--------------"); logger.info("STOPPING > silent-socket"); - skillIssue.sendDetections(); Players.unregister(); logger.info("-------------------------------------------------"); } diff --git a/src/main/java/net/silentclient/client/event/impl/ConnectToServerEvent.java b/src/main/java/net/silentclient/client/event/impl/ConnectToServerEvent.java index 011e951..8f6be2a 100644 --- a/src/main/java/net/silentclient/client/event/impl/ConnectToServerEvent.java +++ b/src/main/java/net/silentclient/client/event/impl/ConnectToServerEvent.java @@ -6,7 +6,6 @@ import net.silentclient.client.event.Event; public class ConnectToServerEvent extends Event { private final ServerData serverData; - public ConnectToServerEvent(ServerData serverData) { this.serverData = serverData; } diff --git a/src/main/java/net/silentclient/client/gui/GuiScreenServerListInGame.java b/src/main/java/net/silentclient/client/gui/GuiScreenServerListInGame.java deleted file mode 100644 index b519fee..0000000 --- a/src/main/java/net/silentclient/client/gui/GuiScreenServerListInGame.java +++ /dev/null @@ -1,27 +0,0 @@ -package net.silentclient.client.gui; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.GuiScreenServerList; -import net.minecraft.client.multiplayer.ServerData; - -import java.io.IOException; - -public class GuiScreenServerListInGame extends GuiScreenServerList { - public GuiScreenServerListInGame(GuiScreen p_i1031_1_, ServerData p_i1031_2_) { - super(p_i1031_1_, p_i1031_2_); - } - - @Override - protected void actionPerformed(GuiButton button) throws IOException { - if(button.id == 0) { - if(this.mc.theWorld != null) { - this.mc.theWorld.sendQuittingDisconnectingPacket(); - this.mc.loadWorld(null); - this.mc.displayGuiScreen(null); - } - } - - super.actionPerformed(button); - } -} diff --git a/src/main/java/net/silentclient/client/gui/SplashScreen.java b/src/main/java/net/silentclient/client/gui/SplashScreen.java deleted file mode 100644 index c368098..0000000 --- a/src/main/java/net/silentclient/client/gui/SplashScreen.java +++ /dev/null @@ -1,63 +0,0 @@ -package net.silentclient.client.gui; - -import org.lwjgl.opengl.GL11; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.texture.TextureManager; -import net.minecraft.client.shader.Framebuffer; -import net.minecraft.util.ResourceLocation; - -public class SplashScreen { - private static ResourceLocation SPLASH; - public static void update() { - if(Minecraft.getMinecraft() == null || Minecraft.getMinecraft().getLanguageManager() == null) { - return; - } - - drawSplash(Minecraft.getMinecraft().getTextureManager()); - } - - public static void setProgress(int givenProgress, String givenText) { - update(); - } - - public static void drawSplash(TextureManager tm) { - ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); - int scaleFactor = scaledResolution.getScaleFactor(); - - Framebuffer framebuffer = new Framebuffer(scaledResolution.getScaledWidth() * scaleFactor, scaledResolution.getScaledHeight() * scaleFactor, true); - framebuffer.bindFramebuffer(false); - - GlStateManager.matrixMode(GL11.GL_PROJECTION); - GlStateManager.loadIdentity(); - GlStateManager.ortho(0.0D, (double) scaledResolution.getScaledWidth(), (double) scaledResolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D); - GlStateManager.matrixMode(GL11.GL_MODELVIEW); - GlStateManager.loadIdentity(); - GlStateManager.translate(0.0F, 0.0F, -2000.0F); - GlStateManager.disableLighting(); - GlStateManager.disableFog(); - GlStateManager.disableDepth(); - GlStateManager.enableTexture2D(); - - if(SPLASH == null) { - SPLASH = new ResourceLocation("silentclient/splash.png"); - } - - tm.bindTexture(SPLASH); - - GlStateManager.resetColor(); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - - Gui.drawScaledCustomSizeModalRect(0, 0, 0, 0, 1920, 1080, scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight(), 1920, 1080); - framebuffer.unbindFramebuffer(); - framebuffer.framebufferRender(scaledResolution.getScaledWidth() * scaleFactor, scaledResolution.getScaledHeight() * scaleFactor); - - GlStateManager.enableAlpha(); - GlStateManager.alphaFunc(516, 0.1F); - - Minecraft.getMinecraft().updateDisplay(); - } - } diff --git a/src/main/java/net/silentclient/client/mods/render/ChatMod.java b/src/main/java/net/silentclient/client/mods/render/ChatMod.java index 41e0cc9..6e63080 100644 --- a/src/main/java/net/silentclient/client/mods/render/ChatMod.java +++ b/src/main/java/net/silentclient/client/mods/render/ChatMod.java @@ -1,8 +1,13 @@ package net.silentclient.client.mods.render; import net.minecraft.client.gui.GuiNewChat; +import net.minecraft.event.ClickEvent; +import net.minecraft.event.HoverEvent; import net.minecraft.network.play.server.S02PacketChat; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatStyle; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StringUtils; import net.silentclient.client.Client; import net.silentclient.client.event.EventTarget; import net.silentclient.client.event.impl.EventReceivePacket; @@ -19,11 +24,13 @@ public class ChatMod extends Mod { @Override public void setup() { + setUpdated(true); this.addBooleanSetting("Font Shadow", this, true); this.addBooleanSetting("Bar Animation", this, false); this.addBooleanSetting("Smooth", this, false); this.addSliderSetting("Smooth Speed", this, 4, 1, 10, false); this.addBooleanSetting("Disable Background", this, true); + this.addBooleanSetting("Copy Message Button", this, false); this.addBooleanSetting("Anti-Spam", this, false); } @@ -31,7 +38,23 @@ public class ChatMod extends Mod { public void chat(EventReceivePacket event) { if(event.getPacket() instanceof S02PacketChat && !event.isCancelable()) { final S02PacketChat chatPacket = (S02PacketChat)event.getPacket(); - if (Client.getInstance().getSettingsManager().getSettingByName(this, "Anti-Spam").getValBoolean() && chatPacket.getType() == 0) { + if(chatPacket.getType() == 2) return; + + if (Client.getInstance().getSettingsManager().getSettingByName(this, "Copy Message Button").getValBoolean()) { + String unformattedText = StringUtils.stripControlCodes(chatPacket.getChatComponent().getUnformattedText()); + if (!unformattedText.replace(" ", "").isEmpty()) { + ChatComponentText copyText = new ChatComponentText(EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "[COPY]"); + ChatStyle style = new ChatStyle() + .setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(EnumChatFormatting.GRAY + "Copy message"))) + .setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/slc$copy " + unformattedText)); + copyText.setChatStyle(style); + + chatPacket.getChatComponent().appendSibling(new ChatComponentText(EnumChatFormatting.RESET + " ")); + chatPacket.getChatComponent().appendSibling(copyText); + } + } + + if (Client.getInstance().getSettingsManager().getSettingByName(this, "Anti-Spam").getValBoolean()) { GuiNewChat guiNewChat = mc.ingameGUI.getChatGUI(); if (lastMessage.equals(chatPacket.getChatComponent().getUnformattedText())) { guiNewChat.deleteChatLine(line); diff --git a/src/main/java/net/silentclient/client/mods/render/skins/Direction.java b/src/main/java/net/silentclient/client/mods/render/skins/Direction.java index 340f729..f857399 100644 --- a/src/main/java/net/silentclient/client/mods/render/skins/Direction.java +++ b/src/main/java/net/silentclient/client/mods/render/skins/Direction.java @@ -8,7 +8,7 @@ public enum Direction { DOWN(new Vec3i(0, -1, 0)), UP(new Vec3i(0, 1, 0)), NORTH(new Vec3i(0, 0, -1)), SOUTH(new Vec3i(0, 0, 1)), WEST(new Vec3i(-1, 0, 0)), EAST(new Vec3i(1, 0, 0)); - private Direction(Vec3i normal) { + Direction(Vec3i normal) { this.normal = normal; } diff --git a/src/main/java/net/silentclient/client/mods/render/skins/SkullRendererCache.java b/src/main/java/net/silentclient/client/mods/render/skins/SkullRendererCache.java deleted file mode 100644 index c88e439..0000000 --- a/src/main/java/net/silentclient/client/mods/render/skins/SkullRendererCache.java +++ /dev/null @@ -1,31 +0,0 @@ -package net.silentclient.client.mods.render.skins; - -import net.minecraft.item.ItemStack; -import net.silentclient.client.mixin.accessors.skins.SkullSettings; -import net.silentclient.client.mods.render.skins.render.CustomizableModelPart; - -import java.util.WeakHashMap; - -public class SkullRendererCache { - - public static boolean renderNext = false; - public static SkullSettings lastSkull = null; - public static WeakHashMap itemCache = new WeakHashMap<>(); - - public static class ItemSettings implements SkullSettings { - - private CustomizableModelPart hatModel = null; - - @Override - public CustomizableModelPart getHeadLayers() { - return hatModel; - } - - @Override - public void setupHeadLayers(CustomizableModelPart box) { - this.hatModel = box; - } - - } - -} diff --git a/src/main/java/net/silentclient/client/mods/render/skins/renderlayers/BodyLayerFeatureRenderer.java b/src/main/java/net/silentclient/client/mods/render/skins/renderlayers/BodyLayerFeatureRenderer.java index 325910c..a37e8ac 100644 --- a/src/main/java/net/silentclient/client/mods/render/skins/renderlayers/BodyLayerFeatureRenderer.java +++ b/src/main/java/net/silentclient/client/mods/render/skins/renderlayers/BodyLayerFeatureRenderer.java @@ -21,13 +21,11 @@ import java.util.function.Supplier; public class BodyLayerFeatureRenderer implements LayerRenderer { - private RenderPlayer playerRenderer; private final boolean thinArms; private static final Minecraft mc = Minecraft.getMinecraft(); public BodyLayerFeatureRenderer( RenderPlayer playerRenderer) { - this.playerRenderer = playerRenderer; thinArms = ((PlayerEntityModelAccessor)playerRenderer).client$hasThinArms(); bodyLayers.add(new Layer(0, false, EnumPlayerModelParts.LEFT_PANTS_LEG, Shape.LEGS, () -> playerRenderer.getMainModel().bipedLeftLeg, () -> Client.getInstance().getSettingsManager().getSettingByClass(SkinsMod.class, "Left Leg").getValBoolean())); bodyLayers.add(new Layer(1, false, EnumPlayerModelParts.RIGHT_PANTS_LEG, Shape.LEGS, () -> playerRenderer.getMainModel().bipedRightLeg, () -> Client.getInstance().getSettingsManager().getSettingByClass(SkinsMod.class, "Right Leg").getValBoolean())); diff --git a/src/main/java/net/silentclient/client/mods/render/skins/renderlayers/HeadLayerFeatureRenderer.java b/src/main/java/net/silentclient/client/mods/render/skins/renderlayers/HeadLayerFeatureRenderer.java index 74d831f..5a4b7d0 100644 --- a/src/main/java/net/silentclient/client/mods/render/skins/renderlayers/HeadLayerFeatureRenderer.java +++ b/src/main/java/net/silentclient/client/mods/render/skins/renderlayers/HeadLayerFeatureRenderer.java @@ -37,7 +37,7 @@ public class HeadLayerFeatureRenderer implements LayerRenderer Client.getInstance().getSettingsManager().getSettingByClass(SkinsMod.class, "Level Of Detail Distance").getValInt()*Client.getInstance().getSettingsManager().getSettingByClass(SkinsMod.class, "Level Of Detail Distance").getValInt())return; - ItemStack itemStack = player.getEquipmentInSlot(1); //TODO + ItemStack itemStack = player.getEquipmentInSlot(1); if (itemStack != null && hideHeadLayers.contains(itemStack.getItem())) { return; } diff --git a/src/main/java/net/silentclient/client/mods/settings/GeneralMod.java b/src/main/java/net/silentclient/client/mods/settings/GeneralMod.java index d9a9a88..ce3ea50 100644 --- a/src/main/java/net/silentclient/client/mods/settings/GeneralMod.java +++ b/src/main/java/net/silentclient/client/mods/settings/GeneralMod.java @@ -17,9 +17,7 @@ public class GeneralMod extends Mod { public boolean isEnabled() { return true; } - - boolean lastFullscreen = false; - + public GeneralMod() { super("General", ModCategory.SETTINGS, "silentclient/icons/settings/general.png"); } diff --git a/src/main/java/net/silentclient/client/mods/settings/RenderMod.java b/src/main/java/net/silentclient/client/mods/settings/RenderMod.java index 8bd4a76..f83f6e0 100644 --- a/src/main/java/net/silentclient/client/mods/settings/RenderMod.java +++ b/src/main/java/net/silentclient/client/mods/settings/RenderMod.java @@ -9,7 +9,6 @@ public class RenderMod extends Mod { public boolean isEnabled() { return true; } - public RenderMod() { super("Render", ModCategory.SETTINGS, "silentclient/icons/settings/render.png"); diff --git a/src/main/java/net/silentclient/client/mods/staff/RadmirMod.java b/src/main/java/net/silentclient/client/mods/staff/RadmirMod.java deleted file mode 100644 index d9afe9f..0000000 --- a/src/main/java/net/silentclient/client/mods/staff/RadmirMod.java +++ /dev/null @@ -1,27 +0,0 @@ -package net.silentclient.client.mods.staff; - -import net.silentclient.client.event.EventTarget; -import net.silentclient.client.event.impl.EventText; -import net.silentclient.client.mods.Mod; -import net.silentclient.client.mods.ModCategory; - -public class RadmirMod extends Mod { - public RadmirMod() { - super("Radmir Mod", ModCategory.MODS, "silentclient/mods/radmir/radmir.png"); - } - - @EventTarget - public void onText(EventText event) { - event.setOutputText(this.replaceWords(event.getText(), "Radmir (курица)")); - } - - private String replaceWords(String input, String replacement) { - String[] words = input.split("\\s+"); - - for (int i = 0; i < words.length; i++) { - words[i] = replacement; - } - - return String.join(" ", words); - } -} diff --git a/src/main/java/net/silentclient/client/mods/util/Server.java b/src/main/java/net/silentclient/client/mods/util/Server.java index 1f47cd2..ada6e81 100644 --- a/src/main/java/net/silentclient/client/mods/util/Server.java +++ b/src/main/java/net/silentclient/client/mods/util/Server.java @@ -11,7 +11,6 @@ public class Server { public static boolean isHypixel() { return hypixel; } - public static void setHypixel(boolean hypixel) { Server.hypixel = hypixel; } @@ -19,7 +18,6 @@ public class Server { public static boolean isRuHypixel() { return ruHypixel; } - public static void setRuHypixel(boolean ruHypixel) { Server.ruHypixel = ruHypixel; } diff --git a/src/main/java/net/silentclient/client/mods/world/WeatherChangerMod.java b/src/main/java/net/silentclient/client/mods/world/WeatherChangerMod.java index 3ca1c4e..483a2fc 100644 --- a/src/main/java/net/silentclient/client/mods/world/WeatherChangerMod.java +++ b/src/main/java/net/silentclient/client/mods/world/WeatherChangerMod.java @@ -1,7 +1,5 @@ package net.silentclient.client.mods.world; -import java.util.ArrayList; - import net.minecraft.network.play.server.S2BPacketChangeGameState; import net.silentclient.client.Client; import net.silentclient.client.event.EventTarget; @@ -11,6 +9,8 @@ import net.silentclient.client.event.impl.EventReceivePacket; import net.silentclient.client.mods.Mod; import net.silentclient.client.mods.ModCategory; +import java.util.ArrayList; + public class WeatherChangerMod extends Mod { public WeatherChangerMod() { super("Weather", ModCategory.MODS, "silentclient/icons/mods/weatherchanger.png"); @@ -68,6 +68,4 @@ public class WeatherChangerMod extends Mod { event.setCancelled(true); } } - - } diff --git a/src/main/java/net/silentclient/client/skillissue/SkillIssue.java b/src/main/java/net/silentclient/client/skillissue/SkillIssue.java deleted file mode 100644 index fc1d27a..0000000 --- a/src/main/java/net/silentclient/client/skillissue/SkillIssue.java +++ /dev/null @@ -1,60 +0,0 @@ -package net.silentclient.client.skillissue; - -import net.minecraft.client.Minecraft; -import net.silentclient.client.Client; -import net.silentclient.client.event.EventManager; -import net.silentclient.client.event.EventTarget; -import net.silentclient.client.event.impl.ClientTickEvent; -import net.silentclient.client.skillissue.detections.Detection; -import net.silentclient.client.utils.Requests; -import net.silentclient.client.utils.TimerUtils; -import org.json.JSONArray; -import org.json.JSONObject; - -import java.util.ArrayList; - -public class SkillIssue { - public static final String VERSION = "1.0.0-beta.1"; - private final ArrayList detections = new ArrayList<>(); - private TimerUtils timer; - - public SkillIssue() { - EventManager.register(this); - Client.logger.info(String.format("[SkillIssue]: Initialising (v%s)", VERSION)); -// detections.add(new Reach(this)); -// detections.add(new AutoClicker(this)); - timer = new TimerUtils(); - } - - @EventTarget - public void tickEvent(ClientTickEvent event) { - if(timer.delay(30000)) { - timer.reset(); - (new Thread(this::sendDetections)).start(); - } - } - - public void sendDetections() { - JSONArray jsonArray = new JSONArray(); - for(Detection detection : detections) { - for(String detectReason : detection.getDetections()) { - jsonArray.put(new JSONObject().put("type", detection.getName().toLowerCase()).put("message", detectReason)); - } - detection.getDetections().clear(); - } - if(jsonArray.isEmpty()) { - return; - } - JSONObject jsonObject = new JSONObject().put("detects", jsonArray); - - Requests.post("https://api.silentclient.net/anticheat/detect", jsonObject.toString()); - - if(Minecraft.getMinecraft().theWorld != null) { - Client.getInstance().updateUserInformation(); - } - } - - public ArrayList getDetections() { - return detections; - } -} diff --git a/src/main/java/net/silentclient/client/skillissue/detections/AutoClicker.java b/src/main/java/net/silentclient/client/skillissue/detections/AutoClicker.java deleted file mode 100644 index 736ca65..0000000 --- a/src/main/java/net/silentclient/client/skillissue/detections/AutoClicker.java +++ /dev/null @@ -1,27 +0,0 @@ -package net.silentclient.client.skillissue.detections; - -import net.silentclient.client.Client; -import net.silentclient.client.event.EventTarget; -import net.silentclient.client.event.impl.EntityAttackEvent; -import net.silentclient.client.skillissue.SkillIssue; -import net.silentclient.client.utils.PlayerUtils; -import org.lwjgl.input.Mouse; - -public class AutoClicker extends Detection { - private long lastHit = 0; - - public AutoClicker(SkillIssue skillIssue) { - super(skillIssue, "AutoClicker"); - } - - @EventTarget - public void onHit(EntityAttackEvent event) { - if(System.currentTimeMillis() - lastHit < 500 || !PlayerUtils.isSurvival()) { - return; - } - this.lastHit = System.currentTimeMillis(); - if(!Mouse.isButtonDown(0) && Client.getInstance().getCPSTracker().getLCPS() > 10) { - this.detect(String.format("lmb is not pressed when hitting, %s cps", Client.getInstance().getCPSTracker().getLCPS())); - } - } -} diff --git a/src/main/java/net/silentclient/client/skillissue/detections/Detection.java b/src/main/java/net/silentclient/client/skillissue/detections/Detection.java deleted file mode 100644 index 2ddabf7..0000000 --- a/src/main/java/net/silentclient/client/skillissue/detections/Detection.java +++ /dev/null @@ -1,34 +0,0 @@ -package net.silentclient.client.skillissue.detections; - -import net.minecraft.client.Minecraft; -import net.silentclient.client.Client; -import net.silentclient.client.event.EventManager; -import net.silentclient.client.skillissue.SkillIssue; - -import java.util.ArrayList; - -public class Detection { - protected Minecraft mc = Minecraft.getMinecraft(); - protected SkillIssue skillIssue; - private final String name; - protected ArrayList detections = new ArrayList<>(); - - public Detection(SkillIssue skillIssue, String name) { - this.skillIssue = skillIssue; - this.name = name; - EventManager.register(this); - } - - public void detect(String data) { - this.detections.add(data); - Client.logger.warn(String.format("[SkillIssue]: %s Detection: %s (vl: %s)", name, data, detections.size())); - } - - public ArrayList getDetections() { - return detections; - } - - public String getName() { - return name; - } -} diff --git a/src/main/java/net/silentclient/client/skillissue/detections/Reach.java b/src/main/java/net/silentclient/client/skillissue/detections/Reach.java deleted file mode 100644 index bee6940..0000000 --- a/src/main/java/net/silentclient/client/skillissue/detections/Reach.java +++ /dev/null @@ -1,29 +0,0 @@ -package net.silentclient.client.skillissue.detections; - -import net.silentclient.client.event.EventTarget; -import net.silentclient.client.event.impl.EntityAttackEvent; -import net.silentclient.client.mods.hud.ReachDisplayMod; -import net.silentclient.client.skillissue.SkillIssue; -import net.silentclient.client.utils.PlayerUtils; - -public class Reach extends Detection { - private long lastHit = 0; - - public Reach(SkillIssue skillIssue) { - super(skillIssue, "Reach"); - } - - @EventTarget - public void totallyNoReachHax(EntityAttackEvent event) { - if(System.currentTimeMillis() - lastHit < 500 || !PlayerUtils.isSurvival() || mc.isSingleplayer()) { - return; - } - if(mc.objectMouseOver != null && mc.objectMouseOver.hitVec != null) { - this.lastHit = System.currentTimeMillis(); - double distance = mc.objectMouseOver.hitVec.distanceTo(mc.thePlayer.getPositionEyes(1.0F)); - if(distance > 3) { - this.detect("distance: " + ReachDisplayMod.FORMAT.format(distance)); - } - } - } -} diff --git a/src/main/java/net/silentclient/client/utils/ScreenshotManager.java b/src/main/java/net/silentclient/client/utils/ScreenshotManager.java index 602507e..aa14f64 100644 --- a/src/main/java/net/silentclient/client/utils/ScreenshotManager.java +++ b/src/main/java/net/silentclient/client/utils/ScreenshotManager.java @@ -1,23 +1,20 @@ package net.silentclient.client.utils; -import java.awt.HeadlessException; -import java.awt.Toolkit; +import net.minecraft.client.Minecraft; +import net.minecraft.util.Util; +import net.silentclient.client.Client; +import net.silentclient.client.event.EventTarget; +import net.silentclient.client.event.impl.RunCommandEvent; +import net.silentclient.client.utils.AsyncScreenshots.ImageSelection; +import org.lwjgl.Sys; + +import java.awt.*; +import java.awt.datatransfer.StringSelection; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.net.URI; -import net.silentclient.client.event.EventTarget; -import net.silentclient.client.event.impl.RunCommandEvent; -import org.lwjgl.Sys; - -import net.minecraft.client.Minecraft; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.Util; -import net.silentclient.client.Client; -import net.silentclient.client.utils.AsyncScreenshots.ImageSelection; - public class ScreenshotManager { private File screenshot; private BufferedImage image; @@ -46,6 +43,12 @@ public class ScreenshotManager { @EventTarget() public void command(RunCommandEvent event) { + if(event.getCommand().startsWith("/slc$copy ")) { + String message = event.getCommand().replace("/slc$copy ", ""); + Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(message), null); + event.setCancelled(true); + return; + } switch(event.getCommand()) { case "/$openfolder": File file1 = new File(mc.mcDataDir, "screenshots");