make cool stuffs

This commit is contained in:
core 2023-07-19 10:14:03 -04:00
parent 92238ea3bb
commit 753c96e97d
Signed by: core
GPG Key ID: FDBF740DADDCEECF
23 changed files with 792 additions and 9 deletions

View File

@ -0,0 +1,9 @@
package dev.coredoes.coreclient;
import net.minecraft.network.PacketCallbacks;
import net.minecraft.network.packet.Packet;
import org.jetbrains.annotations.Nullable;
public interface ConnectionInterface {
void sendVolatile(Packet<?> packet, @Nullable PacketCallbacks callbacks);
}

View File

@ -1,20 +1,31 @@
package dev.coredoes.coreclient; package dev.coredoes.coreclient;
import dev.coredoes.coreclient.commands.CommandManager;
import dev.coredoes.coreclient.event.TickEvent;
import dev.coredoes.coreclient.gui.Category; import dev.coredoes.coreclient.gui.Category;
import dev.coredoes.coreclient.gui.ClickGUI; import dev.coredoes.coreclient.gui.ClickGUI;
import dev.coredoes.coreclient.gui.module.*; import dev.coredoes.coreclient.gui.module.*;
import dev.coredoes.coreclient.module.bypass.BotMovement; import dev.coredoes.coreclient.module.bypass.*;
import dev.coredoes.coreclient.module.bypass.PacketLogger; import dev.coredoes.coreclient.module.bypass.ButtonClicker;
import dev.coredoes.coreclient.module.movement.CreativeFlight;
import dev.coredoes.coreclient.module.movement.Jetpack;
import dev.coredoes.coreclient.module.misc.PacketLogger;
import dev.coredoes.coreclient.module.movement.NoFall;
import meteordevelopment.orbit.EventBus; import meteordevelopment.orbit.EventBus;
import net.fabricmc.api.ClientModInitializer; import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.networking.v1.ClientLoginNetworking;
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback; import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
import net.fabricmc.fabric.api.networking.v1.PacketByteBufs;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.network.PacketByteBuf;
import org.lwjgl.glfw.GLFW; import org.lwjgl.glfw.GLFW;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodHandles;
import java.util.concurrent.CompletableFuture;
public class CoreClient implements ClientModInitializer { public class CoreClient implements ClientModInitializer {
public static final Logger LOGGER = LoggerFactory.getLogger("coreclient"); public static final Logger LOGGER = LoggerFactory.getLogger("coreclient");
@ -46,6 +57,14 @@ public class CoreClient implements ClientModInitializer {
Category.HUD.modules.add(new LogoModule()); Category.HUD.modules.add(new LogoModule());
Category.BYPASS.modules.add(new BotMovement()); Category.BYPASS.modules.add(new BotMovement());
Category.BYPASS.modules.add(new WorldguardMovebypass());
Category.BYPASS.modules.add(new NewLOButton());
Category.MOVEMENT.modules.add(new CreativeFlight());
Category.MOVEMENT.modules.add(new Jetpack());
Category.MOVEMENT.modules.add(new NoFall());
Category.EXPLOITS.modules.add(new ButtonClicker());
Category.MISCELLANEOUS.modules.add(new PacketLogger()); Category.MISCELLANEOUS.modules.add(new PacketLogger());
@ -65,11 +84,49 @@ public class CoreClient implements ClientModInitializer {
if (i==ClickGUIModule.keybind.getKey()) gui.enterGUI(); if (i==ClickGUIModule.keybind.getKey()) gui.enterGUI();
if (i==HUDEditorModule.keybind.getKey()) gui.enterHUDEditor(); if (i==HUDEditorModule.keybind.getKey()) gui.enterHUDEditor();
gui.handleKeyEvent(i); gui.handleKeyEvent(i);
if (i == CreativeFlight.keybind.getKey()) {
CreativeFlight.getInstance().isEnabled().toggle();
}
if (i == Jetpack.keybind.getKey()) {
Jetpack.getInstance().isEnabled().toggle();
}
if (i == NoFall.keybind.getKey()) {
NoFall.getInstance().isEnabled().toggle();
}
} }
} }
} }
}); });
LOGGER.info("[Stage 5/5: JoinChallengeInit] Registering join challenge");
ClientLoginNetworking.registerGlobalReceiver(JoinChallengeConstants.JOIN_PACKET_ID, (client, handler, buf, responseSender) -> {
String string = buf.readString();
int a = buf.readInt();
int b = buf.readInt();
LOGGER.info("{} {} {}", string, a, b);
int resp = a + b;
PacketByteBuf buf2 = PacketByteBufs.create();
buf2.writeInt(resp);
return CompletableFuture.completedFuture(buf2);
});
LOGGER.info("[Stage 6/6: LifecycleInit] Registering lifecycle tick events");
ClientTickEvents.START_CLIENT_TICK.register(client -> {
CoreClient.eventBus.post(TickEvent.Pre.get());
});
ClientTickEvents.END_CLIENT_TICK.register(client -> {
CoreClient.eventBus.post(TickEvent.Post.get());
});
LOGGER.info("[Stage 7/7: CommandInit] Registering Brigadier commands");
ClientCommandRegistrationCallback.EVENT.register(CommandManager::registerCommands);
LOGGER.info("CoreClient loaded!"); LOGGER.info("CoreClient loaded!");
} }
} }

