Исходник FIshEsp 1.16.5 SlashWare Ready

Начинающий
Статус
Оффлайн
Регистрация
16 Июл 2023
Сообщения
101
Реакции[?]
5
Поинты[?]
5K
FishEsp:
package ru.java777.slashware.module.impl.Visual;

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.gui.AbstractGui;
import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.fish.CodEntity;
import net.minecraft.entity.passive.fish.PufferfishEntity;
import net.minecraft.entity.passive.fish.SalmonEntity;
import net.minecraft.entity.passive.fish.TropicalFishEntity;
import net.minecraft.util.StringUtils;
import ru.java777.slashware.SlashWare;
import ru.java777.slashware.event.EventTarget;
import ru.java777.slashware.event.render.EventRender;
import ru.java777.slashware.module.CategoryType;
import ru.java777.slashware.module.Module;
import ru.java777.slashware.module.ModuleAnnotation;
import ru.java777.slashware.ui.setting.impl.BooleanSetting;
import ru.java777.slashware.ui.setting.impl.ColorSetting;
import ru.java777.slashware.util.StencilUtil;
import ru.java777.slashware.util.font.Fonts;
import ru.java777.slashware.util.render.ClientUtil;
import ru.java777.slashware.util.render.ColorUtil;
import ru.java777.slashware.util.render.RenderUtil;

import java.awt.*;
import java.math.BigDecimal;
import java.math.RoundingMode;


@ModuleAnnotation(name = "FishESP", desc = "", type = CategoryType.Visuals)
public class FishESP extends Module {

    public static final BooleanSetting box = new BooleanSetting("Коробка", false);
    public static final BooleanSetting health = new BooleanSetting("Жизни", false);
    public static final BooleanSetting name = new BooleanSetting("Имя", false);

    public ColorSetting color = new ColorSetting("Цвет", new Color(255, 255, 255).getRGB());
    public MatrixStack stack = new MatrixStack();

    @EventTarget
    public void event(EventRender event) {
        if (event.isRender2D()) {
            if (SlashWare.getInstance().manager.getModule(FishESP.class).state) {

                for (Entity entity : mc.world.getEntities()) {
                    if (entity instanceof SalmonEntity || entity instanceof TropicalFishEntity || entity instanceof PufferfishEntity || entity instanceof CodEntity) {
                        double x = entity.lastTickPosX + (entity.getPosX() - entity.lastTickPosX) * mc.getRenderPartialTicks();
                        double y = entity.lastTickPosY + (entity.getPosY() - entity.lastTickPosY) * mc.getRenderPartialTicks();
                        double z = entity.lastTickPosZ + (entity.getPosZ() - entity.lastTickPosZ) * mc.getRenderPartialTicks();

                        double[] headVec = RenderUtil.project(x, y + entity.getHeight() + 0.2f, z);
                        double[] footVec = RenderUtil.project(x, y, z);

                        if (headVec != null && footVec != null) {
                            double headX = headVec[0];
                            double headY = headVec[1];
                            double footX = footVec[0];
                            double footY = footVec[1];
                            float dif = (float) Math.abs(footY - headY) / 4;

                            GlStateManager.pushMatrix();

                            if (headY > footY) {
                                float saved = (float) headY;
                                headY = footY;
                                footY = saved;
                            }
                            if (headX > footX) {
                                float saved = (float) headX;
                                headX = footX;
                                footX = saved;
                            }


                            if (box.get()) {
                                StencilUtil.initStencilToWrite();
                                AbstractGui.fill(stack.getLast().getMatrix(), (int) (headX - dif), (int) (headY + 1), (float) (footX + dif), (float) footY, ClientUtil.getClientColor().getRGB());
                                StencilUtil.readStencilBuffer(2);
                                AbstractGui.fill(stack.getLast().getMatrix(), (int) (headX - dif), (int) (headY + 1) - 1, (float) (footX + dif) + 1, (float) footY + 1, new Color(0, 0, 0, 128).getRGB());
                                AbstractGui.fill(stack.getLast().getMatrix(), (int) ((headX - dif) - 1), (int) (headY + 1) - 0.5f, (float) (footX + dif) + 1.5f, (float) footY + 1.5f, ClientUtil.getClientColor().getRGB());
                                StencilUtil.uninitStencilBuffer();

                            }
                            if (health.get()) {
                                RenderUtil.drawGradientRect((int) headX - dif - 4, (int) (headY + 1), (float) (headX) - dif - 3, (float) (headY + footY) / 2, ColorUtil.green.getRGB(), ColorUtil.orange.getRGB());
                                RenderUtil.drawGradientRect((int) headX - dif - 4, (int) (headY + footY) / 2, (float) (headX) - dif - 3, (float) footY, ColorUtil.orange.getRGB(), ColorUtil.red.getRGB());
                            }
                            if (name.get()) {
                                Fonts.MCR8.drawCenteredStringWithOutline(new MatrixStack(), StringUtils.stripControlCodes(entity.getName().getString()), footX, footY + 10, new Color(0, 0, 0).getRGB());
                            }
                            GlStateManager.popMatrix();
                        }
                    }
                }
            }
        }
    }

