Исходник Trails | похожее на катлаван | сделанно для пастеров!

Начинающий
Статус
Оффлайн
Регистрация
28 Ноя 2024
Сообщения
3
Реакции[?]
0
Поинты[?]
0

Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:

  • бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
  • маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
  • приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
  • обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.

Спасибо!

ss -
Пожалуйста, авторизуйтесь для просмотра ссылки.





trails:
package hilz.orbita.modules.impl.render;

import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.vector.Vector3d;
import hilz.orbita.modules.Function;
import hilz.orbita.modules.FunctionAnnotation;
import hilz.orbita.modules.settings.imp.SliderSetting;
import hilz.orbita.util.IMinecraft;
import hilz.orbita.util.math.MathUtil;
import hilz.orbita.util.render.ProjectionUtils;
import hilz.orbita.util.render.RenderUtil;
import hilz.orbita.util.world.WorldUtil;
import org.joml.Vector2d;
import hilz.orbita.events.Event;
import hilz.orbita.events.impl.player.EventMotion;
import hilz.orbita.events.impl.render.EventRender;
import hilz.orbita.modules.Type;
import hilz.orbita.util.render.ColorUtil;
import hilz.orbita.util.render.animation.AnimationMath;
import net.minecraft.entity.Entity;

import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

@FunctionAnnotation(name = "Trails 2", type = Type.Render)
public class Snow extends Function {

    private SliderSetting maxPoints = new SliderSetting("Сила", 20, 10, 200, 50);

    public Snow() {
        this.addSettings(maxPoints);
    }

    CopyOnWriteArrayList<Snow.Point> points = new CopyOnWriteArrayList<>();

    [USER=1367676]@override[/USER]
    public void onEvent(final Event event) {
        if (IMinecraft.mc.world == null || IMinecraft.mc.player == null) return;

        if (event instanceof EventMotion e) {
            Vector3d previousPos = new Vector3d(IMinecraft.mc.player.prevPosX, IMinecraft.mc.player.prevPosY, IMinecraft.mc.player.prevPosZ);
            Vector3d currentPos = new Vector3d(IMinecraft.mc.player.getPosX(), IMinecraft.mc.player.getPosY(), IMinecraft.mc.player.getPosZ());

            if (!previousPos.equals(currentPos)) {
                if (IMinecraft.mc.player.ticksExisted % 6 == 0) {
                    createPoints(currentPos);
                }
            }
        }

        if (event instanceof EventRender e) {
            // Ensure the list does not exceed the max points limit
            while (points.size() > maxPoints.getValue().floatValue()) {
                points.remove(0);
            }

            for (Snow.Point point : points) {
                Vector2d pos = ProjectionUtils.project(point.position.x, point.position.y, point.position.z);

                if (pos != null) {
                    point.update();

                    // Transparency animation
                    float alpha = AnimationMath.fast(0, 1, (System.currentTimeMillis() - point.createdTime) / 10000.0f); // Transparency from 0 to 1 over 10 seconds
                    RenderUtil.Render2D.drawImage(new ResourceLocation("orbita/images/star.png"), (float) pos.x, (float) pos.y, 15, 15, ColorUtil.getColorStyle(points.indexOf(point)));
                }
            }
        }
    }

    private void createPoints(Vector3d position) {
        int numberOfStars = 20;

        for (int i = 0; i < numberOfStars; i++) {
            Vector3d randomizedPosition = new Vector3d(
                    position.x + MathUtil.randomizeFloat(-0.5f, 0.5f),
                    position.y + MathUtil.randomizeFloat(0.0f, 2.0f),
                    position.z + MathUtil.randomizeFloat(-0.5f, 0.5f)
            );
            points.add(new Point(randomizedPosition));
        }
    }

    public final class Point {
        public Vector3d position;
        public Vector3d motion;
        public Vector3d animatedMotion;

        public float size;

        public long createdTime = System.currentTimeMillis();
        public boolean isFixed = false;

        public Point(Vector3d position) {
            this.position = new Vector3d(position.x, position.y, position.z);
            this.motion = new Vector3d(MathUtil.randomizeFloat(-0.01f, 0.01f), MathUtil.randomizeFloat(-0.05f, 0.05f), MathUtil.randomizeFloat(-0.01f, 0.01f));
            this.animatedMotion = new Vector3d(0, 0, 0);
            size = MathUtil.randomizeFloat(7, 7);
        }

        public void update() {
            // Gravity effect
            motion.y -= 0.005;

            // Apply friction
            motion.x *= 0.99;
            motion.z *= 0.99;

            // Random deviations
            motion.x += MathUtil.randomizeFloat(-0.001f, 0.001f);
            motion.z += MathUtil.randomizeFloat(-0.001f, 0.001f);

            // Collision handling
            if (handleCollisions()) {
                motion.y *= -0.7; // Bounce effect
                motion.x *= 0.8;  // Apply friction
                motion.z *= 0.8;
            }

            // Update animated motion with smooth interpolation
            animatedMotion.x = AnimationMath.fast((float) animatedMotion.x, (float) motion.x, 10);
            animatedMotion.y = AnimationMath.fast((float) animatedMotion.y, (float) motion.y, 10);
            animatedMotion.z = AnimationMath.fast((float) animatedMotion.z, (float) motion.z, 10);

            // Update position
            position = position.add(animatedMotion);
        }

