Xray | Excellent

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
6 Авг 2024
Сообщения
104
Реакции
0
SS -
1727275436592.png


Код:
Expand Collapse Copy
package dev.excellent.client.module.impl.render;

import dev.excellent.api.event.impl.render.Render3DLastPostEvent;
import dev.excellent.api.interfaces.event.Listener;
import dev.excellent.client.module.api.Category;
import dev.excellent.client.module.api.Module;
import dev.excellent.client.module.api.ModuleInfo;
import dev.excellent.impl.util.render.RenderUtil;
import dev.excellent.impl.value.impl.BooleanValue;
import dev.excellent.impl.value.impl.ColorValue;
import dev.excellent.impl.value.impl.MultiBooleanValue;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.OreBlock;
import net.minecraft.util.math.BlockPos;
import net.mojang.blaze3d.matrix.MatrixStack;

import java.awt.*;

@ModuleInfo(name = "Xray", description = "Подсвечивает руды.", category = Category.MISC)
public class Xray extends Module {
    public final MultiBooleanValue ores = new MultiBooleanValue("Руды", this)
            .add(new BooleanValue("Алмазная руда", true),
                    new BooleanValue("Железная руда", true),
                    new BooleanValue("Золотая руда", true),
                    new BooleanValue("Древний обломок", true),
                    new BooleanValue("Лазуритовая руда", true),
                    new BooleanValue("Редстоуновая руда", true),
                    new BooleanValue("Угольная руда", true));

    private final ColorValue diamondColor = new ColorValue("Цвет Алмазной Руды", this, Color.white, () -> !ores.get("Алмазная руда").getValue());
    private final ColorValue ironColor = new ColorValue("Цвет Железной Руды", this, Color.white, () -> !ores.get("Железная руда").getValue());
    private final ColorValue goldColor = new ColorValue("Цвет Золотой Руды", this, Color.white, () -> !ores.get("Золотая руда").getValue());
    private final ColorValue ancientDebrisColor = new ColorValue("Цвет Древнего Обломка", this, Color.white, () -> !ores.get("Древний обломок").getValue());
    private final ColorValue lapisColor = new ColorValue("Цвет Лазуритовой Руды", this, Color.white, () -> !ores.get("Лазуритовая руда").getValue());
    private final ColorValue redstoneColor = new ColorValue("Цвет Редстоуновой Руды", this, Color.white, () -> !ores.get("Редстоуновая руда").getValue());
    private final ColorValue coalColor = new ColorValue("Цвет Угольной Руды", this, Color.white, () -> !ores.get("Угольная руда").getValue());

    private final Listener<Render3DLastPostEvent> onRender = event -> {
        MatrixStack matrixStack = event.getMatrix();
        BlockPos playerPos = mc.player.getPosition();

        for (int x = playerPos.getX() - 25; x <= playerPos.getX() + 25; x++) {
            for (int y = playerPos.getY() - 25; y <= playerPos.getY() + 25; y++) {
                for (int z = playerPos.getZ() - 25; z <= playerPos.getZ() + 25; z++) {
                    BlockPos pos = new BlockPos(x, y, z);
                    BlockState state = mc.world.getBlockState(pos);

                    if (state.getBlock() instanceof OreBlock) {
                        int color = getColor(state.getBlock());
                        if (color != -1) {
                            RenderUtil.Render3D.drawBlockBox(matrixStack, pos, color);
                        }
                    }
                }
            }
        }
    };

    private int getColor(Block block) {
        if (block == Blocks.DIAMOND_ORE && ores.get("Алмазная руда").getValue()) {
            return diamondColor.getValue().getRGB();
        }
        if (block == Blocks.IRON_ORE && ores.get("Железная руда").getValue()) {
            return ironColor.getValue().getRGB();
        }
        if (block == Blocks.GOLD_ORE && ores.get("Золотая руда").getValue()) {
            return goldColor.getValue().getRGB();
        }
        if (block == Blocks.ANCIENT_DEBRIS && ores.get("Древний обломок").getValue()) {
            return ancientDebrisColor.getValue().getRGB();
        }
        if (block == Blocks.LAPIS_ORE && ores.get("Лазуритовая руда").getValue()) {
            return lapisColor.getValue().getRGB();
        }
        if (block == Blocks.REDSTONE_ORE && ores.get("Редстоуновая руда").getValue()) {
            return redstoneColor.getValue().getRGB();
        }
        if (block == Blocks.COAL_ORE && ores.get("Угольная руда").getValue()) {
            return coalColor.getValue().getRGB();
        }
        return -1;
    }
}
 
SS - Посмотреть вложение 286454

Код:
Expand Collapse Copy
package dev.excellent.client.module.impl.render;

import dev.excellent.api.event.impl.render.Render3DLastPostEvent;
import dev.excellent.api.interfaces.event.Listener;
import dev.excellent.client.module.api.Category;
import dev.excellent.client.module.api.Module;
import dev.excellent.client.module.api.ModuleInfo;
import dev.excellent.impl.util.render.RenderUtil;
import dev.excellent.impl.value.impl.BooleanValue;
import dev.excellent.impl.value.impl.ColorValue;
import dev.excellent.impl.value.impl.MultiBooleanValue;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.OreBlock;
import net.minecraft.util.math.BlockPos;
import net.mojang.blaze3d.matrix.MatrixStack;

import java.awt.*;

@ModuleInfo(name = "Xray", description = "Подсвечивает руды.", category = Category.MISC)
public class Xray extends Module {
    public final MultiBooleanValue ores = new MultiBooleanValue("Руды", this)
            .add(new BooleanValue("Алмазная руда", true),
                    new BooleanValue("Железная руда", true),
                    new BooleanValue("Золотая руда", true),
                    new BooleanValue("Древний обломок", true),
                    new BooleanValue("Лазуритовая руда", true),
                    new BooleanValue("Редстоуновая руда", true),
                    new BooleanValue("Угольная руда", true));

    private final ColorValue diamondColor = new ColorValue("Цвет Алмазной Руды", this, Color.white, () -> !ores.get("Алмазная руда").getValue());
    private final ColorValue ironColor = new ColorValue("Цвет Железной Руды", this, Color.white, () -> !ores.get("Железная руда").getValue());
    private final ColorValue goldColor = new ColorValue("Цвет Золотой Руды", this, Color.white, () -> !ores.get("Золотая руда").getValue());
    private final ColorValue ancientDebrisColor = new ColorValue("Цвет Древнего Обломка", this, Color.white, () -> !ores.get("Древний обломок").getValue());
    private final ColorValue lapisColor = new ColorValue("Цвет Лазуритовой Руды", this, Color.white, () -> !ores.get("Лазуритовая руда").getValue());
    private final ColorValue redstoneColor = new ColorValue("Цвет Редстоуновой Руды", this, Color.white, () -> !ores.get("Редстоуновая руда").getValue());
    private final ColorValue coalColor = new ColorValue("Цвет Угольной Руды", this, Color.white, () -> !ores.get("Угольная руда").getValue());

    private final Listener<Render3DLastPostEvent> onRender = event -> {
        MatrixStack matrixStack = event.getMatrix();
        BlockPos playerPos = mc.player.getPosition();

        for (int x = playerPos.getX() - 25; x <= playerPos.getX() + 25; x++) {
            for (int y = playerPos.getY() - 25; y <= playerPos.getY() + 25; y++) {
                for (int z = playerPos.getZ() - 25; z <= playerPos.getZ() + 25; z++) {
                    BlockPos pos = new BlockPos(x, y, z);
                    BlockState state = mc.world.getBlockState(pos);

                    if (state.getBlock() instanceof OreBlock) {
                        int color = getColor(state.getBlock());
                        if (color != -1) {
                            RenderUtil.Render3D.drawBlockBox(matrixStack, pos, color);
                        }
                    }
                }
            }
        }
    };

