Вопрос Jumpcircles 1.21.1 mcp

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
2 Июн 2024
Сообщения
135
Реакции
1

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

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

Спасибо!

крч я их пытаюсь рендерить в 2D но получается такая вот хуйня
Пожалуйста, авторизуйтесь для просмотра ссылки.

как можно это исправить или как перенести в 3d измерение
Код:
Expand Collapse Copy
@ModuleAnnotation(name = "JumpCircle", type = CategoryUtil.Render)
public class JumpCircle extends Module {
    private final CopyOnWriteArrayList<Circle> circles = new CopyOnWriteArrayList<>();
    private final ResourceLocation circle = new ResourceLocation("minecraft", "enrgy/images/circle.png");
    @EventHandler
    public void onJump(EventPlayerJump jump) {
        long currentTime = System.currentTimeMillis();

        Vec3 playerPos = mc.player.position();
        Vec3 circlePos = new Vec3(playerPos.x, playerPos.y - 0.1, playerPos.z);
        circles.add(new Circle(circlePos));
    }

    @EventHandler
    public void onRender2D(RenderEvent2D e) {

        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();

        for (Circle c : circles) {
            if (System.currentTimeMillis() - c.time > 2000) {
                circles.remove(c);
                continue;
            }

            if (System.currentTimeMillis() - c.time > 1500 && !c.isBack) {
                c.animation.animate(0, 0.5, Easings.BACK_IN);
                c.isBack = true;
            }

            c.animation.update();
            float rad = (float) Mth.clamp(c.animation.getValue(), 0.1f, 1.0f);

            Vec3 pos = c.vector3d;
            Vector3d screenPos = Projection.project(pos.x, pos.y, pos.z);
            if (screenPos.z < 0.0 || screenPos.z > 1.0) {
                continue;
            }

            float screenRad = rad * 300.0f / (float) mc.getWindow().getGuiScale();
            float x = (float) screenPos.x - screenRad / 2;
            float y = (float) screenPos.y - screenRad / 2;


            DrawHelper.drawTexture(circle, e.getGuiGraphics().pose().last().pose(), x, y, screenRad, screenRad, StyleManager.getCurrentStyle().getFirstColor(),StyleManager.getCurrentStyle().getSecondaryColor());

        }

        RenderSystem.disableBlend();
    }
//запастил
    private static class Circle {
        private final Vec3 vector3d;
        private final long time;
        private final CircleAnim animation = new CircleAnim();
        private boolean isBack;

        public Circle(Vec3 vector3d) {
            this.vector3d = vector3d;
            this.time = System.currentTimeMillis();
            this.animation.animate(1, 0.5, Easings.BACK_OUT);

        }
    }
}
у гпт спрашивал он не ебет как это решать
 
Выглядит так будто ты пытаешься отрендерить биллборд партиклы а не квадрат в 3д мире
Найди способ как рендерят ESP кубовые хитбоксы вместо хитбокса рендери тупо квадрат со своей текстурой, да и всё в целом
 
Рендери через 3д евент а не 2д с проекцией
 
Рендери через 3д евент а не 2д с проекцией
Код:
Expand Collapse Copy
@EventHandler
    public void onRender3D(RenderEvent3D e) {
        PoseStack poseStack = e.getPoseStack();

        Vec3 camPos = mc.gameRenderer.getMainCamera().getPosition();

        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        RenderSystem.disableCull();
        RenderSystem.depthMask(false);

        for (Circle c : circles) {
            long elapsed = System.currentTimeMillis() - c.time;

            if (elapsed > 2000) {
                circles.remove(c);
                continue;
            }

            if (elapsed > 1500 && !c.isBack) {
                c.animation.animate(0, 0.5, Easings.BACK_IN);
                c.isBack = true;
            }

            c.animation.update();

            Vec3 pos = c.vector3d;

            poseStack.pushPose();
            poseStack.translate(pos.x - camPos.x, pos.y - camPos.y, pos.z - camPos.z);

            Camera camera = mc.gameRenderer.getMainCamera();
            poseStack.mulPose(Axis.YP.rotationDegrees(-camera.getYRot()));
            poseStack.mulPose(Axis.XP.rotationDegrees(camera.getXRot()));

            float size = (float) Mth.clamp(c.animation.getValue(), 0.1f, 1.0f) * 0.5f;

            DrawHelper.drawTexture3D(circle, poseStack.last().pose(), -size, -size, size, size, StyleManager.getCurrentStyle().getFirstColor(), StyleManager.getCurrentStyle().getSecondaryColor());

            poseStack.popPose();
        }

        RenderSystem.depthMask(true);
        RenderSystem.enableCull();
        RenderSystem.disableBlend();
    }
