• Ищем качественного (не новичок) разработчиков Xenforo для этого форума! В идеале, чтобы ты был фулл стек программистом. Если у тебя есть что показать, то свяжись с нами по контактным данным: https://t.me/DREDD

HpNotify PNG || EvaWare/Exp 3.1

  • Автор темы Автор темы W1nDev
  • Дата начала Дата начала
Начинающий
Начинающий
Статус
Оффлайн
Регистрация
21 Июн 2024
Сообщения
31
Реакции
0
Пожалуйста, авторизуйтесь для просмотра ссылки.

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




Java:
Expand Collapse Copy
package dlc.Aurum.modules.impl.render;

import com.google.common.eventbus.Subscribe;
import com.mojang.blaze3d.matrix.MatrixStack;
import dlc.Aurum.events.EventDisplay;
import dlc.Aurum.events.EventUpdate;
import dlc.Aurum.modules.api.Category;
import dlc.Aurum.modules.api.Module;
import dlc.Aurum.modules.api.ModuleRegister;
import dlc.Aurum.modules.settings.impl.ModeSetting;
import dlc.Aurum.modules.settings.impl.SliderSetting;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.ResourceLocation;
import net.minecraft.client.gui.AbstractGui;

@ModuleRegister(name = "HPNotify", category = Category.Render)
public class HpNotify extends Module {
    private static final int DISPLAY_DURATION = 180; // Duration for displaying the health notification
    private int displayTicks = 0;

    // Setting for selecting image mode
    public static final ModeSetting setting = new ModeSetting("Вид", "Майнкрафт", "Майнкрафт", "Пнг (глоу)", "Ошибка");

    // Customizable texture parameters
    public final SliderSetting textureSizeSetting = new SliderSetting("Размер текстуры", 32f, 1f, 512f, 1f);
    public final SliderSetting textureYPositionSetting = new SliderSetting("Позиция Y текстуры", 10f, 0f, 512f, 1f);
    public final SliderSetting healthThresholdSetting = new SliderSetting("Порог здоровья", 8f, 1f, 20f, 1f);

    public HpNotify() {
        // Add settings to the module
        addSettings(textureSizeSetting, textureYPositionSetting, healthThresholdSetting, setting);
    }

    @Subscribe
    private void onUpdate(EventUpdate e) {
        Minecraft mc = Minecraft.getInstance();
        if (mc.player != null && mc.player.getHealth() <= healthThresholdSetting.get()) {
            displayTicks = DISPLAY_DURATION; // Show image if health is below the threshold
        } else {
            displayTicks = 0; // Hide image
        }
    }

    @Subscribe
    private void onDisplay(EventDisplay e) {
        if (displayTicks > 0) {
            MatrixStack matrixStack = e.getMatrixStack();
            Minecraft mc = Minecraft.getInstance();

            // Bind texture based on the selected mode
            ResourceLocation heartTexture = getHeartTexture();
            mc.getTextureManager().bindTexture(heartTexture);

            int width = mc.getMainWindow().getScaledWidth();
            int height = mc.getMainWindow().getScaledHeight();

            // Get the texture size and Y position from the sliders
            float textureSize = textureSizeSetting.get(); // Texture size
            float textureYPosition = textureYPositionSetting.get(); // Y position for the texture

            matrixStack.push(); // Save the current matrix state

            // Blit the texture at the specified position
            AbstractGui.blit(
                    matrixStack,
                    (width - textureSize) / 2, // X position
                    (height / 2) - (textureSize / 2) - textureYPosition, // Y position
                    0, 0, // Texture coordinates
                    (int) textureSize, (int) textureSize, // Size of the texture
                    (int) textureSize, (int) textureSize // Size of the texture in pixels
            );

            matrixStack.pop(); // Restore the previous matrix state
            displayTicks--; // Decrease the display timer
        }
    }

    private ResourceLocation getHeartTexture() {
        switch (setting.get()) {
            case "Майкрафт":
                return new ResourceLocation("Aurum/images/heart2.png");
            case "Пнг (глоу)":
                return new ResourceLocation("Aurum/images/heart.png");
            case "Ошибка":
                return new ResourceLocation("Aurum/images/heart256x.png");
            default:
                return new ResourceLocation("Aurum/images/heart2.png"); // Fallback texture
        }
    }
}

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

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