    private int getColor(Block block) {
        if (block == Blocks.DIAMOND_ORE && ores.get("Алмазная руда").getValue()) {
            return diamondColor.getValue().getRGB();
        }
        if (block == Blocks.IRON_ORE && ores.get("Железная руда").getValue()) {
            return ironColor.getValue().getRGB();
        }
        if (block == Blocks.GOLD_ORE && ores.get("Золотая руда").getValue()) {
            return goldColor.getValue().getRGB();
        }
        if (block == Blocks.ANCIENT_DEBRIS && ores.get("Древний обломок").getValue()) {
            return ancientDebrisColor.getValue().getRGB();
        }
        if (block == Blocks.LAPIS_ORE && ores.get("Лазуритовая руда").getValue()) {
            return lapisColor.getValue().getRGB();
        }
        if (block == Blocks.REDSTONE_ORE && ores.get("Редстоуновая руда").getValue()) {
            return redstoneColor.getValue().getRGB();
        }
        if (block == Blocks.COAL_ORE && ores.get("Угольная руда").getValue()) {
            return coalColor.getValue().getRGB();
        }
        return -1;
    }
}
годно
 
SS - Посмотреть вложение 286454

Код:
Expand Collapse Copy
package dev.excellent.client.module.impl.render;

import dev.excellent.api.event.impl.render.Render3DLastPostEvent;
import dev.excellent.api.interfaces.event.Listener;
import dev.excellent.client.module.api.Category;
import dev.excellent.client.module.api.Module;
import dev.excellent.client.module.api.ModuleInfo;
import dev.excellent.impl.util.render.RenderUtil;
import dev.excellent.impl.value.impl.BooleanValue;
import dev.excellent.impl.value.impl.ColorValue;
import dev.excellent.impl.value.impl.MultiBooleanValue;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.OreBlock;
import net.minecraft.util.math.BlockPos;
import net.mojang.blaze3d.matrix.MatrixStack;

import java.awt.*;

@ModuleInfo(name = "Xray", description = "Подсвечивает руды.", category = Category.MISC)
public class Xray extends Module {
    public final MultiBooleanValue ores = new MultiBooleanValue("Руды", this)
            .add(new BooleanValue("Алмазная руда", true),
                    new BooleanValue("Железная руда", true),
                    new BooleanValue("Золотая руда", true),
                    new BooleanValue("Древний обломок", true),
                    new BooleanValue("Лазуритовая руда", true),
                    new BooleanValue("Редстоуновая руда", true),
                    new BooleanValue("Угольная руда", true));

    private final ColorValue diamondColor = new ColorValue("Цвет Алмазной Руды", this, Color.white, () -> !ores.get("Алмазная руда").getValue());
    private final ColorValue ironColor = new ColorValue("Цвет Железной Руды", this, Color.white, () -> !ores.get("Железная руда").getValue());
    private final ColorValue goldColor = new ColorValue("Цвет Золотой Руды", this, Color.white, () -> !ores.get("Золотая руда").getValue());
    private final ColorValue ancientDebrisColor = new ColorValue("Цвет Древнего Обломка", this, Color.white, () -> !ores.get("Древний обломок").getValue());
    private final ColorValue lapisColor = new ColorValue("Цвет Лазуритовой Руды", this, Color.white, () -> !ores.get("Лазуритовая руда").getValue());
    private final ColorValue redstoneColor = new ColorValue("Цвет Редстоуновой Руды", this, Color.white, () -> !ores.get("Редстоуновая руда").getValue());
    private final ColorValue coalColor = new ColorValue("Цвет Угольной Руды", this, Color.white, () -> !ores.get("Угольная руда").getValue());

    private final Listener<Render3DLastPostEvent> onRender = event -> {
        MatrixStack matrixStack = event.getMatrix();
        BlockPos playerPos = mc.player.getPosition();

        for (int x = playerPos.getX() - 25; x <= playerPos.getX() + 25; x++) {
            for (int y = playerPos.getY() - 25; y <= playerPos.getY() + 25; y++) {
                for (int z = playerPos.getZ() - 25; z <= playerPos.getZ() + 25; z++) {
                    BlockPos pos = new BlockPos(x, y, z);
                    BlockState state = mc.world.getBlockState(pos);

                    if (state.getBlock() instanceof OreBlock) {
                        int color = getColor(state.getBlock());
                        if (color != -1) {
                            RenderUtil.Render3D.drawBlockBox(matrixStack, pos, color);
                        }
                    }
                }
            }
        }
    };

