Подписывайтесь на наш Telegram и не пропускайте важные новости! Перейти

Часть функционала Aim assist 1.21.4 fabric

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
10 Окт 2024
Сообщения
11
Реакции
0
Выберите загрузчик игры
  1. Fabric
Обновил аим ассист

Сс-нахуй тебе на функцию?

Код:

Код:
Expand Collapse Copy
package pupsik;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.SliderWidget;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.mob.MobEntity;
import net.minecraft.entity.passive.PassiveEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Box;
import org.lwjgl.glfw.GLFW;
import java.util.List;
import java.util.Random;

public class PupsikAimAssist implements ClientModInitializer {
    
    private static KeyBinding guiKey;
    private static KeyBinding aimKey;
    private static boolean guiOpen = false;
    private static boolean aimActive = false;
    
    private static float aimFov = 180.0f;
    private static float aimRange = 100.0f;
    private static float aimSpeed = 5.0f;
    private static boolean throughWalls = false;
    private static boolean friendlyFire = false;
    private static boolean animals = false;
    private static boolean players = true;
    private static boolean mobs = true;
    private static int aimPoint = 0;
    
    private static boolean bypassGrim = true;
    private static boolean bypassVulkan = true;
    private static boolean bypassMatrix = true;
    private static boolean bypassPolar = true;
    private static boolean bypassSloth = true;
    
    private static long lastTargetTime = 0;
    private static Entity currentTarget = null;
    private static Random random = new Random();
    
    private static float lastYaw = 0;
    private static float lastPitch = 0;
    private static long lastMoveTime = 0;
    
