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

Commit e8d05fd

Browse files
authored
Add files via upload
1 parent 17d331c commit e8d05fd

35 files changed

Lines changed: 6960 additions & 0 deletions
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
package cally72jhb.addon;
2+
3+
import cally72jhb.addon.commands.commands.*;
4+
import cally72jhb.addon.modules.combat.PacketHoleFill;
5+
import cally72jhb.addon.modules.combat.SurroundPlus;
6+
import cally72jhb.addon.modules.misc.*;
7+
import cally72jhb.addon.modules.movement.EntityFly;
8+
import cally72jhb.addon.modules.movement.EntityPhase;
9+
import cally72jhb.addon.modules.movement.PacketFly;
10+
import cally72jhb.addon.modules.movement.RubberbandFly;
11+
import cally72jhb.addon.modules.player.NoSwing;
12+
import cally72jhb.addon.modules.player.PortalGodMode;
13+
import cally72jhb.addon.modules.render.HoleRenderer;
14+
import cally72jhb.addon.modules.render.SkeletonESP;
15+
import cally72jhb.addon.utils.ExecutorTask;
16+
import meteordevelopment.meteorclient.addons.MeteorAddon;
17+
import meteordevelopment.meteorclient.systems.commands.Commands;
18+
import meteordevelopment.meteorclient.systems.modules.Modules;
19+
import org.slf4j.Logger;
20+
import org.slf4j.LoggerFactory;
21+
22+
public class VectorAddon extends MeteorAddon {
23+
public static final Logger LOG = LoggerFactory.getLogger("vector-addon");
24+
25+
@Override
26+
public void onInitialize() {
27+
LOG.info("Initializing Vector Addon...");
28+
29+
// Initialisation
30+
31+
ExecutorTask.init();
32+
33+
// Combat
34+
35+
Modules.get().add(new PacketHoleFill());
36+
Modules.get().add(new SurroundPlus());
37+
38+
// Misc
39+
40+
Modules.get().add(new NoCollision());
41+
Modules.get().add(new PacketPlace());
42+
Modules.get().add(new Paragraph());
43+
Modules.get().add(new PingSpoof());
44+
Modules.get().add(new Placeholders());
45+
46+
// Movement
47+
48+
Modules.get().add(new EntityFly());
49+
Modules.get().add(new EntityPhase());
50+
Modules.get().add(new PacketFly());
51+
Modules.get().add(new RubberbandFly());
52+
53+
// Player
54+
55+
Modules.get().add(new NoSwing());
56+
Modules.get().add(new PortalGodMode());
57+
58+
// Render
59+
60+
Modules.get().add(new HoleRenderer());
61+
Modules.get().add(new SkeletonESP());
62+
63+
// Commands
64+
65+
Commands.get().add(new CenterCommand());
66+
Commands.get().add(new DesyncCommand());
67+
Commands.get().add(new PlayerHeadCommand());
68+
Commands.get().add(new ShaderCommand());
69+
Commands.get().add(new TeleportCommand());
70+
Commands.get().add(new TrashCommand());
71+
Commands.get().add(new UUIDCommand());
72+
73+
// Done Initializing
74+
75+
LOG.info("Done Initializing Vector Addon...");
76+
}
77+
78+
public String getPackage() {
79+
return "cally72jhb.addon";
80+
}
81+
}
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
package cally72jhb.addon.commands.arguments;
2+
3+
import com.mojang.brigadier.StringReader;
4+
import com.mojang.brigadier.arguments.ArgumentType;
5+
import com.mojang.brigadier.context.CommandContext;
6+
import com.mojang.brigadier.exceptions.CommandSyntaxException;
7+
import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
8+
import com.mojang.brigadier.suggestion.Suggestions;
9+
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
10+
import net.minecraft.command.CommandSource;
11+
import net.minecraft.server.command.CommandManager;
12+
import net.minecraft.text.Text;
13+
import net.minecraft.util.Pair;
14+
import net.minecraft.util.math.BlockPos;
15+
16+
import java.util.Arrays;
17+
import java.util.Collection;
18+
import java.util.concurrent.CompletableFuture;
19+
20+
import static meteordevelopment.meteorclient.MeteorClient.mc;
21+
22+
public class BlockPosArgumentType implements ArgumentType<BlockPos> {
23+
private static final Collection<String> EXAMPLES = Arrays.asList("0 0 0", "~ ~ ~", "~2 ~1 ~-5");
24+
25+
private static final DynamicCommandExceptionType MISSING_COORDINATE = new DynamicCommandExceptionType(object -> Text.literal("Command is incomplete missing 1 or more coordinates."));
26+
private static final DynamicCommandExceptionType INCOMPLETE_EXCEPTION = new DynamicCommandExceptionType(object -> Text.literal("Incomplete position argument."));
27+
28+
public static BlockPosArgumentType pos() {
29+
return new BlockPosArgumentType();
30+
}
31+
32+
public static BlockPos getPos(final CommandContext<?> context, final String name) {
33+
return context.getArgument(name, BlockPos.class);
34+
}
35+
36+
public BlockPos parse(StringReader stringReader) throws CommandSyntaxException {
37+
return parsePos(stringReader);
38+
}
39+
40+
public <S> CompletableFuture<Suggestions> listSuggestions(CommandContext<S> context, SuggestionsBuilder builder) {
41+
if (!(context.getSource() instanceof CommandSource)) {
42+
return Suggestions.empty();
43+
} else {
44+
return CommandSource.suggestPositions(builder.getRemaining(), ((CommandSource) context.getSource()).getBlockPositionSuggestions(), builder, CommandManager.getCommandValidator(this::parse));
45+
}
46+
}
47+
48+
public Collection<String> getExamples() {
49+
return EXAMPLES;
50+
}
51+
52+
// Utils
53+
54+
private BlockPos parsePos(StringReader reader) throws CommandSyntaxException {
55+
String argument = reader.getString();
56+
int cursor = reader.getCursor();
57+
58+
Pair<Boolean, Integer> x = parseCoordinate(reader);
59+
60+
if (reader.canRead() && reader.peek() == ' ') {
61+
reader.skip();
62+
63+
Pair<Boolean, Integer> y = parseCoordinate(reader);
64+
65+
if (reader.canRead() && reader.peek() == ' ') {
66+
reader.skip();
67+
68+
Pair<Boolean, Integer> z = parseCoordinate(reader);
69+
70+
return new BlockPos(
71+
x.getLeft() ? x.getRight() + mc.player.getX() : x.getRight(),
72+
y.getLeft() ? y.getRight() + mc.player.getY() : y.getRight(),
73+
z.getLeft() ? z.getRight() + mc.player.getZ() : z.getRight()
74+
);
75+
} else {
76+
reader.setCursor(cursor);
77+
78+
throw INCOMPLETE_EXCEPTION.create(argument);
79+
}
80+
} else {
81+
reader.setCursor(cursor);
82+
83+
throw INCOMPLETE_EXCEPTION.create(argument);
84+
}
85+
}
86+
87+
private Pair<Boolean, Integer> parseCoordinate(StringReader reader) throws CommandSyntaxException {
88+
String argument = reader.getString();
89+
90+
if (!reader.canRead()) {
91+
throw MISSING_COORDINATE.create(argument);
92+
} else {
93+
boolean relative = isRelative(reader);
94+
int cursor = reader.getCursor();
95+
int value = reader.canRead() && reader.peek() != ' ' ? reader.readInt() : 0;
96+
97+
String string = reader.getString().substring(cursor, reader.getCursor());
98+
99+
if (relative && string.isEmpty()) {
100+
return new Pair<>(true, 0);
101+
} else {
102+
return new Pair<>(relative, value);
103+
}
104+
}
105+
}
106+
107+
private boolean isRelative(StringReader reader) {
108+
boolean relative;
109+
110+
if (reader.peek() == '~') {
111+
relative = true;
112+
reader.skip();
113+
} else {
114+
relative = false;
115+
}
116+
117+
return relative;
118+
}
119+
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
package cally72jhb.addon.commands.arguments;
2+
3+
import com.mojang.brigadier.StringReader;
4+
import com.mojang.brigadier.arguments.ArgumentType;
5+
import com.mojang.brigadier.context.CommandContext;
6+
import com.mojang.brigadier.exceptions.CommandSyntaxException;
7+
import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
8+
import com.mojang.brigadier.suggestion.Suggestions;
9+
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
10+
import net.minecraft.command.CommandSource;
11+
import net.minecraft.entity.player.PlayerEntity;
12+
import net.minecraft.text.Text;
13+
14+
import java.util.Collection;
15+
import java.util.concurrent.CompletableFuture;
16+
import java.util.stream.Collectors;
17+
18+
import static meteordevelopment.meteorclient.MeteorClient.mc;
19+
20+
public class PlayerArgumentType implements ArgumentType<PlayerEntity> {
21+
private static Collection<String> EXAMPLES;
22+
23+
static {
24+
if (mc.world != null) {
25+
EXAMPLES = mc.world.getPlayers()
26+
.stream()
27+
.map(PlayerEntity::getEntityName)
28+
.collect(Collectors.toList()
29+
);
30+
}
31+
}
32+
33+
private static final DynamicCommandExceptionType NO_SUCH_PLAYER = new DynamicCommandExceptionType(object -> Text.literal("Player with name " + object + " doesn't exist."));
34+
35+
public static PlayerArgumentType player() {
36+
return new PlayerArgumentType();
37+
}
38+
39+
public static PlayerEntity getPlayer(CommandContext<?> context, final String name) {
40+
return context.getArgument(name, PlayerEntity.class);
41+
}
42+
43+
@Override
44+
public PlayerEntity parse(StringReader reader) throws CommandSyntaxException {
45+
int start = reader.getCursor();
46+
47+
while (reader.canRead() && isValidChar(reader.peek())) {
48+
reader.skip();
49+
}
50+
51+
String argument = reader.getString().substring(start, reader.getCursor());
52+
53+
PlayerEntity player = null;
54+
55+
for (PlayerEntity entity : mc.world.getPlayers()) {
56+
if (entity.getEntityName().equalsIgnoreCase(argument)) {
57+
player = entity;
58+
break;
59+
}
60+
}
61+
62+
if (player == null) throw NO_SUCH_PLAYER.create(argument);
63+
64+
return player;
65+
}
66+
67+
@Override
68+
public <S> CompletableFuture<Suggestions> listSuggestions(CommandContext<S> context, SuggestionsBuilder builder) {
69+
return CommandSource.suggestMatching(mc.world.getPlayers().stream().map(PlayerEntity::getEntityName), builder);
70+
}
71+
72+
@Override
73+
public Collection<String> getExamples() {
74+
return EXAMPLES;
75+
}
76+
77+
private boolean isValidChar(char character) {
78+
return character != '\\' && (character >= '0' && character <= '9' || character >= 'A' && character <= 'Z' || character >= 'a' && character <= 'z'
79+
|| character >= '!' && character <= '/' || character >= ':' && character <= '@' || character >= '[' && character <= '`' || character >= '{' && character <= '~');
80+
}
81+
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
package cally72jhb.addon.commands.arguments;
2+
3+
import com.mojang.brigadier.StringReader;
4+
import com.mojang.brigadier.arguments.ArgumentType;
5+
import com.mojang.brigadier.context.CommandContext;
6+
import com.mojang.brigadier.exceptions.CommandSyntaxException;
7+
import com.mojang.brigadier.suggestion.Suggestions;
8+
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
9+
import net.minecraft.command.CommandSource;
10+
import net.minecraft.entity.player.PlayerEntity;
11+
12+
import java.util.ArrayList;
13+
import java.util.Collection;
14+
import java.util.concurrent.CompletableFuture;
15+
import java.util.stream.Collectors;
16+
17+
import static meteordevelopment.meteorclient.MeteorClient.mc;
18+
19+
public class PlayerNameArgumentType implements ArgumentType<String> {
20+
private static Collection<String> EXAMPLES;
21+
22+
static {
23+
if (mc.world != null && mc.getNetworkHandler() != null) {
24+
EXAMPLES = mc.world.getPlayers()
25+
.stream()
26+
.map(PlayerEntity::getEntityName)
27+
.collect(Collectors.toList()
28+
);
29+
30+
EXAMPLES.addAll(mc.getNetworkHandler().getPlayerList()
31+
.stream()
32+
.limit(3)
33+
.map(entry -> entry.getProfile().getName())
34+
.toList()
35+
);
36+
}
37+
}
38+
39+
public static PlayerNameArgumentType player() {
40+
return new PlayerNameArgumentType();
41+
}
42+
43+
public static String getPlayer(CommandContext<?> context, final String name) {
44+
return context.getArgument(name, String.class);
45+
}
46+
47+
@Override
48+
public String parse(StringReader reader) throws CommandSyntaxException {
49+
int start = reader.getCursor();
50+
51+
while (reader.canRead() && isValidChar(reader.peek())) {
52+
reader.skip();
53+
}
54+
55+
return reader.getString().substring(start, reader.getCursor());
56+
}
57+
58+
@Override
59+
public <S> CompletableFuture<Suggestions> listSuggestions(CommandContext<S> context, SuggestionsBuilder builder) {
60+
Collection<String> suggestions = new ArrayList<>(
61+
mc.world.getPlayers()
62+
.stream()
63+
.map(PlayerEntity::getEntityName)
64+
.toList()
65+
);
66+
67+
suggestions.addAll(mc.getNetworkHandler().getPlayerList()
68+
.stream()
69+
.limit(3)
70+
.map(entry -> entry.getProfile().getName())
71+
.toList()
72+
);
73+
74+
return CommandSource.suggestMatching(suggestions, builder);
75+
}
76+
77+
@Override
78+
public Collection<String> getExamples() {
79+
return EXAMPLES;
80+
}
81+
82+
private boolean isValidChar(char character) {
83+
return character != '\\' && (character >= '0' && character <= '9' || character >= 'A' && character <= 'Z' || character >= 'a' && character <= 'z'
84+
|| character >= '!' && character <= '/' || character >= ':' && character <= '@' || character >= '[' && character <= '`' || character >= '{' && character <= '~');
85+
}
86+
}

0 commit comments

Comments
 (0)