    private int getColor(Block block) {
        if (block == Blocks.DIAMOND_ORE && ores.get("Алмазная руда").getValue()) {
            return diamondColor.getValue().getRGB();
        }
        if (block == Blocks.IRON_ORE && ores.get("Железная руда").getValue()) {
            return ironColor.getValue().getRGB();
        }
        if (block == Blocks.GOLD_ORE && ores.get("Золотая руда").getValue()) {
            return goldColor.getValue().getRGB();
        }
        if (block == Blocks.ANCIENT_DEBRIS && ores.get("Древний обломок").getValue()) {
            return ancientDebrisColor.getValue().getRGB();
        }
        if (block == Blocks.LAPIS_ORE && ores.get("Лазуритовая руда").getValue()) {
            return lapisColor.getValue().getRGB();
        }
        if (block == Blocks.REDSTONE_ORE && ores.get("Редстоуновая руда").getValue()) {
            return redstoneColor.getValue().getRGB();
        }
        if (block == Blocks.COAL_ORE && ores.get("Угольная руда").getValue()) {
            return coalColor.getValue().getRGB();
        }
        return -1;
    }
}
Я вчера сделал тоже и тут код 1 в 1 как у меня
 

Пожалуйста, зарегистрируйтесь или авторизуйтесь, чтобы увидеть содержимое.


На Exp 3.1 ?

Я просто сделал и он не находит блоки:
(Исправил)


Java:
Expand Collapse Copy
@FunctionRegister(name = "XRayFT", type = Category.Misc)
public class XRayFT extends Function {
    private final ModeListSetting blocks = new ModeListSetting("Руды",
            new BooleanSetting("Древние обломки", true),
            new BooleanSetting("Алмазная руда", true),
            new BooleanSetting("Золотая руда", true),
            new BooleanSetting("Железная руда", true),
            new BooleanSetting("Редстоуновая руда", true),
            new BooleanSetting("Угольная руда", true)
    );

    public XRayFT() {
        addSettings(blocks);
    }

    Minecraft mc = Minecraft.getInstance();

    @Subscribe
    private void onRender(EventDisplay eventDisplay) {
        if (mc.world == null || eventDisplay.getType() != EventDisplay.Type.POST) {
            return;
        }
        BlockPos playerPos = mc.player.getPosition();

        for (int x = playerPos.getX() - 25; x <= playerPos.getX() + 25; x++) {
            for (int y = playerPos.getY() - 25; y <= playerPos.getY() + 25; y++) {
                for (int z = playerPos.getZ() - 25; z <= playerPos.getZ() + 25; z++) {

                    BlockPos pos = new BlockPos(x, y, z);
                    BlockState state = mc.world.getBlockState(pos);

                    if (state.getBlock() == Blocks.ANCIENT_DEBRIS && blocks.getValueByName("Древние обломки").get()) {
                        int color = ColorUtils.rgba(105, 60, 12, 255);
                        RenderUtils.drawBlockBox(pos, color);
                    }
                    if (state.getBlock() == Blocks.DIAMOND_ORE && blocks.getValueByName("Алмазная руда").get()) {
                        int color = ColorUtils.rgba(77, 219, 255, 255);
                        RenderUtils.drawBlockBox(pos, color);
                    }
                    if (state.getBlock() == Blocks.GOLD_ORE && blocks.getValueByName("Золотая руда").get()) {
                        int color = ColorUtils.rgba(247, 255, 102, 255);
                        RenderUtils.drawBlockBox(pos, color);
                    }
                    if (state.getBlock() == Blocks.IRON_ORE && blocks.getValueByName("Железная руда").get()) {
                        int color = ColorUtils.rgba(122, 122, 122, 255);
                        RenderUtils.drawBlockBox(pos, color);
                    }
                    if (state.getBlock() == Blocks.REDSTONE_ORE && blocks.getValueByName("Редстоуновая руда").get()) {
                        int color = ColorUtils.rgba(255, 82, 82, 255);
                        RenderUtils.drawBlockBox(pos, color);
                    }
                    if (state.getBlock() == Blocks.COAL_ORE && blocks.getValueByName("Угольная руда").get()) {
                        int color = ColorUtils.rgba(12, 12, 12, 255);
                        RenderUtils.drawBlockBox(pos, color);
                    }
                }
            }
        }
    }
}
 