    @Override
    public void onInitializeClient() {
        guiKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
            "key.pupsik.aimgui",
            GLFW.GLFW_KEY_RIGHT_SHIFT,
            "category.pupsik"
        ));
        
        aimKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
            "key.pupsik.aimkey",
            GLFW.GLFW_KEY_LEFT_ALT,
            "category.pupsik"
        ));
        
        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            if (client.player == null) return;
            
            while (guiKey.wasPressed()) {
                guiOpen = !guiOpen;
            }
            
            aimActive = aimKey.isPressed();
            
            if (guiOpen) {
                client.setScreen(new AimGuiScreen());
                guiOpen = false;
            }
            
            if (!aimActive) {
                currentTarget = null;
                return;
            }
            
            Entity target = getBestTarget(client);
            if (target != null) {
                applySuperSmoothAim(client, target);
                currentTarget = target;
                lastTargetTime = System.currentTimeMillis();
            }
        });
    }
    
    private Entity getBestTarget(MinecraftClient client) {
        Vec3d playerPos = client.player.getEyePos();
        Vec3d lookVec = client.player.getRotationVec(1.0f);
        Entity bestEntity = null;
        float bestAngle = aimFov;
        
        List<Entity> entities = client.world.getEntities();
        
        for (Entity entity : entities) {
            if (entity == client.player) continue;
            if (!isValidTarget(entity)) continue;
            
            Vec3d targetPos = getAimPoint(entity);
            Vec3d delta = targetPos.subtract(playerPos);
            double distance = delta.length();
            
            if (distance > aimRange) continue;
            if (!throughWalls && !client.player.canSee(entity)) continue;
            
            Vec3d deltaNorm = delta.normalize();
            double dot = lookVec.dotProduct(deltaNorm);
            double angle = Math.toDegrees(Math.acos(dot));
            
            if (angle < bestAngle) {
                bestAngle = (float) angle;
                bestEntity = entity;
            }
        }
        
        if (bestEntity != null && System.currentTimeMillis() - lastTargetTime < 150) {
            if (currentTarget != null && isValidTarget(currentTarget)) {
                Vec3d delta = getAimPoint(currentTarget).subtract(playerPos);
                if (delta.length() <= aimRange) {
                    return currentTarget;
                }
            }
        }
        
        return bestEntity;
    }
    
    private Vec3d getAimPoint(Entity entity) {
        Box box = entity.getBoundingBox();
        double minY = box.minY;
        double maxY = box.maxY;
        double height = maxY - minY;
        
        switch (aimPoint) {
            case 0:
                return new Vec3d(box.minX + (box.maxX - box.minX) * 0.5, maxY - height * 0.1, box.minZ + (box.maxZ - box.minZ) * 0.5);
            case 1:
                return new Vec3d(box.minX + (box.maxX - box.minX) * 0.5, minY + height * 0.5, box.minZ + (box.maxZ - box.minZ) * 0.5);
            case 2:
                return new Vec3d(box.minX + (box.maxX - box.minX) * 0.5, minY + height * 0.2, box.minZ + (box.maxZ - box.minZ) * 0.5);
            default:
                return entity.getBoundingBox().getCenter();
        }
    }
    
    private boolean isValidTarget(Entity entity) {
        if (entity instanceof LivingEntity && ((LivingEntity) entity).isDead()) return false;
        
        if (entity instanceof PlayerEntity) {
            if (!players) return false;
            if (!friendlyFire && entity == MinecraftClient.getInstance().player) return false;
        }
        
        if (entity instanceof MobEntity) {
            if (!mobs) return false;
        }
        
        if (entity instanceof PassiveEntity) {
            if (!animals) return false;
        }
        
        return true;
    }
    
    private void applySuperSmoothAim(MinecraftClient client, Entity target) {
        Vec3d targetPos = getAimPoint(target);
        Vec3d playerPos = client.player.getEyePos();
        Vec3d delta = targetPos.subtract(playerPos);
        
        double horizontalDistance = Math.sqrt(delta.x * delta.x + delta.z * delta.z);
        float targetYaw = (float) Math.toDegrees(Math.atan2(delta.z, delta.x)) - 90.0f;
        float targetPitch = (float) -Math.toDegrees(Math.atan2(delta.y, horizontalDistance));
        
        targetPitch = MathHelper.clamp(targetPitch, -15.0f, 15.0f);
        
        float currentYaw = client.player.getYaw();
        float currentPitch = client.player.getPitch();
        
        float yawDelta = MathHelper.wrapDegrees(targetYaw - currentYaw);
        float pitchDelta = targetPitch - currentPitch;
        
        if (Math.abs(yawDelta) > aimFov) return;
        
        long now = System.currentTimeMillis();
        float deltaTime = Math.min(1.0f, (now - lastMoveTime) / 1000.0f);
        lastMoveTime = now;
        if (deltaTime <= 0.01f) deltaTime = 0.05f;
        
        float speedMultiplier = aimSpeed / 5.0f;
        float dynamicSpeed = 8.0f * speedMultiplier;
        
        float distance = Math.abs(yawDelta) + Math.abs(pitchDelta);
        if (distance < 5.0f) {
            dynamicSpeed = dynamicSpeed * 0.6f;
        } else if (distance > 20.0f) {
            dynamicSpeed = dynamicSpeed * 1.3f;
        }
        
        float alpha = Math.min(1.0f, deltaTime * dynamicSpeed);
        
        float newYaw = currentYaw + yawDelta * alpha;
        float newPitch = currentPitch + pitchDelta * alpha;
        
        if (bypassGrim) {
            float grimStep = Math.min(Math.abs(yawDelta) * 0.15f, 1.2f);
            newYaw = currentYaw + Math.signum(yawDelta) * grimStep;
            newPitch = currentPitch + Math.signum(pitchDelta) * grimStep * 0.7f;
        }
        
        if (bypassVulkan) {
            float noiseYaw = (random.nextFloat() - 0.5f) * 0.08f;
            float noisePitch = (random.nextFloat() - 0.5f) * 0.05f;
            newYaw += noiseYaw;
            newPitch += noisePitch;
        }
        
        if (bypassMatrix) {
            if (Math.abs(yawDelta) < 3.0f) {
                newYaw = currentYaw + yawDelta * 0.5f;
            }
            if (Math.abs(pitchDelta) < 2.0f) {
                newPitch = currentPitch + pitchDelta * 0.5f;
            }
        }
        
        if (bypassPolar) {
            if (lastYaw != 0) {
                float yawRate = newYaw - lastYaw;
                if (Math.abs(yawRate) > 8.0f) {
                    newYaw = lastYaw + Math.signum(yawRate) * 6.5f;
                }
            }
            lastYaw = newYaw;
            lastPitch = newPitch;
        }
        
        if (bypassSloth) {
            if (now % 2000 < 20) {
                newYaw += (random.nextFloat() - 0.5f) * 0.15f;
                newPitch += (random.nextFloat() - 0.5f) * 0.1f;
            }
        }
        
        float maxChange = 12.0f;
        float yawChange = MathHelper.wrapDegrees(newYaw - currentYaw);
        if (Math.abs(yawChange) > maxChange) {
            newYaw = currentYaw + Math.signum(yawChange) * maxChange;
        }
        
        float pitchChange = newPitch - currentPitch;
        if (Math.abs(pitchChange) > maxChange * 0.7f) {
            newPitch = currentPitch + Math.signum(pitchChange) * maxChange * 0.7f;
        }
        
        client.player.setYaw(newYaw);
        client.player.setPitch(newPitch);
    }
    
    private class AimGuiScreen extends Screen {
        
        private SliderWidget fovSlider;
        private SliderWidget rangeSlider;
        private SliderWidget speedSlider;
        
        protected AimGuiScreen() {
            super(Text.literal("Pupsik AimAssist Pro"));
        }
        
        @Override
        protected void init() {
            int buttonHeight = 20;
            int startX = this.width / 2 - 150;
            int startY = 30;
            int spacing = 24;
            
            fovSlider = new SliderWidget(startX, startY, 300, buttonHeight, Text.literal(""), 0.0) {
                @Override
                protected void updateMessage() {
                    this.setMessage(Text.literal("FOV: " + String.format("%.0f", aimFov) + "° (90-360)"));
                }
                @Override
                protected void applyValue() {
                    aimFov = 90.0f + (float) (this.value * 270.0);
                    if (aimFov < 90.0f) aimFov = 90.0f;
                    if (aimFov > 360.0f) aimFov = 360.0f;
                }
            };
            fovSlider.value = (aimFov - 90.0f) / 270.0;
            fovSlider.updateMessage();
            this.addDrawableChild(fovSlider);
            
            rangeSlider = new SliderWidget(startX, startY + spacing, 300, buttonHeight, Text.literal(""), 0.0) {
                @Override
                protected void updateMessage() {
                    this.setMessage(Text.literal("Range: " + String.format("%.0f", aimRange) + " blocks"));
                }
                @Override
                protected void applyValue() {
                    aimRange = (float) (this.value * 200.0 + 10.0);
                }
            };
            rangeSlider.value = (aimRange - 10.0f) / 200.0;
            rangeSlider.updateMessage();
            this.addDrawableChild(rangeSlider);
            
            speedSlider = new SliderWidget(startX, startY + spacing * 2, 300, buttonHeight, Text.literal(""), 0.0) {
                @Override
                protected void updateMessage() {
                    this.setMessage(Text.literal("Speed: " + String.format("%.1f", aimSpeed) + "/10"));
                }
                @Override
                protected void applyValue() {
                    aimSpeed = 1.0f + (float) (this.value * 9.0);
                    if (aimSpeed < 1.0f) aimSpeed = 1.0f;
                    if (aimSpeed > 10.0f) aimSpeed = 10.0f;
                }
            };
            speedSlider.value = (aimSpeed - 1.0f) / 9.0f;
            speedSlider.updateMessage();
            this.addDrawableChild(speedSlider);
            
            int toggleY = startY + spacing * 3;
            
            String aimPointText = aimPoint == 0 ? "HEAD" : (aimPoint == 1 ? "BODY" : "LEGS");
            this.addDrawableChild(ButtonWidget.builder(Text.literal("Aim Point: " + aimPointText), button -> {
                aimPoint = (aimPoint + 1) % 3;
                String newText = aimPoint == 0 ? "HEAD" : (aimPoint == 1 ? "BODY" : "LEGS");
                button.setMessage(Text.literal("Aim Point: " + newText));
            }).dimensions(startX, toggleY, 140, buttonHeight).build());
            
            this.addDrawableChild(ButtonWidget.builder(Text.literal("Through Walls: " + (throughWalls ? "ON" : "OFF")), button -> {
                throughWalls = !throughWalls;
                button.setMessage(Text.literal("Through Walls: " + (throughWalls ? "ON" : "OFF")));
            }).dimensions(startX + 150, toggleY, 150, buttonHeight).build());
            
            this.addDrawableChild(ButtonWidget.builder(Text.literal("Players: " + (players ? "ON" : "OFF")), button -> {
                players = !players;
                button.setMessage(Text.literal("Players: " + (players ? "ON" : "OFF")));
            }).dimensions(startX, toggleY + spacing, 90, buttonHeight).build());
            
            this.addDrawableChild(ButtonWidget.builder(Text.literal("Mobs: " + (mobs ? "ON" : "OFF")), button -> {
                mobs = !mobs;
                button.setMessage(Text.literal("Mobs: " + (mobs ? "ON" : "OFF")));
            }).dimensions(startX + 100, toggleY + spacing, 90, buttonHeight).build());
            
            this.addDrawableChild(ButtonWidget.builder(Text.literal("Animals: " + (animals ? "ON" : "OFF")), button -> {
                animals = !animals;
                button.setMessage(Text.literal("Animals: " + (animals ? "ON" : "OFF")));
            }).dimensions(startX + 200, toggleY + spacing, 100, buttonHeight).build());
            
            int bypassY = toggleY + spacing * 2;
            
            this.addDrawableChild(ButtonWidget.builder(Text.literal("Grim: " + (bypassGrim ? "✓" : "✗")), button -> {
                bypassGrim = !bypassGrim;
                button.setMessage(Text.literal("Grim: " + (bypassGrim ? "✓" : "✗")));
            }).dimensions(startX, bypassY, 70, buttonHeight).build());
            
            this.addDrawableChild(ButtonWidget.builder(Text.literal("Vulkan: " + (bypassVulkan ? "✓" : "✗")), button -> {
                bypassVulkan = !bypassVulkan;
                button.setMessage(Text.literal("Vulkan: " + (bypassVulkan ? "✓" : "✗")));
            }).dimensions(startX + 75, bypassY, 70, buttonHeight).build());
            
            this.addDrawableChild(ButtonWidget.builder(Text.literal("Matrix: " + (bypassMatrix ? "✓" : "✗")), button -> {
                bypassMatrix = !bypassMatrix;
                button.setMessage(Text.literal("Matrix: " + (bypassMatrix ? "✓" : "✗")));
            }).dimensions(startX + 150, bypassY, 70, buttonHeight).build());
            
            this.addDrawableChild(ButtonWidget.builder(Text.literal("Polar: " + (bypassPolar ? "✓" : "✗")), button -> {
                bypassPolar = !bypassPolar;
                button.setMessage(Text.literal("Polar: " + (bypassPolar ? "✓" : "✗")));
            }).dimensions(startX + 225, bypassY, 75, buttonHeight).build());
            
            this.addDrawableChild(ButtonWidget.builder(Text.literal("Sloth: " + (bypassSloth ? "✓" : "✗")), button -> {
                bypassSloth = !bypassSloth;
                button.setMessage(Text.literal("Sloth: " + (bypassSloth ? "✓" : "✗")));
            }).dimensions(startX, bypassY + spacing, 70, buttonHeight).build());
            
            this.addDrawableChild(ButtonWidget.builder(Text.literal("Close"), button -> {
                this.close();
            }).dimensions(this.width / 2 - 50, this.height - 35, 100, buttonHeight).build());
        }
        
        @Override
        public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
            this.renderBackground(matrices);
            drawCenteredText(matrices, this.textRenderer, "Pupsik AimAssist Pro", this.width / 2, 10, 0xFFAA33);
            drawCenteredText(matrices, this.textRenderer, "Speed 1-10 | FOV 90-360", this.width / 2, this.height - 58, 0x888888);
            super.render(matrices, mouseX, mouseY, delta);
        }
        
        @Override
        public boolean shouldCloseOnEsc() {
            return true;
        }
    }
}
 
