Исходник CS 2 | nixware skid | от SXDpandora | 3.1

Начинающий
Статус
Оффлайн
Регистрация
1 Дек 2020
Сообщения
50
Реакции[?]
1
Поинты[?]
1K
Код:
package dF.Wirent.functions.impl.render;

import com.google.common.eventbus.Subscribe;
import dF.Wirent.events.EventDisplay;
import dF.Wirent.functions.api.Category;
import dF.Wirent.functions.api.Function;
import dF.Wirent.functions.api.FunctionRegister;
import dF.Wirent.functions.settings.impl.ModeSetting;
import dF.Wirent.utils.client.IMinecraft;
import dF.Wirent.utils.math.MathUtil;
import dF.Wirent.utils.projections.ProjectionUtil;
import dF.Wirent.utils.render.ColorUtils;
import dF.Wirent.utils.render.DisplayUtils;
import java.util.concurrent.CopyOnWriteArrayList;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.vector.Vector2f;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.block.BlockState;

@FunctionRegister(name="RainbowRadiusTrails", type=Category.Render)
public class RainbowRadiusTrails extends Function {
    private final ModeSetting setting = new ModeSetting("SXDpandora", "по доброте", "в дс отпишите если идеи будут"); //sxdpandora дс
    private final CopyOnWriteArrayList<Particle> particles = new CopyOnWriteArrayList<>();
    private final int maxParticles = 30;
    private final int circleRadius = 3;

    /* public RainbowRadiusTrails() {
        this.addSettings(this.setting);
    } */

    @Subscribe
    private void onDisplay(EventDisplay e) {
        if (Minecraft.player == null || Minecraft.world == null || e.getType() != EventDisplay.Type.PRE) {
            return;
        }

        if (this.particles.isEmpty()) {
            for (int i = 0; i < maxParticles; i++) {
                this.particles.add(new Particle(i, maxParticles));
            }
        }

        for (Particle p : this.particles) {
            p.updatePosition();
            p.Sigmadampopechenyeslispizdishhuesosebanniyidisampihizhivotnoe();
            p.smoothMove();
            Vector2f pos = ProjectionUtil.project(p.currentPos.x, p.currentPos.y, p.currentPos.z);

            switch ((String)this.setting.get()) {
                case "Радужный круг": {
                    int color = ColorUtils.getColor(1);
                    //DisplayUtils.drawCircle(pos.x, pos.y, 5.0f, color);
                    DisplayUtils.drawStyledRect(pos.x - 2, pos.y - 3, 5, 5, 6);
                    break;
                }
            }
        }
    }

    @Override
    public void onDisable() {
        this.particles.clear();
        super.onDisable();
    }

    /* @Override
    protected float[] rotations(PlayerEntity var1) {
        return new float[0];
    } */ //мои сломанные сурсы, ничего важного

    private class Particle {
        private Vector3d currentPos;
        private Vector3d targetPos;
        private Vector3d velocity = Vector3d.ZERO;
        private final int index;
        private final int totalParticles;
        private float hue;
        private long collisionTime = -1L;

        public Particle(int index, int totalParticles) {
            this.index = index;
            this.totalParticles = totalParticles;
            this.hue = (float) index / totalParticles;
            updatePosition();
            this.currentPos = this.targetPos;
        }

        public void updatePosition() {
            double angle = 2 * Math.PI * index / totalParticles;
            Vector3d playerPos = Minecraft.player.getPositionVec();
            double xOffset = circleRadius * Math.cos(angle);
            double zOffset = circleRadius * Math.sin(angle);
            this.targetPos = playerPos.add(xOffset, 0, zOffset);
        }

        public void smoothMove() {
            this.currentPos = MathUtil.fast(this.currentPos, this.targetPos, 10.1f);
        }