        boolean handleCollisions() {
            Vector3d checkPosition = this.position.add(animatedMotion);
            AxisAlignedBB aabb = new AxisAlignedBB(checkPosition.x - 0.1, checkPosition.y - 0.1, checkPosition.z - 0.1, checkPosition.x + 0.1, checkPosition.y + 0.1, checkPosition.z + 0.1);

            // Check collision with blocks
            boolean collidedWithBlock = WorldUtil.TotemUtil.getSphere(new BlockPos(checkPosition), 1, 2, false, true, 0)
                    .stream()
                    .anyMatch(blockPos -> !IMinecraft.mc.world.getBlockState(blockPos).isAir() &&
                            aabb.intersects(new AxisAlignedBB(blockPos)));

            // Check collision with entities
            List<Entity> entities = IMinecraft.mc.world.getEntitiesWithinAABBExcludingEntity(null, aabb);
            boolean collidedWithEntity = entities.stream().anyMatch(entity -> entity.getBoundingBox().intersects(aabb));

            return collidedWithBlock || collidedWithEntity;
        }
    }
}
 
aka wqzxqz
Read Only
Статус
Онлайн
Регистрация
24 Ноя 2024
Сообщения
268
Реакции[?]
4
Поинты[?]
4K
ss -
Пожалуйста, авторизуйтесь для просмотра ссылки.





trails:
package hilz.orbita.modules.impl.render;

import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.vector.Vector3d;
import hilz.orbita.modules.Function;
import hilz.orbita.modules.FunctionAnnotation;
import hilz.orbita.modules.settings.imp.SliderSetting;
import hilz.orbita.util.IMinecraft;
import hilz.orbita.util.math.MathUtil;
import hilz.orbita.util.render.ProjectionUtils;
import hilz.orbita.util.render.RenderUtil;
import hilz.orbita.util.world.WorldUtil;
import org.joml.Vector2d;
import hilz.orbita.events.Event;
import hilz.orbita.events.impl.player.EventMotion;
import hilz.orbita.events.impl.render.EventRender;
import hilz.orbita.modules.Type;
import hilz.orbita.util.render.ColorUtil;
import hilz.orbita.util.render.animation.AnimationMath;
import net.minecraft.entity.Entity;

import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

@FunctionAnnotation(name = "Trails 2", type = Type.Render)
public class Snow extends Function {

    private SliderSetting maxPoints = new SliderSetting("Сила", 20, 10, 200, 50);

    public Snow() {
        this.addSettings(maxPoints);
    }

    CopyOnWriteArrayList<Snow.Point> points = new CopyOnWriteArrayList<>();

    [USER=1367676]@override[/USER]
    public void onEvent(final Event event) {
        if (IMinecraft.mc.world == null || IMinecraft.mc.player == null) return;

        if (event instanceof EventMotion e) {
            Vector3d previousPos = new Vector3d(IMinecraft.mc.player.prevPosX, IMinecraft.mc.player.prevPosY, IMinecraft.mc.player.prevPosZ);
            Vector3d currentPos = new Vector3d(IMinecraft.mc.player.getPosX(), IMinecraft.mc.player.getPosY(), IMinecraft.mc.player.getPosZ());

            if (!previousPos.equals(currentPos)) {
                if (IMinecraft.mc.player.ticksExisted % 6 == 0) {
                    createPoints(currentPos);
                }
            }
        }

        if (event instanceof EventRender e) {
            // Ensure the list does not exceed the max points limit
            while (points.size() > maxPoints.getValue().floatValue()) {
                points.remove(0);
            }

            for (Snow.Point point : points) {
                Vector2d pos = ProjectionUtils.project(point.position.x, point.position.y, point.position.z);

                if (pos != null) {
                    point.update();

                    // Transparency animation
                    float alpha = AnimationMath.fast(0, 1, (System.currentTimeMillis() - point.createdTime) / 10000.0f); // Transparency from 0 to 1 over 10 seconds
                    RenderUtil.Render2D.drawImage(new ResourceLocation("orbita/images/star.png"), (float) pos.x, (float) pos.y, 15, 15, ColorUtil.getColorStyle(points.indexOf(point)));
                }
            }
        }
    }

    private void createPoints(Vector3d position) {
        int numberOfStars = 20;

        for (int i = 0; i < numberOfStars; i++) {
            Vector3d randomizedPosition = new Vector3d(
                    position.x + MathUtil.randomizeFloat(-0.5f, 0.5f),
                    position.y + MathUtil.randomizeFloat(0.0f, 2.0f),
                    position.z + MathUtil.randomizeFloat(-0.5f, 0.5f)
            );
            points.add(new Point(randomizedPosition));
        }
    }

    public final class Point {
        public Vector3d position;
        public Vector3d motion;
        public Vector3d animatedMotion;

        public float size;

        public long createdTime = System.currentTimeMillis();
        public boolean isFixed = false;

        public Point(Vector3d position) {
            this.position = new Vector3d(position.x, position.y, position.z);
            this.motion = new Vector3d(MathUtil.randomizeFloat(-0.01f, 0.01f), MathUtil.randomizeFloat(-0.05f, 0.05f), MathUtil.randomizeFloat(-0.01f, 0.01f));
            this.animatedMotion = new Vector3d(0, 0, 0);
            size = MathUtil.randomizeFloat(7, 7);
        }

        public void update() {
            // Gravity effect
            motion.y -= 0.005;

            // Apply friction
            motion.x *= 0.99;
            motion.z *= 0.99;

            // Random deviations
            motion.x += MathUtil.randomizeFloat(-0.001f, 0.001f);
            motion.z += MathUtil.randomizeFloat(-0.001f, 0.001f);

            // Collision handling
            if (handleCollisions()) {
                motion.y *= -0.7; // Bounce effect
                motion.x *= 0.8;  // Apply friction
                motion.z *= 0.8;
            }

            // Update animated motion with smooth interpolation
            animatedMotion.x = AnimationMath.fast((float) animatedMotion.x, (float) motion.x, 10);
            animatedMotion.y = AnimationMath.fast((float) animatedMotion.y, (float) motion.y, 10);
            animatedMotion.z = AnimationMath.fast((float) animatedMotion.z, (float) motion.z, 10);

            // Update position
            position = position.add(animatedMotion);
        }

