Skip to content

Commit

Permalink
pizdec
Browse files Browse the repository at this point in the history
  • Loading branch information
Slieko committed Jun 13, 2024
1 parent b5786a8 commit 7f9c058
Show file tree
Hide file tree
Showing 24 changed files with 941 additions and 379 deletions.
2 changes: 0 additions & 2 deletions src/main/java/thunder/hack/ThunderHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public void onInitialize() {
moduleManager.onLoad();
configManager.loadChestStealer();
configManager.loadInvCleaner();
configManager.loadSearch();
configManager.loadNuker();
ThunderUtility.parseStarGazer();

Expand All @@ -99,7 +98,6 @@ public void onInitialize() {
wayPointManager.saveWayPoints();
macroManager.saveMacro();
configManager.saveChestStealer();
configManager.saveSearch();
configManager.saveNuker();
configManager.saveInvCleaner();
}));
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/thunder/hack/cmd/args/WayPointArgumentType.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

public class WayPointArgumentType implements ArgumentType<WayPointManager.WayPoint> {
private static final Collection<String> EXAMPLES = ThunderHack.wayPointManager.getWayPoints().stream()
.map(WayPointManager.WayPoint::name)
.map(WayPointManager.WayPoint::getName)
.limit(5)
.toList();

Expand All @@ -39,11 +39,11 @@ public WayPointManager.WayPoint parse(StringReader reader) throws CommandSyntaxE

@Override
public <S> CompletableFuture<Suggestions> listSuggestions(CommandContext<S> context, SuggestionsBuilder builder) {
return CommandSource.suggestMatching(ThunderHack.wayPointManager.getWayPoints().stream().map(WayPointManager.WayPoint::name), builder);
return CommandSource.suggestMatching(ThunderHack.wayPointManager.getWayPoints().stream().map(WayPointManager.WayPoint::getName), builder);
}

@Override
public Collection<String> getExamples() {
return EXAMPLES;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,21 @@
import org.jetbrains.annotations.NotNull;
import thunder.hack.cmd.Command;
import thunder.hack.cmd.args.SearchArgumentType;
import thunder.hack.modules.render.Search;
import thunder.hack.core.impl.ModuleManager;

import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static thunder.hack.modules.client.ClientSettings.isRu;

public class SearchCommand extends Command {
public SearchCommand() {
super("search");
public class BlockESPCommand extends Command {
public BlockESPCommand() {
super("blockesp");
}

@Override
public void executeBuild(@NotNull LiteralArgumentBuilder<CommandSource> builder) {
builder.then(literal("reset").executes(context -> {
Search.defaultBlocks.clear();
sendMessage("Search got reset.");

ModuleManager.blockESP.selectedBlocks.getValue().clear();
sendMessage(isRu() ? "Search был очищен!" : "Search got reset.");
mc.worldRenderer.reload();
return SINGLE_SUCCESS;
}));
Expand All @@ -33,8 +32,8 @@ public void executeBuild(@NotNull LiteralArgumentBuilder<CommandSource> builder)

Block result = getRegisteredBlock(blockName);
if(result != null){
Search.defaultBlocks.add(result);
sendMessage(Formatting.GREEN + blockName + (isRu() ? " добавлен в Search" : " added to Search"));
ModuleManager.blockESP.selectedBlocks.getValue().add(result);
sendMessage(Formatting.GREEN + blockName + (isRu() ? " добавлен в BlockESP" : " added to BlockESP"));
} else {
sendMessage(Formatting.RED + (isRu() ? "Такого блока нет!" : "There is no such block!"));
}
Expand All @@ -49,8 +48,8 @@ public void executeBuild(@NotNull LiteralArgumentBuilder<CommandSource> builder)

Block result = getRegisteredBlock(blockName);
if(result != null){
Search.defaultBlocks.remove(result);
sendMessage(Formatting.GREEN + blockName + (isRu() ? " удален из Search" : " removed from Search"));
ModuleManager.blockESP.selectedBlocks.getValue().remove(result);
sendMessage(Formatting.GREEN + blockName + (isRu() ? " удален из BlockESP" : " removed from BlockESP"));
} else {
sendMessage(Formatting.RED + (isRu() ? "Такого блока нет!" : "There is no such block!"));
}
Expand All @@ -61,14 +60,14 @@ public void executeBuild(@NotNull LiteralArgumentBuilder<CommandSource> builder)
})));

builder.executes(context -> {
if (Search.defaultBlocks.isEmpty()) {
if (ModuleManager.blockESP.selectedBlocks.getValue().getItemsById().isEmpty()) {
sendMessage("Search list empty");
} else {
StringBuilder f = new StringBuilder("Search list: ");

for (Block name : Search.defaultBlocks)
for (String name : ModuleManager.blockESP.selectedBlocks.getValue().getItemsById())
try {
f.append(name.getTranslationKey().replace("block.minecraft.","")).append(", ");
f.append(name).append(", ");
} catch (Exception ignored) {
}

Expand Down
15 changes: 8 additions & 7 deletions src/main/java/thunder/hack/cmd/impl/WayPointCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import thunder.hack.modules.client.ClientSettings;

import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static thunder.hack.modules.Module.mc;

public class WayPointCommand extends Command {
public WayPointCommand() {
Expand All @@ -26,7 +27,7 @@ public void executeBuild(@NotNull LiteralArgumentBuilder<CommandSource> builder)
else sendMessage("WayPoints:");

sendMessage(" ");
ThunderHack.wayPointManager.getWayPoints().forEach(wp -> sendMessage(wp.name() + "X: " + wp.x() + " Y: " + wp.y() + " Z: " + wp.z() + " Server: " + wp.server()));
ThunderHack.wayPointManager.getWayPoints().forEach(wp -> sendMessage(wp.getName() + " X: " + wp.getX() + " Y: " + wp.getY() + " Z: " + wp.getZ() + " Server: " + wp.getServer() + " Dimension: " + wp.getDimension()));

return SINGLE_SUCCESS;
}));
Expand All @@ -37,17 +38,17 @@ public void executeBuild(@NotNull LiteralArgumentBuilder<CommandSource> builder)
ThunderHack.wayPointManager.removeWayPoint(wp);

if (ClientSettings.language.getValue() == ClientSettings.Language.RU) {
sendMessage("Удалена метка " + wp.name());
sendMessage("Удалена метка " + wp.getName());
} else {
sendMessage("Removed waypoint " + wp.name());
sendMessage("Removed waypoint " + wp.getName());
}

return SINGLE_SUCCESS;
})));

builder.then(literal("add").then(arg("name", StringArgumentType.word()).executes(context -> {
String name = context.getArgument("name", String.class);
WayPointManager.WayPoint wp = new WayPointManager.WayPoint((int) mc.player.getX(), (int) mc.player.getY(), (int) mc.player.getZ(), name, (mc.isInSingleplayer() ? "SinglePlayer" : mc.getNetworkHandler().getServerInfo().address));
WayPointManager.WayPoint wp = new WayPointManager.WayPoint((int) mc.player.getX(), (int) mc.player.getY(), (int) mc.player.getZ(), name, (mc.isInSingleplayer() ? "SinglePlayer" : mc.getNetworkHandler().getServerInfo().address), mc.world.getRegistryKey().getValue().getPath());
ThunderHack.wayPointManager.addWayPoint(wp);

if (ClientSettings.language.getValue() == ClientSettings.Language.RU) {
Expand All @@ -63,7 +64,7 @@ public void executeBuild(@NotNull LiteralArgumentBuilder<CommandSource> builder)
String name = context.getArgument("name", String.class);
BlockPos pos = new BlockPos(context.getArgument("x", Integer.class), context.getArgument("y", Integer.class), context.getArgument("z", Integer.class));

WayPointManager.WayPoint wp = new WayPointManager.WayPoint(pos.getX(), pos.getY(), pos.getZ(), name, (mc.isInSingleplayer() ? "SinglePlayer" : mc.getNetworkHandler().getServerInfo().address));
WayPointManager.WayPoint wp = new WayPointManager.WayPoint(pos.getX(), pos.getY(), pos.getZ(), name, (mc.isInSingleplayer() ? "SinglePlayer" : mc.getNetworkHandler().getServerInfo().address), mc.world.getRegistryKey().getValue().getPath());
ThunderHack.wayPointManager.addWayPoint(wp);

if (ClientSettings.language.getValue() == ClientSettings.Language.RU) {
Expand All @@ -73,7 +74,7 @@ public void executeBuild(@NotNull LiteralArgumentBuilder<CommandSource> builder)
}

return SINGLE_SUCCESS;
})))))); // macro remove. // eclip bedrock // waypoints
}))))));

