Remove old src directory
This commit is contained in:
parent
6c0bb42b73
commit
9e42eb7c7f
54 changed files with 0 additions and 3276 deletions
|
@ -1,37 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.old;
|
|
||||||
|
|
||||||
//JessSystemV
|
|
||||||
//7:28 AM, 2023-10-05
|
|
||||||
//God fucking help me
|
|
||||||
|
|
||||||
/*
|
|
||||||
ASyncRunner aSyncRunner = new ASyncRunner(() -> {
|
|
||||||
//Do big complicated thing that we can't have on tick methods *or* render methods
|
|
||||||
//Fill CopyOnWriteArrayList with Valid Holes grabbed from world for example
|
|
||||||
//but this would be instantiated in the class not method
|
|
||||||
});
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void tick(SafeTickEvent e) {
|
|
||||||
aSyncRunner.run(); //run this on every tick
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
public class ASyncRunner {
|
|
||||||
private final Thread thread;
|
|
||||||
|
|
||||||
public ASyncRunner(Runnable runnable) {
|
|
||||||
this.thread = new Thread(runnable);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void run() {
|
|
||||||
if(!thread.isAlive()) {
|
|
||||||
thread.start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,222 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.old;
|
|
||||||
|
|
||||||
|
|
||||||
import com.baseband.client.old.command.CommandManager;
|
|
||||||
import com.baseband.client.old.event.EventBus;
|
|
||||||
import com.baseband.client.old.event.FMLEventProcessor;
|
|
||||||
import com.baseband.client.old.module.Module;
|
|
||||||
import com.baseband.client.old.module.modules.*;
|
|
||||||
import de.tudbut.parsing.TCN;
|
|
||||||
import de.tudbut.tools.Lock;
|
|
||||||
import de.tudbut.tools.Registry;
|
|
||||||
import de.tudbut.tools.Tools;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.launchwrapper.Launch;
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
|
||||||
import org.lwjgl.opengl.Display;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.nio.file.StandardCopyOption;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.function.Consumer;
|
|
||||||
|
|
||||||
public class BaseBand {
|
|
||||||
public static int majorVersion = 1;
|
|
||||||
public static int buildNumber = 489;
|
|
||||||
public static String hash = "9eaa8192283c5bd8";
|
|
||||||
|
|
||||||
public static String name = "BaseBand";
|
|
||||||
public long timeOfCompile = 1710874072334L;
|
|
||||||
public CommandManager commandRegistry;
|
|
||||||
public EventBus eventBus;
|
|
||||||
public ArrayList<Module> modules = new ArrayList<>();
|
|
||||||
public static BaseBand INSTANCE;
|
|
||||||
public static Registry Registry;
|
|
||||||
private static TCN registryData;
|
|
||||||
|
|
||||||
{ INSTANCE = this; }
|
|
||||||
|
|
||||||
|
|
||||||
public static final Logger log = LogManager.getLogger("BaseBand");
|
|
||||||
|
|
||||||
|
|
||||||
public String getWatermark() {
|
|
||||||
switch (level) {
|
|
||||||
case 1: {
|
|
||||||
return "BaseBand+ v"+majorVersion+"."+buildNumber;
|
|
||||||
}
|
|
||||||
case 2: {
|
|
||||||
return "BaseBand b"+BaseBand.majorVersion + "." + BaseBand.buildNumber + "+" + BaseBand.hash;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return "BaseBand v"+majorVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int level = 0; //Standard user
|
|
||||||
|
|
||||||
public void onInit() {
|
|
||||||
Utils.check();
|
|
||||||
|
|
||||||
try {
|
|
||||||
Object keeper = BaseBand.class.getClassLoader().getClass().getFields()[1].get(BaseBand.class.getClassLoader());
|
|
||||||
for (Method access : keeper.getClass().getMethods()) {
|
|
||||||
if(Arrays.equals(access.getParameterTypes(), new Class<?>[]{Consumer.class}) && access.getDeclaringClass() == keeper.getClass()) {
|
|
||||||
access.invoke(keeper, (Consumer<Object>) accessor -> {
|
|
||||||
try {
|
|
||||||
Object registry = Arrays.stream(accessor.getClass().getMethods()).filter(x -> x.getParameterCount() == 0 && x.getDeclaringClass() == accessor.getClass()).findAny().get().invoke(accessor);
|
|
||||||
for (Method save : registry.getClass().getMethods()) {
|
|
||||||
if (save.getParameterCount() == 0 && save.getReturnType() == Void.TYPE && save.getDeclaringClass() == registry.getClass()) {
|
|
||||||
save.invoke(registry); // registry save
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
Utils.crash();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
Utils.crash();
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
Registry = new Registry("BaseBand.registry");
|
|
||||||
registryData = Registry.register("*");
|
|
||||||
} catch (Exception e) {
|
|
||||||
// tamper detected
|
|
||||||
Utils.crash();
|
|
||||||
}
|
|
||||||
// cant be a normal if statement because it might be null
|
|
||||||
if (registryData.getBoolean("LoaderPresent") == Boolean.TRUE) {
|
|
||||||
String key = registryData.getString("Key");
|
|
||||||
TCN data = TCN.readMap(Tools.stringToMap(new Key(key).decryptString(registryData.getString("Data"))));
|
|
||||||
registryData.set("Key", null);
|
|
||||||
registryData.set("Data", null);
|
|
||||||
|
|
||||||
this.level = data.getInteger("level");
|
|
||||||
} else {
|
|
||||||
// do other stuff here later?
|
|
||||||
log.info("No loader present, but able to start anyway ==> Debug environment detected.");
|
|
||||||
}
|
|
||||||
// unset so this won't be discovered and manipulated
|
|
||||||
registryData.set("LoaderPresent", null);
|
|
||||||
Registry.save();
|
|
||||||
|
|
||||||
|
|
||||||
commandRegistry = new CommandManager();
|
|
||||||
eventBus = new EventBus();
|
|
||||||
|
|
||||||
addModule(new Brightness());
|
|
||||||
addModule(new PacketTest());
|
|
||||||
addModule(new HUD());
|
|
||||||
addModule(new PacketFly());
|
|
||||||
addModule(new Speed());
|
|
||||||
addModule(new TPTracker());
|
|
||||||
addModule(new NoSlip());
|
|
||||||
addModule(new FastUse());
|
|
||||||
addModule(new ElytraFly());
|
|
||||||
addModule(new ChatCrypt());
|
|
||||||
addModule(new NameTags());
|
|
||||||
addModule(new ChatSuffix());
|
|
||||||
|
|
||||||
|
|
||||||
MinecraftForge.EVENT_BUS.register(new FMLEventProcessor());
|
|
||||||
|
|
||||||
try {
|
|
||||||
for (Module m : modules) {
|
|
||||||
if(m.isEnabled()) {
|
|
||||||
m.setEnabled(m.isEnabled());
|
|
||||||
MinecraftForge.EVENT_BUS.register(m);
|
|
||||||
eventBus.register(m);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch(Exception e) {
|
|
||||||
ConfigManager.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
new Thread(() -> {
|
|
||||||
Lock lock = new Lock();
|
|
||||||
while(true) {
|
|
||||||
lock.lock(10000);
|
|
||||||
ConfigManager.save();
|
|
||||||
lock.waitHere();
|
|
||||||
}
|
|
||||||
}, "Config save thread").start();
|
|
||||||
|
|
||||||
Display.setTitle(getWatermark());
|
|
||||||
log.info("BaseBand Instantiated.");
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void downloadMCRegistry() {
|
|
||||||
try {
|
|
||||||
Class.forName("de.tudbut.mcregistry.MCRegistry");
|
|
||||||
} catch (Exception e) {
|
|
||||||
JOptionPane.showMessageDialog(null, "Minecraft might need to restart to download BaseBand's required libraries.");
|
|
||||||
try {
|
|
||||||
InputStream uis = new URL("https://github.com/TudbuT/mcregistry/releases/download/v1.0/mcregistry-1.0.jar").openStream();
|
|
||||||
Files.copy(uis, Paths.get("mods/mcregistry-1.0.jar"), StandardCopyOption.REPLACE_EXISTING);
|
|
||||||
Launch.classLoader.addURL(new URL("file://./mods/mcregistry-1.0.jar"));
|
|
||||||
uis.close();
|
|
||||||
try {
|
|
||||||
Class.forName("de.tudbut.mcregistry.MCRegistry");
|
|
||||||
} catch (ClassNotFoundException ex) {
|
|
||||||
System.out.println("----------- THIS IS NOT A BUG. CRASHING ON PURPOSE TO END GAME QUICKLY.");
|
|
||||||
throw new Error("THIS IS NOT A BUG!!!");
|
|
||||||
}
|
|
||||||
JOptionPane.showMessageDialog(null, "Libraries installed.");
|
|
||||||
} catch (IOException ex) {
|
|
||||||
JOptionPane.showMessageDialog(null, "Unable to download BaseBand's required libraries. Please install mcregistry manually.");
|
|
||||||
throw new RuntimeException(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addModule(Module m) {
|
|
||||||
Restrict annotation = m.getClass().getDeclaredAnnotation(Restrict.class);
|
|
||||||
if (annotation != null) {
|
|
||||||
if(level < annotation.value().level)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
modules.add(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static <T extends Module> T getModule(Class<? extends T> module) {
|
|
||||||
for (int i = 0; i < INSTANCE.modules.size(); i++) {
|
|
||||||
if(INSTANCE.modules.get(i).getClass() == module) {
|
|
||||||
return (T) INSTANCE.modules.get(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw new RuntimeException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Module getModule(String name) {
|
|
||||||
for (Module m : INSTANCE.modules) {
|
|
||||||
if (m.toString().equalsIgnoreCase(name)) {
|
|
||||||
return m;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isIngame() {
|
|
||||||
return Minecraft.getMinecraft().world != null && Minecraft.getMinecraft().player != null;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.old;
|
|
||||||
|
|
||||||
import com.baseband.client.module.Module;
|
|
||||||
import de.tudbut.io.StreamReader;
|
|
||||||
import de.tudbut.parsing.JSON;
|
|
||||||
import de.tudbut.parsing.JSON.JSONFormatException;
|
|
||||||
import de.tudbut.parsing.TCN;
|
|
||||||
import de.tudbut.tools.ConfigSaverTCN2;
|
|
||||||
|
|
||||||
import java.io.*;
|
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
|
|
||||||
public class ConfigManager {
|
|
||||||
|
|
||||||
public static void save() {
|
|
||||||
for (Module module : BaseBand.INSTANCE.modules) {
|
|
||||||
module.updateData();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,162 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.old;
|
|
||||||
|
|
||||||
|
|
||||||
import de.tudbut.tools.Tools;
|
|
||||||
|
|
||||||
import java.io.*;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
public class Key {
|
|
||||||
//Daniella made the actual encryption,
|
|
||||||
//Jess made the serialization/byte handling/randomTicket
|
|
||||||
|
|
||||||
protected final String string;
|
|
||||||
|
|
||||||
private boolean debug = false;
|
|
||||||
|
|
||||||
|
|
||||||
public Key() {
|
|
||||||
string = Tools.randomAlphanumericString(4096);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Key(String key) {
|
|
||||||
string = key;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Key(byte[] key) {
|
|
||||||
string = new String(key, StandardCharsets.ISO_8859_1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDebug(boolean debug) {
|
|
||||||
this.debug = debug;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public byte[] serializeObject(Object obj) {
|
|
||||||
try {
|
|
||||||
if(debug) {
|
|
||||||
System.out.println(obj + " serialize + encrypt");
|
|
||||||
}
|
|
||||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
|
||||||
ObjectOutputStream objectOut = new ObjectOutputStream(byteArrayOutputStream);
|
|
||||||
objectOut.writeObject(obj);
|
|
||||||
objectOut.close();
|
|
||||||
return encryptByte(byteArrayOutputStream.toByteArray());
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return null; // Return null in case of an error
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object deserializeObject(byte[] bytes) {
|
|
||||||
try {
|
|
||||||
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(decryptByte(bytes));
|
|
||||||
ObjectInputStream objectIn = new ObjectInputStream(byteArrayInputStream);
|
|
||||||
Object obj = objectIn.readObject();
|
|
||||||
objectIn.close();
|
|
||||||
if(debug) {
|
|
||||||
System.out.println(obj + " deserialize + decrypt");
|
|
||||||
}
|
|
||||||
return obj;
|
|
||||||
} catch (IOException | ClassNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return null; // Return null in case of an error
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public byte[] encryptByte(byte[] bytes) {
|
|
||||||
if(bytes == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
bytes = bytes.clone();
|
|
||||||
byte[] eb = string.getBytes(StandardCharsets.ISO_8859_1);
|
|
||||||
int len = bytes.length;
|
|
||||||
int p = eb.length;
|
|
||||||
for (int i = 0 ; i < len ; i+=p) {
|
|
||||||
for (int j = 0 ; j < p && i + j < len ; j++) {
|
|
||||||
int idx = i + j;
|
|
||||||
bytes[idx] = (byte) ((int) bytes[idx] + (int) eb[j]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return bytes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public byte[] decryptByte(byte[] bytes) {
|
|
||||||
if(bytes == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
bytes = bytes.clone();
|
|
||||||
byte[] eb = string.getBytes(StandardCharsets.ISO_8859_1);
|
|
||||||
int len = bytes.length;
|
|
||||||
int p = eb.length;
|
|
||||||
for (int i = 0 ; i < len ; i+=p) {
|
|
||||||
for (int j = 0 ; j < p && i + j < len ; j++) {
|
|
||||||
int idx = i + j;
|
|
||||||
bytes[idx] = (byte) ((int) bytes[idx] - (int) eb[j]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return bytes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public byte[] decryptByteKey(byte[] bytes) {
|
|
||||||
if(bytes == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
byte[] eb = string.getBytes(StandardCharsets.ISO_8859_1);
|
|
||||||
int len = bytes.length;
|
|
||||||
int p = eb.length;
|
|
||||||
for (int i = 0 ; i < len ; i+=p) {
|
|
||||||
for (int j = 0 ; j < p && i + j < len ; j++) {
|
|
||||||
int idx = i + j;
|
|
||||||
bytes[idx] = (byte) ((int) bytes[idx] - (int) eb[j]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return bytes;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Encrypts a string
|
|
||||||
* @param s string to encrypt
|
|
||||||
* @return encrypted string
|
|
||||||
*/
|
|
||||||
public String encryptString(String s) {
|
|
||||||
byte[] bytes = s.getBytes(StandardCharsets.ISO_8859_1);
|
|
||||||
byte[] eb = string.getBytes(StandardCharsets.ISO_8859_1);
|
|
||||||
int len = bytes.length;
|
|
||||||
int p = eb.length;
|
|
||||||
for (int i = 0 ; i < len ; i+=p) {
|
|
||||||
for (int j = 0 ; j < p && i + j < len ; j++) {
|
|
||||||
int idx = i + j;
|
|
||||||
bytes[idx] = (byte) ((int) bytes[idx] + (int) eb[j]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new String(bytes, StandardCharsets.ISO_8859_1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Decrypts a string
|
|
||||||
* @param s string to decrypt
|
|
||||||
* @return decrypted string
|
|
||||||
*/
|
|
||||||
public String decryptString(String s) {
|
|
||||||
byte[] bytes = s.getBytes(StandardCharsets.ISO_8859_1);
|
|
||||||
byte[] eb = string.getBytes(StandardCharsets.ISO_8859_1);
|
|
||||||
int len = bytes.length;
|
|
||||||
int p = eb.length;
|
|
||||||
for (int i = 0 ; i < len ; i+=p) {
|
|
||||||
for (int j = 0 ; j < p && i + j < len ; j++) {
|
|
||||||
int idx = i + j;
|
|
||||||
bytes[idx] = (byte) ((int) bytes[idx] - (int) eb[j]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new String(bytes, StandardCharsets.ISO_8859_1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,85 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.old;
|
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.init.MobEffects;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
|
|
||||||
public class MotionUtil {
|
|
||||||
//Needed for Speed, thanks Doogie.
|
|
||||||
|
|
||||||
static final Minecraft mc = Minecraft.getMinecraft();
|
|
||||||
|
|
||||||
public static double applySpeed(double speed) {
|
|
||||||
|
|
||||||
if (mc.player.isPotionActive(MobEffects.SPEED)) {
|
|
||||||
|
|
||||||
double amp = Objects.requireNonNull(mc.player.getActivePotionEffect(MobEffects.SPEED)).getAmplifier() + 1;
|
|
||||||
speed *= 1.0f + 0.2f * amp;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return speed;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static double applyJumpBoost(double height) {
|
|
||||||
|
|
||||||
if (mc.player.isPotionActive(MobEffects.JUMP_BOOST)) {
|
|
||||||
return height + (Objects.requireNonNull(mc.player.getActivePotionEffect(MobEffects.JUMP_BOOST)).getAmplifier() + 1) * 0.1f;
|
|
||||||
}
|
|
||||||
|
|
||||||
return height;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private static float getRotationYaw() {
|
|
||||||
return Minecraft.getMinecraft().player.rotationYaw;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static double[] getMotion(double speed) {
|
|
||||||
|
|
||||||
if (mc.player.moveForward == 0 && mc.player.moveStrafing == 0)
|
|
||||||
return new double[]{0, 0};
|
|
||||||
|
|
||||||
int strafing = 0;
|
|
||||||
int forward = 0;
|
|
||||||
|
|
||||||
if (mc.player.moveStrafing < 0)
|
|
||||||
strafing = -1;
|
|
||||||
else if (mc.player.moveStrafing > 0)
|
|
||||||
strafing = 1;
|
|
||||||
|
|
||||||
if (mc.player.moveForward < 0)
|
|
||||||
forward = -1;
|
|
||||||
else if (mc.player.moveForward > 0)
|
|
||||||
forward = 1;
|
|
||||||
|
|
||||||
float strafe = 90 * strafing;
|
|
||||||
strafe *= (forward != 0F) ? forward * 0.5F : 1;
|
|
||||||
|
|
||||||
float yaw = getRotationYaw() - strafe;
|
|
||||||
yaw -= (mc.player.moveForward < 0F) ? 180 : 0;
|
|
||||||
|
|
||||||
return getMotion(speed, yaw);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static double[] getMotion(double speed, float yaw) {
|
|
||||||
|
|
||||||
// to radians
|
|
||||||
yaw *= 0.017452006980803f;
|
|
||||||
|
|
||||||
double x = (-Math.sin(yaw) * speed);
|
|
||||||
double z = (Math.cos(yaw) * speed);
|
|
||||||
|
|
||||||
return new double[]{x, z};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.old;
|
|
||||||
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
|
|
||||||
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
public @interface Restrict {
|
|
||||||
Edition value();
|
|
||||||
|
|
||||||
enum Edition {
|
|
||||||
BETA(2),
|
|
||||||
PLUS(1),
|
|
||||||
|
|
||||||
;
|
|
||||||
public final int level;
|
|
||||||
private Edition(int level) { this.level = level; }
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,216 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.old;
|
|
||||||
|
|
||||||
import de.tudbut.net.ic.PBIC;
|
|
||||||
import de.tudbut.type.Vector3d;
|
|
||||||
import net.minecraft.util.math.AxisAlignedBB;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.Vec3d;
|
|
||||||
import org.lwjgl.opengl.GL11;
|
|
||||||
|
|
||||||
import java.awt.*;
|
|
||||||
|
|
||||||
import static org.lwjgl.opengl.GL11.*;
|
|
||||||
|
|
||||||
public class Tesselator {
|
|
||||||
|
|
||||||
static int mode;
|
|
||||||
static int color;
|
|
||||||
static Vector3d translated;
|
|
||||||
static boolean depth;
|
|
||||||
|
|
||||||
public static void ready() {
|
|
||||||
glPushMatrix();
|
|
||||||
}
|
|
||||||
public static void translate(double x, double y, double z) {
|
|
||||||
glTranslated(x,y,z);
|
|
||||||
translated = new Vector3d(x,y,z);
|
|
||||||
}
|
|
||||||
public static void begin(int modeIn) {
|
|
||||||
glBegin(mode = modeIn);
|
|
||||||
}
|
|
||||||
public static void color(int argb) {
|
|
||||||
glDisable(GL_TEXTURE_2D);
|
|
||||||
glDisable(GL_LIGHTING);
|
|
||||||
glEnable(GL_BLEND);
|
|
||||||
glDisable(GL_CULL_FACE);
|
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
|
||||||
byte[] bytes = PBIC.putInt(argb);
|
|
||||||
glColor4ub(bytes[1], bytes[2], bytes[3], bytes[0]);
|
|
||||||
color = argb;
|
|
||||||
}
|
|
||||||
public static void depth(boolean b) {
|
|
||||||
depth = b;
|
|
||||||
if(b)
|
|
||||||
glEnable(GL_DEPTH_TEST);
|
|
||||||
else
|
|
||||||
glClear(GL_DEPTH_BUFFER_BIT);
|
|
||||||
}
|
|
||||||
public static void put(double x, double y, double z) {
|
|
||||||
glVertex3d(x,y,z);
|
|
||||||
}
|
|
||||||
public static void end() {
|
|
||||||
translated = null;
|
|
||||||
color = 0;
|
|
||||||
depth = false;
|
|
||||||
mode = 0;
|
|
||||||
glEnd();
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
|
||||||
glDisable(GL_BLEND);
|
|
||||||
glEnable(GL_CULL_FACE);
|
|
||||||
glPopMatrix();
|
|
||||||
}
|
|
||||||
public static void next() {
|
|
||||||
// end current
|
|
||||||
glEnd();
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
|
||||||
glDisable(GL_BLEND);
|
|
||||||
glEnable(GL_CULL_FACE);
|
|
||||||
glPopMatrix();
|
|
||||||
|
|
||||||
// start new
|
|
||||||
glPushMatrix();
|
|
||||||
glTranslated(translated.getX(), translated.getY(), translated.getZ());
|
|
||||||
color(color);
|
|
||||||
depth(depth);
|
|
||||||
glBegin(mode);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Draws an outline around a block.
|
|
||||||
* @param pos The BlockPos of the block you want do draw an outline around.
|
|
||||||
* @param color The RGB colour of the outline. Either as an int or Color.
|
|
||||||
* @param eyePos The Eye Position of the player.
|
|
||||||
* @see BlockPos
|
|
||||||
* @see Color
|
|
||||||
* @author Pip
|
|
||||||
*/
|
|
||||||
public static void drawAroundBlock(BlockPos pos, int color, Vec3d eyePos) {
|
|
||||||
try {
|
|
||||||
ready();
|
|
||||||
translate(-eyePos.x, -eyePos.y, -eyePos.z);
|
|
||||||
color(color);
|
|
||||||
depth(false);
|
|
||||||
begin(GL11.GL_LINES);
|
|
||||||
|
|
||||||
// bottom - just like tud
|
|
||||||
put(pos.getX(), pos.getY(), pos.getZ());
|
|
||||||
put(pos.getX() + 1, pos.getY(), pos.getZ());
|
|
||||||
|
|
||||||
put(pos.getX(), pos.getY(), pos.getZ());
|
|
||||||
put(pos.getX(), pos.getY(), pos.getZ() + 1);
|
|
||||||
|
|
||||||
put(pos.getX() + 1, pos.getY(), pos.getZ());
|
|
||||||
put(pos.getX() + 1, pos.getY(), pos.getZ() + 1);
|
|
||||||
|
|
||||||
put(pos.getX(), pos.getY(), pos.getZ() + 1);
|
|
||||||
put(pos.getX() + 1, pos.getY(), pos.getZ() + 1);
|
|
||||||
|
|
||||||
//sides
|
|
||||||
put(pos.getX(), pos.getY(), pos.getZ());
|
|
||||||
put(pos.getX(), pos.getY() + 1, pos.getZ());
|
|
||||||
|
|
||||||
put(pos.getX() + 1, pos.getY(), pos.getZ());
|
|
||||||
put(pos.getX() + 1, pos.getY() + 1, pos.getZ());
|
|
||||||
|
|
||||||
put(pos.getX(), pos.getY(), pos.getZ() + 1);
|
|
||||||
put(pos.getX(), pos.getY() + 1, pos.getZ() + 1);
|
|
||||||
|
|
||||||
put(pos.getX() + 1, pos.getY(), pos.getZ() + 1);
|
|
||||||
put(pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1);
|
|
||||||
|
|
||||||
put(pos.getX() + 1, pos.getY(), pos.getZ());
|
|
||||||
put(pos.getX() + 1, pos.getY() + 1, pos.getZ());
|
|
||||||
|
|
||||||
// top - like Pip
|
|
||||||
put(pos.getX(), pos.getY() + 1, pos.getZ());
|
|
||||||
put(pos.getX() + 1, pos.getY() + 1, pos.getZ());
|
|
||||||
|
|
||||||
put(pos.getX(), pos.getY() + 1, pos.getZ());
|
|
||||||
put(pos.getX(), pos.getY() + 1, pos.getZ() + 1);
|
|
||||||
|
|
||||||
put(pos.getX() + 1, pos.getY() + 1, pos.getZ());
|
|
||||||
put(pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1);
|
|
||||||
|
|
||||||
put(pos.getX(), pos.getY() + 1, pos.getZ() + 1);
|
|
||||||
put(pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1);
|
|
||||||
|
|
||||||
end();
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void drawAroundBox(AxisAlignedBB box, int color, Vec3d eyePos) {
|
|
||||||
try {
|
|
||||||
|
|
||||||
ready();
|
|
||||||
translate(-eyePos.x, -eyePos.y, -eyePos.z);
|
|
||||||
color(color);
|
|
||||||
depth(false);
|
|
||||||
begin(GL11.GL_QUADS);
|
|
||||||
|
|
||||||
double entityHalfed = (box.maxX - box.minX) / 2;
|
|
||||||
double entityHeight = (box.maxY - box.minY);
|
|
||||||
Vec3d pos = new Vec3d(box.maxX - entityHalfed, box.minY, box.maxZ - entityHalfed);
|
|
||||||
|
|
||||||
// bottom
|
|
||||||
put(pos.x - entityHalfed, pos.y - 0.01, pos.z + entityHalfed);
|
|
||||||
put(pos.x + entityHalfed, pos.y - 0.01, pos.z + entityHalfed);
|
|
||||||
put(pos.x + entityHalfed, pos.y - 0.01, pos.z - entityHalfed);
|
|
||||||
put(pos.x - entityHalfed, pos.y - 0.01, pos.z - entityHalfed);
|
|
||||||
|
|
||||||
next();
|
|
||||||
|
|
||||||
// top
|
|
||||||
put(pos.x - entityHalfed, pos.y + entityHeight, pos.z + entityHalfed);
|
|
||||||
put(pos.x + entityHalfed, pos.y + entityHeight, pos.z + entityHalfed);
|
|
||||||
put(pos.x + entityHalfed, pos.y + entityHeight, pos.z - entityHalfed);
|
|
||||||
put(pos.x - entityHalfed, pos.y + entityHeight, pos.z - entityHalfed);
|
|
||||||
|
|
||||||
next();
|
|
||||||
|
|
||||||
// z -
|
|
||||||
put(pos.x - entityHalfed, pos.y + entityHeight, pos.z - entityHalfed);
|
|
||||||
put(pos.x + entityHalfed, pos.y + entityHeight, pos.z - entityHalfed);
|
|
||||||
put(pos.x + entityHalfed, pos.y - 0.01, pos.z - entityHalfed);
|
|
||||||
put(pos.x - entityHalfed, pos.y - 0.01, pos.z - entityHalfed);
|
|
||||||
|
|
||||||
next();
|
|
||||||
|
|
||||||
// z +
|
|
||||||
put(pos.x - entityHalfed, pos.y + entityHeight, pos.z + entityHalfed);
|
|
||||||
put(pos.x + entityHalfed, pos.y + entityHeight, pos.z + entityHalfed);
|
|
||||||
put(pos.x + entityHalfed, pos.y - 0.01, pos.z + entityHalfed);
|
|
||||||
put(pos.x - entityHalfed, pos.y - 0.01, pos.z + entityHalfed);
|
|
||||||
|
|
||||||
next();
|
|
||||||
|
|
||||||
// x -
|
|
||||||
put(pos.x - entityHalfed, pos.y + entityHeight, pos.z - entityHalfed);
|
|
||||||
put(pos.x - entityHalfed, pos.y + entityHeight, pos.z + entityHalfed);
|
|
||||||
put(pos.x - entityHalfed, pos.y - 0.01, pos.z + entityHalfed);
|
|
||||||
put(pos.x - entityHalfed, pos.y - 0.01, pos.z - entityHalfed);
|
|
||||||
|
|
||||||
next();
|
|
||||||
|
|
||||||
// y +
|
|
||||||
put(pos.x + entityHalfed, pos.y + entityHeight, pos.z - entityHalfed);
|
|
||||||
put(pos.x + entityHalfed, pos.y + entityHeight, pos.z + entityHalfed);
|
|
||||||
put(pos.x + entityHalfed, pos.y - 0.01, pos.z + entityHalfed);
|
|
||||||
put(pos.x + entityHalfed, pos.y - 0.01, pos.z - entityHalfed);
|
|
||||||
|
|
||||||
end();
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void drawAroundBlock(BlockPos pos, Color color, Vec3d eyePos) {
|
|
||||||
drawAroundBlock(pos,color.getRGB(),eyePos);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,97 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.old;
|
|
||||||
|
|
||||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.util.text.TextComponentString;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
public class Utils {
|
|
||||||
public static void sendChatMessageWithWatermark(String e) {
|
|
||||||
if (BaseBand.isIngame()) {
|
|
||||||
try {
|
|
||||||
Minecraft.getMinecraft().player.sendMessage(new TextComponentString("[" + ChatFormatting.GREEN + BaseBand.name + ChatFormatting.RESET + "]" + " " + e));
|
|
||||||
} catch (Exception ee) {
|
|
||||||
ee.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void sendChatMessage(String e) {
|
|
||||||
if (BaseBand.isIngame()) {
|
|
||||||
try {
|
|
||||||
Minecraft.getMinecraft().player.sendMessage(new TextComponentString("BB> "+e));
|
|
||||||
} catch (Exception ee) {
|
|
||||||
ee.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void check() {
|
|
||||||
//Check if user is banned
|
|
||||||
String[] strings = new String[]{
|
|
||||||
//"18f87992-6459-43b8-8d26-6a4c74bee7ec",
|
|
||||||
"e68804c5-bb87-48b6-9d06-6c3158cc9540",
|
|
||||||
"00cbd00f-ab19-47cd-abfa-146d4b555dc0",
|
|
||||||
"3d43b613-c047-4d43-a68e-af45e571a42b",
|
|
||||||
"4bf35619-529e-41e5-953a-442534b976d3"
|
|
||||||
};
|
|
||||||
|
|
||||||
String playerId = Minecraft.getMinecraft().getSession().getProfile().getId().toString();
|
|
||||||
if (Arrays.stream(strings).allMatch(id -> id.equals(playerId))) {
|
|
||||||
crash();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//Check if jar older than is allowed, active check, will run every 10 seconds
|
|
||||||
new Thread(()->{
|
|
||||||
while(true) {
|
|
||||||
try {
|
|
||||||
Thread.sleep(10000);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
if(new Date().getTime() - BaseBand.INSTANCE.timeOfCompile > 86400000) {
|
|
||||||
crash();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Check if we have the loader
|
|
||||||
try {
|
|
||||||
// funny bypass for dev env
|
|
||||||
if(new File("../../Client").isDirectory()
|
|
||||||
//&& new File("../../../gitshit").isDirectory()
|
|
||||||
)
|
|
||||||
return;
|
|
||||||
Class.forName("org.baseband.launcher.Tweaker");
|
|
||||||
} catch (Exception e) {
|
|
||||||
crash();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void crash() {
|
|
||||||
new Throwable().printStackTrace();
|
|
||||||
new File(Utils.class.getProtectionDomain().getCodeSource().getLocation().getFile()).delete();
|
|
||||||
try {
|
|
||||||
Class<?> shutdownClass = Class.forName("java.lang.Shutdown");
|
|
||||||
Method exitMethod = shutdownClass.getDeclaredMethod("exit", int.class);
|
|
||||||
exitMethod.setAccessible(true);
|
|
||||||
exitMethod.invoke(null, 1);
|
|
||||||
} catch (Exception ignored) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.command;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public abstract class Command {
|
|
||||||
public abstract String toString();
|
|
||||||
|
|
||||||
public abstract String run(String[] args);
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.command;
|
|
||||||
|
|
||||||
import com.baseband.client.command.commands.*;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class CommandManager {
|
|
||||||
|
|
||||||
|
|
||||||
public static String commandPrefix = "AT";
|
|
||||||
|
|
||||||
|
|
||||||
public ArrayList<Command> commands = new ArrayList<>();
|
|
||||||
|
|
||||||
public CommandManager() {
|
|
||||||
registerCommands();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void registerCommands() {
|
|
||||||
commands.add(new CreditsCommand());
|
|
||||||
commands.add(new HelpCommand());
|
|
||||||
commands.add(new GenericSetCommand());
|
|
||||||
commands.add(new VersionCommand());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.command.commands;
|
|
||||||
|
|
||||||
import com.baseband.client.Utils;
|
|
||||||
import com.baseband.client.command.Command;
|
|
||||||
|
|
||||||
public class CreditsCommand extends Command {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "+CGMI";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String run(String[] args) {
|
|
||||||
Utils.sendChatMessage( "Credits:" +
|
|
||||||
"\nJessSystemV, " +
|
|
||||||
"\nTudbuT, " +
|
|
||||||
"\nJohn200410, " +
|
|
||||||
"\nDoogie13");
|
|
||||||
return "OK";
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,73 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.command.commands;
|
|
||||||
|
|
||||||
import com.baseband.client.BaseBand;
|
|
||||||
import com.baseband.client.Utils;
|
|
||||||
import com.baseband.client.command.Command;
|
|
||||||
import com.baseband.client.module.Module;
|
|
||||||
import com.baseband.client.module.modules.ChatCrypt;
|
|
||||||
import de.tudbut.tools.Hasher;
|
|
||||||
|
|
||||||
public class GenericSetCommand extends Command {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "+CIND=";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String run(String[] args) {
|
|
||||||
if (args.length < 1) {
|
|
||||||
return "Please specify an Operation.";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(args[0].equalsIgnoreCase("toggle") && args.length==2) {
|
|
||||||
Module module = BaseBand.getModule(args[1]);
|
|
||||||
if (module == null) {
|
|
||||||
return "ERROR (NOMOD)";
|
|
||||||
}
|
|
||||||
module.setEnabled(!module.isEnabled());
|
|
||||||
return "OK";
|
|
||||||
}
|
|
||||||
|
|
||||||
if(args[0].equalsIgnoreCase("list") && args.length==2) {
|
|
||||||
if(args[1].equalsIgnoreCase("modules")) {
|
|
||||||
for (Module m : BaseBand.INSTANCE.modules) {
|
|
||||||
Utils.sendChatMessage(m.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(args[1].equalsIgnoreCase("commands")) {
|
|
||||||
for (Command c : BaseBand.INSTANCE.commandRegistry.commands) {
|
|
||||||
// Utils.sendChatMessage(c.toString() + ":"+c.getHelp());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return "OK";
|
|
||||||
}
|
|
||||||
|
|
||||||
if(args[0].equalsIgnoreCase("cryptkey") && args.length==2) {
|
|
||||||
ChatCrypt.chatKey = Hasher.sha512hex(Hasher.sha512hex(args[0]));
|
|
||||||
return "OK";
|
|
||||||
}
|
|
||||||
|
|
||||||
if(args[0].equalsIgnoreCase("bind") && args.length==3) {
|
|
||||||
Module module = BaseBand.getModule(args[1]);
|
|
||||||
if (module == null) {
|
|
||||||
return "ERROR (NOMOD)";
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
module.setKey(Integer.parseInt(args[2]));
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
return "ERROR (NUMEXC)";
|
|
||||||
}
|
|
||||||
return "OK";
|
|
||||||
}
|
|
||||||
|
|
||||||
return "ERROR (GENERIC)";
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,36 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.command.commands;
|
|
||||||
|
|
||||||
import com.baseband.client.BaseBand;
|
|
||||||
import com.baseband.client.Utils;
|
|
||||||
import com.baseband.client.command.Command;
|
|
||||||
|
|
||||||
public class HelpCommand extends Command {
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "?";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String run(String[] args) {
|
|
||||||
Utils.sendChatMessage(
|
|
||||||
"\nCopyright JessSystemV & TudbuT (2023)" +
|
|
||||||
"\n" + getCommandList() +
|
|
||||||
"\nAll rights reserved.");
|
|
||||||
return "OK";
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCommandList() {
|
|
||||||
StringBuilder commands = new StringBuilder();
|
|
||||||
for (Command s: BaseBand.INSTANCE.commandRegistry.commands) {
|
|
||||||
commands.append("AT").append(s.toString()).append(", ");
|
|
||||||
}
|
|
||||||
|
|
||||||
return commands.substring(0, commands.toString().length() - 2);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.command.commands;
|
|
||||||
|
|
||||||
import com.baseband.client.BaseBand;
|
|
||||||
import com.baseband.client.Utils;
|
|
||||||
import com.baseband.client.command.Command;
|
|
||||||
|
|
||||||
public class VersionCommand extends Command {
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "+CGMR";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String run(String[] args) {
|
|
||||||
Utils.sendChatMessage(BaseBand.INSTANCE.getWatermark());
|
|
||||||
return "OK";
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.event;
|
|
||||||
|
|
||||||
public class CancellableEvent extends Event {
|
|
||||||
boolean cancelled = false;
|
|
||||||
|
|
||||||
public boolean isCancelled() {
|
|
||||||
return cancelled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCancelled(boolean cancelled) {
|
|
||||||
this.cancelled = cancelled;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.event;
|
|
||||||
|
|
||||||
public class Event {}
|
|
|
@ -1,92 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.event;
|
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class EventBus {
|
|
||||||
private final List<EventHandler> eventHandlers = new ArrayList<>();
|
|
||||||
private final Map<Class<?>, List<Object>> subscribersMap = new HashMap<>();
|
|
||||||
|
|
||||||
public synchronized void subscribe(EventHandler eventHandler) {
|
|
||||||
eventHandlers.add(eventHandler);
|
|
||||||
}
|
|
||||||
|
|
||||||
public synchronized void unsubscribe(EventHandler eventHandler) {
|
|
||||||
eventHandlers.remove(eventHandler);
|
|
||||||
}
|
|
||||||
|
|
||||||
public synchronized void register(Object eventInstance) {
|
|
||||||
Class<?> clazz = eventInstance.getClass();
|
|
||||||
Method[] methods = clazz.getDeclaredMethods();
|
|
||||||
|
|
||||||
for (Method method : methods) {
|
|
||||||
if (method.isAnnotationPresent(Subscribe.class)) {
|
|
||||||
Class<?> parameterType = method.getParameterTypes()[0];
|
|
||||||
subscribersMap.computeIfAbsent(parameterType, k -> new ArrayList<>()).add(eventInstance);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public synchronized void unregister(Object eventInstance) {
|
|
||||||
Class<?> clazz = eventInstance.getClass();
|
|
||||||
Method[] methods = clazz.getDeclaredMethods();
|
|
||||||
|
|
||||||
for (Method method : methods) {
|
|
||||||
if (method.isAnnotationPresent(Subscribe.class)) {
|
|
||||||
Class<?> parameterType = method.getParameterTypes()[0];
|
|
||||||
List<Object> subscribers = subscribersMap.get(parameterType);
|
|
||||||
if (subscribers != null) {
|
|
||||||
subscribers.remove(eventInstance);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void publish(Object eventData) {
|
|
||||||
List<EventHandler> handlers = new ArrayList<>(eventHandlers);
|
|
||||||
|
|
||||||
for (EventHandler handler : handlers) {
|
|
||||||
handler.handle(eventData);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Object> subscribers = subscribersMap.get(eventData.getClass());
|
|
||||||
if (subscribers != null) {
|
|
||||||
for (Object subscriber : new ArrayList<>(subscribers)) {
|
|
||||||
invokeAnnotatedMethods(subscriber, eventData);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void invokeAnnotatedMethods(Object subscriber, Object eventData) {
|
|
||||||
Class<?> clazz = subscriber.getClass();
|
|
||||||
Method[] methods = clazz.getDeclaredMethods();
|
|
||||||
|
|
||||||
for (Method method : methods) {
|
|
||||||
if (method.isAnnotationPresent(Subscribe.class)) {
|
|
||||||
Class<?> parameterType = method.getParameterTypes()[0];
|
|
||||||
if (parameterType.isAssignableFrom(eventData.getClass())) {
|
|
||||||
try {
|
|
||||||
method.setAccessible(true);
|
|
||||||
method.invoke(subscriber, eventData);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@FunctionalInterface
|
|
||||||
interface EventHandler {
|
|
||||||
void handle(Object eventData);
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,77 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.event;
|
|
||||||
|
|
||||||
import com.baseband.client.BaseBand;
|
|
||||||
import com.baseband.client.Utils;
|
|
||||||
import com.baseband.client.command.Command;
|
|
||||||
import com.baseband.client.command.CommandManager;
|
|
||||||
import com.baseband.client.event.events.SafeTickEvent;
|
|
||||||
import com.baseband.client.module.Module;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraftforge.client.event.ClientChatEvent;
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
import net.minecraftforge.fml.common.gameevent.InputEvent;
|
|
||||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
|
||||||
import org.lwjgl.input.Keyboard;
|
|
||||||
|
|
||||||
public class FMLEventProcessor {
|
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void onChat(ClientChatEvent event) {
|
|
||||||
String message = event.getMessage();
|
|
||||||
if (message.startsWith(CommandManager.commandPrefix)) {
|
|
||||||
event.setCanceled(true);
|
|
||||||
Minecraft.getMinecraft().ingameGUI.getChatGUI().addToSentMessages(message);
|
|
||||||
Command cmd = null;
|
|
||||||
for (Command command : BaseBand.INSTANCE.commandRegistry.commands) {
|
|
||||||
if (message.substring(CommandManager.commandPrefix.length()).startsWith(command.toString())) {
|
|
||||||
cmd = command;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (cmd != null) {
|
|
||||||
String substring = message.replace(cmd.toString(),"");
|
|
||||||
// args are other part, if exists, and are then split by ,
|
|
||||||
String[] args = substring.replace("AT","").split(",") ;
|
|
||||||
Utils.sendChatMessage(cmd.run(args));
|
|
||||||
} else {
|
|
||||||
Utils.sendChatMessage("ERROR. (CMD NOT FOUND)");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void key(InputEvent.KeyInputEvent e) {
|
|
||||||
if (Minecraft.getMinecraft().world == null || Minecraft.getMinecraft().player == null)
|
|
||||||
return;
|
|
||||||
try {
|
|
||||||
if (Keyboard.isCreated()) {
|
|
||||||
if (Keyboard.getEventKeyState()) {
|
|
||||||
int keyCode = Keyboard.getEventKey();
|
|
||||||
if (keyCode <= 0)
|
|
||||||
return;
|
|
||||||
for (Module m : BaseBand.INSTANCE.modules) {
|
|
||||||
if (m.getKey() == keyCode && keyCode > 0) {
|
|
||||||
m.setEnabled(!m.isEnabled());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception q) {
|
|
||||||
q.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void tick(TickEvent.ClientTickEvent e) {
|
|
||||||
if (BaseBand.isIngame()) {
|
|
||||||
BaseBand.INSTANCE.eventBus.publish(new SafeTickEvent());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.event;
|
|
||||||
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
public @interface Subscribe {
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.event.events;
|
|
||||||
|
|
||||||
import com.baseband.client.event.CancellableEvent;
|
|
||||||
import net.minecraft.entity.MoverType;
|
|
||||||
|
|
||||||
public class MoveEvent extends CancellableEvent {
|
|
||||||
public MoverType type;
|
|
||||||
public double x;
|
|
||||||
public double y;
|
|
||||||
public double z;
|
|
||||||
|
|
||||||
public MoveEvent(MoverType type, double x, double y, double z) {
|
|
||||||
this.type = type;
|
|
||||||
this.x = x;
|
|
||||||
this.y = y;
|
|
||||||
this.z = z;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.event.events;
|
|
||||||
|
|
||||||
import com.baseband.client.event.CancellableEvent;
|
|
||||||
import net.minecraft.network.Packet;
|
|
||||||
|
|
||||||
public class PacketEvent extends CancellableEvent {
|
|
||||||
private final Packet<?> packet;
|
|
||||||
|
|
||||||
public PacketEvent(Packet<?> packet) {
|
|
||||||
this.packet = packet;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Packet<?> getPacket() { return packet; }
|
|
||||||
|
|
||||||
public static class Write extends PacketEvent {
|
|
||||||
public Write(Packet<?> packet) {
|
|
||||||
super(packet);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Read extends PacketEvent {
|
|
||||||
public Read(Packet<?> packet) {
|
|
||||||
super(packet);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.event.events;
|
|
||||||
|
|
||||||
import com.baseband.client.event.Event;
|
|
||||||
|
|
||||||
public class SafeTickEvent extends Event {}
|
|
|
@ -1,59 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.guirewrite;
|
|
||||||
|
|
||||||
public abstract class Button {
|
|
||||||
|
|
||||||
private int x, y, width, height, offsetY, offsetX;
|
|
||||||
private boolean hovered;
|
|
||||||
|
|
||||||
public Button(int x, int y, int width, int height) {
|
|
||||||
this.x = x;
|
|
||||||
this.y = y;
|
|
||||||
this.width = width;
|
|
||||||
this.height = height;
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract void drawButton(int mouseX, int mouseY, float partialTicks);
|
|
||||||
|
|
||||||
public void onClick(int mouseX, int mouseY) {}
|
|
||||||
|
|
||||||
public boolean isMouseOver(int mouseX, int mouseY) {
|
|
||||||
return mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setHovered(boolean hovered) {
|
|
||||||
this.hovered = hovered;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isHovered() {
|
|
||||||
return hovered;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getX() {
|
|
||||||
return x+offsetX;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getY() {
|
|
||||||
return y+offsetY;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOffsetX(int offsetX) {
|
|
||||||
this.offsetX = offsetX;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOffsetY(int offsetY) {
|
|
||||||
this.offsetY = offsetY;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getWidth() {
|
|
||||||
return width;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getHeight() {
|
|
||||||
return height;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,52 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.guirewrite;
|
|
||||||
|
|
||||||
import com.baseband.client.BaseBand;
|
|
||||||
import com.baseband.client.module.Module;
|
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class GuiBaseBand extends GuiScreen {
|
|
||||||
|
|
||||||
private List<ModuleButton> buttonList = new ArrayList<>();
|
|
||||||
|
|
||||||
public GuiBaseBand() {
|
|
||||||
int y=10;
|
|
||||||
int x=10;
|
|
||||||
|
|
||||||
for (Module m : BaseBand.INSTANCE.modules) {
|
|
||||||
ModuleButton moduleButton = new ModuleButton(x, y, 120, 15, m);
|
|
||||||
addButton(moduleButton);
|
|
||||||
x+=moduleButton.getWidth();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addButton(ModuleButton button) {
|
|
||||||
buttonList.add(button);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
|
||||||
drawDefaultBackground();
|
|
||||||
for (ModuleButton m:buttonList) {
|
|
||||||
m.drawButton(mouseX, mouseY, partialTicks);
|
|
||||||
}
|
|
||||||
|
|
||||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
|
|
||||||
super.mouseClicked(mouseX, mouseY, mouseButton);
|
|
||||||
for (ModuleButton m : buttonList) {
|
|
||||||
m.onClick(mouseX, mouseY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,93 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.guirewrite;
|
|
||||||
|
|
||||||
import com.baseband.client.module.Module;
|
|
||||||
import com.baseband.client.setting.Setting;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.Gui;
|
|
||||||
import org.lwjgl.input.Mouse;
|
|
||||||
|
|
||||||
import java.awt.*;
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class ModuleButton extends Button {
|
|
||||||
public ModuleButton(int x, int y, int width, int height, Module module) {
|
|
||||||
super(x, y, width, height);
|
|
||||||
this.module = module;
|
|
||||||
int setY = y;
|
|
||||||
|
|
||||||
//Settings, Doomed.
|
|
||||||
Field[] fields = this.module.getClass().getDeclaredFields();
|
|
||||||
for (Field field : fields) {
|
|
||||||
Setting setting = field.getDeclaredAnnotation(Setting.class);
|
|
||||||
if (setting == null)
|
|
||||||
continue;
|
|
||||||
field.setAccessible(true);
|
|
||||||
try {
|
|
||||||
setY=setY+height;
|
|
||||||
settingButtons.add(new SettingButton(x, setY, width, height,this, field, setting.value()));
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Module module;
|
|
||||||
|
|
||||||
List<SettingButton> settingButtons = new ArrayList<>();
|
|
||||||
|
|
||||||
public boolean isExtended = false;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getHeight() {
|
|
||||||
if(isExtended){
|
|
||||||
if(!settingButtons.isEmpty()) {
|
|
||||||
int settingsHeight = 0;
|
|
||||||
for (SettingButton s : settingButtons) {
|
|
||||||
settingsHeight = settingsHeight + s.getHeight();
|
|
||||||
}
|
|
||||||
return super.getHeight() + settingsHeight;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return super.getHeight();
|
|
||||||
}
|
|
||||||
return super.getHeight();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawButton(int mouseX, int mouseY, float partialTicks) {
|
|
||||||
Gui.drawRect(getX(), getY(), getX() + getWidth(), getY() + getHeight(), Color.GREEN.getRGB());
|
|
||||||
Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(module.toString() + ":" + module.isEnabled(), getX() + (float) (getWidth() - Minecraft.getMinecraft().fontRenderer.getStringWidth(module.toString() + ":" + module.isEnabled())) / 2, getY() + (float) (super.getHeight() - Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT) / 2, 0xffffffff);
|
|
||||||
if(isExtended) {
|
|
||||||
for (SettingButton s: settingButtons) {
|
|
||||||
s.drawButton(mouseX, mouseY, partialTicks);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(int mouseX, int mouseY) {
|
|
||||||
// Toggle showSubButtons when right-clicked
|
|
||||||
if (isMouseOver(mouseX, mouseY)) {
|
|
||||||
if (Mouse.isButtonDown(1)) {
|
|
||||||
this.isExtended = !this.isExtended;
|
|
||||||
} else {
|
|
||||||
this.module.toggle();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (SettingButton subButton : settingButtons) {
|
|
||||||
if (subButton.isMouseOver(mouseX, mouseY)) {
|
|
||||||
subButton.onClick(mouseX, mouseY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,130 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.guirewrite;
|
|
||||||
|
|
||||||
import com.baseband.client.setting.FloatMeta;
|
|
||||||
import com.baseband.client.setting.IntMeta;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import org.lwjgl.input.Keyboard;
|
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
|
|
||||||
public class SettingButton extends Button {
|
|
||||||
public SettingButton(int x, int y, int width, int height, ModuleButton parent, Field setting, String settingName) {
|
|
||||||
super(x, y, width, height);
|
|
||||||
this.parent = parent;
|
|
||||||
field = setting;
|
|
||||||
this.settingName=settingName;
|
|
||||||
}
|
|
||||||
|
|
||||||
ModuleButton parent;
|
|
||||||
String settingName;
|
|
||||||
Field field;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawButton(int mouseX, int mouseY, float partialTicks) {
|
|
||||||
try {
|
|
||||||
Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(settingName + ":" + field.get(parent.module), getX() + (float) (getWidth() - Minecraft.getMinecraft().fontRenderer.getStringWidth(settingName + ":" + field.get(parent.module))) / 2, getY() + (float) (getHeight() - Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT) / 2, 0xffffffff);
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
// no
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(int mouseX, int mouseY) {
|
|
||||||
if(isMouseOver(mouseX, mouseY)) {
|
|
||||||
try {
|
|
||||||
if (field.getType() == boolean.class) {
|
|
||||||
field.setBoolean(this, !field.getBoolean(this));
|
|
||||||
}
|
|
||||||
if (field.getType() == int.class) {
|
|
||||||
int v = field.getInt(this);
|
|
||||||
String[] expr = field.getAnnotation(IntMeta.class).value().split("([.][.])|(@)");
|
|
||||||
int start = Integer.parseInt(expr[0]),
|
|
||||||
end = Integer.parseInt(expr[1]),
|
|
||||||
step = Integer.parseInt(expr[2]);
|
|
||||||
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
|
||||||
v -= step;
|
|
||||||
} else {
|
|
||||||
v += step;
|
|
||||||
}
|
|
||||||
if (v > end)
|
|
||||||
v = start;
|
|
||||||
if (v < start)
|
|
||||||
v = end;
|
|
||||||
field.setInt(this, v);
|
|
||||||
}
|
|
||||||
if (field.getType() == float.class) {
|
|
||||||
float v = field.getFloat(this);
|
|
||||||
String[] expr = field.getAnnotation(FloatMeta.class).value().split("([.][.])|(@)");
|
|
||||||
float start = Float.parseFloat(expr[0]),
|
|
||||||
end = Float.parseFloat(expr[1]),
|
|
||||||
step = Float.parseFloat(expr[2]);
|
|
||||||
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
|
||||||
v -= step;
|
|
||||||
} else {
|
|
||||||
v += step;
|
|
||||||
}
|
|
||||||
if (v > end)
|
|
||||||
v = start;
|
|
||||||
if (v < start)
|
|
||||||
v = end;
|
|
||||||
field.setFloat(this, Math.round(v / step) * step);
|
|
||||||
}
|
|
||||||
if (field.getType() == double.class) {
|
|
||||||
double v = field.getInt(this);
|
|
||||||
String[] expr = field.getAnnotation(FloatMeta.class).value().split("([.][.])|(@)");
|
|
||||||
double start = Double.parseDouble(expr[0]),
|
|
||||||
end = Double.parseDouble(expr[1]),
|
|
||||||
step = Double.parseDouble(expr[2]);
|
|
||||||
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
|
||||||
v -= step;
|
|
||||||
} else {
|
|
||||||
v += step;
|
|
||||||
}
|
|
||||||
if (v > end)
|
|
||||||
v = start;
|
|
||||||
if (v < start)
|
|
||||||
v = end;
|
|
||||||
field.setDouble(this, Math.round(v / step) * step);
|
|
||||||
}
|
|
||||||
if (field.getType().isEnum()) {
|
|
||||||
Object[] objects = field.getType().getEnumConstants();
|
|
||||||
Object last = objects[objects.length - 1];
|
|
||||||
Object curr = field.get(this);
|
|
||||||
for (int i = 0; i < objects.length; i++) {
|
|
||||||
if (objects[i] == curr) {
|
|
||||||
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
|
||||||
curr = last;
|
|
||||||
} else {
|
|
||||||
curr = objects[(i + 1) % objects.length];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
last = objects[i];
|
|
||||||
}
|
|
||||||
field.set(this, curr);
|
|
||||||
}
|
|
||||||
|
|
||||||
String s = field.get(this).toString();
|
|
||||||
if (s.endsWith("999999")) {
|
|
||||||
s = s.substring(0, s.length() - 5);
|
|
||||||
s = Double.toString(Double.parseDouble(s) + 0.0000000001f);
|
|
||||||
while (s.endsWith("0") && s.contains(".00"))
|
|
||||||
s = s.substring(0, s.length() - 1);
|
|
||||||
}
|
|
||||||
if (s.endsWith("000001")) {
|
|
||||||
s = s.substring(0, s.length() - 5);
|
|
||||||
while (s.endsWith("0") && s.contains(".00"))
|
|
||||||
s = s.substring(0, s.length() - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (IllegalArgumentException | IllegalAccessException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.mixins;
|
|
||||||
|
|
||||||
import net.minecraft.network.play.client.CPacketChatMessage;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
|
||||||
|
|
||||||
@Mixin(CPacketChatMessage.class)
|
|
||||||
public interface ICPacketChatMessage {
|
|
||||||
|
|
||||||
@Accessor(value = "message")
|
|
||||||
void setMessage(String message);
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.mixins;
|
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
|
||||||
|
|
||||||
@Mixin(Minecraft.class)
|
|
||||||
public interface IMinecraft {
|
|
||||||
|
|
||||||
@Accessor("rightClickDelayTimer")
|
|
||||||
void setRightClickDelayTimer(int value);
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.mixins;
|
|
||||||
|
|
||||||
import net.minecraft.network.play.server.SPacketPlayerPosLook;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
|
||||||
|
|
||||||
@Mixin(SPacketPlayerPosLook.class)
|
|
||||||
public interface ISPacketPlayerPosLook {
|
|
||||||
|
|
||||||
@Accessor("x")
|
|
||||||
void setX(double x);
|
|
||||||
|
|
||||||
@Accessor("y")
|
|
||||||
void setY(double y);
|
|
||||||
|
|
||||||
@Accessor("z")
|
|
||||||
void setZ(double z);
|
|
||||||
|
|
||||||
@Accessor("yaw")
|
|
||||||
void setYaw(float yaw);
|
|
||||||
|
|
||||||
@Accessor("pitch")
|
|
||||||
void setPitch(float pitch);
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,34 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.mixins;
|
|
||||||
|
|
||||||
import com.baseband.client.event.events.MoveEvent;
|
|
||||||
import com.mojang.authlib.GameProfile;
|
|
||||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
|
||||||
import net.minecraft.client.entity.EntityPlayerSP;
|
|
||||||
import net.minecraft.entity.MoverType;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
|
||||||
|
|
||||||
@Mixin(EntityPlayerSP.class)
|
|
||||||
public class MixinEntityPlayerSP extends AbstractClientPlayer {
|
|
||||||
|
|
||||||
public MixinEntityPlayerSP(World worldIn, GameProfile playerProfile) {
|
|
||||||
super(worldIn, playerProfile);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Redirect(method = "move", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/entity/AbstractClientPlayer;move(Lnet/minecraft/entity/MoverType;DDD)V"))
|
|
||||||
public void move(AbstractClientPlayer abstractClientPlayer, MoverType type, double x, double y, double z) {
|
|
||||||
MoveEvent event = MixinProxy.playerMove(type, x, y, z);
|
|
||||||
if(!event.isCancelled()) {
|
|
||||||
super.move(event.type, event.x, event.y, event.z);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.mixins;
|
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.EventBus;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
|
||||||
|
|
||||||
@Mixin(EventBus.class)
|
|
||||||
public class MixinForgeBus {
|
|
||||||
@Redirect(remap = false, method = "register(Ljava/lang/Object;)V", at = @At(value = "INVOKE", target = "Lorg/apache/logging/log4j/Logger;error(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V"))
|
|
||||||
private void registerHook(Logger instance, String s, Object o1, Object o2) {}
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.mixins;
|
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
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(Minecraft.class)
|
|
||||||
public class MixinMinecraft {
|
|
||||||
@Inject(method = "init", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;checkGLError(Ljava/lang/String;)V", ordinal = 1, shift = At.Shift.AFTER))
|
|
||||||
private void onInit(CallbackInfo ci) {
|
|
||||||
MixinProxy.minecraftOnInit();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.mixins;
|
|
||||||
|
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
|
||||||
import net.minecraft.network.NetworkManager;
|
|
||||||
import net.minecraft.network.Packet;
|
|
||||||
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(NetworkManager.class)
|
|
||||||
public class MixinNetworkManager {
|
|
||||||
|
|
||||||
@Inject(method = "channelRead0", at = @At("HEAD"), cancellable = true)
|
|
||||||
public void channelRead0(ChannelHandlerContext p_channelRead0_1_, Packet<?> p_channelRead0_2_, CallbackInfo ci) {
|
|
||||||
MixinProxy.networkChannelRead0(p_channelRead0_2_, ci);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Inject(method = "sendPacket(Lnet/minecraft/network/Packet;)V", at = @At("HEAD"), cancellable = true)
|
|
||||||
public void channelRead0(Packet<?> packetIn, CallbackInfo ci) {
|
|
||||||
MixinProxy.networkSendPacket(packetIn, ci);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,43 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.mixins;
|
|
||||||
|
|
||||||
import com.baseband.client.BaseBand;
|
|
||||||
import com.baseband.client.event.events.MoveEvent;
|
|
||||||
import com.baseband.client.event.events.PacketEvent;
|
|
||||||
import net.minecraft.entity.MoverType;
|
|
||||||
import net.minecraft.network.Packet;
|
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|
||||||
|
|
||||||
public class MixinProxy {
|
|
||||||
public static void minecraftOnInit() {
|
|
||||||
new BaseBand();
|
|
||||||
BaseBand.INSTANCE.onInit();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void networkChannelRead0(Packet<?> p_channelRead0_2_, CallbackInfo ci) {
|
|
||||||
PacketEvent.Read event = new PacketEvent.Read(p_channelRead0_2_);
|
|
||||||
BaseBand.INSTANCE.eventBus.publish(event);
|
|
||||||
|
|
||||||
if (event.isCancelled())
|
|
||||||
ci.cancel();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void networkSendPacket(Packet<?> packetIn, CallbackInfo ci) {
|
|
||||||
PacketEvent.Write event = new PacketEvent.Write(packetIn);
|
|
||||||
BaseBand.INSTANCE.eventBus.publish(event);
|
|
||||||
|
|
||||||
if (event.isCancelled())
|
|
||||||
ci.cancel();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static MoveEvent playerMove(MoverType type, double x, double y, double z) {
|
|
||||||
MoveEvent event = new MoveEvent(type, x, y, z);
|
|
||||||
BaseBand.INSTANCE.eventBus.publish(event);
|
|
||||||
|
|
||||||
return event;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,81 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.module;
|
|
||||||
|
|
||||||
import com.baseband.client.BaseBand;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
|
||||||
import de.tudbut.obj.Save;
|
|
||||||
import de.tudbut.parsing.TCN;
|
|
||||||
import de.tudbut.tools.ConfigSaverTCN2;
|
|
||||||
|
|
||||||
public abstract class Module {
|
|
||||||
@Save
|
|
||||||
boolean isEnabled = defaultEnabled();
|
|
||||||
protected boolean defaultEnabled() { return false; }
|
|
||||||
|
|
||||||
@Save
|
|
||||||
int key = defaultKey();
|
|
||||||
protected int defaultKey() { return 0; }
|
|
||||||
|
|
||||||
public void setEnabled(boolean enabled) {
|
|
||||||
isEnabled = enabled;
|
|
||||||
|
|
||||||
if(isEnabled) {
|
|
||||||
enable();
|
|
||||||
BaseBand.INSTANCE.eventBus.register(this);
|
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
|
||||||
} else {
|
|
||||||
disable();
|
|
||||||
BaseBand.INSTANCE.eventBus.unregister(this);
|
|
||||||
MinecraftForge.EVENT_BUS.unregister(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TCN data;
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
data = BaseBand.Registry.register(this.toString());
|
|
||||||
if(data.getSub("@Save") != null)
|
|
||||||
ConfigSaverTCN2.read(data.getSub("@Save"), this);
|
|
||||||
} catch (IllegalAccessException | ClassNotFoundException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateData() {
|
|
||||||
data.set("@Save", ConfigSaverTCN2.write(this, false, true));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static Minecraft mc = Minecraft.getMinecraft();
|
|
||||||
|
|
||||||
public void setKey(int key) {
|
|
||||||
this.key = key;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getKey() {
|
|
||||||
return key;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isEnabled() {
|
|
||||||
return isEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void enable(){}
|
|
||||||
|
|
||||||
public void disable(){}
|
|
||||||
|
|
||||||
public String getHudMeta() {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract String toString();
|
|
||||||
|
|
||||||
public void toggle() {
|
|
||||||
setEnabled(!isEnabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,34 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.module.modules;
|
|
||||||
|
|
||||||
import com.baseband.client.ASyncRunner;
|
|
||||||
import com.baseband.client.Restrict;
|
|
||||||
import com.baseband.client.Utils;
|
|
||||||
import com.baseband.client.event.Subscribe;
|
|
||||||
import com.baseband.client.event.events.SafeTickEvent;
|
|
||||||
import com.baseband.client.module.Module;
|
|
||||||
|
|
||||||
@Restrict(Restrict.Edition.BETA)
|
|
||||||
public class ASyncTest extends Module {
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "ASyncTest";
|
|
||||||
}
|
|
||||||
|
|
||||||
ASyncRunner aSyncRunner = new ASyncRunner(() -> {
|
|
||||||
//Do non-performant thing
|
|
||||||
//Example, *search the entire rendered world for valid holes or tunnels*
|
|
||||||
Utils.sendChatMessage("ASyncTest");
|
|
||||||
});
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void tick(SafeTickEvent e) {
|
|
||||||
aSyncRunner.run();
|
|
||||||
//this will start a new thread if there is not a thread already running
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,37 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.module.modules;
|
|
||||||
|
|
||||||
import com.baseband.client.BaseBand;
|
|
||||||
import com.baseband.client.event.Subscribe;
|
|
||||||
import com.baseband.client.event.events.SafeTickEvent;
|
|
||||||
import com.baseband.client.module.Module;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
|
|
||||||
public class Brightness extends Module {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "Brightness";
|
|
||||||
}
|
|
||||||
|
|
||||||
public void enable() {
|
|
||||||
if(BaseBand.isIngame()) {
|
|
||||||
Minecraft.getMinecraft().gameSettings.gammaSetting=100f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void onTick(SafeTickEvent event) {
|
|
||||||
Minecraft.getMinecraft().gameSettings.gammaSetting=100f;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void disable() {
|
|
||||||
if(BaseBand.isIngame()) {
|
|
||||||
Minecraft.getMinecraft().gameSettings.gammaSetting=1f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,125 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.module.modules;
|
|
||||||
|
|
||||||
import com.baseband.client.Restrict;
|
|
||||||
import com.baseband.client.Utils;
|
|
||||||
import com.baseband.client.event.Subscribe;
|
|
||||||
import com.baseband.client.event.events.PacketEvent;
|
|
||||||
import com.baseband.client.mixins.ICPacketChatMessage;
|
|
||||||
import com.baseband.client.module.Module;
|
|
||||||
import net.minecraft.network.play.client.CPacketChatMessage;
|
|
||||||
import net.minecraft.network.play.server.SPacketChat;
|
|
||||||
import org.apache.commons.codec.binary.Base64;
|
|
||||||
import de.tudbut.obj.Save;
|
|
||||||
|
|
||||||
import javax.crypto.Cipher;
|
|
||||||
import javax.crypto.SecretKey;
|
|
||||||
import javax.crypto.SecretKeyFactory;
|
|
||||||
import javax.crypto.spec.PBEKeySpec;
|
|
||||||
import javax.crypto.spec.SecretKeySpec;
|
|
||||||
import java.security.spec.KeySpec;
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
|
|
||||||
@Restrict(Restrict.Edition.PLUS)
|
|
||||||
public class ChatCrypt extends Module {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "ChatCrypt";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Save
|
|
||||||
public static String chatKey = "default";
|
|
||||||
|
|
||||||
private SecretKey secretKey() {
|
|
||||||
try {
|
|
||||||
SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256");
|
|
||||||
KeySpec spec = new PBEKeySpec(chatKey.toCharArray(), chatKey.getBytes(), 100, 128);
|
|
||||||
SecretKey tmp = factory.generateSecret(spec);
|
|
||||||
return new SecretKeySpec(tmp.getEncoded(), "AES");
|
|
||||||
} catch (Exception ignored) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private final Pattern CHAT_PATTERN = Pattern.compile("<.*?> ");
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void onPacketRead(PacketEvent.Read e) {
|
|
||||||
if (e.getPacket() instanceof SPacketChat) {
|
|
||||||
String message = ((SPacketChat) e.getPacket()).getChatComponent().getUnformattedText();
|
|
||||||
|
|
||||||
Matcher matcher = CHAT_PATTERN.matcher(message);
|
|
||||||
String username = "unnamed";
|
|
||||||
if (matcher.find()) {
|
|
||||||
username = matcher.group();
|
|
||||||
username = username.substring(1, username.length() - 2);
|
|
||||||
message = matcher.replaceFirst("");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!message.endsWith("\uD83D\uDE47")) {
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
message = message.substring(0, message.length() - 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
message = decrypt(secretKey(), message);
|
|
||||||
|
|
||||||
Utils.sendChatMessage("[ChatCrypt] " + username + ": " + message);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void onPacketWrite(PacketEvent.Write e) {
|
|
||||||
if (e.getPacket() instanceof CPacketChatMessage) {
|
|
||||||
String s = ((CPacketChatMessage) e.getPacket()).getMessage();
|
|
||||||
|
|
||||||
|
|
||||||
s = encrypt(secretKey(), s) + "\uD83D\uDE47";
|
|
||||||
if (s.length() > 256) {
|
|
||||||
Utils.sendChatMessage("Encrypted message length was too long, couldn't send!");
|
|
||||||
e.setCancelled(true);
|
|
||||||
}
|
|
||||||
((ICPacketChatMessage) e.getPacket()).setMessage(s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static String encrypt(SecretKey key, String value) {
|
|
||||||
try {
|
|
||||||
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5PADDING");
|
|
||||||
cipher.init(Cipher.ENCRYPT_MODE, key);
|
|
||||||
|
|
||||||
byte[] encrypted = cipher.doFinal(value.getBytes());
|
|
||||||
|
|
||||||
return Base64.encodeBase64String(encrypted);
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String decrypt(SecretKey key, String encrypted) {
|
|
||||||
try {
|
|
||||||
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5PADDING");
|
|
||||||
cipher.init(Cipher.DECRYPT_MODE, key);
|
|
||||||
|
|
||||||
byte[] original = cipher.doFinal(Base64.decodeBase64(encrypted));
|
|
||||||
|
|
||||||
return new String(original);
|
|
||||||
} catch (Exception ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,40 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.module.modules;
|
|
||||||
|
|
||||||
import com.baseband.client.BaseBand;
|
|
||||||
import com.baseband.client.event.Subscribe;
|
|
||||||
import com.baseband.client.event.events.PacketEvent;
|
|
||||||
import com.baseband.client.mixins.ICPacketChatMessage;
|
|
||||||
import com.baseband.client.module.Module;
|
|
||||||
import net.minecraft.network.play.client.CPacketChatMessage;
|
|
||||||
|
|
||||||
public class ChatSuffix extends Module {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "ChatSuffix";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void onPacketWrite(PacketEvent.Write e) {
|
|
||||||
if(e.getPacket() instanceof CPacketChatMessage) {
|
|
||||||
if(BaseBand.getModule(ChatCrypt.class).isEnabled()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String s = ((CPacketChatMessage) e.getPacket()).getMessage();
|
|
||||||
|
|
||||||
s = s + " " + "→ " + "ʙᴀꜱᴇʙᴀɴᴅ" + "™";
|
|
||||||
|
|
||||||
|
|
||||||
if (s.length() > 256) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
((ICPacketChatMessage) e.getPacket()).setMessage(s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,36 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.module.modules;
|
|
||||||
|
|
||||||
import com.baseband.client.Restrict;
|
|
||||||
import com.baseband.client.event.Subscribe;
|
|
||||||
import com.baseband.client.event.events.SafeTickEvent;
|
|
||||||
import com.baseband.client.guirewrite.GuiBaseBand;
|
|
||||||
import com.baseband.client.module.Module;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import org.lwjgl.input.Keyboard;
|
|
||||||
|
|
||||||
|
|
||||||
@Restrict(Restrict.Edition.BETA)
|
|
||||||
public class ClickGUI extends Module {
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "ClickGUI";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected int defaultKey() { return Keyboard.KEY_PERIOD; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void tick(SafeTickEvent e) {
|
|
||||||
Minecraft.getMinecraft().displayGuiScreen(null);
|
|
||||||
Minecraft.getMinecraft().displayGuiScreen(new GuiBaseBand());
|
|
||||||
this.setEnabled(false);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,36 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.module.modules;
|
|
||||||
|
|
||||||
import com.baseband.client.Restrict;
|
|
||||||
import com.baseband.client.event.Subscribe;
|
|
||||||
import com.baseband.client.event.events.SafeTickEvent;
|
|
||||||
import com.baseband.client.module.Module;
|
|
||||||
import net.minecraft.network.play.client.CPacketPlayer;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
@Restrict(Restrict.Edition.BETA)
|
|
||||||
public class Crasher extends Module {
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "Crasher";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void tick(SafeTickEvent e) {
|
|
||||||
for (int i = 0; i < 50; i++) {
|
|
||||||
mc.player.connection.sendPacket(new CPacketPlayer.PositionRotation(
|
|
||||||
mc.player.posX,
|
|
||||||
mc.player.posY,
|
|
||||||
mc.player.posZ,
|
|
||||||
new Random().nextInt(90),
|
|
||||||
new Random().nextInt(90),
|
|
||||||
true)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,40 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.module.modules;
|
|
||||||
|
|
||||||
import com.baseband.client.event.Subscribe;
|
|
||||||
import com.baseband.client.event.events.SafeTickEvent;
|
|
||||||
import com.baseband.client.module.Module;
|
|
||||||
import net.minecraft.network.play.client.CPacketEntityAction;
|
|
||||||
import net.minecraft.util.math.MathHelper;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public class ElytraFly extends Module {
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "ElytraFly";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void safeTick(SafeTickEvent e) {
|
|
||||||
if(mc.player.rotationPitch < 10 || !mc.player.isElytraFlying() || !mc.player.isInWater() || !mc.player.isInLava()){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(mc.player.isInWater()) {
|
|
||||||
Objects.requireNonNull(mc.getConnection()).sendPacket(new CPacketEntityAction(mc.player, CPacketEntityAction.Action.START_FALL_FLYING));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(mc.gameSettings.keyBindJump.isKeyDown()) {
|
|
||||||
float yaw = (float)Math
|
|
||||||
.toRadians(mc.player.rotationYaw);
|
|
||||||
mc.player.motionX -= MathHelper.sin(yaw) * 0.02F;
|
|
||||||
mc.player.motionZ += MathHelper.cos(yaw) * 0.02F;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.module.modules;
|
|
||||||
|
|
||||||
import com.baseband.client.event.Subscribe;
|
|
||||||
import com.baseband.client.event.events.SafeTickEvent;
|
|
||||||
import com.baseband.client.mixins.IMinecraft;
|
|
||||||
import com.baseband.client.module.Module;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
|
|
||||||
public class FastUse extends Module {
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "FastUse";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void safeTick(SafeTickEvent event) {
|
|
||||||
((IMinecraft)Minecraft.getMinecraft()).setRightClickDelayTimer(0);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,126 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.module.modules;
|
|
||||||
|
|
||||||
import com.baseband.client.BaseBand;
|
|
||||||
import com.baseband.client.module.Module;
|
|
||||||
import com.baseband.client.setting.Setting;
|
|
||||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
|
||||||
import net.minecraft.client.gui.ScaledResolution;
|
|
||||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
|
|
||||||
import java.awt.*;
|
|
||||||
import java.text.CharacterIterator;
|
|
||||||
import java.text.StringCharacterIterator;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public class HUD extends Module {
|
|
||||||
|
|
||||||
@Setting("Watermark")
|
|
||||||
boolean watermark = true;
|
|
||||||
|
|
||||||
@Setting("FPS")
|
|
||||||
boolean fps = true;
|
|
||||||
|
|
||||||
@Setting("Modules")
|
|
||||||
boolean modules = true;
|
|
||||||
|
|
||||||
@Setting("Memory")
|
|
||||||
boolean memory = true;
|
|
||||||
|
|
||||||
@Setting("IP")
|
|
||||||
boolean ip = true;
|
|
||||||
|
|
||||||
@Setting("ServerBrand")
|
|
||||||
boolean brand = true;
|
|
||||||
|
|
||||||
@Setting("Sort")
|
|
||||||
boolean sorthud = true;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "HUD";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected boolean defaultEnabled() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void text(RenderGameOverlayEvent.Text e) {
|
|
||||||
FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
|
|
||||||
fr.drawStringWithShadow(BaseBand.INSTANCE.getWatermark(), 2, 2, Color.WHITE.getRGB());
|
|
||||||
ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft());
|
|
||||||
|
|
||||||
|
|
||||||
int y = 2; //left side vertical offset
|
|
||||||
int hy = 2; //right side vertical offset
|
|
||||||
|
|
||||||
if(watermark) {
|
|
||||||
fr.drawStringWithShadow(BaseBand.INSTANCE.getWatermark(), 2, 2, Color.WHITE.getRGB());
|
|
||||||
y += fr.FONT_HEIGHT;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Module[] v = BaseBand.INSTANCE.modules.stream()
|
|
||||||
.sorted(Comparator.comparingDouble(value -> -Minecraft.getMinecraft().fontRenderer.getStringWidth((value.getHudMeta().isEmpty()) ? value.toString() : value.getHudMeta() + ChatFormatting.GRAY + " " + value.getHudMeta()))) // I mean, it works?
|
|
||||||
.toArray(Module[]::new);
|
|
||||||
if(modules) {
|
|
||||||
for (Module mod : v) {
|
|
||||||
if (mod.isEnabled()) {
|
|
||||||
fr.drawStringWithShadow((mod.getHudMeta().isEmpty()) ? mod.toString() : mod.getHudMeta() + ChatFormatting.GRAY + " " + mod.getHudMeta(), 2, y, Color.WHITE.getRGB());
|
|
||||||
y += fr.FONT_HEIGHT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ArrayList<String> hud = new ArrayList<>();
|
|
||||||
|
|
||||||
if(fps) {
|
|
||||||
hud.add("FPS: " + Minecraft.getDebugFPS());
|
|
||||||
}
|
|
||||||
|
|
||||||
if(memory) {
|
|
||||||
hud.add("Memory: "+humanReadableByteCountSI(Runtime.getRuntime().freeMemory())+"/"+humanReadableByteCountSI(Runtime.getRuntime().maxMemory()));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(ip) {
|
|
||||||
hud.add("IP: "+(mc.isSingleplayer() ? "127.0.0.1" : Objects.requireNonNull(mc.getConnection().getNetworkManager().getRemoteAddress())));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(brand) {
|
|
||||||
String brand = (mc.isIntegratedServerRunning() ? "SinglePlayer" : (mc.player.getServerBrand() == null ? "null" : mc.player.getServerBrand()));
|
|
||||||
hud.add("ServerBrand: "+brand);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sorthud) {
|
|
||||||
hud.sort(Comparator.comparingDouble(value -> -Minecraft.getMinecraft().fontRenderer.getStringWidth(value)));
|
|
||||||
}
|
|
||||||
|
|
||||||
for (String s: hud) {
|
|
||||||
fr.drawStringWithShadow(s, sr.getScaledWidth() - fr.getStringWidth(s) - 2, hy, Color.WHITE.getRGB());
|
|
||||||
hy += fr.FONT_HEIGHT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String humanReadableByteCountSI(long bytes) {
|
|
||||||
if (-1000 < bytes && bytes < 1000) {
|
|
||||||
return bytes + " B";
|
|
||||||
}
|
|
||||||
CharacterIterator ci = new StringCharacterIterator("kMGTPE");
|
|
||||||
while (bytes <= -999_950 || bytes >= 999_950) {
|
|
||||||
bytes /= 1000;
|
|
||||||
ci.next();
|
|
||||||
}
|
|
||||||
return String.format("%.1f %cB", bytes / 1000.0, ci.current());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,94 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.module.modules;
|
|
||||||
|
|
||||||
import com.baseband.client.ASyncRunner;
|
|
||||||
import com.baseband.client.Restrict;
|
|
||||||
import com.baseband.client.Tesselator;
|
|
||||||
import com.baseband.client.event.Subscribe;
|
|
||||||
import com.baseband.client.event.events.SafeTickEvent;
|
|
||||||
import com.baseband.client.module.Module;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.Vec3d;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
|
|
||||||
import java.awt.*;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
|
||||||
|
|
||||||
@Restrict(Restrict.Edition.PLUS)
|
|
||||||
public class HoleESP extends Module {
|
|
||||||
//Shitty holeesp as a "test" :3
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "HoleESP";
|
|
||||||
}
|
|
||||||
|
|
||||||
List<BlockPos> toRender = new CopyOnWriteArrayList<>();
|
|
||||||
|
|
||||||
ASyncRunner holeUpdate = new ASyncRunner(() -> {
|
|
||||||
toRender.clear();
|
|
||||||
toRender.addAll(findHoles(Minecraft.getMinecraft().world, 100));
|
|
||||||
});
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void tick(SafeTickEvent e) {
|
|
||||||
holeUpdate.run();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void render(RenderWorldLastEvent event) {
|
|
||||||
Entity e = mc.getRenderViewEntity();
|
|
||||||
assert e != null;
|
|
||||||
Vec3d pos = e.getPositionEyes(event.getPartialTicks()).add(0, -e.getEyeHeight(), 0);
|
|
||||||
for (BlockPos blockPos : toRender) {
|
|
||||||
Tesselator.drawAroundBlock(blockPos, new Color(255,255,255,25), pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static boolean isSurroundedByBedrockOrObsidian(World world, int x, int y, int z) {
|
|
||||||
for (int xOffset = -1; xOffset <= 1; xOffset++) {
|
|
||||||
for (int zOffset = -1; zOffset <= 1; zOffset++) {
|
|
||||||
for (int yOffset = -1; yOffset <= 1; yOffset++) {
|
|
||||||
Block block = world.getBlockState(new BlockPos(x + xOffset, y + yOffset, z + zOffset)).getBlock();
|
|
||||||
if (block != Blocks.BEDROCK && block != Blocks.OBSIDIAN) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<BlockPos> findHoles(World world, int radius) {
|
|
||||||
int maxHeight = world.getHeight();
|
|
||||||
List<BlockPos> blockPos = new ArrayList<>();
|
|
||||||
for (int chunkX = -radius; chunkX <= radius; chunkX += 16) {
|
|
||||||
for (int chunkZ = -radius; chunkZ <= radius; chunkZ += 16) {
|
|
||||||
for (int x = chunkX; x < chunkX + 16; x++) {
|
|
||||||
for (int z = chunkZ; z < chunkZ + 16; z++) {
|
|
||||||
for (int y = 0; y <= maxHeight; y++) {
|
|
||||||
Block block = world.getBlockState(new BlockPos(x, y, z)).getBlock();
|
|
||||||
// Check if the block is air and surrounded by bedrock or obsidian
|
|
||||||
if (block == Blocks.AIR && isSurroundedByBedrockOrObsidian(world, x, y, z)) {
|
|
||||||
blockPos.add(new BlockPos(x, y, z));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return blockPos;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,79 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.module.modules;
|
|
||||||
|
|
||||||
import com.baseband.client.module.Module;
|
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
|
||||||
import net.minecraft.client.renderer.RenderHelper;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraftforge.client.event.RenderLivingEvent;
|
|
||||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
|
|
||||||
public class NameTags extends Module {
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "NameTags";
|
|
||||||
}
|
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void onRenderPlayerNameTag(RenderLivingEvent.Specials.Pre event) {
|
|
||||||
if (event.getEntity() instanceof EntityPlayer) {
|
|
||||||
event.setCanceled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void onRenderWorldLast(RenderWorldLastEvent event) {
|
|
||||||
double renderPosX = mc.player.lastTickPosX + (mc.player.posX - mc.player.lastTickPosX) * event.getPartialTicks();
|
|
||||||
double renderPosY = mc.player.lastTickPosY + (mc.player.posY - mc.player.lastTickPosY) * event.getPartialTicks();
|
|
||||||
double renderPosZ = mc.player.lastTickPosZ + (mc.player.posZ - mc.player.lastTickPosZ) * event.getPartialTicks();
|
|
||||||
|
|
||||||
for (EntityPlayer player : mc.world.playerEntities) {
|
|
||||||
if (player == null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Calculate the interpolated position for the name tag
|
|
||||||
double prevX = player.prevPosX - renderPosX;
|
|
||||||
double prevY = player.prevPosY - renderPosY + player.height + 0.5;
|
|
||||||
double prevZ = player.prevPosZ - renderPosZ;
|
|
||||||
|
|
||||||
double x = player.posX - renderPosX;
|
|
||||||
double y = player.posY - renderPosY + player.height + 0.5;
|
|
||||||
double z = player.posZ - renderPosZ;
|
|
||||||
|
|
||||||
// Update the previous position with the new interpolated position
|
|
||||||
player.prevPosX = x + renderPosX;
|
|
||||||
player.prevPosY = y + renderPosY - player.height - 0.5;
|
|
||||||
player.prevPosZ = z + renderPosZ;
|
|
||||||
|
|
||||||
GlStateManager.pushMatrix();
|
|
||||||
RenderHelper.enableStandardItemLighting();
|
|
||||||
|
|
||||||
GlStateManager.translate(prevX + (x - prevX) * event.getPartialTicks(), prevY + (y - prevY) * event.getPartialTicks(), prevZ + (z - prevZ) * event.getPartialTicks());
|
|
||||||
GlStateManager.rotate(-mc.getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F);
|
|
||||||
GlStateManager.rotate(mc.getRenderManager().playerViewX, 1.0F, 0.0F, 0.0F);
|
|
||||||
GlStateManager.scale(-0.025F, -0.025F, 0.025F);
|
|
||||||
|
|
||||||
// Customize the name tag appearance
|
|
||||||
String customName = player.getDisplayName().getFormattedText() + " [" + (int) player.getHealth() + "]"; // Player's display name
|
|
||||||
int nameTagColor = 0xFFFFFF; // Name tag color (white in this example)
|
|
||||||
|
|
||||||
// Render the background rectangle for the name tag
|
|
||||||
int width = mc.fontRenderer.getStringWidth(customName) / 2;
|
|
||||||
|
|
||||||
// Render the name tag text
|
|
||||||
GlStateManager.disableLighting();
|
|
||||||
mc.fontRenderer.drawString(customName, -width, 0, nameTagColor);
|
|
||||||
GlStateManager.enableLighting();
|
|
||||||
|
|
||||||
RenderHelper.disableStandardItemLighting();
|
|
||||||
GlStateManager.popMatrix();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,25 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.module.modules;
|
|
||||||
|
|
||||||
import com.baseband.client.event.Subscribe;
|
|
||||||
import com.baseband.client.event.events.SafeTickEvent;
|
|
||||||
import com.baseband.client.module.Module;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
|
|
||||||
public class NoSlip extends Module {
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "NoSlip";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void tick(SafeTickEvent e) {
|
|
||||||
Blocks.ICE.slipperiness = Blocks.GLASS.slipperiness;
|
|
||||||
Blocks.PACKED_ICE.slipperiness = Blocks.GLASS.slipperiness;
|
|
||||||
Blocks.FROSTED_ICE.slipperiness = Blocks.GLASS.slipperiness;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,307 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.module.modules;
|
|
||||||
|
|
||||||
import com.baseband.client.Restrict;
|
|
||||||
import com.baseband.client.event.Subscribe;
|
|
||||||
import com.baseband.client.event.events.MoveEvent;
|
|
||||||
import com.baseband.client.event.events.PacketEvent;
|
|
||||||
import com.baseband.client.mixins.ISPacketPlayerPosLook;
|
|
||||||
import com.baseband.client.module.Module;
|
|
||||||
import com.baseband.client.setting.FloatMeta;
|
|
||||||
import com.baseband.client.setting.IntMeta;
|
|
||||||
import com.baseband.client.setting.Setting;
|
|
||||||
import net.minecraft.network.play.client.CPacketConfirmTeleport;
|
|
||||||
import net.minecraft.network.play.client.CPacketPlayer;
|
|
||||||
import net.minecraft.network.play.server.SPacketPlayerPosLook;
|
|
||||||
import net.minecraft.util.math.Vec3d;
|
|
||||||
import de.tudbut.obj.Save;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
@Restrict(Restrict.Edition.PLUS)
|
|
||||||
public class PacketFly extends Module {
|
|
||||||
//Doogie13 made this, ported in with permission
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "PacketFly";
|
|
||||||
}
|
|
||||||
|
|
||||||
// setting for Factor with bounds 0.1 to 5.0 and a precision of 0.1
|
|
||||||
// for 2b2tpvp.net, default value of 1.3 is recommended when using this for flying
|
|
||||||
// when phasing, you may wish to use something closer to 2 or 3
|
|
||||||
@Save
|
|
||||||
@Setting("Factor")
|
|
||||||
@FloatMeta("0.1..5.0@1.3")
|
|
||||||
float factor = 1.3f;
|
|
||||||
|
|
||||||
@Save
|
|
||||||
@Setting("Bound")
|
|
||||||
@IntMeta("-1024..1024@512")
|
|
||||||
int boundValue = 512;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// current teleport ID
|
|
||||||
int tpID = -1;
|
|
||||||
|
|
||||||
// set of packets we allow
|
|
||||||
Set<CPacketPlayer> allowedCPacketPlayers = new HashSet<>();
|
|
||||||
|
|
||||||
|
|
||||||
// map of IDs and positions where we can ignore server rubberbands
|
|
||||||
HashMap<Integer, Vec3d> allowedPositionsAndIDs = new HashMap<>();
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void disable() {
|
|
||||||
// clear these so they don't take up memory
|
|
||||||
allowedCPacketPlayers.clear();
|
|
||||||
allowedPositionsAndIDs.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void enable() {
|
|
||||||
// we will not have been tracking tpID so we must reset it
|
|
||||||
tpID = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// this can be any event which will let us set player motion
|
|
||||||
@Subscribe
|
|
||||||
public void onMotion(MoveEvent event) {
|
|
||||||
|
|
||||||
// first we must get motion
|
|
||||||
double motionX, motionY = 0, motionZ;
|
|
||||||
|
|
||||||
// store whether we are anti-kicking
|
|
||||||
boolean antiKicking = false;
|
|
||||||
|
|
||||||
// Handle motion Y
|
|
||||||
// check if we need to do anti-kick
|
|
||||||
// we do not need to anti-kick when inside blocks
|
|
||||||
if (mc.player.ticksExisted % 10 == 0 && !mc.world.collidesWithAnyBlock(mc.player.getEntityBoundingBox())) {
|
|
||||||
// 0.04 is the distance we must fall before being kicked for flying
|
|
||||||
// net.minecraft.network.NetHandlerPlayServer line 182
|
|
||||||
motionY = -.04;
|
|
||||||
antiKicking = true;
|
|
||||||
} else {
|
|
||||||
|
|
||||||
// we MUST allow the player to prioritise going up as it allows us to manipulate our bounding box with sneaking
|
|
||||||
// NCP will flag SurvivalFly for anything larger than 0.0625 so we use 0.0624 to be on the safe side
|
|
||||||
// I believe this to be because the server doesn't process movement slower than 0.0625 in the same way but I can't find evidence for this
|
|
||||||
if (mc.gameSettings.keyBindJump.isKeyDown())
|
|
||||||
motionY = .0624;
|
|
||||||
else if (mc.gameSettings.keyBindSneak.isKeyDown())
|
|
||||||
motionY = -.0624;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle Motion X, Z
|
|
||||||
// we will handle them as one speed and split them into X and Z based on rotation and keys pressed
|
|
||||||
double motionH;
|
|
||||||
|
|
||||||
// If we are inside blocks, we must use speed slower than 0.0625 so vanilla doesn't set us back
|
|
||||||
// net.minecraft.network.NetHandlerPlayServer line 560
|
|
||||||
|
|
||||||
boolean walls = mc.world.collidesWithAnyBlock(mc.player.getEntityBoundingBox());
|
|
||||||
|
|
||||||
if (walls) {
|
|
||||||
|
|
||||||
motionH = .0624;
|
|
||||||
|
|
||||||
if (motionY != 0) {
|
|
||||||
|
|
||||||
// this means the hypotenuse of our position is always under .625;
|
|
||||||
double multiply = 1 / Math.sqrt(2);
|
|
||||||
|
|
||||||
motionY *= multiply;
|
|
||||||
motionH *= multiply;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
// base air move speed
|
|
||||||
motionH = .2873;
|
|
||||||
|
|
||||||
// we cannot move up if we are moving horizontally since NCP will notice
|
|
||||||
boolean movingHorizontally = mc.player.moveForward != 0 || mc.player.moveStrafing != 0;
|
|
||||||
|
|
||||||
if (movingHorizontally)
|
|
||||||
motionY = Math.min(0, motionY);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// we now split motionH into motionX and motionZ
|
|
||||||
// this should really be in a util
|
|
||||||
// we use dir because tradition
|
|
||||||
double[] dir = new double[]{0,0};
|
|
||||||
|
|
||||||
// if we aren't moving we can just use 0 motion
|
|
||||||
if (!(mc.player.moveForward == 0 && mc.player.moveStrafing == 0)) {
|
|
||||||
|
|
||||||
int strafing = 0;
|
|
||||||
int forward = 0;
|
|
||||||
|
|
||||||
// make moveForward and moveStrafing rounded to the nearest 1
|
|
||||||
if (mc.player.moveStrafing < 0)
|
|
||||||
strafing = -1;
|
|
||||||
else if (mc.player.moveStrafing > 0)
|
|
||||||
strafing = 1;
|
|
||||||
|
|
||||||
if (mc.player.moveForward < 0)
|
|
||||||
forward = -1;
|
|
||||||
else if (mc.player.moveForward > 0)
|
|
||||||
forward = 1;
|
|
||||||
|
|
||||||
float strafe = 90 * strafing;
|
|
||||||
strafe *= (forward != 0F) ? forward * 0.5F : 1;
|
|
||||||
|
|
||||||
float yaw = mc.player.rotationYaw - strafe;
|
|
||||||
yaw -= (mc.player.moveForward < 0F) ? 180 : 0;
|
|
||||||
|
|
||||||
// to radians
|
|
||||||
yaw *= 1 / (180 / Math.PI);
|
|
||||||
|
|
||||||
// get X and Z split
|
|
||||||
double x = (-Math.sin(yaw) * motionH);
|
|
||||||
double z = (Math.cos(yaw) * motionH);
|
|
||||||
|
|
||||||
dir = new double[]{x, z};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
motionX = dir[0];
|
|
||||||
motionZ = dir[1];
|
|
||||||
|
|
||||||
// get the lowest possible factor
|
|
||||||
int factorInt = (int) Math.floor(factor);
|
|
||||||
|
|
||||||
// check if we should send more packets
|
|
||||||
// decimal place is how much we should factorise more
|
|
||||||
if (mc.player.ticksExisted % 10 < 10 * (factor - factorInt))
|
|
||||||
factorInt++;
|
|
||||||
|
|
||||||
// send packets
|
|
||||||
Vec3d motion = send(motionX, motionY, motionZ, antiKicking, factorInt);
|
|
||||||
|
|
||||||
event.x=(motion.x);
|
|
||||||
event.y=(motion.y);
|
|
||||||
event.z=(motion.z);
|
|
||||||
|
|
||||||
// allows us to phase
|
|
||||||
mc.player.noClip = true;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// this can be repeated multiple times to move faster
|
|
||||||
Vec3d send(double motionX, double motionY, double motionZ, boolean antiKick, int factor) {
|
|
||||||
|
|
||||||
int i = 1;
|
|
||||||
while (i < factor + 1) {
|
|
||||||
|
|
||||||
// only anti-kick once per loop as doing it multiple times is a waste of height
|
|
||||||
if (antiKick && factor != 1)
|
|
||||||
motionY = 0;
|
|
||||||
|
|
||||||
// get the absolute position
|
|
||||||
Vec3d pos = mc.player.getPositionVector().add(motionX * i, motionY * i, motionZ * i);
|
|
||||||
|
|
||||||
// create a movement packet
|
|
||||||
// we use onGround true to prevent fall damage on some servers
|
|
||||||
CPacketPlayer.Position packet = new CPacketPlayer.Position(pos.x, pos.y, pos.z, true);
|
|
||||||
|
|
||||||
// create a "bounds" packet
|
|
||||||
// this is just any packet over 100 blocks away from current position or 300 when elytra is open
|
|
||||||
// net.minecraft.network.NetHandlerPlayServer line 529
|
|
||||||
CPacketPlayer.Position bounds = new CPacketPlayer.Position(pos.x, pos.y + boundValue, pos.z, true);
|
|
||||||
|
|
||||||
// allow normal packet and "bounds" packet to be sent (handled later)
|
|
||||||
allowedCPacketPlayers.add(packet);
|
|
||||||
allowedCPacketPlayers.add(bounds);
|
|
||||||
|
|
||||||
// send packets
|
|
||||||
mc.player.connection.sendPacket(packet);
|
|
||||||
mc.player.connection.sendPacket(bounds);
|
|
||||||
|
|
||||||
// we must have a correct teleport ID to save, we use the "bounds" packet to get one anyways if not
|
|
||||||
if (tpID < 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
// iterate tpID as bounds will have caused rubberband
|
|
||||||
tpID++;
|
|
||||||
|
|
||||||
// send a tpID packet confirming the bounds packet
|
|
||||||
mc.player.connection.sendPacket(new CPacketConfirmTeleport(tpID));
|
|
||||||
|
|
||||||
// add move vector and tpID to the map
|
|
||||||
allowedPositionsAndIDs.put(tpID, pos);
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// return a vec of our motion
|
|
||||||
return new Vec3d(motionX * factor, motionY * (antiKick ? 1 : factor), motionZ * factor);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void onPacketSend(PacketEvent.Write event) {
|
|
||||||
|
|
||||||
// we only cancel CPacketPlayers
|
|
||||||
if (event.getPacket() instanceof CPacketPlayer)
|
|
||||||
// check if we are allowing the packet through
|
|
||||||
// cancel if not
|
|
||||||
if (!allowedCPacketPlayers.contains((CPacketPlayer) event.getPacket()))
|
|
||||||
event.setCancelled(true);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void onPacketReceive(PacketEvent.Write event) {
|
|
||||||
|
|
||||||
// check if the packet is a player pos look
|
|
||||||
if (event.getPacket() instanceof SPacketPlayerPosLook) {
|
|
||||||
|
|
||||||
SPacketPlayerPosLook packet = (SPacketPlayerPosLook) event.getPacket();
|
|
||||||
int id = packet.getTeleportId();
|
|
||||||
|
|
||||||
// check if saved history contains the packet ID
|
|
||||||
if (allowedPositionsAndIDs.containsKey(id)) {
|
|
||||||
|
|
||||||
// check if saved packet with that ID has the corresponding position
|
|
||||||
// this would mean the packet lines up and we can ignore the packet
|
|
||||||
if (allowedPositionsAndIDs.get(id).equals(new Vec3d(packet.getX(), packet.getY(), packet.getZ()))) {
|
|
||||||
|
|
||||||
// remove the entry
|
|
||||||
allowedPositionsAndIDs.remove(id);
|
|
||||||
|
|
||||||
// confirm the packet
|
|
||||||
mc.player.connection.sendPacket(new CPacketConfirmTeleport(id));
|
|
||||||
|
|
||||||
// cancel the event
|
|
||||||
event.setCancelled(true);
|
|
||||||
return;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// update our teleport ID
|
|
||||||
tpID = id;
|
|
||||||
|
|
||||||
// prevent jittery rotation
|
|
||||||
((ISPacketPlayerPosLook) packet).setYaw(mc.player.rotationYaw);
|
|
||||||
((ISPacketPlayerPosLook) packet).setPitch(mc.player.rotationPitch);
|
|
||||||
|
|
||||||
// we MUST confirm this packet
|
|
||||||
mc.player.connection.sendPacket(new CPacketConfirmTeleport(id));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.module.modules;
|
|
||||||
|
|
||||||
import com.baseband.client.Restrict;
|
|
||||||
import com.baseband.client.event.Subscribe;
|
|
||||||
import com.baseband.client.event.events.PacketEvent;
|
|
||||||
import com.baseband.client.module.Module;
|
|
||||||
|
|
||||||
@Restrict(Restrict.Edition.BETA)
|
|
||||||
public class PacketTest extends Module {
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "PacketTest";
|
|
||||||
}
|
|
||||||
|
|
||||||
String packet = "";
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void handleEvent(PacketEvent event) {
|
|
||||||
packet = event.getPacket().getClass().getSimpleName();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getHudMeta() {
|
|
||||||
return packet;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,174 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.module.modules;
|
|
||||||
|
|
||||||
import com.baseband.client.MotionUtil;
|
|
||||||
import com.baseband.client.event.Subscribe;
|
|
||||||
import com.baseband.client.event.events.MoveEvent;
|
|
||||||
import com.baseband.client.event.events.PacketEvent;
|
|
||||||
import com.baseband.client.event.events.SafeTickEvent;
|
|
||||||
import com.baseband.client.module.Module;
|
|
||||||
import com.baseband.client.setting.FloatMeta;
|
|
||||||
import com.baseband.client.setting.Setting;
|
|
||||||
import net.minecraft.network.play.server.SPacketEntityVelocity;
|
|
||||||
import net.minecraft.network.play.server.SPacketExplosion;
|
|
||||||
import net.minecraft.network.play.server.SPacketPlayerPosLook;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import de.tudbut.obj.Save;
|
|
||||||
|
|
||||||
public class Speed extends Module {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "Speed";
|
|
||||||
}
|
|
||||||
|
|
||||||
//final ModeSetting bunnyMode = register(new ModeSetting("NCP Mode", "Normal", Arrays.asList("Normal", "Updated")).setDescription("How to accelerate when jumping"));
|
|
||||||
|
|
||||||
@Save
|
|
||||||
@Setting("Boost")
|
|
||||||
boolean boost = false;
|
|
||||||
|
|
||||||
|
|
||||||
@Save
|
|
||||||
@Setting("Factor")
|
|
||||||
@FloatMeta("0.0..1.0@0")
|
|
||||||
Float boostReduction = 1.3f;
|
|
||||||
|
|
||||||
|
|
||||||
boolean slow = false;
|
|
||||||
int jumps = 0;
|
|
||||||
double bunnySpeed = .2873;
|
|
||||||
int groundTick = 0;
|
|
||||||
|
|
||||||
double lastDist = 0;
|
|
||||||
double dmgBoost = 0;
|
|
||||||
boolean isDmgBoostAbsolute = false;
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void enable() {
|
|
||||||
bunnySpeed = lastDist = dmgBoost = jumps = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public final void onUpdate(SafeTickEvent event) {
|
|
||||||
//parent.setTickLength(50f / 1.088f);
|
|
||||||
lastDist = Math.hypot(mc.player.posX - mc.player.prevPosX, mc.player.posZ - mc.player.prevPosZ);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void onPacketReceive(PacketEvent.Read event) {
|
|
||||||
|
|
||||||
if (event.getPacket() instanceof SPacketPlayerPosLook) {
|
|
||||||
bunnySpeed = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mc.player.isInWater() || mc.player.isInLava())
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!boost)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (event.getPacket() instanceof SPacketExplosion) {
|
|
||||||
|
|
||||||
SPacketExplosion packet = (SPacketExplosion) event.getPacket();
|
|
||||||
|
|
||||||
dmgBoost = Math.hypot(packet.getMotionX(), packet.getMotionZ());
|
|
||||||
|
|
||||||
} else if (event.getPacket() instanceof SPacketEntityVelocity) {
|
|
||||||
|
|
||||||
SPacketEntityVelocity packet = (SPacketEntityVelocity) event.getPacket();
|
|
||||||
|
|
||||||
if (packet.getEntityID() == mc.player.getEntityId()) {
|
|
||||||
dmgBoost = Math.hypot(packet.getMotionX() / 8000D, packet.getMotionZ() / 8000D);
|
|
||||||
isDmgBoostAbsolute = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void onMove(MoveEvent event) {
|
|
||||||
|
|
||||||
if (mc.player.isInWater() || mc.player.isInLava())
|
|
||||||
return;
|
|
||||||
|
|
||||||
double xzSpeed;
|
|
||||||
|
|
||||||
double base = MotionUtil.applySpeed(.2873);
|
|
||||||
|
|
||||||
if (mc.player.moveForward == 0 && mc.player.moveStrafing == 0 || mc.player.collidedHorizontally)
|
|
||||||
jumps = 0;
|
|
||||||
|
|
||||||
if (mc.player.onGround && (mc.player.moveForward != 0 || mc.player.moveStrafing != 0)) {
|
|
||||||
|
|
||||||
bunnySpeed = Math.max(
|
|
||||||
// current speed multiplied by a condensed version of mc friction code
|
|
||||||
bunnySpeed = .2 + bunnySpeed * (double) (mc.world.getBlockState(BlockPos.PooledMutableBlockPos.retain(mc.player.posX, mc.player.getEntityBoundingBox().minY - 1.0D, mc.player.posZ).setPos(mc.player.posX, mc.player.getEntityBoundingBox().minY - 1.0D, mc.player.posZ)).getBlock().getSlipperiness(mc.world.getBlockState(BlockPos.PooledMutableBlockPos.retain(mc.player.posX, mc.player.getEntityBoundingBox().minY - 1.0D, mc.player.posZ).setPos(mc.player.posX, mc.player.getEntityBoundingBox().minY - 1.0D, mc.player.posZ)), mc.world, BlockPos.PooledMutableBlockPos.retain(mc.player.posX, mc.player.getEntityBoundingBox().minY - 1.0D, mc.player.posZ), mc.player) * 0.91F),
|
|
||||||
getBunnySpeed(MotionUtil.applySpeed(.2873))
|
|
||||||
);
|
|
||||||
|
|
||||||
// jump
|
|
||||||
event.y=(mc.player.motionY = MotionUtil.applyJumpBoost(.42F));
|
|
||||||
|
|
||||||
groundTick = 0;
|
|
||||||
slow = true;
|
|
||||||
|
|
||||||
if (++jumps == 1)
|
|
||||||
bunnySpeed *= .95;
|
|
||||||
|
|
||||||
} else if (slow || mc.player.collidedHorizontally) {
|
|
||||||
|
|
||||||
// https://github.com/NoCheatPlus/NoCheatPlus/blob/f7b2c017fd66838ed2542fba483d7268ff01c2cf/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/player/SurvivalFly.java#L1692
|
|
||||||
bunnySpeed -= 0.66 * base;
|
|
||||||
slow = false;
|
|
||||||
|
|
||||||
} else
|
|
||||||
// https://github.com/NoCheatPlus/NoCheatPlus/blob/f7b2c017fd66838ed2542fba483d7268ff01c2cf/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/player/SurvivalFly.java#L1698
|
|
||||||
// we use a little less so that we don't flag
|
|
||||||
bunnySpeed = lastDist - lastDist / 159;
|
|
||||||
|
|
||||||
double oldSpeed = bunnySpeed;
|
|
||||||
if (dmgBoost >= 0) {
|
|
||||||
if (isDmgBoostAbsolute) {
|
|
||||||
bunnySpeed = dmgBoost - ((dmgBoost - bunnySpeed) * (1 - boostReduction));
|
|
||||||
} else {
|
|
||||||
bunnySpeed += dmgBoost * (1 - boostReduction);
|
|
||||||
}
|
|
||||||
dmgBoost = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bunnySpeed = Math.max(oldSpeed, bunnySpeed);
|
|
||||||
|
|
||||||
xzSpeed = bunnySpeed = Math.max(base, bunnySpeed);
|
|
||||||
|
|
||||||
// should never happen
|
|
||||||
|
|
||||||
//event.setMotion(true);
|
|
||||||
|
|
||||||
if (xzSpeed == Double.MIN_VALUE)
|
|
||||||
return;
|
|
||||||
|
|
||||||
double[] dir = MotionUtil.getMotion(xzSpeed);
|
|
||||||
event.x=(dir[0]);
|
|
||||||
event.z=(dir[1]);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
double getBunnySpeed(double base) {
|
|
||||||
|
|
||||||
// prevent too aggressive acceleration causing flags
|
|
||||||
base = Math.min(1, base);
|
|
||||||
|
|
||||||
//if (bunnyMode.getValue().equals("Normal"))
|
|
||||||
return base * 1.935;
|
|
||||||
//else
|
|
||||||
// return base * 1.87;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,43 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.module.modules;
|
|
||||||
|
|
||||||
import com.baseband.client.Utils;
|
|
||||||
import com.baseband.client.event.Subscribe;
|
|
||||||
import com.baseband.client.event.events.SafeTickEvent;
|
|
||||||
import com.baseband.client.module.Module;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.util.math.Vec3d;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class TPTracker extends Module {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "TPTracker";
|
|
||||||
}
|
|
||||||
|
|
||||||
private Map<Entity, Vec3d> knownPlayers = new HashMap<>();
|
|
||||||
|
|
||||||
@Subscribe
|
|
||||||
public void safeTick(SafeTickEvent event) {
|
|
||||||
for (Entity e : mc.world.getLoadedEntityList()) {
|
|
||||||
if (e.getName().equals(mc.player.getName()) || !(e instanceof EntityPlayer)) continue;
|
|
||||||
Vec3d targetPos = new Vec3d(e.posX, e.posY, e.posZ);
|
|
||||||
if (knownPlayers.containsKey(e)) {
|
|
||||||
if (Math.abs(mc.player.getPositionVector().distanceTo(targetPos)) >= 128.0 && knownPlayers.get(e).distanceTo(targetPos) >= 64.0) {
|
|
||||||
Utils.sendChatMessage("PLAYER " + e.getName() + " TELEPORTED TO "+ targetPos);
|
|
||||||
}
|
|
||||||
knownPlayers.put(e, targetPos);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
knownPlayers.put(e, targetPos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.setting;
|
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
@Target(ElementType.FIELD)
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
public @interface FloatMeta {
|
|
||||||
String value(); // 0.0..1.0@0.2
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.setting;
|
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
@Target(ElementType.FIELD)
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
public @interface IntMeta {
|
|
||||||
String value(); // 0..10@5
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 Jess H & Daniella H. All Rights Reserved.
|
|
||||||
* Unauthorized copying of this file via any medium is Strictly Prohibited.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.baseband.client.setting;
|
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
@Target(ElementType.FIELD)
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
public @interface Setting {
|
|
||||||
String value();
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue