Fixed FullFlight/NoClip (#254)

This commit is contained in:
yorik100
2023-06-15 12:15:45 +02:00
committed by GitHub
parent 27174e76d3
commit 275fa1d16f
4 changed files with 33 additions and 8 deletions

View File

@@ -0,0 +1,24 @@
package anticope.rejects.mixin;
import meteordevelopment.meteorclient.systems.modules.Modules;
import anticope.rejects.modules.FullFlight;
import anticope.rejects.modules.FullNoClip;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.util.math.Vec3d;
import net.minecraft.block.BlockState;
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;
import static meteordevelopment.meteorclient.MeteorClient.mc;
@Mixin(Entity.class)
public abstract class MixinEntity {
@Inject(method = "slowMovement", at = @At("HEAD"), cancellable = true)
public void slowMovement(BlockState blockState, Vec3d multiplier, CallbackInfo ci) {
if (Modules.get().isActive(FullFlight.class) || Modules.get().isActive(FullNoClip.class)) ci.cancel();
}
}

View File

@@ -1,11 +1,14 @@
package anticope.rejects.mixin;
import anticope.rejects.events.OffGroundSpeedEvent;
import anticope.rejects.modules.FullNoClip;
import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.MeteorClient;
import net.minecraft.entity.player.PlayerEntity;
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.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(PlayerEntity.class)
@@ -14,4 +17,8 @@ public class PlayerEntityMixin {
private void onGetOffGroundSpeed(CallbackInfoReturnable<Float> cir) {
cir.setReturnValue(MeteorClient.EVENT_BUS.post(OffGroundSpeedEvent.get(cir.getReturnValueF())).speed);
}
@Redirect(method = {"tick", "updatePose"}, at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;isSpectator()Z"))
private boolean FullNoClip(PlayerEntity player) {
return Modules.get().isActive(FullNoClip.class);
}
}