        boolean handleCollisions() {
            Vector3d checkPosition = this.position.add(animatedMotion);
            AxisAlignedBB aabb = new AxisAlignedBB(checkPosition.x - 0.1, checkPosition.y - 0.1, checkPosition.z - 0.1, checkPosition.x + 0.1, checkPosition.y + 0.1, checkPosition.z + 0.1);

            // Check collision with blocks
            boolean collidedWithBlock = WorldUtil.TotemUtil.getSphere(new BlockPos(checkPosition), 1, 2, false, true, 0)
                    .stream()
                    .anyMatch(blockPos -> !IMinecraft.mc.world.getBlockState(blockPos).isAir() &&
                            aabb.intersects(new AxisAlignedBB(blockPos)));

            // Check collision with entities
            List<Entity> entities = IMinecraft.mc.world.getEntitiesWithinAABBExcludingEntity(null, aabb);
            boolean collidedWithEntity = entities.stream().anyMatch(entity -> entity.getBoundingBox().intersects(aabb));

            return collidedWithBlock || collidedWithEntity;
        }
    }
}
ss 200+ mb, xd
/del
 
Начинающий
Статус
Оффлайн
Регистрация
16 Апр 2024
Сообщения
307
Реакции[?]
3
Поинты[?]
1K
ss -
Пожалуйста, авторизуйтесь для просмотра ссылки.





trails:
package hilz.orbita.modules.impl.render;

import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.vector.Vector3d;
import hilz.orbita.modules.Function;
import hilz.orbita.modules.FunctionAnnotation;
import hilz.orbita.modules.settings.imp.SliderSetting;
import hilz.orbita.util.IMinecraft;
import hilz.orbita.util.math.MathUtil;
import hilz.orbita.util.render.ProjectionUtils;
import hilz.orbita.util.render.RenderUtil;
import hilz.orbita.util.world.WorldUtil;
import org.joml.Vector2d;
import hilz.orbita.events.Event;
import hilz.orbita.events.impl.player.EventMotion;
import hilz.orbita.events.impl.render.EventRender;
import hilz.orbita.modules.Type;
import hilz.orbita.util.render.ColorUtil;
import hilz.orbita.util.render.animation.AnimationMath;
import net.minecraft.entity.Entity;

import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

@FunctionAnnotation(name = "Trails 2", type = Type.Render)
public class Snow extends Function {

    private SliderSetting maxPoints = new SliderSetting("Сила", 20, 10, 200, 50);

    public Snow() {
        this.addSettings(maxPoints);
    }

    CopyOnWriteArrayList<Snow.Point> points = new CopyOnWriteArrayList<>();

    [USER=1367676]@override[/USER]
    public void onEvent(final Event event) {
        if (IMinecraft.mc.world == null || IMinecraft.mc.player == null) return;

        if (event instanceof EventMotion e) {
            Vector3d previousPos = new Vector3d(IMinecraft.mc.player.prevPosX, IMinecraft.mc.player.prevPosY, IMinecraft.mc.player.prevPosZ);
            Vector3d currentPos = new Vector3d(IMinecraft.mc.player.getPosX(), IMinecraft.mc.player.getPosY(), IMinecraft.mc.player.getPosZ());

            if (!previousPos.equals(currentPos)) {
                if (IMinecraft.mc.player.ticksExisted % 6 == 0) {
                    createPoints(currentPos);
                }
            }
        }

        if (event instanceof EventRender e) {
            // Ensure the list does not exceed the max points limit
            while (points.size() > maxPoints.getValue().floatValue()) {
                points.remove(0);
            }

            for (Snow.Point point : points) {
                Vector2d pos = ProjectionUtils.project(point.position.x, point.position.y, point.position.z);

                if (pos != null) {
                    point.update();

                    // Transparency animation
                    float alpha = AnimationMath.fast(0, 1, (System.currentTimeMillis() - point.createdTime) / 10000.0f); // Transparency from 0 to 1 over 10 seconds
                    RenderUtil.Render2D.drawImage(new ResourceLocation("orbita/images/star.png"), (float) pos.x, (float) pos.y, 15, 15, ColorUtil.getColorStyle(points.indexOf(point)));
                }
            }
        }
    }

    private void createPoints(Vector3d position) {
        int numberOfStars = 20;

        for (int i = 0; i < numberOfStars; i++) {
            Vector3d randomizedPosition = new Vector3d(
                    position.x + MathUtil.randomizeFloat(-0.5f, 0.5f),
                    position.y + MathUtil.randomizeFloat(0.0f, 2.0f),
                    position.z + MathUtil.randomizeFloat(-0.5f, 0.5f)
            );
            points.add(new Point(randomizedPosition));
        }
    }

    public final class Point {
        public Vector3d position;
        public Vector3d motion;
        public Vector3d animatedMotion;

        public float size;

        public long createdTime = System.currentTimeMillis();
        public boolean isFixed = false;

        public Point(Vector3d position) {
            this.position = new Vector3d(position.x, position.y, position.z);
            this.motion = new Vector3d(MathUtil.randomizeFloat(-0.01f, 0.01f), MathUtil.randomizeFloat(-0.05f, 0.05f), MathUtil.randomizeFloat(-0.01f, 0.01f));
            this.animatedMotion = new Vector3d(0, 0, 0);
            size = MathUtil.randomizeFloat(7, 7);
        }