        private void Sigmadampopechenyeslispizdishhuesosebanniyidisampihizhivotnoe() {
            if (this.collisionTime != -1L) {
                long timeSinceCollision = System.currentTimeMillis() - this.collisionTime;
                this.hue = Math.max(0.0f, 1.0f - (float) timeSinceCollision / 3000.0f);
            }

            this.velocity = this.velocity.add(0.0, -8.0E-4, 0.0);
            Vector3d newPos = this.currentPos.add(this.velocity);
            BlockPos particlePos = new BlockPos(newPos);
            BlockState blockState = Minecraft.world.getBlockState(particlePos);

            boolean collidedX = !Minecraft.world.getBlockState(new BlockPos(this.currentPos.x + this.velocity.x, this.currentPos.y, this.currentPos.z)).isAir();
            boolean collidedY = !Minecraft.world.getBlockState(new BlockPos(this.currentPos.x, this.currentPos.y + this.velocity.y, this.currentPos.z)).isAir();
            boolean collidedZ = !Minecraft.world.getBlockState(new BlockPos(this.currentPos.x, this.currentPos.y, this.currentPos.z + this.velocity.z)).isAir();

            if (!blockState.isAir()) {
                if (this.collisionTime == -1L) {
                    this.collisionTime = System.currentTimeMillis();
                }
                if (collidedX) {
                    this.velocity = new Vector3d(-this.velocity.x * 0.5, this.velocity.y * 0.8, this.velocity.z * 0.8);
                    this.currentPos = this.currentPos.add(-Math.signum(this.velocity.x) * 0.05, 0, 0);
                }
                if (collidedY && this.velocity.y < 0) {
                    this.velocity = new Vector3d(this.velocity.x * 0.8, 0, this.velocity.z * 0.8);
                    this.currentPos = this.currentPos.add(0, -Math.signum(this.velocity.y) * 0.05, 0);
                }
                if (collidedZ) {
                    this.velocity = new Vector3d(this.velocity.x * 0.8, this.velocity.y * 0.8, -this.velocity.z * 0.5);
                    this.currentPos = this.currentPos.add(0, 0, -Math.signum(this.velocity.z) * 0.05);
                }
            } else {
                this.currentPos = newPos;
            }
            this.velocity = this.velocity.scale(0.95);
            BlockPos currentBlockPos = new BlockPos(this.currentPos);
            if (Minecraft.world.getBlockState(currentBlockPos).isSolid()) {
                Vector3d playerPos = Minecraft.player.getPositionVec();
                Vector3d directionToCenter = playerPos.subtract(this.currentPos).normalize();

                this.currentPos = this.currentPos.add(directionToCenter.scale(0.05));
                //this.velocity = directionToCenter.scale(-0.025);
            }
        }

        public void update() {
            this.hue += 0.01f;
            if (this.hue > 1.0f) {
                this.hue = 0.0f;
            }
        }
    }
}
 

Вложения

Последнее редактирование:
Начинающий
Статус
Оффлайн
Регистрация
26 Авг 2024
Сообщения
235
Реакции[?]
0
Поинты[?]
1K
Код:
package dF.Wirent.functions.impl.render;

import com.google.common.eventbus.Subscribe;
import dF.Wirent.events.EventDisplay;
import dF.Wirent.functions.api.Category;
import dF.Wirent.functions.api.Function;
import dF.Wirent.functions.api.FunctionRegister;
import dF.Wirent.functions.settings.impl.ModeSetting;
import dF.Wirent.utils.client.IMinecraft;
import dF.Wirent.utils.math.MathUtil;
import dF.Wirent.utils.projections.ProjectionUtil;
import dF.Wirent.utils.render.ColorUtils;
import dF.Wirent.utils.render.DisplayUtils;
import java.util.concurrent.CopyOnWriteArrayList;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.vector.Vector2f;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.block.BlockState;

@FunctionRegister(name="RainbowRadiusTrails", type=Category.Render)
public class RainbowRadiusTrails extends Function {
    private final ModeSetting setting = new ModeSetting("SXDpandora", "по доброте", "в дс отпишите если идеи будут"); //sxdpandora дс
    private final CopyOnWriteArrayList<Particle> particles = new CopyOnWriteArrayList<>();
    private final int maxParticles = 30;
    private final int circleRadius = 3;

    /* public RainbowRadiusTrails() {
        this.addSettings(this.setting);
    } */