builder.executes(context -> {
sendMessage(usage());
Expand All @@ -85,4 +86,4 @@ public void executeBuild(@NotNull LiteralArgumentBuilder<CommandSource> builder)
String usage() {
return "waypoint add/remove/list (waypoint add x y z name), (waypoint remove name)";
}
}
}
3 changes: 1 addition & 2 deletions src/main/java/thunder/hack/core/impl/CommandManager.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package thunder.hack.core.impl;

import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.ClientCommandSource;
import net.minecraft.command.CommandSource;
Expand Down Expand Up @@ -40,7 +39,7 @@ public CommandManager() {
add(new FriendCommand());
add(new ModuleCommand());
add(new PrefixCommand());
add(new SearchCommand());
add(new BlockESPCommand());
add(new TrackerCommand());
add(new DropAllCommand());
add(new TreasureCommand());
Expand Down
40 changes: 2 additions & 38 deletions src/main/java/thunder/hack/core/impl/ConfigManager.java
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
package thunder.hack.core.impl;

import com.google.gson.*;
import com.mojang.logging.LogUtils;
import net.minecraft.block.Block;
import net.minecraft.util.Pair;
import org.apache.commons.io.IOUtils;
import org.jetbrains.annotations.NotNull;
import thunder.hack.ThunderHack;
import thunder.hack.cmd.Command;
import thunder.hack.cmd.impl.NukerCommand;
import thunder.hack.cmd.impl.SearchCommand;
import thunder.hack.cmd.impl.BlockESPCommand;
import thunder.hack.core.IManager;
import thunder.hack.modules.Module;
import thunder.hack.modules.client.ClientSettings;
import thunder.hack.modules.misc.Nuker;
import thunder.hack.modules.render.Search;
import thunder.hack.modules.render.BlockESP;
import thunder.hack.setting.Setting;
import thunder.hack.setting.impl.*;
import thunder.hack.utility.player.InventoryUtility;

import java.io.*;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
Expand Down Expand Up @@ -63,19 +55,6 @@ public ConfigManager() {
if (!STASHLOGGER_FOLDER.exists()) STASHLOGGER_FOLDER.mkdirs();
}

public void loadSearch() {
try {
File file = new File(CONFIG_FOLDER_NAME + "/misc/search.txt");

if (file.exists())
try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
while (reader.ready())
Search.defaultBlocks.add(SearchCommand.getRegisteredBlock(reader.readLine()));
}
} catch (Exception ignored) {
}
}