        public void update() {
            // Gravity effect
            motion.y -= 0.005;

            // Apply friction
            motion.x *= 0.99;
            motion.z *= 0.99;

            // Random deviations
            motion.x += MathUtil.randomizeFloat(-0.001f, 0.001f);
            motion.z += MathUtil.randomizeFloat(-0.001f, 0.001f);

            // Collision handling
            if (handleCollisions()) {
                motion.y *= -0.7; // Bounce effect
                motion.x *= 0.8;  // Apply friction
                motion.z *= 0.8;
            }

            // Update animated motion with smooth interpolation
            animatedMotion.x = AnimationMath.fast((float) animatedMotion.x, (float) motion.x, 10);
            animatedMotion.y = AnimationMath.fast((float) animatedMotion.y, (float) motion.y, 10);
            animatedMotion.z = AnimationMath.fast((float) animatedMotion.z, (float) motion.z, 10);

            // Update position
            position = position.add(animatedMotion);
        }

        boolean handleCollisions() {
            Vector3d checkPosition = this.position.add(animatedMotion);
            AxisAlignedBB aabb = new AxisAlignedBB(checkPosition.x - 0.1, checkPosition.y - 0.1, checkPosition.z - 0.1, checkPosition.x + 0.1, checkPosition.y + 0.1, checkPosition.z + 0.1);

            // Check collision with blocks
            boolean collidedWithBlock = WorldUtil.TotemUtil.getSphere(new BlockPos(checkPosition), 1, 2, false, true, 0)
                    .stream()
                    .anyMatch(blockPos -> !IMinecraft.mc.world.getBlockState(blockPos).isAir() &&
                            aabb.intersects(new AxisAlignedBB(blockPos)));

            // Check collision with entities
            List<Entity> entities = IMinecraft.mc.world.getEntitiesWithinAABBExcludingEntity(null, aabb);
            boolean collidedWithEntity = entities.stream().anyMatch(entity -> entity.getBoundingBox().intersects(aabb));

            return collidedWithBlock || collidedWithEntity;
        }
    }
}
залить на ют - неее

залить файл на 200мб так еще и на дв - даа
 
Начинающий
Статус
Оффлайн
Регистрация
28 Ноя 2024
Сообщения
3
Реакции[?]
0
Поинты[?]
0
Начинающий
Статус
Оффлайн
Регистрация
8 Май 2023
Сообщения
457
Реакции[?]
5
Поинты[?]
6K
ss -
Пожалуйста, авторизуйтесь для просмотра ссылки.





trails:
package hilz.orbita.modules.impl.render;

import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.vector.Vector3d;
import hilz.orbita.modules.Function;
import hilz.orbita.modules.FunctionAnnotation;
import hilz.orbita.modules.settings.imp.SliderSetting;
import hilz.orbita.util.IMinecraft;
import hilz.orbita.util.math.MathUtil;
import hilz.orbita.util.render.ProjectionUtils;
import hilz.orbita.util.render.RenderUtil;
import hilz.orbita.util.world.WorldUtil;
import org.joml.Vector2d;
import hilz.orbita.events.Event;
import hilz.orbita.events.impl.player.EventMotion;
import hilz.orbita.events.impl.render.EventRender;
import hilz.orbita.modules.Type;
import hilz.orbita.util.render.ColorUtil;
import hilz.orbita.util.render.animation.AnimationMath;
import net.minecraft.entity.Entity;

import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

@FunctionAnnotation(name = "Trails 2", type = Type.Render)
public class Snow extends Function {

    private SliderSetting maxPoints = new SliderSetting("Сила", 20, 10, 200, 50);

    public Snow() {
        this.addSettings(maxPoints);
    }

    CopyOnWriteArrayList<Snow.Point> points = new CopyOnWriteArrayList<>();

    [USER=1367676]@override[/USER]
    public void onEvent(final Event event) {
        if (IMinecraft.mc.world == null || IMinecraft.mc.player == null) return;

        if (event instanceof EventMotion e) {
            Vector3d previousPos = new Vector3d(IMinecraft.mc.player.prevPosX, IMinecraft.mc.player.prevPosY, IMinecraft.mc.player.prevPosZ);
            Vector3d currentPos = new Vector3d(IMinecraft.mc.player.getPosX(), IMinecraft.mc.player.getPosY(), IMinecraft.mc.player.getPosZ());

            if (!previousPos.equals(currentPos)) {
                if (IMinecraft.mc.player.ticksExisted % 6 == 0) {
                    createPoints(currentPos);
                }
            }
        }

        if (event instanceof EventRender e) {
            // Ensure the list does not exceed the max points limit
            while (points.size() > maxPoints.getValue().floatValue()) {
                points.remove(0);
            }

            for (Snow.Point point : points) {
                Vector2d pos = ProjectionUtils.project(point.position.x, point.position.y, point.position.z);

                if (pos != null) {
                    point.update();

                    // Transparency animation
                    float alpha = AnimationMath.fast(0, 1, (System.currentTimeMillis() - point.createdTime) / 10000.0f); // Transparency from 0 to 1 over 10 seconds
                    RenderUtil.Render2D.drawImage(new ResourceLocation("orbita/images/star.png"), (float) pos.x, (float) pos.y, 15, 15, ColorUtil.getColorStyle(points.indexOf(point)));
                }
            }
        }
    }

    private void createPoints(Vector3d position) {
        int numberOfStars = 20;

        for (int i = 0; i < numberOfStars; i++) {
            Vector3d randomizedPosition = new Vector3d(
                    position.x + MathUtil.randomizeFloat(-0.5f, 0.5f),
                    position.y + MathUtil.randomizeFloat(0.0f, 2.0f),
                    position.z + MathUtil.randomizeFloat(-0.5f, 0.5f)
            );
            points.add(new Point(randomizedPosition));
        }
    }