Сделайте hud под excellent буду благодарен и сосать готов
 
Скрытое содержимое
На Exp 3.1 ?

Я просто сделал и он не находит блоки:
(Исправил)


Java:
Expand Collapse Copy
@FunctionRegister(name = "XRayFT", type = Category.Misc)
public class XRayFT extends Function {
    private final ModeListSetting blocks = new ModeListSetting("Руды",
            new BooleanSetting("Древние обломки", true),
            new BooleanSetting("Алмазная руда", true),
            new BooleanSetting("Золотая руда", true),
            new BooleanSetting("Железная руда", true),
            new BooleanSetting("Редстоуновая руда", true),
            new BooleanSetting("Угольная руда", true)
    );

    public XRayFT() {
        addSettings(blocks);
    }

    Minecraft mc = Minecraft.getInstance();

    @Subscribe
    private void onRender(EventDisplay eventDisplay) {
        if (mc.world == null || eventDisplay.getType() != EventDisplay.Type.POST) {
            return;
        }
        BlockPos playerPos = mc.player.getPosition();

        for (int x = playerPos.getX() - 25; x <= playerPos.getX() + 25; x++) {
            for (int y = playerPos.getY() - 25; y <= playerPos.getY() + 25; y++) {
                for (int z = playerPos.getZ() - 25; z <= playerPos.getZ() + 25; z++) {

                    BlockPos pos = new BlockPos(x, y, z);
                    BlockState state = mc.world.getBlockState(pos);

                    if (state.getBlock() == Blocks.ANCIENT_DEBRIS && blocks.getValueByName("Древние обломки").get()) {
                        int color = ColorUtils.rgba(105, 60, 12, 255);
                        RenderUtils.drawBlockBox(pos, color);
                    }
                    if (state.getBlock() == Blocks.DIAMOND_ORE && blocks.getValueByName("Алмазная руда").get()) {
                        int color = ColorUtils.rgba(77, 219, 255, 255);
                        RenderUtils.drawBlockBox(pos, color);
                    }
                    if (state.getBlock() == Blocks.GOLD_ORE && blocks.getValueByName("Золотая руда").get()) {
                        int color = ColorUtils.rgba(247, 255, 102, 255);
                        RenderUtils.drawBlockBox(pos, color);
                    }
                    if (state.getBlock() == Blocks.IRON_ORE && blocks.getValueByName("Железная руда").get()) {
                        int color = ColorUtils.rgba(122, 122, 122, 255);
                        RenderUtils.drawBlockBox(pos, color);
                    }
                    if (state.getBlock() == Blocks.REDSTONE_ORE && blocks.getValueByName("Редстоуновая руда").get()) {
                        int color = ColorUtils.rgba(255, 82, 82, 255);
                        RenderUtils.drawBlockBox(pos, color);
                    }
                    if (state.getBlock() == Blocks.COAL_ORE && blocks.getValueByName("Угольная руда").get()) {
                        int color = ColorUtils.rgba(12, 12, 12, 255);
                        RenderUtils.drawBlockBox(pos, color);
                    }
                }
            }
        }
    }
}
Скажи пожалуйста как исправить?
 
неоптимизированный и неоч вкусный код
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
SS - Посмотреть вложение 286454

Код:
Expand Collapse Copy
package dev.excellent.client.module.impl.render;

import dev.excellent.api.event.impl.render.Render3DLastPostEvent;
import dev.excellent.api.interfaces.event.Listener;
import dev.excellent.client.module.api.Category;
import dev.excellent.client.module.api.Module;
import dev.excellent.client.module.api.ModuleInfo;
import dev.excellent.impl.util.render.RenderUtil;
import dev.excellent.impl.value.impl.BooleanValue;
import dev.excellent.impl.value.impl.ColorValue;
import dev.excellent.impl.value.impl.MultiBooleanValue;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.OreBlock;
import net.minecraft.util.math.BlockPos;
import net.mojang.blaze3d.matrix.MatrixStack;

