Skip to content

Commit

Permalink
feat: improved aiming (#4952)
Browse files Browse the repository at this point in the history
* Basic implementation

* First acceptable implementation

* Improvement for snowball

* Latest code revision

* Latest changes

* Add DroneControl proof of work

* Refactoring...
  • Loading branch information
superblaubeere27 authored Dec 18, 2024
1 parent 993df9c commit 5d29ed9
Show file tree
Hide file tree
Showing 40 changed files with 1,591 additions and 580 deletions.
2 changes: 1 addition & 1 deletion config/detekt/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ style:
ForbiddenComment:
active: false
UnusedPrivateProperty:
allowedNames: '_|ignored|expected|serialVersionUID|.+Handler'
allowedNames: '_|ignored|expected|serialVersionUID|.+Handler\d*|repeatable'
ForbiddenMethodCall:
active: true
methods: [ 'kotlin.io.print', 'kotlin.io.println' ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import net.ccbluex.liquidbounce.event.EventManager;
import net.ccbluex.liquidbounce.event.events.*;
import net.ccbluex.liquidbounce.features.module.modules.combat.ModuleAutoBow;
import net.ccbluex.liquidbounce.features.module.modules.combat.aimbot.ModuleAutoBow;
import net.ccbluex.liquidbounce.features.module.modules.combat.ModuleAutoClicker;
import net.ccbluex.liquidbounce.utils.client.SilentHotbar;
import net.minecraft.client.network.ClientPlayerInteractionManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import net.ccbluex.liquidbounce.features.module.modules.render.*;
import net.ccbluex.liquidbounce.features.module.modules.combat.aimbot.ModuleDroneControl;
import net.ccbluex.liquidbounce.utils.aiming.AimPlan;
import net.ccbluex.liquidbounce.utils.aiming.RotationManager;
import net.minecraft.client.render.Camera;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.BlockView;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
Expand Down Expand Up @@ -54,6 +56,9 @@ public abstract class MixinCamera {
@Shadow
protected abstract void moveBy(float f, float g, float h);

@Shadow
public abstract void setPos(Vec3d pos);

@Inject(method = "update", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/Camera;setPos(DDD)V", shift = At.Shift.AFTER), cancellable = true)
private void modifyCameraOrientation(BlockView area, Entity focusedEntity, boolean thirdPerson, boolean inverseView, float tickDelta, CallbackInfo ci) {
var freeLook = ModuleFreeLook.INSTANCE.getRunning();
Expand Down Expand Up @@ -81,6 +86,12 @@ private void modifyCameraOrientation(BlockView area, Entity focusedEntity, boole
ci.cancel();
return;
}
var screen = ModuleDroneControl.INSTANCE.getScreen();

if (screen != null) {
this.setPos(screen.getCameraPos());
this.setRotation(screen.getCameraRotation().x, screen.getCameraRotation().y);
}

AimPlan aimPlan = RotationManager.INSTANCE.getWorkingAimPlan();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package net.ccbluex.liquidbounce.injection.mixins.minecraft.render;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import com.llamalad7.mixinextras.sugar.Local;
import com.mojang.blaze3d.systems.RenderSystem;
import net.ccbluex.liquidbounce.LiquidBounce;
Expand All @@ -27,6 +28,7 @@
import net.ccbluex.liquidbounce.event.events.PerspectiveEvent;
import net.ccbluex.liquidbounce.event.events.ScreenRenderEvent;
import net.ccbluex.liquidbounce.event.events.WorldRenderEvent;
import net.ccbluex.liquidbounce.features.module.modules.combat.aimbot.ModuleDroneControl;
import net.ccbluex.liquidbounce.features.module.modules.fun.ModuleDankBobbing;
import net.ccbluex.liquidbounce.features.module.modules.render.*;
import net.ccbluex.liquidbounce.features.module.modules.world.ModuleLiquidPlace;
Expand Down Expand Up @@ -330,4 +332,15 @@ private Perspective hookPerspectiveEventOnHand(Perspective original) {
return EventManager.INSTANCE.callEvent(new PerspectiveEvent(original)).getPerspective();
}

@ModifyReturnValue(method = "getFov", at = @At("RETURN"))
private double injectShit(double original) {
var screen = ModuleDroneControl.INSTANCE.getScreen();

if (screen != null) {
return Math.min(120.0, original / screen.getZoomFactor());
}

return original;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import net.ccbluex.liquidbounce.event.events.*
import net.ccbluex.liquidbounce.utils.client.EventScheduler
import net.ccbluex.liquidbounce.utils.client.logger
import net.ccbluex.liquidbounce.utils.kotlin.sortedInsert
import net.minecraft.client.MinecraftClient
import java.util.concurrent.CopyOnWriteArrayList
import kotlin.reflect.KClass

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import net.minecraft.client.world.ClientWorld
import net.minecraft.entity.EquipmentSlot
import net.minecraft.entity.player.PlayerEntity
import net.minecraft.item.ItemStack
import net.minecraft.network.packet.s2c.play.ChunkDeltaUpdateS2CPacket
import net.minecraft.util.math.BlockPos
import net.minecraft.util.shape.VoxelShape

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ import net.ccbluex.liquidbounce.features.module.modules.client.ModuleLiquidChat
import net.ccbluex.liquidbounce.features.module.modules.client.ModuleRichPresence
import net.ccbluex.liquidbounce.features.module.modules.client.ModuleTargets
import net.ccbluex.liquidbounce.features.module.modules.combat.*
import net.ccbluex.liquidbounce.features.module.modules.combat.aimbot.ModuleAutoBow
import net.ccbluex.liquidbounce.features.module.modules.combat.aimbot.ModuleDroneControl
import net.ccbluex.liquidbounce.features.module.modules.combat.aimbot.ModuleProjectileAimbot
import net.ccbluex.liquidbounce.features.module.modules.combat.autoarmor.ModuleAutoArmor
import net.ccbluex.liquidbounce.features.module.modules.combat.criticals.ModuleCriticals
import net.ccbluex.liquidbounce.features.module.modules.combat.crystalaura.ModuleCrystalAura
Expand Down
Loading

0 comments on commit 5d29ed9

Please sign in to comment.