    public static double round(double num, double increment) {
        double v = (double) Math.round(num / increment) * increment;
        BigDecimal bd = new BigDecimal(v);
        bd = bd.setScale(2, RoundingMode.HALF_UP);
        return bd.doubleValue();
    }
}
Screenshot_2.png
 
Начинающий
Статус
Оффлайн
Регистрация
10 Фев 2023
Сообщения
330
Реакции[?]
0
Поинты[?]
1K
FishEsp:
package ru.java777.slashware.module.impl.Visual;

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.gui.AbstractGui;
import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.fish.CodEntity;
import net.minecraft.entity.passive.fish.PufferfishEntity;
import net.minecraft.entity.passive.fish.SalmonEntity;
import net.minecraft.entity.passive.fish.TropicalFishEntity;
import net.minecraft.util.StringUtils;
import ru.java777.slashware.SlashWare;
import ru.java777.slashware.event.EventTarget;
import ru.java777.slashware.event.render.EventRender;
import ru.java777.slashware.module.CategoryType;
import ru.java777.slashware.module.Module;
import ru.java777.slashware.module.ModuleAnnotation;
import ru.java777.slashware.ui.setting.impl.BooleanSetting;
import ru.java777.slashware.ui.setting.impl.ColorSetting;
import ru.java777.slashware.util.StencilUtil;
import ru.java777.slashware.util.font.Fonts;
import ru.java777.slashware.util.render.ClientUtil;
import ru.java777.slashware.util.render.ColorUtil;
import ru.java777.slashware.util.render.RenderUtil;

import java.awt.*;
import java.math.BigDecimal;
import java.math.RoundingMode;


@ModuleAnnotation(name = "FishESP", desc = "", type = CategoryType.Visuals)
public class FishESP extends Module {

    public static final BooleanSetting box = new BooleanSetting("Коробка", false);
    public static final BooleanSetting health = new BooleanSetting("Жизни", false);
    public static final BooleanSetting name = new BooleanSetting("Имя", false);

    public ColorSetting color = new ColorSetting("Цвет", new Color(255, 255, 255).getRGB());
    public MatrixStack stack = new MatrixStack();