    @Subscribe
    private void onDisplay(EventDisplay e) {
        if (Minecraft.player == null || Minecraft.world == null || e.getType() != EventDisplay.Type.PRE) {
            return;
        }

        if (this.particles.isEmpty()) {
            for (int i = 0; i < maxParticles; i++) {
                this.particles.add(new Particle(i, maxParticles));
            }
        }

        for (Particle p : this.particles) {
            p.updatePosition();
            p.Sigmadampopechenyeslispizdishhuesosebanniyidisampihizhivotnoe();
            p.smoothMove();
            Vector2f pos = ProjectionUtil.project(p.currentPos.x, p.currentPos.y, p.currentPos.z);

            switch ((String)this.setting.get()) {
                case "Радужный круг": {
                    int color = ColorUtils.getColor(1);
                    //DisplayUtils.drawCircle(pos.x, pos.y, 5.0f, color);
                    DisplayUtils.drawStyledRect(pos.x - 2, pos.y - 3, 5, 5, 6);
                    break;
                }
            }
        }
    }

    @Override
    public void onDisable() {
        this.particles.clear();
        super.onDisable();
    }

    @Override
    protected float[] rotations(PlayerEntity var1) {
        return new float[0];
    }

    private class Particle {
        private Vector3d currentPos;
        private Vector3d targetPos;
        private Vector3d velocity = Vector3d.ZERO;
        private final int index;
        private final int totalParticles;
        private float hue;
        private long collisionTime = -1L;

        public Particle(int index, int totalParticles) {
            this.index = index;
            this.totalParticles = totalParticles;
            this.hue = (float) index / totalParticles;
            updatePosition();
            this.currentPos = this.targetPos;
        }

        public void updatePosition() {
            double angle = 2 * Math.PI * index / totalParticles;
            Vector3d playerPos = Minecraft.player.getPositionVec();
            double xOffset = circleRadius * Math.cos(angle);
            double zOffset = circleRadius * Math.sin(angle);
            this.targetPos = playerPos.add(xOffset, 0, zOffset);
        }

        public void smoothMove() {
            this.currentPos = MathUtil.fast(this.currentPos, this.targetPos, 10.1f);
        }

        private void Sigmadampopechenyeslispizdishhuesosebanniyidisampihizhivotnoe() {
            if (this.collisionTime != -1L) {
                long timeSinceCollision = System.currentTimeMillis() - this.collisionTime;
                this.hue = Math.max(0.0f, 1.0f - (float) timeSinceCollision / 3000.0f);
            }

            this.velocity = this.velocity.add(0.0, -8.0E-4, 0.0);
            Vector3d newPos = this.currentPos.add(this.velocity);
            BlockPos particlePos = new BlockPos(newPos);
            BlockState blockState = Minecraft.world.getBlockState(particlePos);

            boolean collidedX = !Minecraft.world.getBlockState(new BlockPos(this.currentPos.x + this.velocity.x, this.currentPos.y, this.currentPos.z)).isAir();
            boolean collidedY = !Minecraft.world.getBlockState(new BlockPos(this.currentPos.x, this.currentPos.y + this.velocity.y, this.currentPos.z)).isAir();
            boolean collidedZ = !Minecraft.world.getBlockState(new BlockPos(this.currentPos.x, this.currentPos.y, this.currentPos.z + this.velocity.z)).isAir();

            if (!blockState.isAir()) {
                if (this.collisionTime == -1L) {
                    this.collisionTime = System.currentTimeMillis();
                }
                if (collidedX) {
                    this.velocity = new Vector3d(-this.velocity.x * 0.5, this.velocity.y * 0.8, this.velocity.z * 0.8);
                    this.currentPos = this.currentPos.add(-Math.signum(this.velocity.x) * 0.05, 0, 0);
                }
                if (collidedY && this.velocity.y < 0) {
                    this.velocity = new Vector3d(this.velocity.x * 0.8, 0, this.velocity.z * 0.8);
                    this.currentPos = this.currentPos.add(0, -Math.signum(this.velocity.y) * 0.05, 0);
                }
                if (collidedZ) {
                    this.velocity = new Vector3d(this.velocity.x * 0.8, this.velocity.y * 0.8, -this.velocity.z * 0.5);
                    this.currentPos = this.currentPos.add(0, 0, -Math.signum(this.velocity.z) * 0.05);
                }
            } else {
                this.currentPos = newPos;
            }
            this.velocity = this.velocity.scale(0.95);
            BlockPos currentBlockPos = new BlockPos(this.currentPos);
            if (Minecraft.world.getBlockState(currentBlockPos).isSolid()) {
                Vector3d playerPos = Minecraft.player.getPositionVec();
                Vector3d directionToCenter = playerPos.subtract(this.currentPos).normalize();

                this.currentPos = this.currentPos.add(directionToCenter.scale(0.05));
                //this.velocity = directionToCenter.scale(-0.025);
            }
        }

