Re-added AimAssist (#246)

This commit is contained in:
Soda5601
2023-05-02 15:04:37 +08:00
committed by GitHub
parent cc91428cb8
commit 3b409b8215
26 changed files with 344 additions and 229 deletions

View File

@@ -31,6 +31,7 @@
# Features
## Modules
- AimAssist (Removed from Meteor in [ee391](https://github.com/MeteorDevelopment/meteor-client/commit/ee391e431f345f253447f425dbc0de8625f88e65))
- AntiBot (Removed from Meteor in [166fc](https://github.com/MeteorDevelopment/meteor-client/commit/166fccc73e53de6cfdbe41ea58dc593a2f5011f6))
- AntiCrash (Ported from [Anti-ClientCrasher](https://github.com/wagyourtail/Anti-ClientCrasher))
- AntiSpawnpoint
@@ -93,8 +94,6 @@
- KillAura
- `Fov and invisible filter`
- `Random Teleport, Hit Chance, Random Delay` (Removed from Meteor in [8722e](https://github.com/MeteorDevelopment/meteor-client/commit/8722ef565afa02ca4b6d9710a20fc9fcfd97bf05))
- AimAssist
- `Fov filter`
- Alts
- `Yggdrasil Login`

View File

@@ -1,22 +1,20 @@
package anticope.rejects;
import anticope.rejects.commands.*;
import anticope.rejects.gui.hud.*;
import anticope.rejects.gui.hud.RadarHud;
import anticope.rejects.gui.themes.rounded.MeteorRoundedGuiTheme;
import anticope.rejects.modules.*;
import meteordevelopment.meteorclient.addons.GithubRepo;
import meteordevelopment.meteorclient.addons.MeteorAddon;
import meteordevelopment.meteorclient.commands.Commands;
import meteordevelopment.meteorclient.gui.GuiThemes;
import meteordevelopment.meteorclient.systems.Systems;
import meteordevelopment.meteorclient.systems.commands.Commands;
import meteordevelopment.meteorclient.systems.hud.Hud;
import meteordevelopment.meteorclient.systems.hud.HudGroup;
import meteordevelopment.meteorclient.systems.modules.Category;
import meteordevelopment.meteorclient.systems.modules.Modules;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.item.Items;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -24,13 +22,14 @@ public class MeteorRejectsAddon extends MeteorAddon {
public static final Logger LOG = LoggerFactory.getLogger("Rejects");
public static final Category CATEGORY = new Category("Rejects", Items.BARRIER.getDefaultStack());
public static final HudGroup HUD_GROUP = new HudGroup("Rejects");
@Override
public void onInitialize() {
LOG.info("Initializing Meteor Rejects Addon");
// Modules
Modules modules = Modules.get();
modules.add(new AimAssist());
modules.add(new AntiBot());
modules.add(new AntiCrash());
modules.add(new AntiSpawnpoint());
@@ -79,34 +78,33 @@ public class MeteorRejectsAddon extends MeteorAddon {
modules.add(new SkeletonESP());
modules.add(new SoundLocator());
modules.add(new TreeAura());
// Commands
Commands commands = Commands.get();
commands.add(new CenterCommand());
commands.add(new ClearChatCommand());
commands.add(new GhostCommand());
commands.add(new GiveCommand());
commands.add(new HeadsCommand());
commands.add(new KickCommand());
commands.add(new LocateCommand());
commands.add(new PanicCommand());
commands.add(new ReconnectCommand());
commands.add(new ServerCommand());
commands.add(new SaveSkinCommand());
commands.add(new SeedCommand());
commands.add(new SetBlockCommand());
commands.add(new SetVelocityCommand());
commands.add(new TeleportCommand());
commands.add(new TerrainExport());
Commands.add(new CenterCommand());
Commands.add(new ClearChatCommand());
Commands.add(new GhostCommand());
Commands.add(new GiveCommand());
Commands.add(new HeadsCommand());
Commands.add(new KickCommand());
Commands.add(new LocateCommand());
Commands.add(new PanicCommand());
Commands.add(new ReconnectCommand());
Commands.add(new ServerCommand());
Commands.add(new SaveSkinCommand());
Commands.add(new SeedCommand());
Commands.add(new SetBlockCommand());
Commands.add(new SetVelocityCommand());
Commands.add(new TeleportCommand());
Commands.add(new TerrainExport());
// HUD
Hud hud = Systems.get(Hud.class);
hud.register(RadarHud.INFO);
// Themes
GuiThemes.add(new MeteorRoundedGuiTheme());
}
@Override
public void onRegisterCategories() {
Modules.registerCategory(CATEGORY);
@@ -125,11 +123,11 @@ public class MeteorRejectsAddon extends MeteorAddon {
@Override
public String getCommit() {
String commit = FabricLoader
.getInstance()
.getModContainer("meteor-rejects")
.get().getMetadata()
.getCustomValue("github:sha")
.getAsString();
.getInstance()
.getModContainer("meteor-rejects")
.get().getMetadata()
.getCustomValue("github:sha")
.getAsString();
LOG.info(String.format("Rejects version: %s", commit));
return commit.isEmpty() ? null : commit.trim();
}

View File

@@ -8,20 +8,18 @@ import com.mojang.brigadier.suggestion.Suggestions;
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import net.minecraft.client.MinecraftClient;
import net.minecraft.command.CommandSource;
import net.minecraft.command.argument.*;
import net.minecraft.command.argument.CoordinateArgument;
import net.minecraft.command.argument.Vec3ArgumentType;
import net.minecraft.server.command.CommandManager;
import net.minecraft.util.math.Vec3d;
import java.util.*;
import java.util.Arrays;
import java.util.Collection;
import java.util.concurrent.CompletableFuture;
public class ClientPosArgumentType implements ArgumentType<Vec3d> {
private static final Collection<String> EXAMPLES = Arrays.asList("0 0 0", "~ ~ ~", "~0.5 ~1 ~-5");
private static final MinecraftClient mc = MinecraftClient.getInstance();
public ClientPosArgumentType() {
}
public static ClientPosArgumentType pos() {
return new ClientPosArgumentType();
}
@@ -31,9 +29,9 @@ public class ClientPosArgumentType implements ArgumentType<Vec3d> {
return Suggestions.empty();
} else {
String string = builder.getRemaining();
Object collection2 = ((CommandSource)context.getSource()).getBlockPositionSuggestions();
Collection<CommandSource.RelativePosition> collection2 = ((CommandSource)context.getSource()).getBlockPositionSuggestions();
return CommandSource.suggestPositions(string, (Collection)collection2, builder, CommandManager.getCommandValidator(this::parse));
return CommandSource.suggestPositions(string, collection2, builder, CommandManager.getCommandValidator(this::parse));
}
}

View File

@@ -1,8 +1,5 @@
package anticope.rejects.arguments;
import java.util.Arrays;
import java.util.concurrent.CompletableFuture;
import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.arguments.ArgumentType;
import com.mojang.brigadier.context.CommandContext;
@@ -10,11 +7,13 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
import com.mojang.brigadier.suggestion.Suggestions;
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import java.lang.reflect.InvocationTargetException;
import net.minecraft.command.CommandSource;
import net.minecraft.text.Text;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.concurrent.CompletableFuture;
public class EnumArgumentType<T extends Enum<?>> implements ArgumentType<T> {
private static final DynamicCommandExceptionType NO_SUCH_TYPE = new DynamicCommandExceptionType(o ->
Text.literal(o + " is not a valid argument."));
@@ -32,7 +31,7 @@ public class EnumArgumentType<T extends Enum<?>> implements ArgumentType<T> {
}
public static <T extends Enum<?>> EnumArgumentType<T> enumArgument(T defaultValue) {
return new EnumArgumentType<T>(defaultValue);
return new EnumArgumentType<>(defaultValue);
}
public static <T extends Enum<?>> T getEnum(CommandContext<?> context, String name, T defaultValue) {

View File

@@ -1,8 +1,5 @@
package anticope.rejects.arguments;
import java.util.Collection;
import java.util.concurrent.CompletableFuture;
import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.arguments.ArgumentType;
import com.mojang.brigadier.context.CommandContext;
@@ -10,10 +7,12 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
import com.mojang.brigadier.suggestion.Suggestions;
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import net.minecraft.command.CommandSource;
import net.minecraft.text.Text;
import java.util.Collection;
import java.util.concurrent.CompletableFuture;
public class EnumStringArgumentType implements ArgumentType<String> {
private Collection<String> EXAMPLES;

View File

@@ -1,12 +1,13 @@
package anticope.rejects.commands;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.systems.commands.Command;
import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.command.CommandSource;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.util.math.MathHelper;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;
public class CenterCommand extends Command {
public CenterCommand() {

View File

@@ -1,10 +1,11 @@
package anticope.rejects.commands;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.systems.commands.Command;
import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.command.CommandSource;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;
public class ClearChatCommand extends Command {
public ClearChatCommand() {

View File

@@ -1,8 +1,8 @@
package anticope.rejects.commands;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.systems.commands.Command;
import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.client.network.ClientPlayNetworkHandler;
import net.minecraft.command.CommandSource;
import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket;
@@ -10,8 +10,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import static meteordevelopment.meteorclient.MeteorClient.mc;
public class GhostCommand extends Command {
public GhostCommand() {

View File

@@ -1,28 +1,33 @@
package anticope.rejects.commands;
import anticope.rejects.arguments.EnumStringArgumentType;
import anticope.rejects.utils.GiveUtils;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.command.CommandSource;
import net.minecraft.item.*;
import net.minecraft.nbt.*;
import anticope.rejects.utils.GiveUtils;
import meteordevelopment.meteorclient.systems.commands.Command;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtDouble;
import net.minecraft.nbt.NbtList;
import net.minecraft.nbt.NbtString;
import net.minecraft.registry.Registries;
import net.minecraft.text.Text;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import java.util.Collection;
import java.util.*;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;
public class GiveCommand extends Command {
private final Collection<String> PRESETS = GiveUtils.PRESETS.keySet();
public GiveCommand() {
super("give", "Gives items in creative", "item", "kit");
}
private final Collection<String> PRESETS = GiveUtils.PRESETS.keySet();
@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
@@ -31,7 +36,7 @@ public class GiveCommand extends Command {
ItemStack item = new ItemStack(Items.STRIDER_SPAWN_EGG);
NbtCompound ct = new NbtCompound();
if (inHand.getItem() instanceof BlockItem) {
ct.putInt("Time",1);
ct.putInt("Time", 1);
ct.putString("id", "minecraft:falling_block");
ct.put("BlockState", new NbtCompound());
ct.getCompound("BlockState").putString("Name", Registries.ITEM.getId(inHand.getItem()).toString());
@@ -45,11 +50,11 @@ public class GiveCommand extends Command {
ct.putString("id", "minecraft:item");
NbtCompound it = new NbtCompound();
it.putString("id", Registries.ITEM.getId(inHand.getItem()).toString());
it.putInt("Count",inHand.getCount());
it.putInt("Count", inHand.getCount());
if (inHand.hasNbt()) {
it.put("tag", inHand.getNbt());
}
ct.put("Item",it);
ct.put("Item", it);
}
NbtCompound t = new NbtCompound();
t.put("EntityTag", ct);
@@ -94,8 +99,8 @@ public class GiveCommand extends Command {
return SINGLE_SUCCESS;
})));
builder.then(literal("head").then(argument("owner",StringArgumentType.greedyString()).executes(ctx -> {
String playerName = ctx.getArgument("owner",String.class);
builder.then(literal("head").then(argument("owner", StringArgumentType.greedyString()).executes(ctx -> {
String playerName = ctx.getArgument("owner", String.class);
ItemStack itemStack = new ItemStack(Items.PLAYER_HEAD);
NbtCompound tag = new NbtCompound();
tag.putString("SkullOwner", playerName);

View File

@@ -2,8 +2,8 @@ package anticope.rejects.commands;
import anticope.rejects.gui.screens.HeadScreen;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.commands.Command;
import meteordevelopment.meteorclient.gui.GuiThemes;
import meteordevelopment.meteorclient.systems.commands.Command;
import meteordevelopment.meteorclient.utils.Utils;
import net.minecraft.command.CommandSource;
@@ -21,8 +21,8 @@ public class HeadsCommand extends Command {
Utils.screenToOpen = new HeadScreen(GuiThemes.get());
return SINGLE_SUCCESS;
});
}
}

View File

@@ -1,7 +1,7 @@
package anticope.rejects.commands;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.commands.Command;
import meteordevelopment.meteorclient.utils.player.ChatUtils;
import net.minecraft.client.util.GlfwUtil;
import net.minecraft.command.CommandSource;
@@ -11,9 +11,8 @@ import net.minecraft.network.packet.s2c.play.DisconnectS2CPacket;
import net.minecraft.text.Text;
import org.apache.commons.lang3.SystemUtils;
import meteordevelopment.meteorclient.systems.commands.Command;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;
public class KickCommand extends Command {
@@ -21,10 +20,30 @@ public class KickCommand extends Command {
super("kick", "Kick or disconnect yourself from the server", "disconnect", "quit");
}
private static void shutdown() throws Exception {
String cmd;
if (SystemUtils.IS_OS_AIX)
cmd = "shutdown -Fh 0";
else if (SystemUtils.IS_OS_FREE_BSD || SystemUtils.IS_OS_LINUX || SystemUtils.IS_OS_MAC || SystemUtils.IS_OS_MAC_OSX || SystemUtils.IS_OS_NET_BSD || SystemUtils.IS_OS_OPEN_BSD || SystemUtils.IS_OS_UNIX)
cmd = "shutdown -h now";
else if (SystemUtils.IS_OS_HP_UX)
cmd = "shutdown -hy 0";
else if (SystemUtils.IS_OS_IRIX)
cmd = "shutdown -y -g 0";
else if (SystemUtils.IS_OS_SOLARIS || SystemUtils.IS_OS_SUN_OS)
cmd = "shutdown -y -i5 -g 0";
else if (SystemUtils.IS_OS_WINDOWS)
cmd = "shutdown.exe /s /t 0";
else
throw new Exception("Unsupported operating system.");
Runtime.getRuntime().exec(cmd);
}
@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.then(literal("disconnect").executes(ctx -> {
mc.player.networkHandler.onDisconnect(new DisconnectS2CPacket(Text.literal("Disconnected via .kick command")));
mc.player.networkHandler.onDisconnect(new DisconnectS2CPacket(Text.literal("Disconnected via .kick command")));
return SINGLE_SUCCESS;
}));
builder.then(literal("pos").executes(ctx -> {
@@ -52,25 +71,4 @@ public class KickCommand extends Command {
return SINGLE_SUCCESS;
}));
}
private static void shutdown() throws Exception {
String cmd = "";
if (SystemUtils.IS_OS_AIX)
cmd = "shutdown -Fh 0";
else if (SystemUtils.IS_OS_FREE_BSD || SystemUtils.IS_OS_LINUX || SystemUtils.IS_OS_MAC || SystemUtils.IS_OS_MAC_OSX || SystemUtils.IS_OS_NET_BSD || SystemUtils.IS_OS_OPEN_BSD || SystemUtils.IS_OS_UNIX)
cmd = "shutdown -h now";
else if (SystemUtils.IS_OS_HP_UX)
cmd = "shutdown -hy 0";
else if (SystemUtils.IS_OS_IRIX)
cmd = "shutdown -y -g 0";
else if (SystemUtils.IS_OS_SOLARIS || SystemUtils.IS_OS_SUN_OS)
cmd = "shutdown -y -i5 -g 0";
else if (SystemUtils.IS_OS_WINDOWS)
cmd = "shutdown.exe /s /t 0";
else
throw new Exception("Unsupported operating system.");
Runtime.getRuntime().exec(cmd);
}
}

View File

@@ -4,7 +4,7 @@ import anticope.rejects.arguments.EnumArgumentType;
import anticope.rejects.utils.WorldGenUtils;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
import meteordevelopment.meteorclient.systems.commands.Command;
import meteordevelopment.meteorclient.commands.Command;
import meteordevelopment.meteorclient.utils.Utils;
import meteordevelopment.meteorclient.utils.player.ChatUtils;
import net.minecraft.command.CommandSource;
@@ -14,6 +14,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;
public class LocateCommand extends Command {

View File

@@ -1,7 +1,7 @@
package anticope.rejects.commands;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.systems.commands.Command;
import meteordevelopment.meteorclient.commands.Command;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.systems.modules.Modules;
import net.minecraft.command.CommandSource;

View File

@@ -1,7 +1,7 @@
package anticope.rejects.commands;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.systems.commands.Command;
import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.client.gui.screen.ConnectScreen;
import net.minecraft.client.gui.screen.TitleScreen;
import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen;
@@ -10,6 +10,7 @@ import net.minecraft.client.network.ServerInfo;
import net.minecraft.command.CommandSource;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;
public class ReconnectCommand extends Command {
public ReconnectCommand() {

View File

@@ -1,14 +1,15 @@
package anticope.rejects.commands;
import com.google.gson.*;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
import meteordevelopment.meteorclient.systems.commands.Command;
import meteordevelopment.meteorclient.systems.commands.arguments.PlayerListEntryArgumentType;
import meteordevelopment.meteorclient.commands.Command;
import meteordevelopment.meteorclient.commands.arguments.PlayerListEntryArgumentType;
import meteordevelopment.meteorclient.utils.network.Http;
import net.minecraft.command.CommandSource;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.text.Text;
import org.apache.commons.codec.binary.Base64;
import org.lwjgl.BufferUtils;
@@ -32,7 +33,7 @@ public class SaveSkinCommand extends Command {
private final Gson GSON = new Gson();
public SaveSkinCommand() {
super("save-skin","Download a player's skin by name.", "skin","skinsteal");
super("save-skin", "Download a player's skin by name.", "skin", "skinsteal");
filters = BufferUtils.createPointerBuffer(1);
@@ -50,9 +51,9 @@ public class SaveSkinCommand extends Command {
if (path == null) IO_EXCEPTION.create();
if (path != null) {
if (!path.endsWith(".png")) path += ".png";
saveSkin(id.toString(),path);
saveSkin(id.toString(), path);
}
return SINGLE_SUCCESS;
}));
}

View File

@@ -1,17 +1,15 @@
package anticope.rejects.commands;
import anticope.rejects.arguments.EnumArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
import net.minecraft.command.CommandSource;
import com.seedfinding.mccore.version.MCVersion;
import meteordevelopment.meteorclient.systems.commands.Command;
import anticope.rejects.utils.seeds.Seed;
import anticope.rejects.utils.seeds.Seeds;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
import com.seedfinding.mccore.version.MCVersion;
import meteordevelopment.meteorclient.commands.Command;
import meteordevelopment.meteorclient.utils.Utils;
import net.minecraft.command.CommandSource;
import net.minecraft.text.MutableText;
import net.minecraft.text.Text;

View File

@@ -1,32 +1,27 @@
package anticope.rejects.commands;
import anticope.rejects.utils.portscanner.PScanRunner;
import anticope.rejects.utils.portscanner.PortScannerManager;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.client.network.ServerInfo;
import net.minecraft.command.CommandSource;
import net.minecraft.text.ClickEvent;
import net.minecraft.text.HoverEvent;
import net.minecraft.text.ClickEvent.Action;
import net.minecraft.text.HoverEvent;
import net.minecraft.text.MutableText;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import anticope.rejects.utils.portscanner.PScanRunner;
import anticope.rejects.utils.portscanner.PortScannerManager;
import meteordevelopment.meteorclient.systems.commands.Command;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.*;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;
/*
Ported from Cornos
@@ -37,7 +32,7 @@ public class ServerCommand extends Command {
private final static SimpleCommandExceptionType ADDRESS_ERROR = new SimpleCommandExceptionType(Text.literal("Couldn't obtain server address"));
private final static SimpleCommandExceptionType INVALID_RANGE = new SimpleCommandExceptionType(Text.literal("Invalid range"));
private final static HashMap<Integer, String> ports = new HashMap<Integer, String>();
private final static HashMap<Integer, String> ports = new HashMap<>();
public ServerCommand() {
super("server", "Prints server information");
@@ -68,7 +63,7 @@ public class ServerCommand extends Command {
})));
builder.then(literal("ports").then(argument("from", IntegerArgumentType.integer(0)).then(argument("to", IntegerArgumentType.integer(1)).executes(ctx -> {
scanRange(getAddress(), IntegerArgumentType.getInteger(ctx, "from"),
IntegerArgumentType.getInteger(ctx, "to"));
IntegerArgumentType.getInteger(ctx, "to"));
return SINGLE_SUCCESS;
}))));
}
@@ -80,8 +75,7 @@ public class ServerCommand extends Command {
} catch (UnknownHostException e) {
throw ADDRESS_ERROR.create();
}
}
else {
} else {
ServerInfo server = mc.getCurrentServerEntry();
if (server == null) throw ADDRESS_ERROR.create();
try {
@@ -92,7 +86,7 @@ public class ServerCommand extends Command {
}
}
private void scanPorts(InetAddress address, Collection<Integer> port_list){
private void scanPorts(InetAddress address, Collection<Integer> port_list) {
info("Started scanning %d ports", port_list.size());
PScanRunner pScanRunner = new PScanRunner(address, 5, 3, 200, port_list, scanResults -> {
int open_ports = 0;
@@ -113,7 +107,7 @@ public class ServerCommand extends Command {
}
private void scanRange(InetAddress address, int min, int max) throws CommandSyntaxException {
if (max<min) throw INVALID_RANGE.create();
if (max < min) throw INVALID_RANGE.create();
List<Integer> port_list = new LinkedList<>();
for (int i = min; i <= max; i++) port_list.add(i);
scanPorts(address, port_list);
@@ -125,48 +119,48 @@ public class ServerCommand extends Command {
text.append(ports.get(port));
if (ports.get(port).startsWith("HTTP") || ports.get(port).startsWith("FTP")) {
text.setStyle(text.getStyle()
.withClickEvent(new ClickEvent(
Action.OPEN_URL,
String.format("%s://%s:%d", ports.get(port).toLowerCase(), address.getHostAddress(), port)
))
.withHoverEvent(new HoverEvent(
HoverEvent.Action.SHOW_TEXT,
Text.literal("Open in browser")
))
.withClickEvent(new ClickEvent(
Action.OPEN_URL,
String.format("%s://%s:%d", ports.get(port).toLowerCase(), address.getHostAddress(), port)
))
.withHoverEvent(new HoverEvent(
HoverEvent.Action.SHOW_TEXT,
Text.literal("Open in browser")
))
);
} else if (ports.get(port) == "DynMap") {
} else if (Objects.equals(ports.get(port), "DynMap")) {
text.setStyle(text.getStyle()
.withClickEvent(new ClickEvent(
ClickEvent.Action.OPEN_URL,
String.format("http://%s:%d", address.getHostAddress(), port)
))
.withHoverEvent(new HoverEvent(
HoverEvent.Action.SHOW_TEXT,
Text.literal("Open in browser")
))
.withClickEvent(new ClickEvent(
ClickEvent.Action.OPEN_URL,
String.format("http://%s:%d", address.getHostAddress(), port)
))
.withHoverEvent(new HoverEvent(
HoverEvent.Action.SHOW_TEXT,
Text.literal("Open in browser")
))
);
} else {
text.setStyle(text.getStyle()
.withClickEvent(new ClickEvent(
ClickEvent.Action.COPY_TO_CLIPBOARD,
String.format("%s:%d", address.getHostAddress(), port)
))
.withHoverEvent(new HoverEvent(
HoverEvent.Action.SHOW_TEXT,
Text.literal("Copy")
))
.withClickEvent(new ClickEvent(
ClickEvent.Action.COPY_TO_CLIPBOARD,
String.format("%s:%d", address.getHostAddress(), port)
))
.withHoverEvent(new HoverEvent(
HoverEvent.Action.SHOW_TEXT,
Text.literal("Copy")
))
);
}
} else {
text.setStyle(text.getStyle()
.withClickEvent(new ClickEvent(
ClickEvent.Action.COPY_TO_CLIPBOARD,
String.format("%s:%d", address.getHostAddress(), port)
))
.withHoverEvent(new HoverEvent(
HoverEvent.Action.SHOW_TEXT,
Text.literal("Copy")
))
.withClickEvent(new ClickEvent(
ClickEvent.Action.COPY_TO_CLIPBOARD,
String.format("%s:%d", address.getHostAddress(), port)
))
.withHoverEvent(new HoverEvent(
HoverEvent.Action.SHOW_TEXT,
Text.literal("Copy")
))
);
}

View File

@@ -2,8 +2,7 @@ package anticope.rejects.commands;
import anticope.rejects.arguments.ClientPosArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.systems.commands.Command;
import meteordevelopment.meteorclient.systems.commands.Commands;
import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.block.BlockState;
import net.minecraft.command.CommandSource;
import net.minecraft.command.argument.BlockStateArgument;
@@ -12,6 +11,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;
public class SetBlockCommand extends Command {
public SetBlockCommand() {
@@ -20,10 +20,10 @@ public class SetBlockCommand extends Command {
@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.then(argument("pos", ClientPosArgumentType.pos()).then(argument("block", BlockStateArgumentType.blockState(Commands.REGISTRY_ACCESS)).executes(ctx -> {
builder.then(argument("pos", ClientPosArgumentType.pos()).then(argument("block", BlockStateArgumentType.blockState(REGISTRY_ACCESS)).executes(ctx -> {
Vec3d pos = ClientPosArgumentType.getPos(ctx, "pos");
BlockState blockState = ctx.getArgument("block", BlockStateArgument.class).getBlockState();
mc.world.setBlockState(new BlockPos((int)pos.getX(), (int)pos.getY(), (int)pos.getZ()), blockState);
mc.world.setBlockState(new BlockPos((int) pos.getX(), (int) pos.getY(), (int) pos.getZ()), blockState);
return SINGLE_SUCCESS;
})));

View File

@@ -2,10 +2,11 @@ package anticope.rejects.commands;
import com.mojang.brigadier.arguments.DoubleArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.systems.commands.Command;
import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.command.CommandSource;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;
public class SetVelocityCommand extends Command {
public SetVelocityCommand() {
@@ -19,7 +20,7 @@ public class SetVelocityCommand extends Command {
mc.player.setVelocity(currentVelocity.x, DoubleArgumentType.getDouble(ctx, "y"), currentVelocity.z);
return SINGLE_SUCCESS;
}));
builder.then(argument("x", DoubleArgumentType.doubleArg()).then(argument("z", DoubleArgumentType.doubleArg()).executes(ctx -> {
double x = DoubleArgumentType.getDouble(ctx, "x");
double z = DoubleArgumentType.getDouble(ctx, "z");

View File

@@ -3,17 +3,18 @@ package anticope.rejects.commands;
import anticope.rejects.arguments.ClientPosArgumentType;
import com.mojang.brigadier.arguments.FloatArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.systems.commands.Command;
import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.command.CommandSource;
import net.minecraft.util.math.Vec3d;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;
public class TeleportCommand extends Command {
public TeleportCommand() {
super("teleport","Sends a packet to the server with new position. Allows to teleport small distances.", "tp");
super("teleport", "Sends a packet to the server with new position. Allows to teleport small distances.", "tp");
}
@Override
@@ -24,7 +25,7 @@ public class TeleportCommand extends Command {
return SINGLE_SUCCESS;
}));
builder.then(argument("pos", ClientPosArgumentType.pos()).then(argument("yaw", FloatArgumentType.floatArg()).then(argument("pitch",FloatArgumentType.floatArg()).executes(ctx -> {
builder.then(argument("pos", ClientPosArgumentType.pos()).then(argument("yaw", FloatArgumentType.floatArg()).then(argument("pitch", FloatArgumentType.floatArg()).executes(ctx -> {
Vec3d pos = ClientPosArgumentType.getPos(ctx, "pos");
float yaw = FloatArgumentType.getFloat(ctx, "yaw");
float pitch = FloatArgumentType.getFloat(ctx, "pitch");

View File

@@ -3,12 +3,10 @@ package anticope.rejects.commands;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
import meteordevelopment.meteorclient.systems.commands.Command;
import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.command.CommandSource;
import net.minecraft.text.Text;
import net.minecraft.util.math.BlockPos;
import org.lwjgl.BufferUtils;
import org.lwjgl.PointerBuffer;
import org.lwjgl.system.MemoryUtil;
@@ -19,12 +17,12 @@ import java.io.IOException;
import java.nio.ByteBuffer;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;
public class TerrainExport extends Command {
private final PointerBuffer filters;
private final static SimpleCommandExceptionType IO_EXCEPTION = new SimpleCommandExceptionType(Text.literal("An IOException occurred"));
private final PointerBuffer filters;
public TerrainExport() {
super("terrain-export", "Export an area to the c++ terrain finder format (very popbob command).");

View File

@@ -3,7 +3,7 @@ package anticope.rejects.mixin.meteor;
import anticope.rejects.utils.accounts.AddCustomYggdrasilAccountScreen;
import meteordevelopment.meteorclient.gui.GuiTheme;
import meteordevelopment.meteorclient.gui.WindowScreen;
import meteordevelopment.meteorclient.gui.screens.AccountsScreen;
import meteordevelopment.meteorclient.gui.screens.accounts.AccountsScreen;
import meteordevelopment.meteorclient.gui.widgets.WWidget;
import meteordevelopment.meteorclient.gui.widgets.containers.WContainer;
import meteordevelopment.meteorclient.gui.widgets.containers.WHorizontalList;
@@ -25,7 +25,7 @@ public abstract class AccountsScreenMixin extends WindowScreen {
@Shadow
protected abstract void addButton(WContainer c, String text, Runnable action);
@Inject(method = "initWidgets", at = @At(value = "INVOKE", target = "Lmeteordevelopment/meteorclient/gui/screens/AccountsScreen;addButton(Lmeteordevelopment/meteorclient/gui/widgets/containers/WContainer;Ljava/lang/String;Ljava/lang/Runnable;)V", ordinal = 0), locals = LocalCapture.CAPTURE_FAILHARD)
@Inject(method = "initWidgets", at = @At(value = "INVOKE", target = "Lmeteordevelopment/meteorclient/gui/screens/accounts/AccountsScreen;addButton(Lmeteordevelopment/meteorclient/gui/widgets/containers/WContainer;Ljava/lang/String;Ljava/lang/Runnable;)V", ordinal = 0), locals = LocalCapture.CAPTURE_FAILHARD)
private void afterAddCrackedButton(CallbackInfo info, WHorizontalList l) {
addButton(l, "Yggdrasil", () -> mc.setScreen(new AddCustomYggdrasilAccountScreen(theme, (AccountsScreen) (Object) this)));
}

View File

@@ -1,39 +0,0 @@
package anticope.rejects.mixin.meteor.modules;
import anticope.rejects.utils.RejectsUtils;
import meteordevelopment.meteorclient.settings.DoubleSetting;
import meteordevelopment.meteorclient.settings.Setting;
import meteordevelopment.meteorclient.settings.SettingGroup;
import meteordevelopment.meteorclient.systems.modules.combat.AimAssist;
import net.minecraft.entity.Entity;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(value = AimAssist.class, remap = false)
public class AimAssistMixin {
@Shadow @Final private SettingGroup sgGeneral;
private Setting<Double> fov;
@Inject(method = "<init>", at = @At("TAIL"))
private void onInit(CallbackInfo info) {
fov = sgGeneral.add(new DoubleSetting.Builder()
.name("fov")
.description("Will only aim entities in the fov.")
.defaultValue(360)
.min(0)
.max(360)
.build()
);
}
@Inject(method = "lambda$onTick$1", at = @At(value = "RETURN", ordinal = 5), cancellable = true)
private void onCheckEntity(Entity entity, CallbackInfoReturnable<Boolean> info) {
info.setReturnValue(RejectsUtils.inFov(entity, fov.get()));
}
}

View File

@@ -0,0 +1,163 @@
package anticope.rejects.modules;
import anticope.rejects.MeteorRejectsAddon;
import anticope.rejects.utils.RejectsUtils;
import it.unimi.dsi.fastutil.objects.Object2BooleanMap;
import meteordevelopment.meteorclient.events.render.Render3DEvent;
import meteordevelopment.meteorclient.events.world.TickEvent;
import meteordevelopment.meteorclient.settings.*;
import meteordevelopment.meteorclient.systems.friends.Friends;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.utils.Utils;
import meteordevelopment.meteorclient.utils.entity.EntityUtils;
import meteordevelopment.meteorclient.utils.entity.SortPriority;
import meteordevelopment.meteorclient.utils.entity.Target;
import meteordevelopment.meteorclient.utils.entity.TargetUtils;
import meteordevelopment.meteorclient.utils.player.PlayerUtils;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.MathHelper;
import org.joml.Vector3d;
public class AimAssist extends Module {
private final SettingGroup sgGeneral = settings.getDefaultGroup();
private final SettingGroup sgSpeed = settings.createGroup("Aim Speed");
// General
private final Setting<Object2BooleanMap<EntityType<?>>> entities = sgGeneral.add(new EntityTypeListSetting.Builder()
.name("entities")
.description("Entities to aim at.")
.defaultValue(EntityType.PLAYER)
.build()
);
private final Setting<Double> range = sgGeneral.add(new DoubleSetting.Builder()
.name("range")
.description("The range at which an entity can be targeted.")
.defaultValue(5)
.min(0)
.build()
);
private final Setting<Double> fov = sgGeneral.add(new DoubleSetting.Builder()
.name("fov")
.description("Will only aim entities in the fov.")
.defaultValue(360)
.min(0)
.max(360)
.build()
);
private final Setting<Boolean> ignoreWalls = sgGeneral.add(new BoolSetting.Builder()
.name("ignore-walls")
.description("Whether or not to ignore aiming through walls.")
.defaultValue(false)
.build()
);
private final Setting<SortPriority> priority = sgGeneral.add(new EnumSetting.Builder<SortPriority>()
.name("priority")
.description("How to filter targets within range.")
.defaultValue(SortPriority.LowestHealth)
.build()
);
private final Setting<Target> bodyTarget = sgGeneral.add(new EnumSetting.Builder<Target>()
.name("aim-target")
.description("Which part of the entities body to aim at.")
.defaultValue(Target.Body)
.build()
);
// Aim Speed
private final Setting<Boolean> instant = sgSpeed.add(new BoolSetting.Builder()
.name("instant-look")
.description("Instantly looks at the entity.")
.defaultValue(false)
.build()
);
private final Setting<Double> speed = sgSpeed.add(new DoubleSetting.Builder()
.name("speed")
.description("How fast to aim at the entity.")
.defaultValue(5)
.min(0)
.visible(() -> !instant.get())
.build()
);
private final Vector3d vec3d1 = new Vector3d();
private Entity target;
public AimAssist() {
super(MeteorRejectsAddon.CATEGORY, "aim-assist", "Automatically aims at entities.");
}
@EventHandler
private void onTick(TickEvent.Post event) {
target = TargetUtils.get(entity -> {
if (!entity.isAlive()) return false;
if (!PlayerUtils.isWithin(entity, range.get())) return false;
if (!ignoreWalls.get() && !PlayerUtils.canSeeEntity(entity)) return false;
if (entity == mc.player || !entities.get().getBoolean(entity.getType())) return false;
if (entity instanceof PlayerEntity) return Friends.get().shouldAttack((PlayerEntity) entity);
return RejectsUtils.inFov(entity, fov.get());
}, priority.get());
}
@EventHandler
private void onRender(Render3DEvent event) {
if (target != null) aim(target, event.tickDelta, instant.get());
}
private void aim(Entity target, double delta, boolean instant) {
Utils.set(vec3d1, target, delta);
switch (bodyTarget.get()) {
case Head -> vec3d1.add(0, target.getEyeHeight(target.getPose()), 0);
case Body -> vec3d1.add(0, target.getEyeHeight(target.getPose()) / 2, 0);
}
double deltaX = vec3d1.x - mc.player.getX();
double deltaZ = vec3d1.z - mc.player.getZ();
double deltaY = vec3d1.y - (mc.player.getY() + mc.player.getEyeHeight(mc.player.getPose()));
// Yaw
double angle = Math.toDegrees(Math.atan2(deltaZ, deltaX)) - 90;
double deltaAngle;
double toRotate;
if (instant) {
mc.player.setYaw((float) angle);
} else {
deltaAngle = MathHelper.wrapDegrees(angle - mc.player.getYaw());
toRotate = speed.get() * (deltaAngle >= 0 ? 1 : -1) * delta;
if ((toRotate >= 0 && toRotate > deltaAngle) || (toRotate < 0 && toRotate < deltaAngle))
toRotate = deltaAngle;
mc.player.setYaw(mc.player.getYaw() + (float) toRotate);
}
// Pitch
double idk = Math.sqrt(deltaX * deltaX + deltaZ * deltaZ);
angle = -Math.toDegrees(Math.atan2(deltaY, idk));
if (instant) {
mc.player.setPitch((float) angle);
} else {
deltaAngle = MathHelper.wrapDegrees(angle - mc.player.getPitch());
toRotate = speed.get() * (deltaAngle >= 0 ? 1 : -1) * delta;
if ((toRotate >= 0 && toRotate > deltaAngle) || (toRotate < 0 && toRotate < deltaAngle))
toRotate = deltaAngle;
mc.player.setPitch(mc.player.getPitch() + (float) toRotate);
}
}
@Override
public String getInfoString() {
return EntityUtils.getName(target);
}
}

View File

@@ -1,8 +1,8 @@
package anticope.rejects.utils.accounts;
import meteordevelopment.meteorclient.gui.GuiTheme;
import meteordevelopment.meteorclient.gui.screens.AccountsScreen;
import meteordevelopment.meteorclient.gui.screens.AddAccountScreen;
import meteordevelopment.meteorclient.gui.screens.accounts.AccountsScreen;
import meteordevelopment.meteorclient.gui.screens.accounts.AddAccountScreen;
import meteordevelopment.meteorclient.gui.widgets.containers.WTable;
import meteordevelopment.meteorclient.gui.widgets.input.WTextBox;
import meteordevelopment.meteorclient.systems.accounts.Accounts;

View File

@@ -15,7 +15,6 @@
"ModuleMixin",
"ModulesMixin",
"WAccountMixin",
"modules.AimAssistMixin",
"modules.AutoSignMixin",
"modules.FlightMixin",
"modules.InventoryTweaksMixin",