    @EventTarget
    public void event(EventRender event) {
        if (event.isRender2D()) {
            if (SlashWare.getInstance().manager.getModule(FishESP.class).state) {

                for (Entity entity : mc.world.getEntities()) {
                    if (entity instanceof SalmonEntity || entity instanceof TropicalFishEntity || entity instanceof PufferfishEntity || entity instanceof CodEntity) {
                        double x = entity.lastTickPosX + (entity.getPosX() - entity.lastTickPosX) * mc.getRenderPartialTicks();
                        double y = entity.lastTickPosY + (entity.getPosY() - entity.lastTickPosY) * mc.getRenderPartialTicks();
                        double z = entity.lastTickPosZ + (entity.getPosZ() - entity.lastTickPosZ) * mc.getRenderPartialTicks();

                        double[] headVec = RenderUtil.project(x, y + entity.getHeight() + 0.2f, z);
                        double[] footVec = RenderUtil.project(x, y, z);

                        if (headVec != null && footVec != null) {
                            double headX = headVec[0];
                            double headY = headVec[1];
                            double footX = footVec[0];
                            double footY = footVec[1];
                            float dif = (float) Math.abs(footY - headY) / 4;

                            GlStateManager.pushMatrix();

                            if (headY > footY) {
                                float saved = (float) headY;
                                headY = footY;
                                footY = saved;
                            }
                            if (headX > footX) {
                                float saved = (float) headX;
                                headX = footX;
                                footX = saved;
                            }


                            if (box.get()) {
                                StencilUtil.initStencilToWrite();
                                AbstractGui.fill(stack.getLast().getMatrix(), (int) (headX - dif), (int) (headY + 1), (float) (footX + dif), (float) footY, ClientUtil.getClientColor().getRGB());
                                StencilUtil.readStencilBuffer(2);
                                AbstractGui.fill(stack.getLast().getMatrix(), (int) (headX - dif), (int) (headY + 1) - 1, (float) (footX + dif) + 1, (float) footY + 1, new Color(0, 0, 0, 128).getRGB());
                                AbstractGui.fill(stack.getLast().getMatrix(), (int) ((headX - dif) - 1), (int) (headY + 1) - 0.5f, (float) (footX + dif) + 1.5f, (float) footY + 1.5f, ClientUtil.getClientColor().getRGB());
                                StencilUtil.uninitStencilBuffer();

                            }
                            if (health.get()) {
                                RenderUtil.drawGradientRect((int) headX - dif - 4, (int) (headY + 1), (float) (headX) - dif - 3, (float) (headY + footY) / 2, ColorUtil.green.getRGB(), ColorUtil.orange.getRGB());
                                RenderUtil.drawGradientRect((int) headX - dif - 4, (int) (headY + footY) / 2, (float) (headX) - dif - 3, (float) footY, ColorUtil.orange.getRGB(), ColorUtil.red.getRGB());
                            }
                            if (name.get()) {
                                Fonts.MCR8.drawCenteredStringWithOutline(new MatrixStack(), StringUtils.stripControlCodes(entity.getName().getString()), footX, footY + 10, new Color(0, 0, 0).getRGB());
                            }
                            GlStateManager.popMatrix();
                        }
                    }
                }
            }
        }
    }

    public static double round(double num, double increment) {
        double v = (double) Math.round(num / increment) * increment;
        BigDecimal bd = new BigDecimal(v);
        bd = bd.setScale(2, RoundingMode.HALF_UP);
        return bd.doubleValue();
    }
}
Посмотреть вложение 283695
полезно....
 
Начинающий
Статус
Оффлайн
Регистрация
10 Май 2023
Сообщения
580
Реакции[?]
8
Поинты[?]
3K
FishEsp:
package ru.java777.slashware.module.impl.Visual;

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.gui.AbstractGui;
import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.fish.CodEntity;
import net.minecraft.entity.passive.fish.PufferfishEntity;
import net.minecraft.entity.passive.fish.SalmonEntity;
import net.minecraft.entity.passive.fish.TropicalFishEntity;
import net.minecraft.util.StringUtils;
import ru.java777.slashware.SlashWare;
import ru.java777.slashware.event.EventTarget;
import ru.java777.slashware.event.render.EventRender;
import ru.java777.slashware.module.CategoryType;
import ru.java777.slashware.module.Module;
import ru.java777.slashware.module.ModuleAnnotation;
import ru.java777.slashware.ui.setting.impl.BooleanSetting;
import ru.java777.slashware.ui.setting.impl.ColorSetting;
import ru.java777.slashware.util.StencilUtil;
import ru.java777.slashware.util.font.Fonts;
import ru.java777.slashware.util.render.ClientUtil;
import ru.java777.slashware.util.render.ColorUtil;
import ru.java777.slashware.util.render.RenderUtil;

import java.awt.*;
import java.math.BigDecimal;
import java.math.RoundingMode;