public void loadNuker() {
try {
File file = new File(CONFIG_FOLDER_NAME + "/misc/nuker.txt");
Expand All @@ -90,21 +69,6 @@ public void loadNuker() {
}
}

public void saveSearch() {
File file = new File(CONFIG_FOLDER_NAME + "/misc/search.txt");
try {
new File(CONFIG_FOLDER_NAME).mkdirs();
file.createNewFile();
} catch (Exception ignored) {
}

try (BufferedWriter writer = new BufferedWriter(new FileWriter(file))) {
for (Block name : Search.defaultBlocks) {
writer.write(name.getTranslationKey() + "\n");
}
} catch (Exception ignored) {
}
}

public void saveNuker() {
File file = new File(CONFIG_FOLDER_NAME + "/misc/nuker.txt");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/thunder/hack/core/impl/ModuleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public class ModuleManager implements IManager {
public static Trails trails = new Trails();
public static Strafe strafe = new Strafe();
public static Spider spider = new Spider();
public static Search search = new Search();
public static BlockESP blockESP = new BlockESP();
public static NoSlow noSlow = new NoSlow();
public static NoFall noFall = new NoFall();
public static Hotbar hotbar = new Hotbar();
Expand Down
Loading

0 comments on commit 7f9c058

Please sign in to comment.