diff --git a/src/main/java/thunder/hack/cmd/impl/FriendCommand.java b/src/main/java/thunder/hack/cmd/impl/FriendCommand.java index 66578472..ebaeb70a 100644 --- a/src/main/java/thunder/hack/cmd/impl/FriendCommand.java +++ b/src/main/java/thunder/hack/cmd/impl/FriendCommand.java @@ -20,11 +20,13 @@ public void executeBuild(@NotNull LiteralArgumentBuilder builder) builder.then(literal("reset").executes(context -> { ThunderHack.friendManager.clear(); sendMessage("Friends got reset."); + return SINGLE_SUCCESS; })); builder.then(literal("add").then(arg("player", StringArgumentType.word()).executes(context -> { String nickname = context.getArgument("player", String.class); + ThunderHack.friendManager.addFriend(nickname); sendMessage(nickname + " has been friended"); return SINGLE_SUCCESS; diff --git a/src/main/java/thunder/hack/cmd/impl/GetNbtCommand.java b/src/main/java/thunder/hack/cmd/impl/GetNbtCommand.java new file mode 100644 index 00000000..05c16792 --- /dev/null +++ b/src/main/java/thunder/hack/cmd/impl/GetNbtCommand.java @@ -0,0 +1,23 @@ +package thunder.hack.cmd.impl; + +import com.mojang.brigadier.builder.LiteralArgumentBuilder; +import net.minecraft.command.CommandSource; +import org.jetbrains.annotations.NotNull; +import thunder.hack.cmd.Command; + +import static com.mojang.brigadier.Command.SINGLE_SUCCESS; +import static thunder.hack.modules.client.MainSettings.isRu; + +public class GetNbtCommand extends Command { + public GetNbtCommand() { + super("nbt", "getnbt"); + } + + @Override + public void executeBuild(@NotNull LiteralArgumentBuilder builder) { + builder.executes(context -> { + sendMessage(mc.player.getMainHandStack().hasNbt() ? mc.player.getMainHandStack().getNbt().toString() : isRu() ? "У этого предмета нет nbt тегов!" : "This item don't contains nbt tags!"); + return SINGLE_SUCCESS; + }); + } +} diff --git a/src/main/java/thunder/hack/cmd/impl/TreasureCommand.java b/src/main/java/thunder/hack/cmd/impl/TreasureCommand.java new file mode 100644 index 00000000..a3dbcdc8 --- /dev/null +++ b/src/main/java/thunder/hack/cmd/impl/TreasureCommand.java @@ -0,0 +1,28 @@ +package thunder.hack.cmd.impl; + +import com.mojang.brigadier.builder.LiteralArgumentBuilder; +import net.minecraft.command.CommandSource; +import thunder.hack.cmd.Command; + +import static com.mojang.brigadier.Command.SINGLE_SUCCESS; +import static thunder.hack.modules.client.MainSettings.isRu; + +public class TreasureCommand extends Command { + public TreasureCommand() { + super("gettreasure", "treasure"); + } + + @Override + public void executeBuild(LiteralArgumentBuilder builder) { + builder.executes(context -> { + if (mc.player.getMainHandStack().getItem().toString().equals("filled_map")) { + StringBuilder result = new StringBuilder(); + String rawNbt = mc.player.getMainHandStack().getNbt().toString(); + for (int i = rawNbt.indexOf("x"); i < rawNbt.indexOf("]") - 2; i++) + result.append(rawNbt.charAt(i)); + sendMessage(isRu() ? "Нашел! Координаты: " + result : "Found! Coords: " + result); + } else sendMessage(isRu() ? "Возьми карту в руки!" : "Get map in hand!"); + return SINGLE_SUCCESS; + }); + } +} diff --git a/src/main/java/thunder/hack/core/impl/CommandManager.java b/src/main/java/thunder/hack/core/impl/CommandManager.java index 6f165a62..f6519ea2 100644 --- a/src/main/java/thunder/hack/core/impl/CommandManager.java +++ b/src/main/java/thunder/hack/core/impl/CommandManager.java @@ -23,7 +23,6 @@ public CommandManager() { add(new RpcCommand()); add(new KitCommand()); add(new GpsCommand()); - add(new CalcCommand()); add(new CfgCommand()); add(new BindCommand()); add(new DrawCommand()); @@ -34,12 +33,14 @@ public CommandManager() { add(new MacroCommand()); add(new StaffCommand()); add(new VClipCommand()); + add(new GetNbtCommand()); add(new FriendCommand()); add(new ModuleCommand()); add(new PrefixCommand()); add(new SearchCommand()); add(new TrackerCommand()); add(new DropAllCommand()); + add(new TreasureCommand()); add(new WayPointCommand()); add(new OpenFolderCommand()); add(new ResetBindsCommand()); diff --git a/src/main/java/thunder/hack/core/impl/ModuleManager.java b/src/main/java/thunder/hack/core/impl/ModuleManager.java index 2e4ae6c5..925b6eae 100644 --- a/src/main/java/thunder/hack/core/impl/ModuleManager.java +++ b/src/main/java/thunder/hack/core/impl/ModuleManager.java @@ -100,7 +100,6 @@ public class ModuleManager implements IManager { public static FakePlayer fakePlayer = new FakePlayer(); public static ElytraSwap elytraSwap = new ElytraSwap(); public static ElytraPlus elytraPlus = new ElytraPlus(); - public static AntiAfk antiAfk = new AntiAfk(); public static CevBreaker cevBreaker = new CevBreaker(); public static AutoSprint autoSprint = new AutoSprint(); public static AutoGApple autoGApple = new AutoGApple(); @@ -111,14 +110,11 @@ public class ModuleManager implements IManager { public static GapplesHud gapplesHud = new GapplesHud(); public static Particles particles = new Particles(); public static ToolSaver toolSaver = new ToolSaver(); - public static PVETools pveTools = new PVETools(); - public static GetNbtTags getNbtTags = new GetNbtTags(); public static DamageFly damageFly = new DamageFly(); public static WayPoints wayPoints = new WayPoints(); public static WaterMark waterMark = new WaterMark(); public static ViewModel viewModel = new ViewModel(); public static TunnelEsp tunnelEsp = new TunnelEsp(); - public static AutoWalk autoWalk = new AutoWalk(); public static TickShift tickShift = new TickShift(); public static TargetHud targetHud = new TargetHud(); public static SpeedMine speedMine = new SpeedMine(); @@ -165,6 +161,9 @@ public class ModuleManager implements IManager { public static SelfTrap selfTrap = new SelfTrap(); public static AntiVoid antiVoid = new AntiVoid(); public static KillFeed killFeed = new KillFeed(); + public static AutoWalk autoWalk = new AutoWalk(); + public static AutoEat autoEat = new AutoEat(); + public static AntiAFK antiAFK = new AntiAFK(); public static AutoBuy autoBuy = new AutoBuy(); public static SoundFX soundFX = new SoundFX(); public static AutoBed autoBed = new AutoBed(); diff --git a/src/main/java/thunder/hack/gui/mainmenu/MainMenuScreen.java b/src/main/java/thunder/hack/gui/mainmenu/MainMenuScreen.java index 8c5c0fc7..e4e85c08 100644 --- a/src/main/java/thunder/hack/gui/mainmenu/MainMenuScreen.java +++ b/src/main/java/thunder/hack/gui/mainmenu/MainMenuScreen.java @@ -35,7 +35,6 @@ public class MainMenuScreen extends Screen { private final List buttons = new ArrayList<>(); public boolean confirm = false; public static int ticksActive; - static ArrayList particles = new ArrayList<>(); private TextUtil animatedText = new TextUtil("THUNDERHACK", "HAPPY NEW YEAR!"); protected MainMenuScreen() { @@ -54,7 +53,6 @@ protected MainMenuScreen() { private static MainMenuScreen INSTANCE = new MainMenuScreen(); public static MainMenuScreen getInstance() { - particles.clear(); ticksActive = 0; if (INSTANCE == null) { @@ -68,20 +66,9 @@ public void tick() { ticksActive++; animatedText.tick(); - if(particles.size() < 100 && ticksActive > 40) { - particles.add(new Particle(0, mc.getWindow().getScaledHeight(), false)); - particles.add(new Particle(0, mc.getWindow().getScaledHeight(), false)); - - particles.add(new Particle(mc.getWindow().getScaledWidth(), mc.getWindow().getScaledHeight(), true)); - particles.add(new Particle(mc.getWindow().getScaledWidth(), mc.getWindow().getScaledHeight(), true)); - } - if(ticksActive > 400) { - particles.clear(); ticksActive = 0; } - - particles.forEach(Particle::tick); } @Override @@ -103,7 +90,6 @@ public void render(@NotNull DrawContext context, int mouseX, int mouseY, float d RenderSystem.enableBlend(); RenderSystem.defaultBlendFunc(); - particles.forEach(p -> p.render(context)); RenderSystem.disableBlend(); MSAAFramebuffer.use(true, () -> { @@ -163,36 +149,4 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) { return super.mouseClicked(mouseX, mouseY, button); } - - public static class Particle { - - Color color; - float px, py, x, y, mx, my; - - public Particle(int x, int y, boolean opposite) { - this.x = x; - this.y = y; - px = x; - py = y; - mx = opposite ? -MathUtility.random(7, 24) : MathUtility.random(7, 24); - my = MathUtility.random(1, 36); - color = HudEditor.getColor((int) mx * 20); - } - - public void tick() { - px = x; - py = y; - x += mx; - y -= my; - my -= 0.5f; - mx *= 0.99f; - my *= 0.99f; - } - - public void render(DrawContext context) { - RenderSystem.setShaderColor(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, 1f); - context.drawTexture(Render2DEngine.star, (int) Render2DEngine.interpolate(px, x, mc.getTickDelta()), (int) Render2DEngine.interpolate(py, y, mc.getTickDelta()), 20, 20, 0, 0, 20, 20, 20, 20); - RenderSystem.setShaderColor(1f, 1f, 1f, 1f); - } - } } diff --git a/src/main/java/thunder/hack/modules/combat/Aura.java b/src/main/java/thunder/hack/modules/combat/Aura.java index 5c06c0da..193ec12c 100644 --- a/src/main/java/thunder/hack/modules/combat/Aura.java +++ b/src/main/java/thunder/hack/modules/combat/Aura.java @@ -165,11 +165,17 @@ public void modifyJump(EventPlayerJump e) { } public void auraLogic() { + Item handItem = mc.player.getMainHandStack().getItem(); + + if((switchMode.getValue() != Switch.Silent && onlyWeapon.getValue() && !(handItem instanceof SwordItem || handItem instanceof AxeItem))) { + target = null; + return; + } + handleKill(); updateTarget(); - Item handItem = mc.player.getMainHandStack().getItem(); - if (target == null || (switchMode.getValue() != Switch.Silent && onlyWeapon.getValue() && !(handItem instanceof SwordItem || handItem instanceof AxeItem))) { + if (target == null) { return; } diff --git a/src/main/java/thunder/hack/modules/misc/AntiAfk.java b/src/main/java/thunder/hack/modules/misc/AntiAfk.java index 7b45fe98..b1d47e38 100644 --- a/src/main/java/thunder/hack/modules/misc/AntiAfk.java +++ b/src/main/java/thunder/hack/modules/misc/AntiAfk.java @@ -1,45 +1,100 @@ package thunder.hack.modules.misc; +import meteordevelopment.orbit.EventHandler; +import thunder.hack.ThunderHack; +import thunder.hack.events.impl.SettingEvent; import thunder.hack.modules.Module; import thunder.hack.setting.Setting; +import thunder.hack.utility.Timer; -import java.util.Random; +import java.util.concurrent.ThreadLocalRandom; -public class AntiAfk extends Module { - public AntiAfk() { - super("AntiAfk", Category.MISC); +public class AntiAFK extends Module { + + public AntiAFK() { + super("AntiAFK", Category.MISC); + } + + private final Setting mode = new Setting<>("Mode", Mode.Simple); + private final Setting spin = new Setting<>("Spin", false, v -> mode.getValue() == Mode.Simple); + private final Setting speed = new Setting<>("Speed", 5f, 1f, 7f, v -> mode.getValue() == Mode.Simple); + private final Setting jump = new Setting<>("Jump", false, v -> mode.getValue() == Mode.Simple); + private final Setting swing = new Setting<>("Swing", false, v -> mode.getValue() == Mode.Simple); + private final Setting alwayssneak = new Setting<>("AlwaysSneak", false, v -> mode.getValue() == Mode.Simple); + private final Setting radius = new Setting<>("Radius", 64, 1, 128, v -> mode.getValue() == Mode.Baritone); + + private int step; + private Timer inactiveTime = new Timer(); + + private enum Mode { + Simple, Baritone } - private final Setting spin = new Setting<>("Spin", false); - public Setting speed = new Setting<>("Speed", 5f, 1f, 7f); - private final Setting jump = new Setting<>("Jump", false); - private final Setting swing = new Setting<>("Swing", false); - private final Setting alwayssneak = new Setting<>("AlwaysSneak", false); - private float prevYaw; - private final Random random = new Random(); @Override public void onEnable() { - prevYaw = mc.player.getYaw(); - if(alwayssneak.getValue()){mc.options.sneakKey.setPressed(true);} + if (alwayssneak.getValue()) + mc.options.sneakKey.setPressed(true); + + step = 0; + } + + @EventHandler + public void onSettingChange(SettingEvent e) { + if(e.getSetting() == mode) + step = 0; } @Override - public void onUpdate(){ - if(spin.getValue()){ - prevYaw += speed.getValue(); - mc.player.setYaw(prevYaw); - } - if(jump.getValue()){ - if (mc.options.jumpKey.isPressed()) mc.options.jumpKey.setPressed(false); - else if (random.nextInt(99) == 0) mc.options.jumpKey.setPressed(true); - } - if(swing.getValue()){ - if (random.nextInt(99) == 0) mc.player.swingHand(mc.player.getActiveHand()); + public void onUpdate() { + if(mode.getValue() == Mode.Simple) { + if (spin.getValue()) { + double gcdFix = (Math.pow(mc.options.getMouseSensitivity().getValue() * 0.6 + 0.2, 3.0)) * 1.2; + float newYaw = mc.player.getYaw() + speed.getValue(); + mc.player.setYaw((float) (newYaw - (newYaw - mc.player.getYaw()) % gcdFix)); + } + + if (jump.getValue() && mc.player.isOnGround()) + mc.player.jump(); + + if (swing.getValue() && ThreadLocalRandom.current().nextInt(99) == 0) + mc.player.swingHand(mc.player.getActiveHand()); + } else { + if(inactiveTime.every(5000)) { + if(step > 3) + step = 0; + + switch (step) { + case 0: { + mc.player.networkHandler.sendChatMessage("#goto ~ ~" + radius.getValue()); + break; + } + case 1: { + mc.player.networkHandler.sendChatMessage("#goto ~" + radius.getValue() + " ~"); + break; + } + case 2: { + mc.player.networkHandler.sendChatMessage("#goto ~ ~-" + radius.getValue()); + break; + } + case 3: { + mc.player.networkHandler.sendChatMessage("#goto ~-" + radius.getValue() + " ~"); + break; + } + } + step++; + } } + + if(ThunderHack.playerManager.currentPlayerSpeed > 0.07) + inactiveTime.reset(); } @Override public void onDisable() { - if(alwayssneak.getValue()){mc.options.sneakKey.setPressed(false);} + if (alwayssneak.getValue()) + mc.options.sneakKey.setPressed(false); + + if(mode.getValue() == Mode.Baritone) + mc.player.networkHandler.sendChatMessage("#stop"); } -} +} \ No newline at end of file diff --git a/src/main/java/thunder/hack/modules/misc/GetNbtTags.java b/src/main/java/thunder/hack/modules/misc/GetNbtTags.java deleted file mode 100644 index 7badf2b8..00000000 --- a/src/main/java/thunder/hack/modules/misc/GetNbtTags.java +++ /dev/null @@ -1,20 +0,0 @@ -package thunder.hack.modules.misc; - -import thunder.hack.modules.Module; -import static thunder.hack.modules.client.MainSettings.isRu; - -public class GetNbtTags extends Module { - public GetNbtTags() { - super("GetNbtTags", Module.Category.MISC); - } - - @Override - public void onEnable() { - if (mc.player.getMainHandStack().hasNbt()) { - disable(mc.player.getMainHandStack().getNbt().toString()); - } - else{ - disable(isRu() ? "У этого предмета нет nbt тегов!" : "This item dont contains nbt tags!"); - } - } -} diff --git a/src/main/java/thunder/hack/modules/misc/PVETools.java b/src/main/java/thunder/hack/modules/misc/PVETools.java index a2b55e4a..35aeb379 100644 --- a/src/main/java/thunder/hack/modules/misc/PVETools.java +++ b/src/main/java/thunder/hack/modules/misc/PVETools.java @@ -33,8 +33,7 @@ public PVETools() { // Sheeps private final Setting SheepPaint = new Setting<>("SheepPaint", false); private final Setting SheepShear = new Setting<>("SheepShear", false); - String CladHelperCoords; - String string; + @EventHandler public void rotateAction(EventSync e) { @@ -43,36 +42,10 @@ public void rotateAction(EventSync e) { @EventHandler public void postRotateAction(EventPostSync e) { } - @Override - public void onEnable() { - if(mc.player.getMainHandStack().getItem().toString().equals("filled_map")) { - if (cladHelper.getValue()) { - string = ""; - CladHelperCoords = mc.player.getMainHandStack().getNbt().toString(); - for (int i = CladHelperCoords.indexOf("x"); i < CladHelperCoords.indexOf("]") - 2; i++) { - string += CladHelperCoords.charAt(i); - } - disable("Found! Coords: " + string); - } - } - else{ - disable(isRu() ? "Возьми карту в руки!" : "Get map in hand!"); - } - } + @EventHandler public void onSync(EventSync e) { - if (autoHoe.getValue()) { - if (mc.crosshairTarget != null && mc.crosshairTarget instanceof BlockHitResult bhr) { - if (mc.world.getBlockState(bhr.getBlockPos()).getBlock() instanceof CropBlock block && block.getAge(mc.world.getBlockState(bhr.getBlockPos())) == 7) { - mc.options.attackKey.setPressed(true); - } - } - } } - - @EventHandler(priority = EventPriority.HIGHEST) - private void onPostSync(EventPostSync event) { - mc.options.attackKey.setPressed(false); - } + // ПИЗДЕЦ НЕ ТРОГАЙТЕ МОДУЛЬ! } \ No newline at end of file diff --git a/src/main/java/thunder/hack/modules/movement/AutoWalk.java b/src/main/java/thunder/hack/modules/movement/AutoWalk.java index 5247eb7c..09f76c1d 100644 --- a/src/main/java/thunder/hack/modules/movement/AutoWalk.java +++ b/src/main/java/thunder/hack/modules/movement/AutoWalk.java @@ -1,5 +1,7 @@ package thunder.hack.modules.movement; +import meteordevelopment.orbit.EventHandler; +import thunder.hack.events.impl.EventKeyboardInput; import thunder.hack.modules.Module; import thunder.hack.modules.Module; import thunder.hack.setting.Setting; @@ -11,8 +13,8 @@ public AutoWalk() { super("AutoWalk", Category.MOVEMENT); } - @Override - public void onUpdate() { - mc.options.forwardKey.setPressed(true); + @EventHandler + public void onKey(EventKeyboardInput e) { + mc.player.input.movementForward = 1f; } } diff --git a/src/main/java/thunder/hack/modules/player/AutoEat.java b/src/main/java/thunder/hack/modules/player/AutoEat.java new file mode 100644 index 00000000..274e1229 --- /dev/null +++ b/src/main/java/thunder/hack/modules/player/AutoEat.java @@ -0,0 +1,72 @@ +package thunder.hack.modules.player; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; +import net.minecraft.network.packet.c2s.play.UpdateSelectedSlotC2SPacket; +import net.minecraft.util.Hand; +import org.jetbrains.annotations.NotNull; +import thunder.hack.modules.Module; +import thunder.hack.setting.Setting; + +import java.util.Stack; + +public class AutoEat extends Module { + + public AutoEat() { + super("AutoEat", Category.PLAYER); + } + + public final Setting hunger = new Setting("Hunger", 8, 0, 20); + public final Setting gapple = new Setting("Gapple", false); + public final Setting chorus = new Setting("Chorus", false); + public final Setting rottenFlesh = new Setting("RottenFlesh", false); + public final Setting spiderEye = new Setting("SpiderEye", false); + public final Setting pufferfish = new Setting("Pufferfish", false); + + private boolean eating; + + @Override + public void onUpdate() { + if (mc.player.getHungerManager().getFoodLevel() <= hunger.getValue()) { + if(!isHandGood(Hand.MAIN_HAND) && !isHandGood(Hand.OFF_HAND)) { + for (int i = 0; i < 9; i++) { + ItemStack stack = mc.player.getInventory().getStack(i); + if (stack.isFood()) { + if (!gapple.getValue() && (stack.getItem() == Items.GOLDEN_APPLE || stack.getItem() == Items.ENCHANTED_GOLDEN_APPLE)) + continue; + if (!chorus.getValue() && (stack.getItem() == Items.CHORUS_FRUIT)) + continue; + if (!rottenFlesh.getValue() && (stack.getItem() == Items.ROTTEN_FLESH)) + continue; + if (!spiderEye.getValue() && (stack.getItem() == Items.SPIDER_EYE)) + continue; + if (!pufferfish.getValue() && (stack.getItem() == Items.PUFFERFISH)) + continue; + mc.player.getInventory().selectedSlot = i; + sendPacket(new UpdateSelectedSlotC2SPacket(i)); + break; + } + } + } + + eating = true; + mc.options.useKey.setPressed(true); + } else if (eating) { + eating = false; + mc.options.useKey.setPressed(false); + } + } + + private boolean isHandGood(Hand hand) { + ItemStack stack = hand == Hand.MAIN_HAND ? mc.player.getMainHandStack() : mc.player.getOffHandStack(); + + Item item = stack.getItem(); + return stack.isFood() + && (gapple.getValue() || (item != Items.GOLDEN_APPLE && item != Items.ENCHANTED_GOLDEN_APPLE)) + && (chorus.getValue() || item != Items.CHORUS_FRUIT) + && (rottenFlesh.getValue() || item != Items.ROTTEN_FLESH) + && (spiderEye.getValue() || item != Items.SPIDER_EYE) + && (pufferfish.getValue() || item != Items.PUFFERFISH); + } +} diff --git a/src/main/resources/assets/thunderhack/lang/ru_ru.json b/src/main/resources/assets/thunderhack/lang/ru_ru.json index abe39550..1884066c 100644 --- a/src/main/resources/assets/thunderhack/lang/ru_ru.json +++ b/src/main/resources/assets/thunderhack/lang/ru_ru.json @@ -193,5 +193,5 @@ "descriptions.commands.tracker": "Добавить игроков в Tracker.", "descriptions.commands.vclip": "Клипнуться вертикально.", "descriptions.commands.waypoint": "Добавить вейпоинт (надо включить WayPoints!!!).", - "descriptions.combat.autocrystalbase": "Automatically places obsidian for crystal." + "descriptions.commands.getnbt": "Добавить вейпоинт (надо включить WayPoints!!!)." } \ No newline at end of file