import java.awt.*;

@ModuleInfo(name = "Xray", description = "Подсвечивает руды.", category = Category.MISC)
public class Xray extends Module {
    public final MultiBooleanValue ores = new MultiBooleanValue("Руды", this)
            .add(new BooleanValue("Алмазная руда", true),
                    new BooleanValue("Железная руда", true),
                    new BooleanValue("Золотая руда", true),
                    new BooleanValue("Древний обломок", true),
                    new BooleanValue("Лазуритовая руда", true),
                    new BooleanValue("Редстоуновая руда", true),
                    new BooleanValue("Угольная руда", true));

    private final ColorValue diamondColor = new ColorValue("Цвет Алмазной Руды", this, Color.white, () -> !ores.get("Алмазная руда").getValue());
    private final ColorValue ironColor = new ColorValue("Цвет Железной Руды", this, Color.white, () -> !ores.get("Железная руда").getValue());
    private final ColorValue goldColor = new ColorValue("Цвет Золотой Руды", this, Color.white, () -> !ores.get("Золотая руда").getValue());
    private final ColorValue ancientDebrisColor = new ColorValue("Цвет Древнего Обломка", this, Color.white, () -> !ores.get("Древний обломок").getValue());
    private final ColorValue lapisColor = new ColorValue("Цвет Лазуритовой Руды", this, Color.white, () -> !ores.get("Лазуритовая руда").getValue());
    private final ColorValue redstoneColor = new ColorValue("Цвет Редстоуновой Руды", this, Color.white, () -> !ores.get("Редстоуновая руда").getValue());
    private final ColorValue coalColor = new ColorValue("Цвет Угольной Руды", this, Color.white, () -> !ores.get("Угольная руда").getValue());

    private final Listener<Render3DLastPostEvent> onRender = event -> {
        MatrixStack matrixStack = event.getMatrix();
        BlockPos playerPos = mc.player.getPosition();

        for (int x = playerPos.getX() - 25; x <= playerPos.getX() + 25; x++) {
            for (int y = playerPos.getY() - 25; y <= playerPos.getY() + 25; y++) {
                for (int z = playerPos.getZ() - 25; z <= playerPos.getZ() + 25; z++) {
                    BlockPos pos = new BlockPos(x, y, z);
                    BlockState state = mc.world.getBlockState(pos);

                    if (state.getBlock() instanceof OreBlock) {
                        int color = getColor(state.getBlock());
                        if (color != -1) {
                            RenderUtil.Render3D.drawBlockBox(matrixStack, pos, color);
                        }
                    }
                }
            }
        }
    };

    private int getColor(Block block) {
        if (block == Blocks.DIAMOND_ORE && ores.get("Алмазная руда").getValue()) {
            return diamondColor.getValue().getRGB();
        }
        if (block == Blocks.IRON_ORE && ores.get("Железная руда").getValue()) {
            return ironColor.getValue().getRGB();
        }
        if (block == Blocks.GOLD_ORE && ores.get("Золотая руда").getValue()) {
            return goldColor.getValue().getRGB();
        }
        if (block == Blocks.ANCIENT_DEBRIS && ores.get("Древний обломок").getValue()) {
            return ancientDebrisColor.getValue().getRGB();
        }
        if (block == Blocks.LAPIS_ORE && ores.get("Лазуритовая руда").getValue()) {
            return lapisColor.getValue().getRGB();
        }
        if (block == Blocks.REDSTONE_ORE && ores.get("Редстоуновая руда").getValue()) {
            return redstoneColor.getValue().getRGB();
        }
        if (block == Blocks.COAL_ORE && ores.get("Угольная руда").getValue()) {
            return coalColor.getValue().getRGB();
        }
        return -1;
    }
}
pasted from eva.ware
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Как его оптимизировать ?
 
Назад
Сверху Снизу