Обновил аим ассист

Сс-нахуй тебе на функцию?

Код:

Код:
Expand Collapse Copy
package pupsik;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.SliderWidget;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.mob.MobEntity;
import net.minecraft.entity.passive.PassiveEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Box;
import org.lwjgl.glfw.GLFW;
import java.util.List;
import java.util.Random;

public class PupsikAimAssist implements ClientModInitializer {
   
    private static KeyBinding guiKey;
    private static KeyBinding aimKey;
    private static boolean guiOpen = false;
    private static boolean aimActive = false;
   
    private static float aimFov = 180.0f;
    private static float aimRange = 100.0f;
    private static float aimSpeed = 5.0f;
    private static boolean throughWalls = false;
    private static boolean friendlyFire = false;
    private static boolean animals = false;
    private static boolean players = true;
    private static boolean mobs = true;
    private static int aimPoint = 0;
   
    private static boolean bypassGrim = true;
    private static boolean bypassVulkan = true;
    private static boolean bypassMatrix = true;
    private static boolean bypassPolar = true;
    private static boolean bypassSloth = true;
   
    private static long lastTargetTime = 0;
    private static Entity currentTarget = null;
    private static Random random = new Random();
   
    private static float lastYaw = 0;
    private static float lastPitch = 0;
    private static long lastMoveTime = 0;
   