        public void update() {
            this.hue += 0.01f;
            if (this.hue > 1.0f) {
                this.hue = 0.0f;
            }
        }
    }
}
спс
 
Начинающий
Статус
Оффлайн
Регистрация
1 Дек 2020
Сообщения
50
Реакции[?]
1
Поинты[?]
1K
Посмотреть вложение 285106
xd, чёта не то, помоги пожалуйста
замени на обычный рект
Посмотреть вложение 285106
xd, чёта не то, помоги пожалуйста
Код:
public static void drawStyledRect(float x, float y, float width, float height, float radius) {

DisplayUtils.drawShadow(x, y, width, height, 12, ColorUtils.setAlpha(HUD.getColor(0, 1.0F), 165), ColorUtils.setAlpha(HUD.getColor(90, 1.0F), 165), ColorUtils.setAlpha(HUD.getColor(180, 1.0F), 165), ColorUtils.setAlpha(HUD.getColor(270, 1.0F), 165)); // ColorUtils.setAlpha(ColorUtils.rgb(255,255,255),60)

Vector4i colors = new Vector4i(ColorUtils.setAlpha(HUD.getColor(0, 1.0F), 165), ColorUtils.setAlpha(HUD.getColor(90, 1.0F), 165), ColorUtils.setAlpha(HUD.getColor(180, 1.0F), 165), ColorUtils.setAlpha(HUD.getColor(270, 1.0F), 165));

Vector4i colors2 = new Vector4i(ColorUtils.rgba(0, 0, 0, 150), ColorUtils.rgba(0, 0, 0, 165), ColorUtils.rgba(0, 0, 0, 165), ColorUtils.rgba(0, 0, 0, 165));

DisplayUtils.drawRoundedRect(x, y, width, height, new Vector4f(radius, radius, radius, radius), colors);

}
вот это засунь в DisplayUtils
типо с Crtl по DisplayUtils и туда
Вы совсем ебанутые?
почему?
 
Начинающий
Статус
Оффлайн
Регистрация
9 Фев 2024
Сообщения
22
Реакции[?]
0
Поинты[?]
0
Код:
package dF.Wirent.functions.impl.render;

import com.google.common.eventbus.Subscribe;
import dF.Wirent.events.EventDisplay;
import dF.Wirent.functions.api.Category;
import dF.Wirent.functions.api.Function;
import dF.Wirent.functions.api.FunctionRegister;
import dF.Wirent.functions.settings.impl.ModeSetting;
import dF.Wirent.utils.client.IMinecraft;
import dF.Wirent.utils.math.MathUtil;
import dF.Wirent.utils.projections.ProjectionUtil;
import dF.Wirent.utils.render.ColorUtils;
import dF.Wirent.utils.render.DisplayUtils;
import java.util.concurrent.CopyOnWriteArrayList;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.vector.Vector2f;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.block.BlockState;

@FunctionRegister(name="RainbowRadiusTrails", type=Category.Render)
public class RainbowRadiusTrails extends Function {
    private final ModeSetting setting = new ModeSetting("SXDpandora", "по доброте", "в дс отпишите если идеи будут"); //sxdpandora дс
    private final CopyOnWriteArrayList<Particle> particles = new CopyOnWriteArrayList<>();
    private final int maxParticles = 30;
    private final int circleRadius = 3;