    public final class Point {
        public Vector3d position;
        public Vector3d motion;
        public Vector3d animatedMotion;

        public float size;

        public long createdTime = System.currentTimeMillis();
        public boolean isFixed = false;

        public Point(Vector3d position) {
            this.position = new Vector3d(position.x, position.y, position.z);
            this.motion = new Vector3d(MathUtil.randomizeFloat(-0.01f, 0.01f), MathUtil.randomizeFloat(-0.05f, 0.05f), MathUtil.randomizeFloat(-0.01f, 0.01f));
            this.animatedMotion = new Vector3d(0, 0, 0);
            size = MathUtil.randomizeFloat(7, 7);
        }

        public void update() {
            // Gravity effect
            motion.y -= 0.005;

            // Apply friction
            motion.x *= 0.99;
            motion.z *= 0.99;

            // Random deviations
            motion.x += MathUtil.randomizeFloat(-0.001f, 0.001f);
            motion.z += MathUtil.randomizeFloat(-0.001f, 0.001f);

            // Collision handling
            if (handleCollisions()) {
                motion.y *= -0.7; // Bounce effect
                motion.x *= 0.8;  // Apply friction
                motion.z *= 0.8;
            }

            // Update animated motion with smooth interpolation
            animatedMotion.x = AnimationMath.fast((float) animatedMotion.x, (float) motion.x, 10);
            animatedMotion.y = AnimationMath.fast((float) animatedMotion.y, (float) motion.y, 10);
            animatedMotion.z = AnimationMath.fast((float) animatedMotion.z, (float) motion.z, 10);

            // Update position
            position = position.add(animatedMotion);
        }

        boolean handleCollisions() {
            Vector3d checkPosition = this.position.add(animatedMotion);
            AxisAlignedBB aabb = new AxisAlignedBB(checkPosition.x - 0.1, checkPosition.y - 0.1, checkPosition.z - 0.1, checkPosition.x + 0.1, checkPosition.y + 0.1, checkPosition.z + 0.1);

            // Check collision with blocks
            boolean collidedWithBlock = WorldUtil.TotemUtil.getSphere(new BlockPos(checkPosition), 1, 2, false, true, 0)
                    .stream()
                    .anyMatch(blockPos -> !IMinecraft.mc.world.getBlockState(blockPos).isAir() &&
                            aabb.intersects(new AxisAlignedBB(blockPos)));

            // Check collision with entities
            List<Entity> entities = IMinecraft.mc.world.getEntitiesWithinAABBExcludingEntity(null, aabb);
            boolean collidedWithEntity = entities.stream().anyMatch(entity -> entity.getBoundingBox().intersects(aabb));

            return collidedWithBlock || collidedWithEntity;
        }
    }
}
ебнутся чё с звуком, ты чё это в самолёте записывал?
 
Начинающий
Статус
Оффлайн
Регистрация
29 Май 2024
Сообщения
575
Реакции[?]
2
Поинты[?]
1K
ебнутся чё с звуком, ты чё это в самолёте записывал?
монтаж крутой(нет) зато
// Check collision with blocks
boolean collidedWithBlock = WorldUtil.TotemUtil.getSphere(new BlockPos(checkPosition), 1, 2, false, true, 0)

// Check collision with entities
List<Entity> entities = IMinecraft.mc.world.getEntitiesWithinAABBExcludingEntity(null, aabb);

}[/CODE]
ду ю спик инглишь бротхер
ебнутся чё с звуком, ты чё это в самолёте записывал?
он на орбите был какбы
 
Начинающий
Статус
Оффлайн
Регистрация
14 Дек 2022
Сообщения
54
Реакции[?]
1
Поинты[?]
1K
ss -
Пожалуйста, авторизуйтесь для просмотра ссылки.





trails:
package hilz.orbita.modules.impl.render;

import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.vector.Vector3d;
import hilz.orbita.modules.Function;
import hilz.orbita.modules.FunctionAnnotation;
import hilz.orbita.modules.settings.imp.SliderSetting;
import hilz.orbita.util.IMinecraft;
import hilz.orbita.util.math.MathUtil;
import hilz.orbita.util.render.ProjectionUtils;
import hilz.orbita.util.render.RenderUtil;
import hilz.orbita.util.world.WorldUtil;
import org.joml.Vector2d;
import hilz.orbita.events.Event;
import hilz.orbita.events.impl.player.EventMotion;
import hilz.orbita.events.impl.render.EventRender;
import hilz.orbita.modules.Type;
import hilz.orbita.util.render.ColorUtil;
import hilz.orbita.util.render.animation.AnimationMath;
import net.minecraft.entity.Entity;

import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

@FunctionAnnotation(name = "Trails 2", type = Type.Render)
public class Snow extends Function {

    private SliderSetting maxPoints = new SliderSetting("Сила", 20, 10, 200, 50);

    public Snow() {
        this.addSettings(maxPoints);
    }

    CopyOnWriteArrayList<Snow.Point> points = new CopyOnWriteArrayList<>();