    @Override
    public void onInitializeClient() {
        guiKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
            "key.pupsik.aimgui",
            GLFW.GLFW_KEY_RIGHT_SHIFT,
            "category.pupsik"
        ));
       
        aimKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
            "key.pupsik.aimkey",
            GLFW.GLFW_KEY_LEFT_ALT,
            "category.pupsik"
        ));
       
        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            if (client.player == null) return;
           
            while (guiKey.wasPressed()) {
                guiOpen = !guiOpen;
            }
           
            aimActive = aimKey.isPressed();
           
            if (guiOpen) {
                client.setScreen(new AimGuiScreen());
                guiOpen = false;
            }
           
            if (!aimActive) {
                currentTarget = null;
                return;
            }
           
            Entity target = getBestTarget(client);
            if (target != null) {
                applySuperSmoothAim(client, target);
                currentTarget = target;
                lastTargetTime = System.currentTimeMillis();
            }
        });
    }
   
    private Entity getBestTarget(MinecraftClient client) {
        Vec3d playerPos = client.player.getEyePos();
        Vec3d lookVec = client.player.getRotationVec(1.0f);
        Entity bestEntity = null;
        float bestAngle = aimFov;
       
        List<Entity> entities = client.world.getEntities();
       
        for (Entity entity : entities) {
            if (entity == client.player) continue;
            if (!isValidTarget(entity)) continue;
           
            Vec3d targetPos = getAimPoint(entity);
            Vec3d delta = targetPos.subtract(playerPos);
            double distance = delta.length();
           
            if (distance > aimRange) continue;
            if (!throughWalls && !client.player.canSee(entity)) continue;
           
            Vec3d deltaNorm = delta.normalize();
            double dot = lookVec.dotProduct(deltaNorm);
            double angle = Math.toDegrees(Math.acos(dot));
           
            if (angle < bestAngle) {
                bestAngle = (float) angle;
                bestEntity = entity;
            }
        }
       
        if (bestEntity != null && System.currentTimeMillis() - lastTargetTime < 150) {
            if (currentTarget != null && isValidTarget(currentTarget)) {
                Vec3d delta = getAimPoint(currentTarget).subtract(playerPos);
                if (delta.length() <= aimRange) {
                    return currentTarget;
                }
            }
        }
       
        return bestEntity;
    }
   
    private Vec3d getAimPoint(Entity entity) {
        Box box = entity.getBoundingBox();
        double minY = box.minY;
        double maxY = box.maxY;
        double height = maxY - minY;
       
        switch (aimPoint) {
            case 0:
                return new Vec3d(box.minX + (box.maxX - box.minX) * 0.5, maxY - height * 0.1, box.minZ + (box.maxZ - box.minZ) * 0.5);
            case 1:
                return new Vec3d(box.minX + (box.maxX - box.minX) * 0.5, minY + height * 0.5, box.minZ + (box.maxZ - box.minZ) * 0.5);
            case 2:
                return new Vec3d(box.minX + (box.maxX - box.minX) * 0.5, minY + height * 0.2, box.minZ + (box.maxZ - box.minZ) * 0.5);
            default:
                return entity.getBoundingBox().getCenter();
        }
    }
   
    private boolean isValidTarget(Entity entity) {
        if (entity instanceof LivingEntity && ((LivingEntity) entity).isDead()) return false;
       
        if (entity instanceof PlayerEntity) {
            if (!players) return false;
            if (!friendlyFire && entity == MinecraftClient.getInstance().player) return false;
        }
       
        if (entity instanceof MobEntity) {
            if (!mobs) return false;
        }
       
        if (entity instanceof PassiveEntity) {
            if (!animals) return false;
        }
       
        return true;
    }
   
    private void applySuperSmoothAim(MinecraftClient client, Entity target) {
        Vec3d targetPos = getAimPoint(target);
        Vec3d playerPos = client.player.getEyePos();
        Vec3d delta = targetPos.subtract(playerPos);
       
        double horizontalDistance = Math.sqrt(delta.x * delta.x + delta.z * delta.z);
        float targetYaw = (float) Math.toDegrees(Math.atan2(delta.z, delta.x)) - 90.0f;
        float targetPitch = (float) -Math.toDegrees(Math.atan2(delta.y, horizontalDistance));
       
        targetPitch = MathHelper.clamp(targetPitch, -15.0f, 15.0f);
       
        float currentYaw = client.player.getYaw();
        float currentPitch = client.player.getPitch();
       
        float yawDelta = MathHelper.wrapDegrees(targetYaw - currentYaw);
        float pitchDelta = targetPitch - currentPitch;
       
        if (Math.abs(yawDelta) > aimFov) return;
       
        long now = System.currentTimeMillis();
        float deltaTime = Math.min(1.0f, (now - lastMoveTime) / 1000.0f);
        lastMoveTime = now;
        if (deltaTime <= 0.01f) deltaTime = 0.05f;
       
        float speedMultiplier = aimSpeed / 5.0f;
        float dynamicSpeed = 8.0f * speedMultiplier;
       
        float distance = Math.abs(yawDelta) + Math.abs(pitchDelta);
        if (distance < 5.0f) {
            dynamicSpeed = dynamicSpeed * 0.6f;
        } else if (distance > 20.0f) {
            dynamicSpeed = dynamicSpeed * 1.3f;
        }
       
        float alpha = Math.min(1.0f, deltaTime * dynamicSpeed);
       
        float newYaw = currentYaw + yawDelta * alpha;
        float newPitch = currentPitch + pitchDelta * alpha;
       
        if (bypassGrim) {
            float grimStep = Math.min(Math.abs(yawDelta) * 0.15f, 1.2f);
            newYaw = currentYaw + Math.signum(yawDelta) * grimStep;
            newPitch = currentPitch + Math.signum(pitchDelta) * grimStep * 0.7f;
        }
       
        if (bypassVulkan) {
            float noiseYaw = (random.nextFloat() - 0.5f) * 0.08f;
            float noisePitch = (random.nextFloat() - 0.5f) * 0.05f;
            newYaw += noiseYaw;
            newPitch += noisePitch;
        }
       
        if (bypassMatrix) {
            if (Math.abs(yawDelta) < 3.0f) {
                newYaw = currentYaw + yawDelta * 0.5f;
            }
            if (Math.abs(pitchDelta) < 2.0f) {
                newPitch = currentPitch + pitchDelta * 0.5f;
            }
        }
       
        if (bypassPolar) {
            if (lastYaw != 0) {
                float yawRate = newYaw - lastYaw;
                if (Math.abs(yawRate) > 8.0f) {
                    newYaw = lastYaw + Math.signum(yawRate) * 6.5f;
                }
            }
            lastYaw = newYaw;
            lastPitch = newPitch;
        }
       
        if (bypassSloth) {
            if (now % 2000 < 20) {
                newYaw += (random.nextFloat() - 0.5f) * 0.15f;
                newPitch += (random.nextFloat() - 0.5f) * 0.1f;
            }
        }
       
        float maxChange = 12.0f;
        float yawChange = MathHelper.wrapDegrees(newYaw - currentYaw);
        if (Math.abs(yawChange) > maxChange) {
            newYaw = currentYaw + Math.signum(yawChange) * maxChange;
        }
       
        float pitchChange = newPitch - currentPitch;
        if (Math.abs(pitchChange) > maxChange * 0.7f) {
            newPitch = currentPitch + Math.signum(pitchChange) * maxChange * 0.7f;
        }
       
        client.player.setYaw(newYaw);
        client.player.setPitch(newPitch);
    }
   
    private class AimGuiScreen extends Screen {
       
        private SliderWidget fovSlider;
        private SliderWidget rangeSlider;
        private SliderWidget speedSlider;
       
        protected AimGuiScreen() {
            super(Text.literal("Pupsik AimAssist Pro"));
        }
       
        @Override
        protected void init() {
            int buttonHeight = 20;
            int startX = this.width / 2 - 150;
            int startY = 30;
            int spacing = 24;
           
            fovSlider = new SliderWidget(startX, startY, 300, buttonHeight, Text.literal(""), 0.0) {
                @Override
                protected void updateMessage() {
                    this.setMessage(Text.literal("FOV: " + String.format("%.0f", aimFov) + "° (90-360)"));
                }
                @Override
                protected void applyValue() {
                    aimFov = 90.0f + (float) (this.value * 270.0);
                    if (aimFov < 90.0f) aimFov = 90.0f;
                    if (aimFov > 360.0f) aimFov = 360.0f;
                }
            };
            fovSlider.value = (aimFov - 90.0f) / 270.0;
            fovSlider.updateMessage();
            this.addDrawableChild(fovSlider);
           
            rangeSlider = new SliderWidget(startX, startY + spacing, 300, buttonHeight, Text.literal(""), 0.0) {
                @Override
                protected void updateMessage() {
                    this.setMessage(Text.literal("Range: " + String.format("%.0f", aimRange) + " blocks"));
                }
                @Override
                protected void applyValue() {
                    aimRange = (float) (this.value * 200.0 + 10.0);
                }
            };
            rangeSlider.value = (aimRange - 10.0f) / 200.0;
            rangeSlider.updateMessage();
            this.addDrawableChild(rangeSlider);
           
            speedSlider = new SliderWidget(startX, startY + spacing * 2, 300, buttonHeight, Text.literal(""), 0.0) {
                @Override
                protected void updateMessage() {
                    this.setMessage(Text.literal("Speed: " + String.format("%.1f", aimSpeed) + "/10"));
                }
                @Override
                protected void applyValue() {
                    aimSpeed = 1.0f + (float) (this.value * 9.0);
                    if (aimSpeed < 1.0f) aimSpeed = 1.0f;
                    if (aimSpeed > 10.0f) aimSpeed = 10.0f;
                }
            };
            speedSlider.value = (aimSpeed - 1.0f) / 9.0f;
            speedSlider.updateMessage();
            this.addDrawableChild(speedSlider);
           
            int toggleY = startY + spacing * 3;
           
            String aimPointText = aimPoint == 0 ? "HEAD" : (aimPoint == 1 ? "BODY" : "LEGS");
            this.addDrawableChild(ButtonWidget.builder(Text.literal("Aim Point: " + aimPointText), button -> {
                aimPoint = (aimPoint + 1) % 3;
                String newText = aimPoint == 0 ? "HEAD" : (aimPoint == 1 ? "BODY" : "LEGS");
                button.setMessage(Text.literal("Aim Point: " + newText));
            }).dimensions(startX, toggleY, 140, buttonHeight).build());
           
            this.addDrawableChild(ButtonWidget.builder(Text.literal("Through Walls: " + (throughWalls ? "ON" : "OFF")), button -> {
                throughWalls = !throughWalls;
                button.setMessage(Text.literal("Through Walls: " + (throughWalls ? "ON" : "OFF")));
            }).dimensions(startX + 150, toggleY, 150, buttonHeight).build());
           
            this.addDrawableChild(ButtonWidget.builder(Text.literal("Players: " + (players ? "ON" : "OFF")), button -> {
                players = !players;
                button.setMessage(Text.literal("Players: " + (players ? "ON" : "OFF")));
            }).dimensions(startX, toggleY + spacing, 90, buttonHeight).build());
           
            this.addDrawableChild(ButtonWidget.builder(Text.literal("Mobs: " + (mobs ? "ON" : "OFF")), button -> {
                mobs = !mobs;
                button.setMessage(Text.literal("Mobs: " + (mobs ? "ON" : "OFF")));
            }).dimensions(startX + 100, toggleY + spacing, 90, buttonHeight).build());
           
            this.addDrawableChild(ButtonWidget.builder(Text.literal("Animals: " + (animals ? "ON" : "OFF")), button -> {
                animals = !animals;
                button.setMessage(Text.literal("Animals: " + (animals ? "ON" : "OFF")));
            }).dimensions(startX + 200, toggleY + spacing, 100, buttonHeight).build());
           
            int bypassY = toggleY + spacing * 2;
           
            this.addDrawableChild(ButtonWidget.builder(Text.literal("Grim: " + (bypassGrim ? "✓" : "✗")), button -> {
                bypassGrim = !bypassGrim;
                button.setMessage(Text.literal("Grim: " + (bypassGrim ? "✓" : "✗")));
            }).dimensions(startX, bypassY, 70, buttonHeight).build());
           
            this.addDrawableChild(ButtonWidget.builder(Text.literal("Vulkan: " + (bypassVulkan ? "✓" : "✗")), button -> {
                bypassVulkan = !bypassVulkan;
                button.setMessage(Text.literal("Vulkan: " + (bypassVulkan ? "✓" : "✗")));
            }).dimensions(startX + 75, bypassY, 70, buttonHeight).build());
           
            this.addDrawableChild(ButtonWidget.builder(Text.literal("Matrix: " + (bypassMatrix ? "✓" : "✗")), button -> {
                bypassMatrix = !bypassMatrix;
                button.setMessage(Text.literal("Matrix: " + (bypassMatrix ? "✓" : "✗")));
            }).dimensions(startX + 150, bypassY, 70, buttonHeight).build());
           
            this.addDrawableChild(ButtonWidget.builder(Text.literal("Polar: " + (bypassPolar ? "✓" : "✗")), button -> {
                bypassPolar = !bypassPolar;
                button.setMessage(Text.literal("Polar: " + (bypassPolar ? "✓" : "✗")));
            }).dimensions(startX + 225, bypassY, 75, buttonHeight).build());
           
            this.addDrawableChild(ButtonWidget.builder(Text.literal("Sloth: " + (bypassSloth ? "✓" : "✗")), button -> {
                bypassSloth = !bypassSloth;
                button.setMessage(Text.literal("Sloth: " + (bypassSloth ? "✓" : "✗")));
            }).dimensions(startX, bypassY + spacing, 70, buttonHeight).build());
           
            this.addDrawableChild(ButtonWidget.builder(Text.literal("Close"), button -> {
                this.close();
            }).dimensions(this.width / 2 - 50, this.height - 35, 100, buttonHeight).build());
        }
       
        @Override
        public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
            this.renderBackground(matrices);
            drawCenteredText(matrices, this.textRenderer, "Pupsik AimAssist Pro", this.width / 2, 10, 0xFFAA33);
            drawCenteredText(matrices, this.textRenderer, "Speed 1-10 | FOV 90-360", this.width / 2, this.height - 58, 0x888888);
            super.render(matrices, mouseX, mouseY, delta);
        }
       
        @Override
        public boolean shouldCloseOnEsc() {
            return true;
        }
    }
}
наводка в тиках :roflanPominki:
 
Назад
Сверху Снизу