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; package anticope.rejects.mixin;
import anticope.rejects.events.OffGroundSpeedEvent; import anticope.rejects.events.OffGroundSpeedEvent;
import anticope.rejects.modules.FullNoClip;
import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.MeteorClient; import meteordevelopment.meteorclient.MeteorClient;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
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;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(PlayerEntity.class) @Mixin(PlayerEntity.class)
@@ -14,4 +17,8 @@ public class PlayerEntityMixin {
private void onGetOffGroundSpeed(CallbackInfoReturnable<Float> cir) { private void onGetOffGroundSpeed(CallbackInfoReturnable<Float> cir) {
cir.setReturnValue(MeteorClient.EVENT_BUS.post(OffGroundSpeedEvent.get(cir.getReturnValueF())).speed); 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);
}
} }

View File

@@ -1,7 +1,6 @@
package anticope.rejects.modules; package anticope.rejects.modules;
import anticope.rejects.MeteorRejectsAddon; import anticope.rejects.MeteorRejectsAddon;
import meteordevelopment.meteorclient.events.world.CollisionShapeEvent;
import meteordevelopment.meteorclient.events.entity.player.PlayerMoveEvent; import meteordevelopment.meteorclient.events.entity.player.PlayerMoveEvent;
import meteordevelopment.meteorclient.mixininterface.IVec3d; import meteordevelopment.meteorclient.mixininterface.IVec3d;
import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.meteorclient.systems.modules.Module;
@@ -32,12 +31,6 @@ public class FullNoClip extends Module {
public FullNoClip() { public FullNoClip() {
super(MeteorRejectsAddon.CATEGORY, "fullnoclip", "FullNoClip."); super(MeteorRejectsAddon.CATEGORY, "fullnoclip", "FullNoClip.");
} }
@EventHandler
private void onCollision(CollisionShapeEvent event) {
if (mc.player.getVehicle() == null)
event.shape = VoxelShapes.empty();
}
private double getDir() { private double getDir() {
double dir = 0; double dir = 0;

View File

@@ -20,7 +20,8 @@
"TexturedRenderLayersMixin", "TexturedRenderLayersMixin",
"ToastManagerMixin", "ToastManagerMixin",
"VehicleMoveC2SPacketAccessor", "VehicleMoveC2SPacketAccessor",
"baritone.MineProcessMixin" "baritone.MineProcessMixin",
"MixinEntity"
], ],
"injectors": { "injectors": {
"defaultRequire": 1 "defaultRequire": 1