drawTexture3D:
Код:
Expand Collapse Copy
    public static void drawTexture3D(ResourceLocation texture, Matrix4f matrix, float x1, float y1, float x2, float y2, int color1, int color2) {
        RenderSystem.setShader(GameRenderer::getPositionTexColorShader);
        RenderSystem.setShaderTexture(0, texture);


        Tesselator tessellator = Tesselator.getInstance();
        BufferBuilder buffer = tessellator.getBuilder(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX_COLOR);

        buffer.vertex(matrix, x1, y1, 0).setUv(0, 1).setColor(color1);
        buffer.vertex(matrix, x1, y2, 0).setUv(0, 0).setColor(color1);
        buffer.vertex(matrix, x2, y2, 0).setUv(1, 0).setColor(color2);
        buffer.vertex(matrix, x2, y1, 0).setUv(1, 1).setColor(color2);
        BufferUploader.drawWithShader(buffer.end());
    }
баг со цветом пофиксил если что
вот через 3д но происходит вот такая вот хуйня
Пожалуйста, авторизуйтесь для просмотра ссылки.
 
drawTexture3D:
Код:
Expand Collapse Copy
    public static void drawTexture3D(ResourceLocation texture, Matrix4f matrix, float x1, float y1, float x2, float y2, int color1, int color2) {
        RenderSystem.setShader(GameRenderer::getPositionTexColorShader);
        RenderSystem.setShaderTexture(0, texture);


        Tesselator tessellator = Tesselator.getInstance();
        BufferBuilder buffer = tessellator.getBuilder(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX_COLOR);

        buffer.vertex(matrix, x1, y1, 0).setUv(0, 1).setColor(color1);
        buffer.vertex(matrix, x1, y2, 0).setUv(0, 0).setColor(color1);
        buffer.vertex(matrix, x2, y2, 0).setUv(1, 0).setColor(color2);
        buffer.vertex(matrix, x2, y1, 0).setUv(1, 1).setColor(color2);
        BufferUploader.drawWithShader(buffer.end());
    }
баг со цветом пофиксил если что
вот через 3д но происходит вот такая вот хуйня
Пожалуйста, авторизуйтесь для просмотра ссылки.
А на кой хер ты Y указываешь как ненулевое, если тебе нужно что-бы оно лежало на XZ плоскости?
Код:
Expand Collapse Copy
buffer.vertex(matrix, xMin, 0f, zMin).setUv(0f, 0f).setColor(color1);
buffer.vertex(matrix, xMin, 0f, zMax).setUv(0f, 1f).setColor(color1);
buffer.vertex(matrix, xMax, 0f, zMax).setUv(1f, 1f).setColor(color2);
buffer.vertex(matrix, xMax, 0f, zMin).setUv(1f, 0f).setColor(color2);

Дальше ставишь ModelMatrix на CameraPos - CirclePos и рисуешь без поворота матрицы (если тебе конечно не нужен биллборд который постоянно повёрнут к камере)
 
А на кой хер ты Y указываешь как ненулевое, если тебе нужно что-бы оно лежало на XZ плоскости?
Код:
Expand Collapse Copy
buffer.vertex(matrix, xMin, 0f, zMin).setUv(0f, 0f).setColor(color1);
buffer.vertex(matrix, xMin, 0f, zMax).setUv(0f, 1f).setColor(color1);
buffer.vertex(matrix, xMax, 0f, zMax).setUv(1f, 1f).setColor(color2);
buffer.vertex(matrix, xMax, 0f, zMin).setUv(1f, 0f).setColor(color2);

Дальше ставишь ModelMatrix на CameraPos - CirclePos и рисуешь без поворота матрицы (если тебе конечно не нужен биллборд который постоянно повёрнут к камере)
вроде бы я сделал что ты написал но все равно он хер пойми как движется

Код:
Expand Collapse Copy
  @EventHandler
    public void onRender3D(RenderEvent3D e) {
        PoseStack poseStack = e.getPoseStack();
        Vec3 camPos = mc.gameRenderer.getMainCamera().getPosition();

        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        RenderSystem.disableCull();
        RenderSystem.depthMask(false);

        for (Circle c : circles) {
            long elapsed = System.currentTimeMillis() - c.time;

            if (elapsed > 2000) {
                circles.remove(c);
                continue;
            }

            if (elapsed > 1500 && !c.isBack) {
                c.animation.animate(0, 0.5, Easings.BACK_IN);
                c.isBack = true;
            }

            c.animation.update();

            Vec3 pos = c.vector3d;

            poseStack.pushPose();
            poseStack.translate(pos.x - camPos.x, pos.y - camPos.y, pos.z - camPos.z);

            float size = (float) Mth.clamp(c.animation.getValue(), 0.1f, 1.0f) * 0.7f;

            DrawHelper.drawTexture3D(circle, poseStack.last().pose(), -size, -size, size, size,
                    StyleManager.getCurrentStyle().getFirstColor(),
                    StyleManager.getCurrentStyle().getSecondaryColor());

            poseStack.popPose();
        }

        RenderSystem.depthMask(true);
        RenderSystem.enableCull();
        RenderSystem.disableBlend();
    }