    [USER=1367676]@override[/USER]
    public void onEvent(final Event event) {
        if (IMinecraft.mc.world == null || IMinecraft.mc.player == null) return;

        if (event instanceof EventMotion e) {
            Vector3d previousPos = new Vector3d(IMinecraft.mc.player.prevPosX, IMinecraft.mc.player.prevPosY, IMinecraft.mc.player.prevPosZ);
            Vector3d currentPos = new Vector3d(IMinecraft.mc.player.getPosX(), IMinecraft.mc.player.getPosY(), IMinecraft.mc.player.getPosZ());

            if (!previousPos.equals(currentPos)) {
                if (IMinecraft.mc.player.ticksExisted % 6 == 0) {
                    createPoints(currentPos);
                }
            }
        }

        if (event instanceof EventRender e) {
            // Ensure the list does not exceed the max points limit
            while (points.size() > maxPoints.getValue().floatValue()) {
                points.remove(0);
            }

            for (Snow.Point point : points) {
                Vector2d pos = ProjectionUtils.project(point.position.x, point.position.y, point.position.z);

                if (pos != null) {
                    point.update();

                    // Transparency animation
                    float alpha = AnimationMath.fast(0, 1, (System.currentTimeMillis() - point.createdTime) / 10000.0f); // Transparency from 0 to 1 over 10 seconds
                    RenderUtil.Render2D.drawImage(new ResourceLocation("orbita/images/star.png"), (float) pos.x, (float) pos.y, 15, 15, ColorUtil.getColorStyle(points.indexOf(point)));
                }
            }
        }
    }

    private void createPoints(Vector3d position) {
        int numberOfStars = 20;

        for (int i = 0; i < numberOfStars; i++) {
            Vector3d randomizedPosition = new Vector3d(
                    position.x + MathUtil.randomizeFloat(-0.5f, 0.5f),
                    position.y + MathUtil.randomizeFloat(0.0f, 2.0f),
                    position.z + MathUtil.randomizeFloat(-0.5f, 0.5f)
            );
            points.add(new Point(randomizedPosition));
        }
    }

    public final class Point {
        public Vector3d position;
        public Vector3d motion;
        public Vector3d animatedMotion;

        public float size;

        public long createdTime = System.currentTimeMillis();
        public boolean isFixed = false;

        public Point(Vector3d position) {
            this.position = new Vector3d(position.x, position.y, position.z);
            this.motion = new Vector3d(MathUtil.randomizeFloat(-0.01f, 0.01f), MathUtil.randomizeFloat(-0.05f, 0.05f), MathUtil.randomizeFloat(-0.01f, 0.01f));
            this.animatedMotion = new Vector3d(0, 0, 0);
            size = MathUtil.randomizeFloat(7, 7);
        }

        public void update() {
            // Gravity effect
            motion.y -= 0.005;

            // Apply friction
            motion.x *= 0.99;
            motion.z *= 0.99;

            // Random deviations
            motion.x += MathUtil.randomizeFloat(-0.001f, 0.001f);
            motion.z += MathUtil.randomizeFloat(-0.001f, 0.001f);

            // Collision handling
            if (handleCollisions()) {
                motion.y *= -0.7; // Bounce effect
                motion.x *= 0.8;  // Apply friction
                motion.z *= 0.8;
            }

            // Update animated motion with smooth interpolation
            animatedMotion.x = AnimationMath.fast((float) animatedMotion.x, (float) motion.x, 10);
            animatedMotion.y = AnimationMath.fast((float) animatedMotion.y, (float) motion.y, 10);
            animatedMotion.z = AnimationMath.fast((float) animatedMotion.z, (float) motion.z, 10);

            // Update position
            position = position.add(animatedMotion);
        }

        boolean handleCollisions() {
            Vector3d checkPosition = this.position.add(animatedMotion);
            AxisAlignedBB aabb = new AxisAlignedBB(checkPosition.x - 0.1, checkPosition.y - 0.1, checkPosition.z - 0.1, checkPosition.x + 0.1, checkPosition.y + 0.1, checkPosition.z + 0.1);

            // Check collision with blocks
            boolean collidedWithBlock = WorldUtil.TotemUtil.getSphere(new BlockPos(checkPosition), 1, 2, false, true, 0)
                    .stream()
                    .anyMatch(blockPos -> !IMinecraft.mc.world.getBlockState(blockPos).isAir() &&
                            aabb.intersects(new AxisAlignedBB(blockPos)));

            // Check collision with entities
            List<Entity> entities = IMinecraft.mc.world.getEntitiesWithinAABBExcludingEntity(null, aabb);
            boolean collidedWithEntity = entities.stream().anyMatch(entity -> entity.getBoundingBox().intersects(aabb));

            return collidedWithBlock || collidedWithEntity;
        }
    }
}
/del не пости больше нечего ужс
 
Начинающий
Статус
Онлайн
Регистрация
8 Сен 2024
Сообщения
107
Реакции[?]
0
Поинты[?]
0
ss -
Пожалуйста, авторизуйтесь для просмотра ссылки.





trails:
package hilz.orbita.modules.impl.render;

import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.vector.Vector3d;
import hilz.orbita.modules.Function;
import hilz.orbita.modules.FunctionAnnotation;
import hilz.orbita.modules.settings.imp.SliderSetting;
import hilz.orbita.util.IMinecraft;
import hilz.orbita.util.math.MathUtil;
import hilz.orbita.util.render.ProjectionUtils;
import hilz.orbita.util.render.RenderUtil;
import hilz.orbita.util.world.WorldUtil;
import org.joml.Vector2d;
import hilz.orbita.events.Event;
import hilz.orbita.events.impl.player.EventMotion;
import hilz.orbita.events.impl.render.EventRender;
import hilz.orbita.modules.Type;
import hilz.orbita.util.render.ColorUtil;
import hilz.orbita.util.render.animation.AnimationMath;
import net.minecraft.entity.Entity;

import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

@FunctionAnnotation(name = "Trails 2", type = Type.Render)
public class Snow extends Function {

    private SliderSetting maxPoints = new SliderSetting("Сила", 20, 10, 200, 50);

