diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/lithium/LithiumEntityCollisionsMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/lithium/LithiumEntityCollisionsMixin.java new file mode 100644 index 0000000000..e04058c0ab --- /dev/null +++ b/src/main/java/meteordevelopment/meteorclient/mixin/lithium/LithiumEntityCollisionsMixin.java @@ -0,0 +1,26 @@ +/* + * This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client). + * Copyright (c) Meteor Development. + */ + +package meteordevelopment.meteorclient.mixin.lithium; + +import me.jellysquid.mods.lithium.common.entity.LithiumEntityCollisions; +import meteordevelopment.meteorclient.systems.modules.Modules; +import meteordevelopment.meteorclient.systems.modules.world.Collisions; +import net.minecraft.util.math.Box; +import net.minecraft.world.border.WorldBorder; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(value = LithiumEntityCollisions.class) +public class LithiumEntityCollisionsMixin { + @Inject(method = "isWithinWorldBorder", at = @At("HEAD"), cancellable = true) + private static void onIsWithinWorldBorder(WorldBorder border, Box box, CallbackInfoReturnable cir) { + if (Modules.get().get(Collisions.class).ignoreBorder()) { + cir.setReturnValue(true); + } + } +} diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/world/Collisions.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/world/Collisions.java index 0c441ba7c5..49ae4a1f6b 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/world/Collisions.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/world/Collisions.java @@ -113,6 +113,6 @@ private boolean blockFilter(Block block) { } public boolean ignoreBorder() { - return isActive() && ignoreBorder.get(); + return isActive() && ignoreBorder.get(); } } diff --git a/src/main/resources/meteor-client-lithium.mixins.json b/src/main/resources/meteor-client-lithium.mixins.json index fcad6bd961..58e8d53b0a 100644 --- a/src/main/resources/meteor-client-lithium.mixins.json +++ b/src/main/resources/meteor-client-lithium.mixins.json @@ -4,7 +4,8 @@ "compatibilityLevel": "JAVA_21", "plugin": "meteordevelopment.meteorclient.MixinPlugin", "client": [ - "ChunkAwareBlockCollisionSweeperMixin" + "ChunkAwareBlockCollisionSweeperMixin", + "LithiumEntityCollisionsMixin" ], "injectors": { "defaultRequire": 1