diff --git a/gradlew b/gradlew index 65dcd68..e6fe145 100755 --- a/gradlew +++ b/gradlew @@ -54,7 +54,7 @@ # There are tweaks for specific operating systems such as AIX, CygWin, # Darwin, MinGW, and NonStop. # -# (3) This script is generated from the Groovy template +# (3) This script is generated from the Groovy liveoverflow_utils # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # @@ -144,7 +144,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +152,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac diff --git a/src/main/java/com/example/addon/mixin/ExampleMixin.java b/src/main/java/com/example/addon/mixin/ExampleMixin.java deleted file mode 100644 index a5556c2..0000000 --- a/src/main/java/com/example/addon/mixin/ExampleMixin.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.example.addon.mixin; - -import com.example.addon.AddonTemplate; -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.RunArgs; -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; - -/** - * Example Mixin class. - * For more resources, visit: - * - */ -@Mixin(MinecraftClient.class) -public abstract class ExampleMixin { - /** - * Example Mixin injection targeting the {@code } method (the constructor) at {@code TAIL} (end of method). - */ - @Inject(method = "", at = @At("TAIL")) - private void onGameLoaded(RunArgs args, CallbackInfo ci) { - AddonTemplate.LOG.info("Hello from ExampleMixin!"); - } -} diff --git a/src/main/java/com/example/addon/modules/ModuleExample.java b/src/main/java/com/example/addon/modules/ModuleExample.java deleted file mode 100644 index 10a4bb6..0000000 --- a/src/main/java/com/example/addon/modules/ModuleExample.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.example.addon.modules; - -import com.example.addon.AddonTemplate; -import meteordevelopment.meteorclient.events.render.Render3DEvent; -import meteordevelopment.meteorclient.renderer.ShapeMode; -import meteordevelopment.meteorclient.settings.ColorSetting; -import meteordevelopment.meteorclient.settings.DoubleSetting; -import meteordevelopment.meteorclient.settings.Setting; -import meteordevelopment.meteorclient.settings.SettingGroup; -import meteordevelopment.meteorclient.systems.modules.Module; -import meteordevelopment.meteorclient.utils.render.color.Color; -import meteordevelopment.meteorclient.utils.render.color.SettingColor; -import meteordevelopment.orbit.EventHandler; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Box; - -public class ModuleExample extends Module { - private final SettingGroup sgGeneral = this.settings.getDefaultGroup(); - private final SettingGroup sgRender = this.settings.createGroup("Render"); - - /** - * Example setting. - * The {@code name} parameter should be in kebab-case. - * If you want to access the setting from another class, simply make the setting {@code public}, and use - * {@link meteordevelopment.meteorclient.systems.modules.Modules#get(Class)} to access the {@link Module} object. - */ - private final Setting scale = sgGeneral.add(new DoubleSetting.Builder() - .name("scale") - .description("The size of the marker.") - .defaultValue(2.0d) - .range(0.5d, 10.0d) - .build() - ); - - private final Setting color = sgRender.add(new ColorSetting.Builder() - .name("color") - .description("The color of the marker.") - .defaultValue(Color.MAGENTA) - .build() - ); - - /** - * The {@code name} parameter should be in kebab-case. - */ - public ModuleExample() { - super(AddonTemplate.CATEGORY, "world-origin", "An example module that highlights the center of the world."); - } - - /** - * Example event handling method. - * Requires {@link AddonTemplate#getPackage()} to be setup correctly, will fail silently otherwise. - */ - @EventHandler - private void onRender3d(Render3DEvent event) { - // Create & stretch the marker object - Box marker = new Box(BlockPos.ORIGIN); - marker.stretch( - scale.get() * marker.getLengthX(), - scale.get() * marker.getLengthY(), - scale.get() * marker.getLengthZ() - ); - - // Render the marker based on the color setting - event.renderer.box(marker, color.get(), color.get(), ShapeMode.Both, 0); - } -} diff --git a/src/main/java/com/example/addon/AddonTemplate.java b/src/main/java/xyz/funtimes909/liveoverflow_utils/LiveoverflowUtils.java similarity index 58% rename from src/main/java/com/example/addon/AddonTemplate.java rename to src/main/java/xyz/funtimes909/liveoverflow_utils/LiveoverflowUtils.java index 3bd07af..8949d92 100644 --- a/src/main/java/com/example/addon/AddonTemplate.java +++ b/src/main/java/xyz/funtimes909/liveoverflow_utils/LiveoverflowUtils.java @@ -1,19 +1,15 @@ -package com.example.addon; +package xyz.funtimes909.liveoverflow_utils; -import com.example.addon.commands.CommandExample; -import com.example.addon.hud.HudExample; -import com.example.addon.modules.ModuleExample; +import xyz.funtimes909.liveoverflow_utils.modules.AntiHumanBypass; import com.mojang.logging.LogUtils; import meteordevelopment.meteorclient.addons.GithubRepo; import meteordevelopment.meteorclient.addons.MeteorAddon; -import meteordevelopment.meteorclient.commands.Commands; -import meteordevelopment.meteorclient.systems.hud.Hud; import meteordevelopment.meteorclient.systems.hud.HudGroup; import meteordevelopment.meteorclient.systems.modules.Category; import meteordevelopment.meteorclient.systems.modules.Modules; import org.slf4j.Logger; -public class AddonTemplate extends MeteorAddon { +public class LiveoverflowUtils extends MeteorAddon { public static final Logger LOG = LogUtils.getLogger(); public static final Category CATEGORY = new Category("Example"); public static final HudGroup HUD_GROUP = new HudGroup("Example"); @@ -23,13 +19,7 @@ public void onInitialize() { LOG.info("Initializing Meteor Addon Template"); // Modules - Modules.get().add(new ModuleExample()); - - // Commands - Commands.add(new CommandExample()); - - // HUD - Hud.get().register(HudExample.INFO); + Modules.get().add(new AntiHumanBypass()); } @Override @@ -41,9 +31,4 @@ public void onRegisterCategories() { public String getPackage() { return "com.example.addon"; } - - @Override - public GithubRepo getRepo() { - return new GithubRepo("MeteorDevelopment", "meteor-addon-template"); - } } diff --git a/src/main/java/com/example/addon/commands/CommandExample.java b/src/main/java/xyz/funtimes909/liveoverflow_utils/commands/CommandExample.java similarity index 95% rename from src/main/java/com/example/addon/commands/CommandExample.java rename to src/main/java/xyz/funtimes909/liveoverflow_utils/commands/CommandExample.java index 06ec3ae..84486ef 100644 --- a/src/main/java/com/example/addon/commands/CommandExample.java +++ b/src/main/java/xyz/funtimes909/liveoverflow_utils/commands/CommandExample.java @@ -1,4 +1,4 @@ -package com.example.addon.commands; +package xyz.funtimes909.liveoverflow_utils.commands; import com.mojang.brigadier.arguments.StringArgumentType; import com.mojang.brigadier.builder.LiteralArgumentBuilder; diff --git a/src/main/java/com/example/addon/hud/HudExample.java b/src/main/java/xyz/funtimes909/liveoverflow_utils/hud/HudExample.java similarity index 80% rename from src/main/java/com/example/addon/hud/HudExample.java rename to src/main/java/xyz/funtimes909/liveoverflow_utils/hud/HudExample.java index bdf5928..4af00bc 100644 --- a/src/main/java/com/example/addon/hud/HudExample.java +++ b/src/main/java/xyz/funtimes909/liveoverflow_utils/hud/HudExample.java @@ -1,6 +1,6 @@ -package com.example.addon.hud; +package xyz.funtimes909.liveoverflow_utils.hud; -import com.example.addon.AddonTemplate; +import xyz.funtimes909.liveoverflow_utils.LiveoverflowUtils; import meteordevelopment.meteorclient.systems.hud.HudElement; import meteordevelopment.meteorclient.systems.hud.HudElementInfo; import meteordevelopment.meteorclient.systems.hud.HudRenderer; @@ -10,7 +10,7 @@ public class HudExample extends HudElement { /** * The {@code name} parameter should be in kebab-case. */ - public static final HudElementInfo INFO = new HudElementInfo<>(AddonTemplate.HUD_GROUP, "example", "HUD element example.", HudExample::new); + public static final HudElementInfo INFO = new HudElementInfo<>(LiveoverflowUtils.HUD_GROUP, "example", "HUD element example.", HudExample::new); public HudExample() { super(INFO); diff --git a/src/main/java/xyz/funtimes909/liveoverflow_utils/mixin/MovePacketMixin.java b/src/main/java/xyz/funtimes909/liveoverflow_utils/mixin/MovePacketMixin.java new file mode 100644 index 0000000..cf9b47c --- /dev/null +++ b/src/main/java/xyz/funtimes909/liveoverflow_utils/mixin/MovePacketMixin.java @@ -0,0 +1,38 @@ +package xyz.funtimes909.liveoverflow_utils.mixin; + +import xyz.funtimes909.liveoverflow_utils.modules.AntiHumanBypass; +import xyz.funtimes909.liveoverflow_utils.util.CoordinateRounder; +import meteordevelopment.meteorclient.systems.modules.Modules; +import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Mutable; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(PlayerMoveC2SPacket.class) +public class MovePacketMixin { + @Mutable + @Shadow + @Final + protected double z; + + @Mutable + @Shadow + @Final + protected double x; + + @Inject(at = @At("TAIL"), method = "") + + private void onPlayerMoveC2SPacket(double x, double y, double z, float yaw, float pitch, boolean onGround, boolean changePosition, boolean changeLook, CallbackInfo ci) { + if (!Modules.get().isActive(AntiHumanBypass.class)) { + return; + } + + this.x = CoordinateRounder.roundedDown(x); + this.z = CoordinateRounder.roundedDown(z); + + } +} diff --git a/src/main/java/xyz/funtimes909/liveoverflow_utils/modules/AntiHumanBypass.java b/src/main/java/xyz/funtimes909/liveoverflow_utils/modules/AntiHumanBypass.java new file mode 100644 index 0000000..84ca9f0 --- /dev/null +++ b/src/main/java/xyz/funtimes909/liveoverflow_utils/modules/AntiHumanBypass.java @@ -0,0 +1,10 @@ +package xyz.funtimes909.liveoverflow_utils.modules; + +import xyz.funtimes909.liveoverflow_utils.LiveoverflowUtils; +import meteordevelopment.meteorclient.systems.modules.Module; + +public class AntiHumanBypass extends Module { + public AntiHumanBypass() { + super(LiveoverflowUtils.CATEGORY, "Anti Human Bypass", "Bypass anti human plugin"); + } +} diff --git a/src/main/java/xyz/funtimes909/liveoverflow_utils/modules/WorldguardBypass.java b/src/main/java/xyz/funtimes909/liveoverflow_utils/modules/WorldguardBypass.java new file mode 100644 index 0000000..1fe5bc7 --- /dev/null +++ b/src/main/java/xyz/funtimes909/liveoverflow_utils/modules/WorldguardBypass.java @@ -0,0 +1,11 @@ +package xyz.funtimes909.liveoverflow_utils.modules; + +import xyz.funtimes909.liveoverflow_utils.LiveoverflowUtils; +import meteordevelopment.meteorclient.systems.modules.Module; + +public class WorldguardBypass extends Module { + + public WorldguardBypass() { + super(LiveoverflowUtils.CATEGORY, "world-guard-bypass", "Module to bypass the world border at spawn on LiveOverflow's server"); + } +} diff --git a/src/main/java/xyz/funtimes909/liveoverflow_utils/util/CoordinateRounder.java b/src/main/java/xyz/funtimes909/liveoverflow_utils/util/CoordinateRounder.java new file mode 100644 index 0000000..3d4b99d --- /dev/null +++ b/src/main/java/xyz/funtimes909/liveoverflow_utils/util/CoordinateRounder.java @@ -0,0 +1,9 @@ +package xyz.funtimes909.liveoverflow_utils.util; + +public class CoordinateRounder { + + public static double roundedDown(double num) { + double temp = (double) (Math.round(num*100))/100; + return Math.nextAfter(temp, temp + Math.signum(num)); + } +} diff --git a/src/main/resources/assets/liveoverflow_utils/icon.png b/src/main/resources/assets/liveoverflow_utils/icon.png new file mode 100644 index 0000000..6f5e940 Binary files /dev/null and b/src/main/resources/assets/liveoverflow_utils/icon.png differ diff --git a/src/main/resources/assets/template/icon.png b/src/main/resources/assets/template/icon.png deleted file mode 100644 index 3fb2e7f..0000000 Binary files a/src/main/resources/assets/template/icon.png and /dev/null differ diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index bb8c721..77471e9 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1,24 +1,24 @@ { "schemaVersion": 1, "id": "addon-template", - "version": "${version}", - "name": "Addon Template", - "description": "An addon template for Meteor Client addons.", + "version": "0.1.0", + "name": "Anti Human Bypass", + "description": "Meteor Client addon to bypass LiveOverflows AntiHuman plugin", "authors": [ - "seasnail" + "Funtimes909" ], "contact": { "repo": "https://github.com/MeteorDevelopment/meteor-addon-template" }, - "icon": "assets/template/icon.png", + "icon": "assets/liveoverflow_utils/icon.png", "environment": "client", "entrypoints": { "meteor": [ - "com.example.addon.AddonTemplate" + "xyz.funtimes909.liveoverflow_utils.LiveoverflowUtils" ] }, "mixins": [ - "addon-template.mixins.json" + "liveoverflow_utils.mixins.json" ], "custom": { "meteor-client:color": "225,25,25" diff --git a/src/main/resources/addon-template.mixins.json b/src/main/resources/liveoverflow_utils.mixins.json similarity index 60% rename from src/main/resources/addon-template.mixins.json rename to src/main/resources/liveoverflow_utils.mixins.json index 39d1c99..1846249 100644 --- a/src/main/resources/addon-template.mixins.json +++ b/src/main/resources/liveoverflow_utils.mixins.json @@ -1,9 +1,9 @@ { "required": true, - "package": "com.example.addon.mixin", + "package": "xyz.funtimes909.liveoverflow_utils.mixin", "compatibilityLevel": "JAVA_21", "client": [ - "ExampleMixin" + "MovePacketMixin" ], "injectors": { "defaultRequire": 1