customize & start adding modules

This commit is contained in:
core 2023-07-15 14:19:14 -04:00
parent 86be867fdd
commit 71f1278446
Signed by: core
GPG Key ID: FDBF740DADDCEECF
20 changed files with 194 additions and 78 deletions

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@ -3,6 +3,7 @@ package dev.coredoes.coreclient;
import dev.coredoes.coreclient.gui.Category;
import dev.coredoes.coreclient.gui.ClickGUI;
import dev.coredoes.coreclient.gui.module.*;
import dev.coredoes.coreclient.module.bypass.BotMovement;
import meteordevelopment.orbit.EventBus;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
@ -43,6 +44,8 @@ public class CoreClient implements ClientModInitializer {
Category.HUD.modules.add(new WatermarkModule());
Category.HUD.modules.add(new LogoModule());
Category.BYPASS.modules.add(new BotMovement());
LOGGER.info("[Stage 4/4: GuiEventInit] Registering GUI events");
ClientTickEvents.END_CLIENT_TICK.register(client -> {

View File

@ -0,0 +1,17 @@
package dev.coredoes.coreclient.event;
import meteordevelopment.orbit.ICancellable;
public class Cancellable implements ICancellable {
private boolean cancelled = false;
@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
@Override
public boolean isCancelled() {
return cancelled;
}
}

View File

@ -0,0 +1,9 @@
package dev.coredoes.coreclient.event;
public class ConnectEvent {
private static final ConnectEvent INSTANCE = new ConnectEvent();
public static ConnectEvent get() {
return INSTANCE;
}
}

View File

@ -0,0 +1,9 @@
package dev.coredoes.coreclient.event;
public class DisconnectEvent {
private static final DisconnectEvent INSTANCE = new DisconnectEvent();
public static DisconnectEvent get() {
return INSTANCE;
}
}

View File

@ -0,0 +1,37 @@
package dev.coredoes.coreclient.event;
import net.minecraft.network.packet.Packet;
public class PacketEvent extends Cancellable {
public Packet<?> packet;
public static class Receive extends PacketEvent {
private static final Receive INSTANCE = new Receive();
public static Receive get(Packet<?> packet) {
INSTANCE.setCancelled(false);
INSTANCE.packet = packet;
return INSTANCE;
}
}
public static class Send extends PacketEvent {
private static final Send INSTANCE = new Send();
public static Send get(Packet<?> packet) {
INSTANCE.setCancelled(false);
INSTANCE.packet = packet;
return INSTANCE;
}
}
public static class Sent extends PacketEvent {
private static final Sent INSTANCE = new Sent();
public static Sent get(Packet<?> packet) {
INSTANCE.setCancelled(false);
INSTANCE.packet = packet;
return INSTANCE;
}
}
}

View File

@ -8,34 +8,20 @@ import java.util.Random;
import java.util.stream.Stream;
import dev.coredoes.coreclient.gui.module.Module;
import dev.coredoes.coreclient.gui.setting.BooleanSetting;
import dev.coredoes.coreclient.gui.setting.ColorSetting;
import dev.coredoes.coreclient.gui.setting.DoubleSetting;
import dev.coredoes.coreclient.gui.setting.IntegerSetting;
import dev.coredoes.coreclient.gui.setting.Setting;
import dev.coredoes.coreclient.gui.setting.StringSetting;
import com.lukflug.panelstudio.setting.ICategory;
import com.lukflug.panelstudio.setting.IClient;
import com.lukflug.panelstudio.setting.IModule;
public enum Category implements ICategory {
COMBAT("Combat"),EXPLOITS("Exploits"),HUD("HUD"),MISCELLANEOUS("Miscellaneous"),MOVEMENT("Movement"),OTHER("Other"),RENDER("Render"),WORLD("World");
COMBAT("Combat"),EXPLOITS("Exploits"),HUD("HUD"),MISCELLANEOUS("Miscellaneous"),MOVEMENT("Movement"),OTHER("Other"),RENDER("Render"),WORLD("World"),BYPASS("Bypass");
public final String displayName;
public final List<Module> modules=new ArrayList<Module>();
public static Random random=new Random();
private Category (String displayName) {
this.displayName=displayName;
}
public static void init() {
for (Category category: Category.values()) {
int count=random.nextInt(6)+5;
for (int i=0;i<count;i++) {
if (category!=OTHER && category!=HUD) category.modules.add(generateRandomModule());
}
}
}
public static void init() {}
@Override
public String getDisplayName() {
@ -56,53 +42,5 @@ public enum Category implements ICategory {
};
}
public static Module generateRandomModule() {
Module module=new Module(generateRandomName(5,10),generateRandomName(10,20),()->true,random.nextInt(2)==0);
int count=random.nextInt(6)+5;
for (int i=0;i<count;i++) {
module.settings.add(generateRandomSetting());
}
return module;
}
public static Setting<?> generateRandomSetting() {
String displayName=generateRandomName(5,10);
String description=generateRandomName(10,20);
int type=random.nextInt(6);
int min=random.nextInt(50),max=random.nextInt(50)+50;
boolean alpha=random.nextInt(2)==0;
boolean rainbow=random.nextInt(2)==0;
Color color=new Color(random.nextInt(256),random.nextInt(256),random.nextInt(256),alpha?random.nextInt(256):255);
switch (type) {
case 0:
return new BooleanSetting(displayName,displayName,description,()->true,random.nextInt(2)==0);
case 1:
return new ColorSetting(displayName,displayName,description,()->true,alpha,rainbow,color,rainbow?random.nextInt(2)==0:false);
case 2:
return new DoubleSetting(displayName,displayName,description,()->true,min,max,random.nextDouble()*(max-min)+min);
case 4:
return new IntegerSetting(displayName,displayName,description,()->true,min,max,random.nextInt(max-min+1)+min);
default:
return new StringSetting(displayName,displayName,description,()->true,generateRandomName(5,10));
}
};
public static String generateRandomName (int min, int max) {
int length=random.nextInt(max-min+1)+min;
String s="";
for (int i=0;i<length;i++) {
int type=random.nextInt(5);
switch (type) {
case 0:
s+=' ';
break;
case 1:
s+=(char)('A'+random.nextInt(26));
break;
default:
s+=(char)('a'+random.nextInt(26));
}
}
return s;
}
}

View File

@ -94,7 +94,7 @@ public class ClickGUI extends MinecraftHUDGUI {
inter=new GUIInterface(true) {
@Override
protected String getResourcePrefix() {
return "examplemod:";
return "coreclient:";
}
};
// Instantiating theme ...

View File

@ -13,7 +13,7 @@ public class ClickGUIModule extends Module {
public static final IntegerSetting animationSpeed=new IntegerSetting("Animation Speed","animationSpeed","The speed of GUI animations.",()->true,0,1000,200);
public static final EnumSetting<Theme> theme=new EnumSetting<Theme>("Theme","theme","What theme to use.",()->true,Theme.GameSense,Theme.class);
public static final EnumSetting<Layout> layout=new EnumSetting<Layout>("Layout","layout","What layout to use.",()->true,Layout.ClassicPanel,Layout.class);
public static final KeybindSetting keybind=new KeybindSetting("Keybind","keybind","The key to toggle the module.",()->true,GLFW.GLFW_KEY_O);
public static final KeybindSetting keybind=new KeybindSetting("Keybind","keybind","The key to toggle the module.",()->true,GLFW.GLFW_KEY_TAB);
public ClickGUIModule() {
super("ClickGUI","Module containing ClickGUI settings.",()->true,false);

View File

@ -7,7 +7,7 @@ import dev.coredoes.coreclient.gui.setting.KeybindSetting;
public class HUDEditorModule extends Module {
public static final BooleanSetting showHUD=new BooleanSetting("Show HUD Panels","showHUD","Whether to show the HUD panels in the ClickGUI.",()->true,true);
public static final KeybindSetting keybind=new KeybindSetting("Keybind","keybind","The key to toggle the module.",()->true,GLFW.GLFW_KEY_P);
public static final KeybindSetting keybind=new KeybindSetting("Keybind","keybind","The key to toggle the module.",()->true,GLFW.GLFW_KEY_LEFT_BRACKET);
public HUDEditorModule() {
super("HUDEditor","Module containing HUDEditor settings.",()->true,false);

View File

@ -3,6 +3,7 @@ import java.awt.Color;
import java.awt.Dimension;
import java.awt.Point;
import dev.coredoes.coreclient.CoreClient;
import dev.coredoes.coreclient.gui.setting.BooleanSetting;
import dev.coredoes.coreclient.gui.setting.ColorSetting;
import dev.coredoes.coreclient.gui.setting.IntegerSetting;
@ -11,15 +12,16 @@ import com.lukflug.panelstudio.base.IInterface;
import com.lukflug.panelstudio.base.IToggleable;
import com.lukflug.panelstudio.component.IFixedComponent;
import com.lukflug.panelstudio.hud.HUDComponent;
import net.minecraft.client.MinecraftClient;
public class LogoModule extends Module {
private static LogoModule instance;
private static final IntegerSetting rotation=new IntegerSetting("Image Rotation","rotation","How to rotate the image.",()->true,0,3,0);
private static final BooleanSetting parity=new BooleanSetting("Flip Image","parity","Whether to flip the image or not.",()->true,false);
private static final ColorSetting color=new ColorSetting("Logo Color","color","The color to modulate the logo with.",()->true,true,true,new Color(255,255,255,128),true);
private static final ColorSetting color=new ColorSetting("Logo Color","color","The color to modulate the logo with.",()->true,true,true,new Color(255,255,255,128),false);
public LogoModule() {
super("Logo","Module that displays the PanelStudio icon on HUD.",()->true,true);
super("Logo","Module that displays the PanelStudio icon on HUD.",()->true,false, true);
instance=this;
settings.add(rotation);
settings.add(parity);
@ -27,17 +29,19 @@ public class LogoModule extends Module {
}
public static IFixedComponent getComponent (IInterface inter) {
int image=inter.loadImage("panelstudio.png");
return new HUDComponent(()->"Logo",new Point(300,300),"logo") {
int image=inter.loadImage("logo.png");
return new HUDComponent(()->"Logo",new Point(MinecraftClient.getInstance().getWindow().getWidth() - 32,MinecraftClient.getInstance().getWindow().getHeight() - 32),"logo") {
@Override
public void render (Context context) {
position = new Point(MinecraftClient.getInstance().getWindow().getWidth() / 2 - 32, MinecraftClient.getInstance().getWindow().getHeight() / 2 - 29);
super.render(context);
CoreClient.LOGGER.info("render pos " + position.toString() + " from " + MinecraftClient.getInstance().getWindow().getWidth());
context.getInterface().drawImage(context.getRect(),rotation.getValue(),parity.getValue(),image,color.getValue());
}
@Override
public Dimension getSize (IInterface inter) {
return new Dimension(141,61);
return new Dimension(32,32);
}
};
}

View File

@ -24,6 +24,14 @@ public class Module implements IModule {
this.toggleable=toggleable;
}
public Module (String displayName, String description, IBoolean visible, boolean toggleable, boolean enabled) {
this.displayName=displayName;
this.description=description;
this.visible=visible;
this.toggleable=toggleable;
this.enabled=enabled;
}
@Override
public String getDisplayName() {
return displayName;
@ -41,7 +49,6 @@ public class Module implements IModule {
@Override
public IToggleable isEnabled() {
if (!toggleable) return null;
return new IToggleable() {
@Override
public boolean isOn() {
@ -50,8 +57,10 @@ public class Module implements IModule {
@Override
public void toggle() {
if (toggleable) {
enabled=!enabled;
}
}
};
}

View File

@ -2,6 +2,7 @@ package dev.coredoes.coreclient.gui.setting;
import com.lukflug.panelstudio.base.IBoolean;
import com.lukflug.panelstudio.setting.IKeybindSetting;
import dev.coredoes.coreclient.CoreClient;
import net.minecraft.client.util.InputUtil;
import net.minecraft.text.TranslatableTextContent;
@ -24,7 +25,6 @@ public class KeybindSetting extends Setting<Integer> implements IKeybindSetting
public String getKeyName() {
String translationKey=InputUtil.Type.KEYSYM.createFromCode(getKey()).getTranslationKey();
String translation=new TranslatableTextContent(translationKey,null,TranslatableTextContent.EMPTY_ARGUMENTS).toString();
if (!translation.equals(translationKey)) return translation;
return InputUtil.Type.KEYSYM.createFromCode(getKey()).getLocalizedText().getString();
}
}

View File

@ -0,0 +1,22 @@
package dev.coredoes.coreclient.mixin;
import dev.coredoes.coreclient.module.bypass.BotMovement;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArgs;
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
@Mixin(PlayerMoveC2SPacket.Full.class)
public abstract class PlayerMoveC2SPacketFullMixin {
@ModifyArgs(method = "<init>", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/packet/c2s/play/PlayerMoveC2SPacket;<init>(DDDFFZZZ)V"))
private static void init(Args args) {
if (BotMovement.getInstance().isEnabled().isOn()) {
double newX = Math.round((double) args.get(0) * 100) / 100d;
double newZ = Math.round((double) args.get(2) * 100) / 100d;
args.set(0, Math.nextAfter(newX, newX + Math.signum(newX))); // Round x
args.set(2, Math.nextAfter(newZ, newZ + Math.signum(newZ))); // Round z
}
}
}

View File

@ -0,0 +1,18 @@
package dev.coredoes.coreclient.mixin;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArgs;
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
@Mixin(PlayerMoveC2SPacket.LookAndOnGround.class)
public abstract class PlayerMoveC2SPacketLookMixin {
@ModifyArgs(method = "<init>", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/packet/c2s/play/PlayerMoveC2SPacket;<init>(DDDFFZZZ)V"))
private static void init(Args args) {
/*if (((NoFall) ClientMod.moduleManager.getModuleById("NoFall")).isEnabled()) {
args.set(5, true);
}*/
}
}

View File

@ -0,0 +1,28 @@
package dev.coredoes.coreclient.mixin;
import dev.coredoes.coreclient.module.bypass.BotMovement;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArgs;
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
@Mixin(PlayerMoveC2SPacket.PositionAndOnGround.class)
public abstract class PlayerMoveC2SPacketOnGroundMixin {
@ModifyArgs(method = "<init>", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/packet/c2s/play/PlayerMoveC2SPacket;<init>(DDDFFZZZ)V"))
private static void init(Args args) {
if (BotMovement.getInstance().isEnabled().isOn()) {
double newX = Math.round((double) args.get(0) * 100) / 100d;
double newZ = Math.round((double) args.get(2) * 100) / 100d;
args.set(0, Math.nextAfter(newX, newX + Math.signum(newX))); // Round x
args.set(2, Math.nextAfter(newZ, newZ + Math.signum(newZ))); // Round z
}
/*
if (((NoFall) ClientMod.moduleManager.getModuleById("NoFall")).isEnabled()) {
args.set(5, true);
}
*/
}
}

View File

@ -0,0 +1,22 @@
package dev.coredoes.coreclient.module.bypass;
import com.lukflug.panelstudio.base.IBoolean;
import dev.coredoes.coreclient.CoreClient;
import dev.coredoes.coreclient.gui.module.Module;
import meteordevelopment.orbit.EventHandler;
public class BotMovement extends Module {
private static BotMovement instance;
public BotMovement() {
super("BotMovement", "Bypass the bot detection on LO 1.19 server", () -> true, true, true);
CoreClient.eventBus.subscribe(this);
instance = this;
}
public static BotMovement getInstance() {
return instance;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

File diff suppressed because one or more lines are too long

View File

@ -3,9 +3,10 @@
"minVersion": "0.8",
"package": "dev.coredoes.coreclient.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [
],
"client": [
"PlayerMoveC2SPacketFullMixin",
"PlayerMoveC2SPacketLookMixin",
"PlayerMoveC2SPacketOnGroundMixin"
],
"injectors": {
"defaultRequire": 1