Код:
Expand Collapse Copy
    public static void drawTexture3D(ResourceLocation texture, Matrix4f matrix, float x1, float z1, float x2, float z2, int color1, int color2) {
            RenderSystem.setShader(GameRenderer::getPositionTexColorShader);
            RenderSystem.setShaderTexture(0, texture);

            BufferBuilder buffer = Tesselator.getInstance().getBuilder(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX_COLOR);

            buffer.vertex(matrix, x1, 0f, z1).setUv(0f, 0f).setColor(color1);
            buffer.vertex(matrix, x1, 0f, z2).setUv(0f, 1f).setColor(color1);
            buffer.vertex(matrix, x2, 0f, z2).setUv(1f, 1f).setColor(color2);
            buffer.vertex(matrix, x2, 0f, z1).setUv(1f, 0f).setColor(color2);

            BufferUploader.drawWithShader(buffer.end());
    }
Пожалуйста, авторизуйтесь для просмотра ссылки.
 
оставляй всё как есть угарно выглядит
 
вроде бы я сделал что ты написал но все равно он хер пойми как движется

Код:
Expand Collapse Copy
  @EventHandler
    public void onRender3D(RenderEvent3D e) {
        PoseStack poseStack = e.getPoseStack();
        Vec3 camPos = mc.gameRenderer.getMainCamera().getPosition();

        RenderSystem.enableBlend();
        RenderSystem.defaultBlendFunc();
        RenderSystem.disableCull();
        RenderSystem.depthMask(false);

        for (Circle c : circles) {
            long elapsed = System.currentTimeMillis() - c.time;

            if (elapsed > 2000) {
                circles.remove(c);
                continue;
            }

            if (elapsed > 1500 && !c.isBack) {
                c.animation.animate(0, 0.5, Easings.BACK_IN);
                c.isBack = true;
            }

            c.animation.update();

            Vec3 pos = c.vector3d;

            poseStack.pushPose();
            poseStack.translate(pos.x - camPos.x, pos.y - camPos.y, pos.z - camPos.z);

            float size = (float) Mth.clamp(c.animation.getValue(), 0.1f, 1.0f) * 0.7f;

            DrawHelper.drawTexture3D(circle, poseStack.last().pose(), -size, -size, size, size,
                    StyleManager.getCurrentStyle().getFirstColor(),
                    StyleManager.getCurrentStyle().getSecondaryColor());

            poseStack.popPose();
        }

        RenderSystem.depthMask(true);
        RenderSystem.enableCull();
        RenderSystem.disableBlend();
    }

Код:
Expand Collapse Copy
    public static void drawTexture3D(ResourceLocation texture, Matrix4f matrix, float x1, float z1, float x2, float z2, int color1, int color2) {
            RenderSystem.setShader(GameRenderer::getPositionTexColorShader);
            RenderSystem.setShaderTexture(0, texture);

            BufferBuilder buffer = Tesselator.getInstance().getBuilder(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX_COLOR);

            buffer.vertex(matrix, x1, 0f, z1).setUv(0f, 0f).setColor(color1);
            buffer.vertex(matrix, x1, 0f, z2).setUv(0f, 1f).setColor(color1);
            buffer.vertex(matrix, x2, 0f, z2).setUv(1f, 1f).setColor(color2);
            buffer.vertex(matrix, x2, 0f, z1).setUv(1f, 0f).setColor(color2);

            BufferUploader.drawWithShader(buffer.end());
    }
Пожалуйста, авторизуйтесь для просмотра ссылки.
Супер странная хуйня, оно выглядит будто в ортографии рендерится
Если подвигаться по XZ оно не улетает вперед назад?
 
Супер странная хуйня, оно выглядит будто в ортографии рендерится
Если подвигаться по XZ оно не улетает вперед назад?
я прибавил к + 10 к x и z и они улетели в ебеня то есть их даже не видно как бы ты камеру не крутил. если что я эвент 3д вызываю в GameRender а именно в методе renderLevel
RenderSystem.getModelViewStack().popMatrix();
Matrix4f matrix4f42 = new Matrix4f();
RenderSystem.getModelViewStack().pushMatrix().mul(matrix4f42);
matrix4f42.rotate(Axis.XP.rotationDegrees(camera2.getXRot()));
matrix4f42.rotate(Axis.YP.rotationDegrees(camera2.getYRot() + 180.0f));
RenderSystem.applyModelViewMatrix();


RenderEvent3D renderEvent3D = new RenderEvent3D();
renderEvent3D.setPoseStack(posestack);
renderEvent3D.setPartialTicks(camera.getPartialTickTime());

renderEvent3D.setMatrix4f(matrix4f42);
EventManager.call(renderEvent3D);

RenderSystem.getModelViewStack().popMatrix();
RenderSystem.applyModelViewMatrix();
 
Назад
Сверху Снизу