    /* public RainbowRadiusTrails() {
        this.addSettings(this.setting);
    } */

    @Subscribe
    private void onDisplay(EventDisplay e) {
        if (Minecraft.player == null || Minecraft.world == null || e.getType() != EventDisplay.Type.PRE) {
            return;
        }

        if (this.particles.isEmpty()) {
            for (int i = 0; i < maxParticles; i++) {
                this.particles.add(new Particle(i, maxParticles));
            }
        }

        for (Particle p : this.particles) {
            p.updatePosition();
            p.Sigmadampopechenyeslispizdishhuesosebanniyidisampihizhivotnoe();
            p.smoothMove();
            Vector2f pos = ProjectionUtil.project(p.currentPos.x, p.currentPos.y, p.currentPos.z);

            switch ((String)this.setting.get()) {
                case "Радужный круг": {
                    int color = ColorUtils.getColor(1);
                    //DisplayUtils.drawCircle(pos.x, pos.y, 5.0f, color);
                    DisplayUtils.drawStyledRect(pos.x - 2, pos.y - 3, 5, 5, 6);
                    break;
                }
            }
        }
    }

    @Override
    public void onDisable() {
        this.particles.clear();
        super.onDisable();
    }

    @Override
    protected float[] rotations(PlayerEntity var1) {
        return new float[0];
    }

    private class Particle {
        private Vector3d currentPos;
        private Vector3d targetPos;
        private Vector3d velocity = Vector3d.ZERO;
        private final int index;
        private final int totalParticles;
        private float hue;
        private long collisionTime = -1L;

        public Particle(int index, int totalParticles) {
            this.index = index;
            this.totalParticles = totalParticles;
            this.hue = (float) index / totalParticles;
            updatePosition();
            this.currentPos = this.targetPos;
        }

        public void updatePosition() {
            double angle = 2 * Math.PI * index / totalParticles;
            Vector3d playerPos = Minecraft.player.getPositionVec();
            double xOffset = circleRadius * Math.cos(angle);
            double zOffset = circleRadius * Math.sin(angle);
            this.targetPos = playerPos.add(xOffset, 0, zOffset);
        }

        public void smoothMove() {
            this.currentPos = MathUtil.fast(this.currentPos, this.targetPos, 10.1f);
        }

        private void Sigmadampopechenyeslispizdishhuesosebanniyidisampihizhivotnoe() {
            if (this.collisionTime != -1L) {
                long timeSinceCollision = System.currentTimeMillis() - this.collisionTime;
                this.hue = Math.max(0.0f, 1.0f - (float) timeSinceCollision / 3000.0f);
            }

            this.velocity = this.velocity.add(0.0, -8.0E-4, 0.0);
            Vector3d newPos = this.currentPos.add(this.velocity);
            BlockPos particlePos = new BlockPos(newPos);
            BlockState blockState = Minecraft.world.getBlockState(particlePos);

            boolean collidedX = !Minecraft.world.getBlockState(new BlockPos(this.currentPos.x + this.velocity.x, this.currentPos.y, this.currentPos.z)).isAir();
            boolean collidedY = !Minecraft.world.getBlockState(new BlockPos(this.currentPos.x, this.currentPos.y + this.velocity.y, this.currentPos.z)).isAir();
            boolean collidedZ = !Minecraft.world.getBlockState(new BlockPos(this.currentPos.x, this.currentPos.y, this.currentPos.z + this.velocity.z)).isAir();

            if (!blockState.isAir()) {
                if (this.collisionTime == -1L) {
                    this.collisionTime = System.currentTimeMillis();
                }
                if (collidedX) {
                    this.velocity = new Vector3d(-this.velocity.x * 0.5, this.velocity.y * 0.8, this.velocity.z * 0.8);
                    this.currentPos = this.currentPos.add(-Math.signum(this.velocity.x) * 0.05, 0, 0);
                }
                if (collidedY && this.velocity.y < 0) {
                    this.velocity = new Vector3d(this.velocity.x * 0.8, 0, this.velocity.z * 0.8);
                    this.currentPos = this.currentPos.add(0, -Math.signum(this.velocity.y) * 0.05, 0);
                }
                if (collidedZ) {
                    this.velocity = new Vector3d(this.velocity.x * 0.8, this.velocity.y * 0.8, -this.velocity.z * 0.5);
                    this.currentPos = this.currentPos.add(0, 0, -Math.signum(this.velocity.z) * 0.05);
                }
            } else {
                this.currentPos = newPos;
            }
            this.velocity = this.velocity.scale(0.95);
            BlockPos currentBlockPos = new BlockPos(this.currentPos);
            if (Minecraft.world.getBlockState(currentBlockPos).isSolid()) {
                Vector3d playerPos = Minecraft.player.getPositionVec();
                Vector3d directionToCenter = playerPos.subtract(this.currentPos).normalize();

                this.currentPos = this.currentPos.add(directionToCenter.scale(0.05));
                //this.velocity = directionToCenter.scale(-0.025);
            }
        }

