Re-added AimAssist (#246)
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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")
|
||||
))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
})));
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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).");
|
||||
|
||||
Reference in New Issue
Block a user