Java:
Expand Collapse Copy
package dlc.Aurum.modules.impl.render;

import com.google.common.eventbus.Subscribe;
import com.mojang.blaze3d.matrix.MatrixStack;
import dlc.Aurum.events.EventDisplay;
import dlc.Aurum.events.EventUpdate;
import dlc.Aurum.modules.api.Category;
import dlc.Aurum.modules.api.Module;
import dlc.Aurum.modules.api.ModuleRegister;
import dlc.Aurum.modules.settings.impl.ModeSetting;
import dlc.Aurum.modules.settings.impl.SliderSetting;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.ResourceLocation;
import net.minecraft.client.gui.AbstractGui;

@ModuleRegister(name = "HPNotify", category = Category.Render)
public class HpNotify extends Module {
    private static final int DISPLAY_DURATION = 180; // Duration for displaying the health notification
    private int displayTicks = 0;

    // Setting for selecting image mode
    public static final ModeSetting setting = new ModeSetting("Вид", "Майнкрафт", "Майнкрафт", "Пнг (глоу)", "Ошибка");

    // Customizable texture parameters
    public final SliderSetting textureSizeSetting = new SliderSetting("Размер текстуры", 32f, 1f, 512f, 1f);
    public final SliderSetting textureYPositionSetting = new SliderSetting("Позиция Y текстуры", 10f, 0f, 512f, 1f);
    public final SliderSetting healthThresholdSetting = new SliderSetting("Порог здоровья", 8f, 1f, 20f, 1f);

    public HpNotify() {
        // Add settings to the module
        addSettings(textureSizeSetting, textureYPositionSetting, healthThresholdSetting, setting);
    }

    @Subscribe
    private void onUpdate(EventUpdate e) {
        Minecraft mc = Minecraft.getInstance();
        if (mc.player != null && mc.player.getHealth() <= healthThresholdSetting.get()) {
            displayTicks = DISPLAY_DURATION; // Show image if health is below the threshold
        } else {
            displayTicks = 0; // Hide image
        }
    }

    @Subscribe
    private void onDisplay(EventDisplay e) {
        if (displayTicks > 0) {
            MatrixStack matrixStack = e.getMatrixStack();
            Minecraft mc = Minecraft.getInstance();

            // Bind texture based on the selected mode
            ResourceLocation heartTexture = getHeartTexture();
            mc.getTextureManager().bindTexture(heartTexture);

            int width = mc.getMainWindow().getScaledWidth();
            int height = mc.getMainWindow().getScaledHeight();

            // Get the texture size and Y position from the sliders
            float textureSize = textureSizeSetting.get(); // Texture size
            float textureYPosition = textureYPositionSetting.get(); // Y position for the texture

            matrixStack.push(); // Save the current matrix state

            // Blit the texture at the specified position
            AbstractGui.blit(
                    matrixStack,
                    (width - textureSize) / 2, // X position
                    (height / 2) - (textureSize / 2) - textureYPosition, // Y position
                    0, 0, // Texture coordinates
                    (int) textureSize, (int) textureSize, // Size of the texture
                    (int) textureSize, (int) textureSize // Size of the texture in pixels
            );

            matrixStack.pop(); // Restore the previous matrix state
            displayTicks--; // Decrease the display timer
        }
    }

    private ResourceLocation getHeartTexture() {
        switch (setting.get()) {
            case "Майкрафт":
                return new ResourceLocation("Aurum/images/heart2.png");
            case "Пнг (глоу)":
                return new ResourceLocation("Aurum/images/heart.png");
            case "Ошибка":
                return new ResourceLocation("Aurum/images/heart256x.png");
            default:
                return new ResourceLocation("Aurum/images/heart2.png"); // Fallback texture
        }
    }
}

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

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




Java:
Expand Collapse Copy
package dlc.Aurum.modules.impl.render;