        public void update() {
            this.hue += 0.01f;
            if (this.hue > 1.0f) {
                this.hue = 0.0f;
            }
        }
    }
}
нихуя не понял,я только понял что никсвар кс 2 скид, и все...
 
Начинающий
Статус
Оффлайн
Регистрация
1 Дек 2020
Сообщения
50
Реакции[?]
1
Поинты[?]
1K
по мне прикольно, конечно не дизайн ультра скид,но все равно подарок как то ценить надо
thank you :relaxed:
там сейчас drawStyledRect он неоновый, более лучше а в тёмном времени суток мне очень зашло протести потом)
 
Forge Api ;-;
Начинающий
Статус
Оффлайн
Регистрация
3 Май 2023
Сообщения
489
Реакции[?]
8
Поинты[?]
9K
Начинающий
Статус
Оффлайн
Регистрация
1 Дек 2020
Сообщения
50
Реакции[?]
1
Поинты[?]
1K
Анальные шарики чисто при ходьбе летают ну типо это пздц
1725718726058.pngчем они тебе не угодили, физика как в кс 2 есть, есть, по бокам есть? есть, снизу есть? есть сохраняют форму? да
так что не так, если у тебя даже воздушные шарики ассоциируются с анальными, то это не вина кода
если кто то сможет доработать логику, то скиньте в лс/дс или сюда
 
Начинающий
Статус
Оффлайн
Регистрация
19 Янв 2024
Сообщения
11
Реакции[?]
1
Поинты[?]
1K
замени на обычный рект

Код:
public static void drawStyledRect(float x, float y, float width, float height, float radius) {

DisplayUtils.drawShadow(x, y, width, height, 12, ColorUtils.setAlpha(HUD.getColor(0, 1.0F), 165), ColorUtils.setAlpha(HUD.getColor(90, 1.0F), 165), ColorUtils.setAlpha(HUD.getColor(180, 1.0F), 165), ColorUtils.setAlpha(HUD.getColor(270, 1.0F), 165)); // ColorUtils.setAlpha(ColorUtils.rgb(255,255,255),60)

Vector4i colors = new Vector4i(ColorUtils.setAlpha(HUD.getColor(0, 1.0F), 165), ColorUtils.setAlpha(HUD.getColor(90, 1.0F), 165), ColorUtils.setAlpha(HUD.getColor(180, 1.0F), 165), ColorUtils.setAlpha(HUD.getColor(270, 1.0F), 165));

Vector4i colors2 = new Vector4i(ColorUtils.rgba(0, 0, 0, 150), ColorUtils.rgba(0, 0, 0, 165), ColorUtils.rgba(0, 0, 0, 165), ColorUtils.rgba(0, 0, 0, 165));

DisplayUtils.drawRoundedRect(x, y, width, height, new Vector4f(radius, radius, radius, radius), colors);

}
вот это засунь в DisplayUtils
типо с Crtl по DisplayUtils и туда
1725728498766.png
добавил
1725728515827.png
импортнул
 
Сверху Снизу