View File

@ -0,0 +1,7 @@
package dev.coredoes.coreclient;
import net.minecraft.util.Identifier;
public class JoinChallengeConstants {
public static final Identifier JOIN_PACKET_ID = new Identifier("liveoverflowmod", "join");
}

View File

@ -0,0 +1,12 @@
package dev.coredoes.coreclient.commands;
import com.mojang.brigadier.CommandDispatcher;
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.command.CommandRegistryAccess;
public class CommandManager {
public static void registerCommands(CommandDispatcher<FabricClientCommandSource> dispatcher, CommandRegistryAccess registryAccess) {
VClipCommand.register(dispatcher);
ShowHandCommand.register(dispatcher);
}
}

View File

@ -0,0 +1,48 @@
package dev.coredoes.coreclient.commands;
import com.mojang.brigadier.Command;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.context.CommandContext;
import dev.coredoes.coreclient.CoreClient;
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraft.text.Text;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;
import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.*;
public class ShowHandCommand {
public static void register(CommandDispatcher<FabricClientCommandSource> dispatcher) {
dispatcher.register(
literal("showhand").executes(ShowHandCommand::execute)
);
}
private static int execute(CommandContext<FabricClientCommandSource> ctx) {
HitResult target = MinecraftClient.getInstance().crosshairTarget;
if (target == null) {
ctx.getSource().sendError(Text.of("You aren't looking at anything."));
return -1;
}
if (!(target instanceof EntityHitResult)) {
ctx.getSource().sendError(Text.of("You aren't looking at an entity."));
return -1;
}
Entity entity = ((EntityHitResult) target).getEntity();
for (ItemStack item : entity.getHandItems() ) {
ctx.getSource().sendFeedback(Text.of("Item: " + item));
if (item.getNbt() != null) {
ctx.getSource().sendFeedback(Text.of("NBT: " + item.getNbt().toString()));
}
}
return Command.SINGLE_SUCCESS;
}
}

View File

@ -0,0 +1,72 @@
package dev.coredoes.coreclient.commands;
import com.mojang.brigadier.Command;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.context.CommandContext;
import dev.coredoes.coreclient.ConnectionInterface;
import dev.coredoes.coreclient.CoreClient;
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.client.MinecraftClient;
import net.minecraft.network.ClientConnection;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import java.util.Objects;
import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.*;
public class VClipCommand {
public static void register(CommandDispatcher<FabricClientCommandSource> dispatcher) {
dispatcher.register(
literal("vclip")
.then(
argument("blocks", IntegerArgumentType.integer())
.executes(
ctx -> {
int blocks = IntegerArgumentType.getInteger(ctx, "blocks");
return VClipCommand.execute(
ctx,
blocks
);
}
)
)
);
}
private static int execute(CommandContext<FabricClientCommandSource> ctx, int blocks) {
CoreClient.LOGGER.info("vclipping {}", blocks);
assert MinecraftClient.getInstance().player != null;
int needed = Math.abs(blocks / 10 + 5);
CoreClient.LOGGER.info("need {}", needed);
ClientConnection conn = MinecraftClient.getInstance().getNetworkHandler().getConnection();
ConnectionInterface c = (ConnectionInterface) conn;
for (int i = 0; i < needed; i++) {
c.sendVolatile(new PlayerMoveC2SPacket.PositionAndOnGround(
MinecraftClient.getInstance().player.getX(),
MinecraftClient.getInstance().player.getY(),
MinecraftClient.getInstance().player.getZ(),
MinecraftClient.getInstance().player.isOnGround()
), null);
}
double x = MinecraftClient.getInstance().player.getX();
double y = MinecraftClient.getInstance().player.getY() + blocks;
double z = MinecraftClient.getInstance().player.getZ();
c.sendVolatile(new PlayerMoveC2SPacket.PositionAndOnGround(
x,
y,
z,
MinecraftClient.getInstance().player.isOnGround()
), null);
MinecraftClient.getInstance().player.setPos(x, y, z);
return Command.SINGLE_SUCCESS;
}
}

View File