@ModuleAnnotation(name = "FishESP", desc = "", type = CategoryType.Visuals)
public class FishESP extends Module {

    public static final BooleanSetting box = new BooleanSetting("Коробка", false);
    public static final BooleanSetting health = new BooleanSetting("Жизни", false);
    public static final BooleanSetting name = new BooleanSetting("Имя", false);

    public ColorSetting color = new ColorSetting("Цвет", new Color(255, 255, 255).getRGB());
    public MatrixStack stack = new MatrixStack();

    @EventTarget
    public void event(EventRender event) {
        if (event.isRender2D()) {
            if (SlashWare.getInstance().manager.getModule(FishESP.class).state) {

                for (Entity entity : mc.world.getEntities()) {
                    if (entity instanceof SalmonEntity || entity instanceof TropicalFishEntity || entity instanceof PufferfishEntity || entity instanceof CodEntity) {
                        double x = entity.lastTickPosX + (entity.getPosX() - entity.lastTickPosX) * mc.getRenderPartialTicks();
                        double y = entity.lastTickPosY + (entity.getPosY() - entity.lastTickPosY) * mc.getRenderPartialTicks();
                        double z = entity.lastTickPosZ + (entity.getPosZ() - entity.lastTickPosZ) * mc.getRenderPartialTicks();

                        double[] headVec = RenderUtil.project(x, y + entity.getHeight() + 0.2f, z);
                        double[] footVec = RenderUtil.project(x, y, z);

                        if (headVec != null && footVec != null) {
                            double headX = headVec[0];
                            double headY = headVec[1];
                            double footX = footVec[0];
                            double footY = footVec[1];
                            float dif = (float) Math.abs(footY - headY) / 4;

                            GlStateManager.pushMatrix();

                            if (headY > footY) {
                                float saved = (float) headY;
                                headY = footY;
                                footY = saved;
                            }
                            if (headX > footX) {
                                float saved = (float) headX;
                                headX = footX;
                                footX = saved;
                            }


                            if (box.get()) {
                                StencilUtil.initStencilToWrite();
                                AbstractGui.fill(stack.getLast().getMatrix(), (int) (headX - dif), (int) (headY + 1), (float) (footX + dif), (float) footY, ClientUtil.getClientColor().getRGB());
                                StencilUtil.readStencilBuffer(2);
                                AbstractGui.fill(stack.getLast().getMatrix(), (int) (headX - dif), (int) (headY + 1) - 1, (float) (footX + dif) + 1, (float) footY + 1, new Color(0, 0, 0, 128).getRGB());
                                AbstractGui.fill(stack.getLast().getMatrix(), (int) ((headX - dif) - 1), (int) (headY + 1) - 0.5f, (float) (footX + dif) + 1.5f, (float) footY + 1.5f, ClientUtil.getClientColor().getRGB());
                                StencilUtil.uninitStencilBuffer();

                            }
                            if (health.get()) {
                                RenderUtil.drawGradientRect((int) headX - dif - 4, (int) (headY + 1), (float) (headX) - dif - 3, (float) (headY + footY) / 2, ColorUtil.green.getRGB(), ColorUtil.orange.getRGB());
                                RenderUtil.drawGradientRect((int) headX - dif - 4, (int) (headY + footY) / 2, (float) (headX) - dif - 3, (float) footY, ColorUtil.orange.getRGB(), ColorUtil.red.getRGB());
                            }
                            if (name.get()) {
                                Fonts.MCR8.drawCenteredStringWithOutline(new MatrixStack(), StringUtils.stripControlCodes(entity.getName().getString()), footX, footY + 10, new Color(0, 0, 0).getRGB());
                            }
                            GlStateManager.popMatrix();
                        }
                    }
                }
            }
        }
    }

    public static double round(double num, double increment) {
        double v = (double) Math.round(num / increment) * increment;
        BigDecimal bd = new BigDecimal(v);
        bd = bd.setScale(2, RoundingMode.HALF_UP);
        return bd.doubleValue();
    }
}
Посмотреть вложение 283695
Пожалуйста, авторизуйтесь для просмотра ссылки.
 
Сверху Снизу