    public Snow() {
        this.addSettings(maxPoints);
    }

    CopyOnWriteArrayList<Snow.Point> points = new CopyOnWriteArrayList<>();

    [USER=1367676]@override[/USER]
    public void onEvent(final Event event) {
        if (IMinecraft.mc.world == null || IMinecraft.mc.player == null) return;

        if (event instanceof EventMotion e) {
            Vector3d previousPos = new Vector3d(IMinecraft.mc.player.prevPosX, IMinecraft.mc.player.prevPosY, IMinecraft.mc.player.prevPosZ);
            Vector3d currentPos = new Vector3d(IMinecraft.mc.player.getPosX(), IMinecraft.mc.player.getPosY(), IMinecraft.mc.player.getPosZ());

            if (!previousPos.equals(currentPos)) {
                if (IMinecraft.mc.player.ticksExisted % 6 == 0) {
                    createPoints(currentPos);
                }
            }
        }

        if (event instanceof EventRender e) {
            // Ensure the list does not exceed the max points limit
            while (points.size() > maxPoints.getValue().floatValue()) {
                points.remove(0);
            }

            for (Snow.Point point : points) {
                Vector2d pos = ProjectionUtils.project(point.position.x, point.position.y, point.position.z);

                if (pos != null) {
                    point.update();

                    // Transparency animation
                    float alpha = AnimationMath.fast(0, 1, (System.currentTimeMillis() - point.createdTime) / 10000.0f); // Transparency from 0 to 1 over 10 seconds
                    RenderUtil.Render2D.drawImage(new ResourceLocation("orbita/images/star.png"), (float) pos.x, (float) pos.y, 15, 15, ColorUtil.getColorStyle(points.indexOf(point)));
                }
            }
        }
    }

    private void createPoints(Vector3d position) {
        int numberOfStars = 20;

        for (int i = 0; i < numberOfStars; i++) {
            Vector3d randomizedPosition = new Vector3d(
                    position.x + MathUtil.randomizeFloat(-0.5f, 0.5f),
                    position.y + MathUtil.randomizeFloat(0.0f, 2.0f),
                    position.z + MathUtil.randomizeFloat(-0.5f, 0.5f)
            );
            points.add(new Point(randomizedPosition));
        }
    }

    public final class Point {
        public Vector3d position;
        public Vector3d motion;
        public Vector3d animatedMotion;

        public float size;

        public long createdTime = System.currentTimeMillis();
        public boolean isFixed = false;

        public Point(Vector3d position) {
            this.position = new Vector3d(position.x, position.y, position.z);
            this.motion = new Vector3d(MathUtil.randomizeFloat(-0.01f, 0.01f), MathUtil.randomizeFloat(-0.05f, 0.05f), MathUtil.randomizeFloat(-0.01f, 0.01f));
            this.animatedMotion = new Vector3d(0, 0, 0);
            size = MathUtil.randomizeFloat(7, 7);
        }

        public void update() {
            // Gravity effect
            motion.y -= 0.005;

            // Apply friction
            motion.x *= 0.99;
            motion.z *= 0.99;

            // Random deviations
            motion.x += MathUtil.randomizeFloat(-0.001f, 0.001f);
            motion.z += MathUtil.randomizeFloat(-0.001f, 0.001f);

            // Collision handling
            if (handleCollisions()) {
                motion.y *= -0.7; // Bounce effect
                motion.x *= 0.8;  // Apply friction
                motion.z *= 0.8;
            }

            // Update animated motion with smooth interpolation
            animatedMotion.x = AnimationMath.fast((float) animatedMotion.x, (float) motion.x, 10);
            animatedMotion.y = AnimationMath.fast((float) animatedMotion.y, (float) motion.y, 10);
            animatedMotion.z = AnimationMath.fast((float) animatedMotion.z, (float) motion.z, 10);

            // Update position
            position = position.add(animatedMotion);
        }

        boolean handleCollisions() {
            Vector3d checkPosition = this.position.add(animatedMotion);
            AxisAlignedBB aabb = new AxisAlignedBB(checkPosition.x - 0.1, checkPosition.y - 0.1, checkPosition.z - 0.1, checkPosition.x + 0.1, checkPosition.y + 0.1, checkPosition.z + 0.1);

            // Check collision with blocks
            boolean collidedWithBlock = WorldUtil.TotemUtil.getSphere(new BlockPos(checkPosition), 1, 2, false, true, 0)
                    .stream()
                    .anyMatch(blockPos -> !IMinecraft.mc.world.getBlockState(blockPos).isAir() &&
                            aabb.intersects(new AxisAlignedBB(blockPos)));

            // Check collision with entities
            List<Entity> entities = IMinecraft.mc.world.getEntitiesWithinAABBExcludingEntity(null, aabb);
            boolean collidedWithEntity = entities.stream().anyMatch(entity -> entity.getBoundingBox().intersects(aabb));

            return collidedWithBlock || collidedWithEntity;
        }
    }
}
дай утилку AnimationMath
 
Начинающий
Статус
Оффлайн
Регистрация
8 Авг 2024
Сообщения
429
Реакции[?]
3
Поинты[?]
4K
ss -
Пожалуйста, авторизуйтесь для просмотра ссылки.





trails:
package hilz.orbita.modules.impl.render;

