Skip to content

Commit

Permalink
fixed lithium border collisions #4618
Browse files Browse the repository at this point in the history
  • Loading branch information
19MisterX98 authored and Wide-Cat committed Jun 3, 2024
1 parent 49f3305 commit 3e49a94
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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<Boolean> cir) {
if (Modules.get().get(Collisions.class).ignoreBorder()) {
cir.setReturnValue(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,6 @@ private boolean blockFilter(Block block) {
}

public boolean ignoreBorder() {
return isActive() && ignoreBorder.get();
return isActive() && ignoreBorder.get();
}
}
3 changes: 2 additions & 1 deletion src/main/resources/meteor-client-lithium.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"compatibilityLevel": "JAVA_21",
"plugin": "meteordevelopment.meteorclient.MixinPlugin",
"client": [
"ChunkAwareBlockCollisionSweeperMixin"
"ChunkAwareBlockCollisionSweeperMixin",
"LithiumEntityCollisionsMixin"
],
"injectors": {
"defaultRequire": 1
Expand Down

0 comments on commit 3e49a94

Please sign in to comment.