Skip to content
This repository was archived by the owner on Nov 6, 2024. It is now read-only.

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Pan4ur committed Jan 20, 2024
1 parent 39520e2 commit e8cdca0
Show file tree
Hide file tree
Showing 13 changed files with 228 additions and 133 deletions.
2 changes: 2 additions & 0 deletions src/main/java/thunder/hack/cmd/impl/FriendCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ public void executeBuild(@NotNull LiteralArgumentBuilder<CommandSource> 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;
Expand Down
23 changes: 23 additions & 0 deletions src/main/java/thunder/hack/cmd/impl/GetNbtCommand.java
Original file line number Diff line number Diff line change
@@ -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<CommandSource> 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;
});
}
}
28 changes: 28 additions & 0 deletions src/main/java/thunder/hack/cmd/impl/TreasureCommand.java
Original file line number Diff line number Diff line change
@@ -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<CommandSource> 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;
});
}
}
3 changes: 2 additions & 1 deletion src/main/java/thunder/hack/core/impl/CommandManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/thunder/hack/core/impl/ModuleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
46 changes: 0 additions & 46 deletions src/main/java/thunder/hack/gui/mainmenu/MainMenuScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public class MainMenuScreen extends Screen {
private final List<MainMenuButton> buttons = new ArrayList<>();
public boolean confirm = false;
public static int ticksActive;
static ArrayList<Particle> particles = new ArrayList<>();
private TextUtil animatedText = new TextUtil("THUNDERHACK", "HAPPY NEW YEAR!");

protected MainMenuScreen() {
Expand All @@ -54,7 +53,6 @@ protected MainMenuScreen() {
private static MainMenuScreen INSTANCE = new MainMenuScreen();

public static MainMenuScreen getInstance() {
particles.clear();
ticksActive = 0;

if (INSTANCE == null) {
Expand All @@ -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
Expand All @@ -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, () -> {
Expand Down Expand Up @@ -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);
}
}
}
10 changes: 8 additions & 2 deletions src/main/java/thunder/hack/modules/combat/Aura.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
107 changes: 81 additions & 26 deletions src/main/java/thunder/hack/modules/misc/AntiAfk.java
Original file line number Diff line number Diff line change
@@ -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> mode = new Setting<>("Mode", Mode.Simple);
private final Setting<Boolean> spin = new Setting<>("Spin", false, v -> mode.getValue() == Mode.Simple);
private final Setting<Float> speed = new Setting<>("Speed", 5f, 1f, 7f, v -> mode.getValue() == Mode.Simple);
private final Setting<Boolean> jump = new Setting<>("Jump", false, v -> mode.getValue() == Mode.Simple);
private final Setting<Boolean> swing = new Setting<>("Swing", false, v -> mode.getValue() == Mode.Simple);
private final Setting<Boolean> alwayssneak = new Setting<>("AlwaysSneak", false, v -> mode.getValue() == Mode.Simple);
private final Setting<Integer> 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<Boolean> spin = new Setting<>("Spin", false);
public Setting<Float> speed = new Setting<>("Speed", 5f, 1f, 7f);
private final Setting<Boolean> jump = new Setting<>("Jump", false);
private final Setting<Boolean> swing = new Setting<>("Swing", false);
private final Setting<Boolean> 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");
}
}
}
20 changes: 0 additions & 20 deletions src/main/java/thunder/hack/modules/misc/GetNbtTags.java

This file was deleted.

Loading

0 comments on commit e8cdca0

Please sign in to comment.