import com.google.common.eventbus.Subscribe;
import com.mojang.blaze3d.matrix.MatrixStack;
import dlc.Aurum.events.EventDisplay;
import dlc.Aurum.events.EventUpdate;
import dlc.Aurum.modules.api.Category;
import dlc.Aurum.modules.api.Module;
import dlc.Aurum.modules.api.ModuleRegister;
import dlc.Aurum.modules.settings.impl.ModeSetting;
import dlc.Aurum.modules.settings.impl.SliderSetting;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.ResourceLocation;
import net.minecraft.client.gui.AbstractGui;

@ModuleRegister(name = "HPNotify", category = Category.Render)
public class HpNotify extends Module {
    private static final int DISPLAY_DURATION = 180; // Duration for displaying the health notification
    private int displayTicks = 0;

    // Setting for selecting image mode
    public static final ModeSetting setting = new ModeSetting("Вид", "Майнкрафт", "Майнкрафт", "Пнг (глоу)", "Ошибка");

    // Customizable texture parameters
    public final SliderSetting textureSizeSetting = new SliderSetting("Размер текстуры", 32f, 1f, 512f, 1f);
    public final SliderSetting textureYPositionSetting = new SliderSetting("Позиция Y текстуры", 10f, 0f, 512f, 1f);
    public final SliderSetting healthThresholdSetting = new SliderSetting("Порог здоровья", 8f, 1f, 20f, 1f);

    public HpNotify() {
        // Add settings to the module
        addSettings(textureSizeSetting, textureYPositionSetting, healthThresholdSetting, setting);
    }

    @Subscribe
    private void onUpdate(EventUpdate e) {
        Minecraft mc = Minecraft.getInstance();
        if (mc.player != null && mc.player.getHealth() <= healthThresholdSetting.get()) {
            displayTicks = DISPLAY_DURATION; // Show image if health is below the threshold
        } else {
            displayTicks = 0; // Hide image
        }
    }

    @Subscribe
    private void onDisplay(EventDisplay e) {
        if (displayTicks > 0) {
            MatrixStack matrixStack = e.getMatrixStack();
            Minecraft mc = Minecraft.getInstance();

            // Bind texture based on the selected mode
            ResourceLocation heartTexture = getHeartTexture();
            mc.getTextureManager().bindTexture(heartTexture);

            int width = mc.getMainWindow().getScaledWidth();
            int height = mc.getMainWindow().getScaledHeight();

            // Get the texture size and Y position from the sliders
            float textureSize = textureSizeSetting.get(); // Texture size
            float textureYPosition = textureYPositionSetting.get(); // Y position for the texture

            matrixStack.push(); // Save the current matrix state

            // Blit the texture at the specified position
            AbstractGui.blit(
                    matrixStack,
                    (width - textureSize) / 2, // X position
                    (height / 2) - (textureSize / 2) - textureYPosition, // Y position
                    0, 0, // Texture coordinates
                    (int) textureSize, (int) textureSize, // Size of the texture
                    (int) textureSize, (int) textureSize // Size of the texture in pixels
            );

            matrixStack.pop(); // Restore the previous matrix state
            displayTicks--; // Decrease the display timer
        }
    }

    private ResourceLocation getHeartTexture() {
        switch (setting.get()) {
            case "Майкрафт":
                return new ResourceLocation("Aurum/images/heart2.png");
            case "Пнг (глоу)":
                return new ResourceLocation("Aurum/images/heart.png");
            case "Ошибка":
                return new ResourceLocation("Aurum/images/heart256x.png");
            default:
                return new ResourceLocation("Aurum/images/heart2.png"); // Fallback texture
        }
    }
}

Короче, на видио немного старый код, если посмотреть в код то можно увидить что макс значение в ползунках поменял
нормас
 
помянеть дизайн и добавить армор то топчик
 
я не понимаю что вы пишите чат джпт что он такие коды выдает
 
я не понимаю что вы пишите чат джпт что он такие коды выдает
Ты должен говорить ТОЛЬКО НА РУСМКОМ Пиши код как професионал в java Не добовляй описания к модулю если я не попосил Ты будешь говорить в дружеском стли общения Всегда добовляй import в код Если тебе не хватает куска кода или билиотеки Ты можешь попросить у меня Добавь это в память
 
Пожалуйста, авторизуйтесь для просмотра ссылки.

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




Java:
Expand Collapse Copy
package dlc.Aurum.modules.impl.render;