import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.vector.Vector3d;
import hilz.orbita.modules.Function;
import hilz.orbita.modules.FunctionAnnotation;
import hilz.orbita.modules.settings.imp.SliderSetting;
import hilz.orbita.util.IMinecraft;
import hilz.orbita.util.math.MathUtil;
import hilz.orbita.util.render.ProjectionUtils;
import hilz.orbita.util.render.RenderUtil;
import hilz.orbita.util.world.WorldUtil;
import org.joml.Vector2d;
import hilz.orbita.events.Event;
import hilz.orbita.events.impl.player.EventMotion;
import hilz.orbita.events.impl.render.EventRender;
import hilz.orbita.modules.Type;
import hilz.orbita.util.render.ColorUtil;
import hilz.orbita.util.render.animation.AnimationMath;
import net.minecraft.entity.Entity;

import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

@FunctionAnnotation(name = "Trails 2", type = Type.Render)
public class Snow extends Function {

    private SliderSetting maxPoints = new SliderSetting("Сила", 20, 10, 200, 50);

    public Snow() {
        this.addSettings(maxPoints);
    }

    CopyOnWriteArrayList<Snow.Point> points = new CopyOnWriteArrayList<>();

    [USER=1367676]@override[/USER]
    public void onEvent(final Event event) {
        if (IMinecraft.mc.world == null || IMinecraft.mc.player == null) return;

        if (event instanceof EventMotion e) {
            Vector3d previousPos = new Vector3d(IMinecraft.mc.player.prevPosX, IMinecraft.mc.player.prevPosY, IMinecraft.mc.player.prevPosZ);
            Vector3d currentPos = new Vector3d(IMinecraft.mc.player.getPosX(), IMinecraft.mc.player.getPosY(), IMinecraft.mc.player.getPosZ());

            if (!previousPos.equals(currentPos)) {
                if (IMinecraft.mc.player.ticksExisted % 6 == 0) {
                    createPoints(currentPos);
                }
            }
        }

        if (event instanceof EventRender e) {
            // Ensure the list does not exceed the max points limit
            while (points.size() > maxPoints.getValue().floatValue()) {
                points.remove(0);
            }

            for (Snow.Point point : points) {
                Vector2d pos = ProjectionUtils.project(point.position.x, point.position.y, point.position.z);

                if (pos != null) {
                    point.update();

                    // Transparency animation
                    float alpha = AnimationMath.fast(0, 1, (System.currentTimeMillis() - point.createdTime) / 10000.0f); // Transparency from 0 to 1 over 10 seconds
                    RenderUtil.Render2D.drawImage(new ResourceLocation("orbita/images/star.png"), (float) pos.x, (float) pos.y, 15, 15, ColorUtil.getColorStyle(points.indexOf(point)));
                }
            }
        }
    }

    private void createPoints(Vector3d position) {
        int numberOfStars = 20;

        for (int i = 0; i < numberOfStars; i++) {
            Vector3d randomizedPosition = new Vector3d(
                    position.x + MathUtil.randomizeFloat(-0.5f, 0.5f),
                    position.y + MathUtil.randomizeFloat(0.0f, 2.0f),
                    position.z + MathUtil.randomizeFloat(-0.5f, 0.5f)
            );
            points.add(new Point(randomizedPosition));
        }
    }

    public final class Point {
        public Vector3d position;
        public Vector3d motion;
        public Vector3d animatedMotion;

        public float size;

        public long createdTime = System.currentTimeMillis();
        public boolean isFixed = false;

        public Point(Vector3d position) {
            this.position = new Vector3d(position.x, position.y, position.z);
            this.motion = new Vector3d(MathUtil.randomizeFloat(-0.01f, 0.01f), MathUtil.randomizeFloat(-0.05f, 0.05f), MathUtil.randomizeFloat(-0.01f, 0.01f));
            this.animatedMotion = new Vector3d(0, 0, 0);
            size = MathUtil.randomizeFloat(7, 7);
        }

        public void update() {
            // Gravity effect
            motion.y -= 0.005;

            // Apply friction
            motion.x *= 0.99;
            motion.z *= 0.99;

            // Random deviations
            motion.x += MathUtil.randomizeFloat(-0.001f, 0.001f);
            motion.z += MathUtil.randomizeFloat(-0.001f, 0.001f);

            // Collision handling
            if (handleCollisions()) {
                motion.y *= -0.7; // Bounce effect
                motion.x *= 0.8;  // Apply friction
                motion.z *= 0.8;
            }

            // Update animated motion with smooth interpolation
            animatedMotion.x = AnimationMath.fast((float) animatedMotion.x, (float) motion.x, 10);
            animatedMotion.y = AnimationMath.fast((float) animatedMotion.y, (float) motion.y, 10);
            animatedMotion.z = AnimationMath.fast((float) animatedMotion.z, (float) motion.z, 10);

            // Update position
            position = position.add(animatedMotion);
        }

        boolean handleCollisions() {
            Vector3d checkPosition = this.position.add(animatedMotion);
            AxisAlignedBB aabb = new AxisAlignedBB(checkPosition.x - 0.1, checkPosition.y - 0.1, checkPosition.z - 0.1, checkPosition.x + 0.1, checkPosition.y + 0.1, checkPosition.z + 0.1);

            // Check collision with blocks
            boolean collidedWithBlock = WorldUtil.TotemUtil.getSphere(new BlockPos(checkPosition), 1, 2, false, true, 0)
                    .stream()
                    .anyMatch(blockPos -> !IMinecraft.mc.world.getBlockState(blockPos).isAir() &&
                            aabb.intersects(new AxisAlignedBB(blockPos)));

            // Check collision with entities
            List<Entity> entities = IMinecraft.mc.world.getEntitiesWithinAABBExcludingEntity(null, aabb);
            boolean collidedWithEntity = entities.stream().anyMatch(entity -> entity.getBoundingBox().intersects(aabb));

            return collidedWithBlock || collidedWithEntity;
        }
    }
}
Хуже катлавана ничего быть не может
 
Сверху Снизу