@ -0,0 +1,19 @@
package dev.coredoes.coreclient.event;
public class TickEvent extends Cancellable {
public static class Pre extends TickEvent {
private static final Pre INSTANCE = new Pre();
public static Pre get() {
return INSTANCE;
}
}
public static class Post extends TickEvent {
private static final Post INSTANCE = new Post();
public static Post get() {
return INSTANCE;
}
}
}

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 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<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 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_TAB); public static final KeybindSetting keybind=new KeybindSetting("Keybind","keybind","The key to toggle the module.",()->true,GLFW.GLFW_KEY_GRAVE_ACCENT);
public ClickGUIModule() { public ClickGUIModule() {
super("ClickGUI","Module containing ClickGUI settings.",()->true,false); super("ClickGUI","Module containing ClickGUI settings.",()->true,false);

View File

@ -0,0 +1,19 @@
package dev.coredoes.coreclient.mixin;
import net.minecraft.client.ClientBrandRetriever;
import net.minecraft.obfuscate.DontObfuscate;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(ClientBrandRetriever.class)
public class ClientBrandRetrieverMixin {
/**
* @author c0repwn3r
* @reason because liveoverflow
*/
@DontObfuscate
@Overwrite(remap = false)
public static String getClientModName() {
return "LiveOverflowMod";
}
}

View File

@ -1,26 +1,40 @@
package dev.coredoes.coreclient.mixin; package dev.coredoes.coreclient.mixin;
import dev.coredoes.coreclient.ConnectionInterface;
import dev.coredoes.coreclient.CoreClient; import dev.coredoes.coreclient.CoreClient;
import dev.coredoes.coreclient.event.ConnectEvent; import dev.coredoes.coreclient.event.ConnectEvent;
import dev.coredoes.coreclient.event.DisconnectEvent; import dev.coredoes.coreclient.event.DisconnectEvent;
import dev.coredoes.coreclient.event.PacketEvent; import dev.coredoes.coreclient.event.PacketEvent;
import net.minecraft.network.ClientConnection; import net.minecraft.network.ClientConnection;
import net.minecraft.network.PacketCallbacks;
import net.minecraft.network.listener.PacketListener; import net.minecraft.network.listener.PacketListener;
import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.c2s.play.CustomPayloadC2SPacket;
import net.minecraft.network.packet.s2c.play.HealthUpdateS2CPacket;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.util.Objects;
@Mixin(ClientConnection.class) @Mixin(ClientConnection.class)
public class ClientConnectionMixin { public abstract class ClientConnectionMixin implements ConnectionInterface {
@Inject(method = "handlePacket", at = @At("HEAD"), cancellable = true) @Inject(method = "handlePacket", at = @At("HEAD"), cancellable = true)
private static <T extends PacketListener> void onHandlePacket(Packet<T> packet, PacketListener listener, CallbackInfo info) { private static <T extends PacketListener> void onHandlePacket(Packet<T> packet, PacketListener listener, CallbackInfo info) {
if (CoreClient.eventBus.post(PacketEvent.Receive.get(packet)).isCancelled()) info.cancel(); if (CoreClient.eventBus.post(PacketEvent.Receive.get(packet)).isCancelled()) info.cancel();
if (packet instanceof HealthUpdateS2CPacket pkt) {
if (pkt.getHealth() == 0 && pkt.getFood() == 0 && pkt.getSaturation() == 0) {
info.cancel();
}
}
} }
@Inject(method = "send(Lnet/minecraft/network/packet/Packet;)V", at = @At("HEAD"), cancellable = true) @Inject(method = "send(Lnet/minecraft/network/packet/Packet;)V", at = @At("HEAD"), cancellable = true)
@ -46,4 +60,20 @@ public class ClientConnectionMixin {
private static void onConnect(InetSocketAddress address, boolean useEpoll, CallbackInfoReturnable<ClientConnection> info) { private static void onConnect(InetSocketAddress address, boolean useEpoll, CallbackInfoReturnable<ClientConnection> info) {
CoreClient.eventBus.post(ConnectEvent.get()); CoreClient.eventBus.post(ConnectEvent.get());
} }
@Inject(method = "sendImmediately", at = @At("HEAD"), cancellable = true)
private void sendImmediately(Packet<?> packet, @Nullable PacketCallbacks callbacks, CallbackInfo ci) {
if (packet instanceof CustomPayloadC2SPacket pkt) {
if (Objects.equals(pkt.getChannel(), new Identifier("minecraft", "register"))) {
ci.cancel();
return;
}
}
}
@Shadow protected abstract void sendImmediately(Packet<?> packet, @Nullable PacketCallbacks callbacks);
public void sendVolatile(Packet<?> packet, @Nullable PacketCallbacks callbacks) {
this.sendImmediately(packet, callbacks);
}
} }

View File

@ -0,0 +1,11 @@
package dev.coredoes.coreclient.mixin;
import net.minecraft.client.network.ClientPlayerEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(ClientPlayerEntity.class)
public interface ClientPlayerEntityAccessor {
@Accessor("ticksSinceLastPositionPacketSent")
void setTicksSinceLastPositionPacketSent(int ticks);
}

View File

@ -0,0 +1,17 @@
package dev.coredoes.coreclient.mixin;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(PlayerMoveC2SPacket.class)
public interface PlayerMoveC2SPacketAccessor {
@Mutable
@Accessor("y")
void setY(double y);
@Mutable
@Accessor("onGround")
void setOnGround(boolean onGround);
}

View File

@ -1,6 +1,9 @@
package dev.coredoes.coreclient.mixin; package dev.coredoes.coreclient.mixin;
import dev.coredoes.coreclient.CoreClient;
import dev.coredoes.coreclient.module.bypass.BotMovement; import dev.coredoes.coreclient.module.bypass.BotMovement;
import dev.coredoes.coreclient.module.bypass.WorldguardMovebypass;
import net.minecraft.client.MinecraftClient;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
@ -11,6 +14,27 @@ import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
public abstract class PlayerMoveC2SPacketFullMixin { public abstract class PlayerMoveC2SPacketFullMixin {
@ModifyArgs(method = "<init>", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/packet/c2s/play/PlayerMoveC2SPacket;<init>(DDDFFZZZ)V")) @ModifyArgs(method = "<init>", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/packet/c2s/play/PlayerMoveC2SPacket;<init>(DDDFFZZZ)V"))
private static void init(Args args) { private static void init(Args args) {
CoreClient.LOGGER.info("X: {}", (double) args.get(0));
assert MinecraftClient.getInstance().player != null;
if (WorldguardMovebypass.getInstance().isEnabled().isOn()) {
if ((double) args.get(0) < 0) { args.set(0, MinecraftClient.getInstance().player.getPos().getX() - (double) WorldguardMovebypass.maxMoveAmount.getValue()); }
if ((double) args.get(0) > 0) { args.set(0, MinecraftClient.getInstance().player.getPos().getX() + (double) WorldguardMovebypass.maxMoveAmount.getValue()); }
if ((double) args.get(1) < 0) { args.set(1, MinecraftClient.getInstance().player.getPos().getY() - WorldguardMovebypass.maxMoveAmount.getValue()); }
if ((double) args.get(1) > 0) { args.set(1, MinecraftClient.getInstance().player.getPos().getY() + WorldguardMovebypass.maxMoveAmount.getValue()); }
if ((double) args.get(2) < 0) { args.set(2, MinecraftClient.getInstance().player.getPos().getZ() - WorldguardMovebypass.maxMoveAmount.getValue()); }
if ((double) args.get(2) > 0) { args.set(2, MinecraftClient.getInstance().player.getPos().getZ() + WorldguardMovebypass.maxMoveAmount.getValue()); }
if ((double) args.get(3) < 0) { args.set(3, 0); }
if ((double) args.get(3) > 0) { args.set(3, 0); }
if ((double) args.get(4) < 0) { args.set(4, 0); }
if ((double) args.get(4) > 0) { args.set(4, 0); }
}
if (BotMovement.getInstance().isEnabled().isOn()) { if (BotMovement.getInstance().isEnabled().isOn()) {
double newX = Math.round((double) args.get(0) * 100) / 100d; double newX = Math.round((double) args.get(0) * 100) / 100d;
double newZ = Math.round((double) args.get(2) * 100) / 100d; double newZ = Math.round((double) args.get(2) * 100) / 100d;

View File

@ -1,5 +1,7 @@
package dev.coredoes.coreclient.mixin; package dev.coredoes.coreclient.mixin;
import dev.coredoes.coreclient.module.bypass.WorldguardMovebypass;
import net.minecraft.client.MinecraftClient;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
@ -10,6 +12,25 @@ import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
public abstract class PlayerMoveC2SPacketLookMixin { public abstract class PlayerMoveC2SPacketLookMixin {
@ModifyArgs(method = "<init>", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/packet/c2s/play/PlayerMoveC2SPacket;<init>(DDDFFZZZ)V")) @ModifyArgs(method = "<init>", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/packet/c2s/play/PlayerMoveC2SPacket;<init>(DDDFFZZZ)V"))
private static void init(Args args) { private static void init(Args args) {
assert MinecraftClient.getInstance().player != null;
if (WorldguardMovebypass.getInstance().isEnabled().isOn()) {
if ((double) args.get(0) < 0) { args.set(0, MinecraftClient.getInstance().player.getPos().getX() - WorldguardMovebypass.maxMoveAmount.getValue()); }
if ((double) args.get(0) > 0) { args.set(0, MinecraftClient.getInstance().player.getPos().getX() + WorldguardMovebypass.maxMoveAmount.getValue()); }
if ((double) args.get(1) < 0) { args.set(1, MinecraftClient.getInstance().player.getPos().getY() - WorldguardMovebypass.maxMoveAmount.getValue()); }
if ((double) args.get(1) > 0) { args.set(1, MinecraftClient.getInstance().player.getPos().getY() + WorldguardMovebypass.maxMoveAmount.getValue()); }
if ((double) args.get(2) < 0) { args.set(2, MinecraftClient.getInstance().player.getPos().getZ() - WorldguardMovebypass.maxMoveAmount.getValue()); }
if ((double) args.get(2) > 0) { args.set(2, MinecraftClient.getInstance().player.getPos().getZ() + WorldguardMovebypass.maxMoveAmount.getValue()); }
if ((double) args.get(3) < 0) { args.set(3, 0); }
if ((double) args.get(3) > 0) { args.set(3, 0); }
if ((double) args.get(4) < 0) { args.set(4, 0); }
if ((double) args.get(4) > 0) { args.set(4, 0); }
}
/*if (((NoFall) ClientMod.moduleManager.getModuleById("NoFall")).isEnabled()) { /*if (((NoFall) ClientMod.moduleManager.getModuleById("NoFall")).isEnabled()) {
args.set(5, true); args.set(5, true);
}*/ }*/

View File

@ -1,6 +1,8 @@
package dev.coredoes.coreclient.mixin; package dev.coredoes.coreclient.mixin;
import dev.coredoes.coreclient.module.bypass.BotMovement; import dev.coredoes.coreclient.module.bypass.BotMovement;
import dev.coredoes.coreclient.module.bypass.WorldguardMovebypass;
import net.minecraft.client.MinecraftClient;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
@ -11,6 +13,25 @@ import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
public abstract class PlayerMoveC2SPacketOnGroundMixin { public abstract class PlayerMoveC2SPacketOnGroundMixin {
@ModifyArgs(method = "<init>", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/packet/c2s/play/PlayerMoveC2SPacket;<init>(DDDFFZZZ)V")) @ModifyArgs(method = "<init>", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/packet/c2s/play/PlayerMoveC2SPacket;<init>(DDDFFZZZ)V"))
private static void init(Args args) { private static void init(Args args) {
assert MinecraftClient.getInstance().player != null;
if (WorldguardMovebypass.getInstance().isEnabled().isOn()) {
if ((double) args.get(0) < 0) { args.set(0, MinecraftClient.getInstance().player.getPos().getX() - WorldguardMovebypass.maxMoveAmount.getValue()); }
if ((double) args.get(0) > 0) { args.set(0, MinecraftClient.getInstance().player.getPos().getX() + WorldguardMovebypass.maxMoveAmount.getValue()); }
if ((double) args.get(1) < 0) { args.set(1, MinecraftClient.getInstance().player.getPos().getY() - WorldguardMovebypass.maxMoveAmount.getValue()); }
if ((double) args.get(1) > 0) { args.set(1, MinecraftClient.getInstance().player.getPos().getY() + WorldguardMovebypass.maxMoveAmount.getValue()); }
if ((double) args.get(2) < 0) { args.set(2, MinecraftClient.getInstance().player.getPos().getZ() - WorldguardMovebypass.maxMoveAmount.getValue()); }
if ((double) args.get(2) > 0) { args.set(2, MinecraftClient.getInstance().player.getPos().getZ() + WorldguardMovebypass.maxMoveAmount.getValue()); }
if ((double) args.get(3) < 0) { args.set(3, 0); }
if ((double) args.get(3) > 0) { args.set(3, 0); }
if ((double) args.get(4) < 0) { args.set(4, 0); }
if ((double) args.get(4) > 0) { args.set(4, 0); }
}
if (BotMovement.getInstance().isEnabled().isOn()) { if (BotMovement.getInstance().isEnabled().isOn()) {
double newX = Math.round((double) args.get(0) * 100) / 100d; double newX = Math.round((double) args.get(0) * 100) / 100d;
double newZ = Math.round((double) args.get(2) * 100) / 100d; double newZ = Math.round((double) args.get(2) * 100) / 100d;

View File

@ -0,0 +1,38 @@
package dev.coredoes.coreclient.module.bypass;
import com.lukflug.panelstudio.base.IBoolean;
import dev.coredoes.coreclient.CoreClient;
import dev.coredoes.coreclient.event.ConnectEvent;
import dev.coredoes.coreclient.event.PacketEvent;
import dev.coredoes.coreclient.gui.module.Module;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.client.MinecraftClient;
import net.minecraft.network.packet.s2c.play.*;
public class NewLOButton extends Module {
private static NewLOButton instance;
public NewLOButton() {
super("NewLOButton", "Solve the New LO button challenge (1337 -1337)", () -> true, true, false);
CoreClient.eventBus.subscribe(this);
instance = this;
}
@EventHandler
public void onPacketRecieved(PacketEvent.Receive e) {
if (isEnabled().isOn()) {
if (e.packet instanceof UnloadChunkS2CPacket pkt) {
assert MinecraftClient.getInstance().player != null;
if (pkt.getX() == MinecraftClient.getInstance().player.getChunkPos().x && pkt.getZ() == MinecraftClient.getInstance().player.getChunkPos().z) {
e.cancel();
}
}
}
}
public static NewLOButton getInstance() {
return instance;
}
}

View File

@ -0,0 +1,27 @@
package dev.coredoes.coreclient.module.bypass;
import dev.coredoes.coreclient.CoreClient;
import dev.coredoes.coreclient.gui.module.Module;
import dev.coredoes.coreclient.gui.setting.DoubleSetting;
public class WorldguardMovebypass extends Module {
private static WorldguardMovebypass instance;
public static DoubleSetting maxMoveAmount;
public WorldguardMovebypass() {
super("WorldguardBypass", "Bypass worldguard movement", () -> true, true, false);
maxMoveAmount = new DoubleSetting("Move amount", "moveAmount", "Maximum amount to move", () -> true, 0.0, 1.0, 0.0034);
settings.add(maxMoveAmount);
CoreClient.eventBus.subscribe(this);
instance = this;
}
public static WorldguardMovebypass getInstance() {
return instance;
}
}

View File

@ -0,0 +1,65 @@
package dev.coredoes.coreclient.module.bypass;
import com.lukflug.panelstudio.base.IToggleable;
import dev.coredoes.coreclient.CoreClient;
import dev.coredoes.coreclient.gui.module.Module;
import dev.coredoes.coreclient.gui.setting.DoubleSetting;
import dev.coredoes.coreclient.gui.setting.StringSetting;
import net.minecraft.client.MinecraftClient;
import net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3d;
public class ButtonClicker extends Module {
private static ButtonClicker instance;
public static StringSetting x;
public static StringSetting y;
public static StringSetting z;
private boolean enabled;
public ButtonClicker() {
super("ButtonClicker", "Click a button", () -> true, true, false);
// 1336 66 -1335
x = new StringSetting("X", "x_coord", "X coordinate", () -> true, "1336");
y = new StringSetting("Y", "y_coord", "Y coordinate", () -> true, "66");
z = new StringSetting("Z", "z_coord", "Z coordinate", () -> true, "-1335");
settings.add(x);
settings.add(y);
settings.add(z);
CoreClient.eventBus.subscribe(this);
instance = this;
}
public static ButtonClicker getInstance() {
return instance;
}
@Override
public IToggleable isEnabled() {
return new IToggleable() {
@Override
public boolean isOn() {
return false;
}
@Override
public void toggle() {
BlockPos blockPos = new BlockPos(Integer.parseInt(x.getValue()), Integer.parseInt(y.getValue()), Integer.parseInt(z.getValue()));
Direction direction = Direction.UP;
BlockHitResult blockHitResult = new BlockHitResult(new Vec3d(blockPos.getX(), blockPos.getY(), blockPos.getZ()), direction, blockPos, false);
assert MinecraftClient.getInstance().interactionManager != null;
MinecraftClient.getInstance().interactionManager.interactBlock(MinecraftClient.getInstance().player, Hand.MAIN_HAND, blockHitResult);
}
};
}
}

View File

@ -1,4 +1,4 @@
package dev.coredoes.coreclient.module.bypass; package dev.coredoes.coreclient.module.misc;
import com.lukflug.panelstudio.base.IBoolean; import com.lukflug.panelstudio.base.IBoolean;
import dev.coredoes.coreclient.CoreClient; import dev.coredoes.coreclient.CoreClient;
@ -6,6 +6,8 @@ import dev.coredoes.coreclient.event.ConnectEvent;
import dev.coredoes.coreclient.event.PacketEvent; import dev.coredoes.coreclient.event.PacketEvent;
import dev.coredoes.coreclient.gui.module.Module; import dev.coredoes.coreclient.gui.module.Module;
import meteordevelopment.orbit.EventHandler; import meteordevelopment.orbit.EventHandler;
import net.minecraft.client.MinecraftClient;
import net.minecraft.network.packet.s2c.play.*;
public class PacketLogger extends Module { public class PacketLogger extends Module {
private static PacketLogger instance; private static PacketLogger instance;
@ -21,7 +23,22 @@ public class PacketLogger extends Module {
@EventHandler @EventHandler
public void onPacketRecieved(PacketEvent.Receive e) { public void onPacketRecieved(PacketEvent.Receive e) {
if (isEnabled().isOn()) { if (isEnabled().isOn()) {
CoreClient.LOGGER.debug("pkt", e.packet); if (e.packet instanceof PlayerListS2CPacket) return;
if (e.packet instanceof EntityS2CPacket) return;
if (e.packet instanceof EntityTrackerUpdateS2CPacket) return;
if (e.packet instanceof EntityVelocityUpdateS2CPacket) return;
if (e.packet instanceof EntitySetHeadYawS2CPacket) return;
if (e.packet instanceof EntityStatusS2CPacket) return;
if (e.packet instanceof EntityPositionS2CPacket) return;
if (e.packet instanceof HealthUpdateS2CPacket) return;
CoreClient.LOGGER.info("pkt received {}", e.packet.toString());
/*if (e.packet instanceof UnloadChunkS2CPacket pkt) {
assert MinecraftClient.getInstance().player != null;
if (pkt.getX() == MinecraftClient.getInstance().player.getChunkPos().x && pkt.getZ() == MinecraftClient.getInstance().player.getChunkPos().z) {
e.cancel();
}
}*/
} }
} }

View File

@ -0,0 +1,176 @@
package dev.coredoes.coreclient.module.movement;
import com.lukflug.panelstudio.base.IToggleable;
import dev.coredoes.coreclient.CoreClient;
import dev.coredoes.coreclient.event.PacketEvent;
import dev.coredoes.coreclient.event.TickEvent;
import dev.coredoes.coreclient.gui.module.Module;
import dev.coredoes.coreclient.gui.setting.BooleanSetting;
import dev.coredoes.coreclient.gui.setting.DoubleSetting;
import dev.coredoes.coreclient.gui.setting.IntegerSetting;
import dev.coredoes.coreclient.gui.setting.KeybindSetting;
import dev.coredoes.coreclient.mixin.ClientPlayerEntityAccessor;
import dev.coredoes.coreclient.mixin.PlayerMoveC2SPacketAccessor;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.block.AbstractBlock;
import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.Entity;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import org.lwjgl.glfw.GLFW;
import java.util.Objects;
public class CreativeFlight extends Module {
private static CreativeFlight instance;
private static boolean enabled;
public static final KeybindSetting keybind=new KeybindSetting("Keybind","keybind","The key to toggle the module.",()->true, GLFW.GLFW_KEY_F25);
public static final BooleanSetting antikick = new BooleanSetting("Anti-Kick", "antikick", "Prevent vanilla antifly", () -> true, true);
public static final IntegerSetting delay = new IntegerSetting("Delay", "delay", "The amount of delay in ticks between flying down a bit and returning to original position", () -> true, 1, 200, 20);
public static final IntegerSetting offTime = new IntegerSetting("Off Time", "offtime", "The amount of delay, in milliseconds, to fly down a bit to reset floating ticks.", () -> true, 1, 20, 1);
private int delayLeft = delay.getValue();
private int offLeft = offTime.getValue();
private boolean flip;
private float lastYaw;
private double lastPacketY = Double.MAX_VALUE;
public CreativeFlight() {
super("CreativeFlight", "Enable creative mode flight", () -> true, true, false);
settings.add(keybind);
settings.add(antikick);
settings.add(delay);
settings.add(offTime);
enabled=false;
instance = this;
CoreClient.eventBus.subscribe(this);
}
@EventHandler
private void onPreTick(TickEvent.Pre e) {
if (MinecraftClient.getInstance().player == null) {
return;
}
assert MinecraftClient.getInstance().player != null;
float currentYaw = MinecraftClient.getInstance().player.getYaw();
if (MinecraftClient.getInstance().player.fallDistance >= 3f && currentYaw == lastYaw && MinecraftClient.getInstance().player.getVelocity().length() < 0.003d) {
MinecraftClient.getInstance().player.setYaw(currentYaw + (flip ? 1 : -1));
flip = !flip;
}
lastYaw = currentYaw;
}
@EventHandler
private void onPostTick(TickEvent.Post e) {
if (MinecraftClient.getInstance().player == null) {
return;
}
MinecraftClient.getInstance().player.getAbilities().allowFlying = enabled;
if (delayLeft > 0) delayLeft--;
if (offLeft <= 0 && delayLeft <= 0) {
delayLeft = delay.getValue();
offLeft = offTime.getValue();
assert MinecraftClient.getInstance().player != null;
((ClientPlayerEntityAccessor) MinecraftClient.getInstance().player).setTicksSinceLastPositionPacketSent(20);
} else if (delayLeft <= 0) {
if (offLeft == offTime.getValue()) {
assert MinecraftClient.getInstance().player != null;
((ClientPlayerEntityAccessor) MinecraftClient.getInstance().player).setTicksSinceLastPositionPacketSent(20);
}
offLeft--;
}
if (MinecraftClient.getInstance().player.getYaw() != lastYaw) MinecraftClient.getInstance().player.setYaw(lastYaw);
}
private boolean shouldFlyDown(double currentY, double lastY) {
if (currentY >= lastY) {
return true;
} else return lastY - currentY < 0.03130D;
}
private boolean isEntityOnAir(Entity entity) {
return entity.getWorld().getStatesInBox(entity.getBoundingBox().expand(0.0625).stretch(0.0, -0.55, 0.0)).allMatch(AbstractBlock.AbstractBlockState::isAir);
}
private void antiKickPacket(PlayerMoveC2SPacket packet, double currentY) {
// maximum time we can be "floating" is 80 ticks, so 4 seconds max
if (this.delayLeft <= 0 && this.lastPacketY != Double.MAX_VALUE &&
shouldFlyDown(currentY, this.lastPacketY) && isEntityOnAir(MinecraftClient.getInstance().player)) {
// actual check is for >= -0.03125D, but we have to do a bit more than that
// due to the fact that it's a bigger or *equal* to, and not just a bigger than
((PlayerMoveC2SPacketAccessor) packet).setY(lastPacketY - 0.03130D);
} else {
lastPacketY = currentY;
}
}
@EventHandler
private void onSendPacket(PacketEvent.Send e) {
if (MinecraftClient.getInstance().player == null) {
return;
}
if (!(e.packet instanceof PlayerMoveC2SPacket packet) || !CreativeFlight.antikick.isOn()) return;
double currentY = packet.getY(Double.MAX_VALUE);
if (currentY != Double.MAX_VALUE) {
antiKickPacket(packet, currentY);
} else {
PlayerMoveC2SPacket fullPacket;
if (packet.changesLook()) {
assert MinecraftClient.getInstance().player != null;
fullPacket = new PlayerMoveC2SPacket.Full(
MinecraftClient.getInstance().player.getX(),
MinecraftClient.getInstance().player.getY(),
MinecraftClient.getInstance().player.getZ(),
packet.getYaw(0),
packet.getPitch(0),
packet.isOnGround()
);
} else {
assert MinecraftClient.getInstance().player != null;
fullPacket = new PlayerMoveC2SPacket.PositionAndOnGround(
MinecraftClient.getInstance().player.getX(),
MinecraftClient.getInstance().player.getY(),
MinecraftClient.getInstance().player.getZ(),
packet.isOnGround()
);
}
e.cancel();
antiKickPacket(fullPacket, MinecraftClient.getInstance().player.getY());
Objects.requireNonNull(MinecraftClient.getInstance().getNetworkHandler()).sendPacket(fullPacket);
}
}
public static CreativeFlight getInstance() {
return instance;
}
@Override
public IToggleable isEnabled() {
return new IToggleable() {
@Override
public boolean isOn() {
return enabled;
}
@Override
public void toggle() {
if (toggleable) {
enabled=!enabled;
}
}
};
}
}

View File

@ -0,0 +1,46 @@
package dev.coredoes.coreclient.module.movement;
import com.lukflug.panelstudio.base.IToggleable;
import dev.coredoes.coreclient.CoreClient;
import dev.coredoes.coreclient.gui.module.Module;
import dev.coredoes.coreclient.gui.setting.KeybindSetting;
import net.minecraft.client.MinecraftClient;
import org.lwjgl.glfw.GLFW;
public class Jetpack extends Module {
private static Jetpack instance;
private static boolean enabled;
public static final KeybindSetting keybind=new KeybindSetting("Keybind","keybind","The key to toggle the module.",()->true, GLFW.GLFW_KEY_F25);
public Jetpack() {
super("Jetpack", "Zoom!", () -> true, true, false);
enabled=false;
instance = this;
}
// 1327 63 -1335
// 1336 66 -1335
public static Jetpack getInstance() {
return instance;
}
@Override
public IToggleable isEnabled() {
return new IToggleable() {
@Override
public boolean isOn() {
return enabled;
}
@Override
public void toggle() {
if (toggleable) {
enabled=!enabled;
}
}
};
}
}

View File

@ -0,0 +1,42 @@
package dev.coredoes.coreclient.module.movement;
import dev.coredoes.coreclient.CoreClient;
import dev.coredoes.coreclient.event.PacketEvent;
import dev.coredoes.coreclient.gui.module.Module;
import dev.coredoes.coreclient.gui.setting.KeybindSetting;
import dev.coredoes.coreclient.mixin.PlayerMoveC2SPacketAccessor;
import dev.coredoes.coreclient.module.misc.PacketLogger;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.network.packet.s2c.play.*;
import org.lwjgl.glfw.GLFW;
public class NoFall extends Module {
private static NoFall instance;
public static final KeybindSetting keybind=new KeybindSetting("Keybind","keybind","The key to toggle the module.",()->true, GLFW.GLFW_KEY_F25);
public NoFall() {
super("NoFall", "Poof goes the fall damage", () -> true, true, false);
CoreClient.eventBus.subscribe(this);
settings.add(keybind);
instance = this;
}
@EventHandler
public void onPacketSend(PacketEvent.Send e) {
if (isEnabled().isOn()) {
if (e.packet instanceof PlayerMoveC2SPacket) {
((PlayerMoveC2SPacketAccessor) e.packet).setOnGround(true);
}
}
}
public static NoFall getInstance() {
return instance;
}
}

View File

@ -4,12 +4,17 @@
"package": "dev.coredoes.coreclient.mixin", "package": "dev.coredoes.coreclient.mixin",
"compatibilityLevel": "JAVA_17", "compatibilityLevel": "JAVA_17",
"client": [ "client": [
"ClientBrandRetrieverMixin",
"ClientConnectionMixin",
"ClientPlayerEntityAccessor",
"PlayerMoveC2SPacketFullMixin", "PlayerMoveC2SPacketFullMixin",
"PlayerMoveC2SPacketLookMixin", "PlayerMoveC2SPacketLookMixin",
"PlayerMoveC2SPacketOnGroundMixin", "PlayerMoveC2SPacketOnGroundMixin"
"ClientConnectionMixin"
], ],
"injectors": { "injectors": {
"defaultRequire": 1 "defaultRequire": 1
} },
"mixins": [
"PlayerMoveC2SPacketAccessor"
]
} }