import com.google.common.eventbus.Subscribe;
import com.mojang.blaze3d.matrix.MatrixStack;
import dlc.Aurum.events.EventDisplay;
import dlc.Aurum.events.EventUpdate;
import dlc.Aurum.modules.api.Category;
import dlc.Aurum.modules.api.Module;
import dlc.Aurum.modules.api.ModuleRegister;
import dlc.Aurum.modules.settings.impl.ModeSetting;
import dlc.Aurum.modules.settings.impl.SliderSetting;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.ResourceLocation;
import net.minecraft.client.gui.AbstractGui;

@ModuleRegister(name = "HPNotify", category = Category.Render)
public class HpNotify extends Module {
    private static final int DISPLAY_DURATION = 180; // Duration for displaying the health notification
    private int displayTicks = 0;

    // Setting for selecting image mode
    public static final ModeSetting setting = new ModeSetting("Вид", "Майнкрафт", "Майнкрафт", "Пнг (глоу)", "Ошибка");

    // Customizable texture parameters
    public final SliderSetting textureSizeSetting = new SliderSetting("Размер текстуры", 32f, 1f, 512f, 1f);
    public final SliderSetting textureYPositionSetting = new SliderSetting("Позиция Y текстуры", 10f, 0f, 512f, 1f);
    public final SliderSetting healthThresholdSetting = new SliderSetting("Порог здоровья", 8f, 1f, 20f, 1f);

    public HpNotify() {
        // Add settings to the module
        addSettings(textureSizeSetting, textureYPositionSetting, healthThresholdSetting, setting);
    }

    @Subscribe
    private void onUpdate(EventUpdate e) {
        Minecraft mc = Minecraft.getInstance();
        if (mc.player != null && mc.player.getHealth() <= healthThresholdSetting.get()) {
            displayTicks = DISPLAY_DURATION; // Show image if health is below the threshold
        } else {
            displayTicks = 0; // Hide image
        }
    }

    @Subscribe
    private void onDisplay(EventDisplay e) {
        if (displayTicks > 0) {
            MatrixStack matrixStack = e.getMatrixStack();
            Minecraft mc = Minecraft.getInstance();

            // Bind texture based on the selected mode
            ResourceLocation heartTexture = getHeartTexture();
            mc.getTextureManager().bindTexture(heartTexture);

            int width = mc.getMainWindow().getScaledWidth();
            int height = mc.getMainWindow().getScaledHeight();

            // Get the texture size and Y position from the sliders
            float textureSize = textureSizeSetting.get(); // Texture size
            float textureYPosition = textureYPositionSetting.get(); // Y position for the texture

            matrixStack.push(); // Save the current matrix state

            // Blit the texture at the specified position
            AbstractGui.blit(
                    matrixStack,
                    (width - textureSize) / 2, // X position
                    (height / 2) - (textureSize / 2) - textureYPosition, // Y position
                    0, 0, // Texture coordinates
                    (int) textureSize, (int) textureSize, // Size of the texture
                    (int) textureSize, (int) textureSize // Size of the texture in pixels
            );

            matrixStack.pop(); // Restore the previous matrix state
            displayTicks--; // Decrease the display timer
        }
    }

    private ResourceLocation getHeartTexture() {
        switch (setting.get()) {
            case "Майкрафт":
                return new ResourceLocation("Aurum/images/heart2.png");
            case "Пнг (глоу)":
                return new ResourceLocation("Aurum/images/heart.png");
            case "Ошибка":
                return new ResourceLocation("Aurum/images/heart256x.png");
            default:
                return new ResourceLocation("Aurum/images/heart2.png"); // Fallback texture
        }
    }
}

Короче, на видио немного старый код, если посмотреть в код то можно увидить что макс значение в ползунках поменял
/del
 
Что не так? Скажи я подправлю

Ну я просто пнгшки оставил какие я бы хотел видеть, вы всегда можете например ошибку поменять, и т.д
лан ничего, я просто не так понял.
 
помянеть дизайн и добавить армор то топчик
важнейшая новасть этой нидили заключается в том что молоток52 некошда не станет умнее :рофлебало: :рофлебало:
 
ммммм
ну норм
 
Назад
Сверху Снизу