Подписывайтесь на наш Telegram и не пропускайте важные новости! Перейти

Часть функционала WardenHelper / Rockstar

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
15 Ноя 2025
Сообщения
24
Реакции
0
Выберите загрузчик игры
  1. Fabric
супер мега скид кода с найта 1.21.4 крч я высосал эту функц с найта и перенес на рокстар ну хз мне пох я сливаю мне она вобще не нужна SS не будет
а еще типо надо в авто гпс чуть исправить
SuperSkid:
Expand Collapse Copy
package gug.astralis.systems.modules.modules.player;
//ай пидорасы о илюхха Месси
import com.mojang.blaze3d.platform.GlStateManager.DstFactor;
import com.mojang.blaze3d.platform.GlStateManager.SrcFactor;
import com.mojang.blaze3d.systems.RenderSystem;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import gug.astralis.Astral;
import gug.astralis.systems.event.EventListener;
import gug.astralis.systems.event.impl.game.WorldChangeEvent;
import gug.astralis.systems.event.impl.player.ClientPlayerTickEvent;
import gug.astralis.systems.event.impl.render.Render3DEvent;
import gug.astralis.systems.event.impl.window.KeyPressEvent;
import gug.astralis.systems.modules.api.ModuleCategory;
import gug.astralis.systems.modules.api.ModuleInfo;
import gug.astralis.systems.modules.impl.BaseModule;
import gug.astralis.systems.notifications.NotificationType;
import gug.astralis.systems.setting.settings.BindSetting;
import gug.astralis.systems.setting.settings.BooleanSetting;
import gug.astralis.utility.colors.ColorRGBA;
import gug.astralis.utility.game.WorldUtility;
import gug.astralis.utility.render.Draw3DUtility;
import gug.astralis.utility.render.RenderUtility;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.ChestBlockEntity;
import net.minecraft.block.entity.TrappedChestBlockEntity;
import net.minecraft.client.gl.ShaderProgramKeys;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.VertexFormats;
import net.minecraft.client.render.VertexFormat.DrawMode;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.decoration.ArmorStandEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Box;
import net.minecraft.util.math.Vec3d;

@ModuleInfo(name = "Warden Helper", category = ModuleCategory.PLAYER, desc = "Warden Helper поможет вам на 1.21.8 анках ")
public class WardenHelper extends BaseModule {

 

    private final BooleanSetting autoGPS = new BooleanSetting(this, "Авто GPS",
            "Автоматически ставит GPS-метку на готовый сундук").enable();

    private final BooleanSetting notifications = new BooleanSetting(this, "Уведомления",
            "Показывает уведомление когда сундук готов или скоро откроется").enable();

    private final BindSetting resetBind = new BindSetting(this, "Ресет сундуков");

 

    private final Map<BlockPos, ChestData> chestDataMap = new ConcurrentHashMap<>();
    private final Set<BlockPos> gpsVisited   = new HashSet<>();
    private final Set<BlockPos> notified     = new HashSet<>();
    private BlockPos currentGPSTarget        = null;

 

    private static final double WARDEN_X    = 2000.0;
    private static final double WARDEN_Z    = 2000.0;
    private static final double ZONE_RADIUS = 250.0;

    private static final ColorRGBA COLOR_INACTIVE = new ColorRGBA(180, 180, 180, 120);
    private static final ColorRGBA COLOR_DEFAULT  = new ColorRGBA(255,  60,  60, 180);
    private static final ColorRGBA COLOR_WARN     = new ColorRGBA(255, 220,  50, 180);
    private static final ColorRGBA COLOR_READY    = new ColorRGBA( 60, 255,  60, 180);

    private static final Pattern TIME_PATTERN    = Pattern.compile("(\\d{1,2}):(\\d{2})(?::(\\d{2}))?");
    private static final Pattern SECONDS_PATTERN = Pattern.compile("(\\d+)\\s*(с|s|сек|sec)");

 

    private final EventListener<WorldChangeEvent> onWorldChange = event -> clearAll();

    private final EventListener<KeyPressEvent> onKeyPress = event -> {
        if (resetBind.isKey(event.getKey()) && event.getAction() == 1) {
            clearAll();
            if (mc.player != null) {
                Astral.getInstance().getNotificationManager()
                        .addNotificationOther(NotificationType.SUCCESS, "Warden Helper", "Сундуки сброшены!");
            }
        }
    };

    private final EventListener<ClientPlayerTickEvent> onTick = event -> {
        if (mc.player == null || mc.world == null || !isInWardenZone()) return;
        updateTimersFromEntities();
        updateGPSAndNotifications();
    };

    private final EventListener<Render3DEvent> on3DRender = event -> {
        if (mc.world == null || mc.player == null) return;

        MatrixStack matrices = event.getMatrices();
        Camera camera        = event.getCamera();
        Vec3d cam            = camera.getPos();

        RenderSystem.enableBlend();
        RenderSystem.disableDepthTest();
        RenderSystem.disableCull();
        RenderSystem.blendFunc(SrcFactor.SRC_ALPHA, DstFactor.ONE);
        RenderSystem.setShader(ShaderProgramKeys.POSITION_COLOR);

      
        BufferBuilder quadsBuffer = RenderSystem.renderThreadTesselator()
                .begin(DrawMode.QUADS, VertexFormats.POSITION_COLOR);

        for (BlockEntity be : WorldUtility.blockEntities) {
            if (!isWardenChest(be)) continue;
            BlockPos pos = be.getPos();
            chestDataMap.computeIfAbsent(pos, ChestData::new);
            ColorRGBA color = getESPColor(chestDataMap.get(pos));
            Box box = new Box(pos).offset(-cam.getX(), -cam.getY(), -cam.getZ());
            Draw3DUtility.renderFilledBox(matrices, quadsBuffer, box, color.withAlpha(50.0F));
        }

        RenderUtility.buildBuffer(quadsBuffer);

        
        BufferBuilder linesBuffer = RenderSystem.renderThreadTesselator()
                .begin(DrawMode.DEBUG_LINES, VertexFormats.POSITION_COLOR);

        for (BlockEntity be : WorldUtility.blockEntities) {
            if (!isWardenChest(be)) continue;
            BlockPos pos    = be.getPos();
            ColorRGBA color = getESPColor(chestDataMap.getOrDefault(pos, new ChestData(pos)));
            Box box         = new Box(pos).offset(-cam.getX(), -cam.getY(), -cam.getZ());
            Draw3DUtility.renderOutlinedBox(matrices, linesBuffer, box, color.withAlpha(200.0F));
            Draw3DUtility.renderBoxInternalDiagonals(matrices, linesBuffer, box, color.withAlpha(120.0F));
        }

        RenderUtility.buildBuffer(linesBuffer);

        RenderSystem.defaultBlendFunc();
        RenderSystem.enableCull();
        RenderSystem.enableDepthTest();
        RenderSystem.disableBlend();
    };

 

    private void clearAll() {
        chestDataMap.clear();
        gpsVisited.clear();
        notified.clear();
        currentGPSTarget = null;
    }

    private boolean isWardenChest(BlockEntity be) {
        return be instanceof ChestBlockEntity || be instanceof TrappedChestBlockEntity;
    }

    private boolean isInWardenZone() {
        return Math.abs(mc.player.getX() - WARDEN_X) <= ZONE_RADIUS
                && Math.abs(mc.player.getZ() - WARDEN_Z) <= ZONE_RADIUS;
    }

    private void updateTimersFromEntities() {
        for (Map.Entry<BlockPos, ChestData> entry : chestDataMap.entrySet()) {
            BlockPos pos  = entry.getKey();
            ChestData data = entry.getValue();
            boolean found  = false;

            Box searchBox = new Box(pos).expand(1.0, 3.0, 1.0);
            for (ArmorStandEntity stand : mc.world.getEntitiesByClass(
                    ArmorStandEntity.class, searchBox, ArmorStandEntity::hasCustomName)) {

                String name = stand.getCustomName().getString()
                        .replaceAll("§[0-9a-fk-or]", "");
                long seconds = parseTimeToSeconds(name);
                if (seconds >= 0) {
                    data.setTimer(seconds);
                    found = true;
                    break;
                }
            }

            if (!found) data.hasTimer = false;
        }
    }

    private long parseTimeToSeconds(String str) {
        Matcher m1 = TIME_PATTERN.matcher(str);
        if (m1.find()) {
            if (m1.group(3) == null)
                return (long) Integer.parseInt(m1.group(1)) * 60 + Integer.parseInt(m1.group(2));
            return (long) Integer.parseInt(m1.group(1)) * 3600
                    + (long) Integer.parseInt(m1.group(2)) * 60
                    + Integer.parseInt(m1.group(3));
        }
        Matcher m2 = SECONDS_PATTERN.matcher(str);
        if (m2.find()) return Long.parseLong(m2.group(1));

        String digits = str.replaceAll("[^0-9]", "").trim();
        if (digits.isEmpty()) return -1L;
        long val = Long.parseLong(digits);
        return (val > 0 && val < 36000) ? val : -1L;
    }

    private void updateGPSAndNotifications() {
       
        if (currentGPSTarget != null
                && mc.player.squaredDistanceTo(Vec3d.ofCenter(currentGPSTarget)) <= 100.0) {
            mc.player.networkHandler.sendChatCommand("gps off");
            currentGPSTarget = null;
        }

        for (Map.Entry<BlockPos, ChestData> entry : chestDataMap.entrySet()) {
            BlockPos  pos  = entry.getKey();
            ChestData data = entry.getValue();
            if (!data.hasTimer) continue;

            float t = data.getTimeLeft();

            if (t <= 0.0f) {
                if (autoGPS.isEnabled() && !gpsVisited.contains(pos))
                    sendGPS(pos);
                if (notifications.isEnabled() && !notified.contains(pos)) {
                    Astral.getInstance().getNotificationManager()
                            .addNotificationOther(NotificationType.SUCCESS, "Warden Helper",
                                    "Сундук готов! [" + pos.getX() + " " + pos.getZ() + "]");
                    notified.add(pos);
                }
            } else if (t <= 20.0f) {
                if (autoGPS.isEnabled() && !gpsVisited.contains(pos))
                    sendGPS(pos);
                if (notifications.isEnabled() && !notified.contains(pos)) {
                    Astral.getInstance().getNotificationManager()
                            .addNotificationOther(NotificationType.INFO, "Warden Helper",
                                    "Сундук через " + (int) t + " сек! [" + pos.getX() + " " + pos.getZ() + "]");
                    notified.add(pos);
                }
            }
        }
    }

    private void sendGPS(BlockPos pos) {
        mc.player.networkHandler.sendChatCommand("gps set " + pos.getX() + " " + pos.getZ());
        gpsVisited.add(pos);
        currentGPSTarget = pos;
    }

 

    private ColorRGBA getESPColor(ChestData data) {
        if (!data.hasTimer) return COLOR_INACTIVE;
        float t = data.getTimeLeft();
        if (t <= 0.0f) {
            float p = (float) ((Math.sin(System.currentTimeMillis() / 200.0) * 0.3) + 0.7);
            return new ColorRGBA(0, (int)(255 * p), (int)(128 * p), 220);
        }
        if (t > 120.0f) return COLOR_DEFAULT;
        if (t > 20.0f)  return lerpColor(COLOR_DEFAULT, COLOR_WARN,  1.0f - ((t - 20.0f) / 100.0f));
        return              lerpColor(COLOR_WARN,    COLOR_READY, 1.0f - (t / 20.0f));
    }

    private static ColorRGBA lerpColor(ColorRGBA a, ColorRGBA b, float t) {
        t = Math.max(0f, Math.min(1f, t));
        return new ColorRGBA(
                (int)(a.getRed()   + (b.getRed()   - a.getRed())   * t),
                (int)(a.getGreen() + (b.getGreen() - a.getGreen()) * t),
                (int)(a.getBlue()  + (b.getBlue()  - a.getBlue())  * t),
                (int)(a.getAlpha() + (b.getAlpha() - a.getAlpha()) * t)
        );
    }

 

    private static class ChestData {
        boolean hasTimer  = false;
        private long timerEndMs = 0L;

        ChestData(BlockPos pos) {}

        void setTimer(long secondsLeft) {
            this.timerEndMs = System.currentTimeMillis() + secondsLeft * 1000L;
            this.hasTimer   = true;
        }

        float getTimeLeft() {
            return (timerEndMs - System.currentTimeMillis()) / 1000.0f;
        }
    }
}
 
Последнее редактирование:
супер мега скид кода с найта 1.21.4 крч я высосал эту функц с найта и перенес на рокстар ну хз мне пох я сливаю мне она вобще не нужна SS не будет
а еще типо надо в авто гпс чуть исправить
SuperSkid:
Expand Collapse Copy
package gug.astralis.systems.modules.modules.player;
//ай пидорасы о илюхха Месси
import com.mojang.blaze3d.platform.GlStateManager.DstFactor;
import com.mojang.blaze3d.platform.GlStateManager.SrcFactor;
import com.mojang.blaze3d.systems.RenderSystem;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import gug.astralis.Astral;
import gug.astralis.systems.event.EventListener;
import gug.astralis.systems.event.impl.game.WorldChangeEvent;
import gug.astralis.systems.event.impl.player.ClientPlayerTickEvent;
import gug.astralis.systems.event.impl.render.Render3DEvent;
import gug.astralis.systems.event.impl.window.KeyPressEvent;
import gug.astralis.systems.modules.api.ModuleCategory;
import gug.astralis.systems.modules.api.ModuleInfo;
import gug.astralis.systems.modules.impl.BaseModule;
import gug.astralis.systems.notifications.NotificationType;
import gug.astralis.systems.setting.settings.BindSetting;
import gug.astralis.systems.setting.settings.BooleanSetting;
import gug.astralis.utility.colors.ColorRGBA;
import gug.astralis.utility.game.WorldUtility;
import gug.astralis.utility.render.Draw3DUtility;
import gug.astralis.utility.render.RenderUtility;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.ChestBlockEntity;
import net.minecraft.block.entity.TrappedChestBlockEntity;
import net.minecraft.client.gl.ShaderProgramKeys;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.VertexFormats;
import net.minecraft.client.render.VertexFormat.DrawMode;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.decoration.ArmorStandEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Box;
import net.minecraft.util.math.Vec3d;

@ModuleInfo(name = "Warden Helper", category = ModuleCategory.PLAYER, desc = "Warden Helper поможет вам на 1.21.8 анках ")
public class WardenHelper extends BaseModule {

 

    private final BooleanSetting autoGPS = new BooleanSetting(this, "Авто GPS",
            "Автоматически ставит GPS-метку на готовый сундук").enable();

    private final BooleanSetting notifications = new BooleanSetting(this, "Уведомления",
            "Показывает уведомление когда сундук готов или скоро откроется").enable();

    private final BindSetting resetBind = new BindSetting(this, "Ресет сундуков");

 

    private final Map<BlockPos, ChestData> chestDataMap = new ConcurrentHashMap<>();
    private final Set<BlockPos> gpsVisited   = new HashSet<>();
    private final Set<BlockPos> notified     = new HashSet<>();
    private BlockPos currentGPSTarget        = null;

 

    private static final double WARDEN_X    = 2000.0;
    private static final double WARDEN_Z    = 2000.0;
    private static final double ZONE_RADIUS = 250.0;

    private static final ColorRGBA COLOR_INACTIVE = new ColorRGBA(180, 180, 180, 120);
    private static final ColorRGBA COLOR_DEFAULT  = new ColorRGBA(255,  60,  60, 180);
    private static final ColorRGBA COLOR_WARN     = new ColorRGBA(255, 220,  50, 180);
    private static final ColorRGBA COLOR_READY    = new ColorRGBA( 60, 255,  60, 180);

    private static final Pattern TIME_PATTERN    = Pattern.compile("(\\d{1,2}):(\\d{2})(?::(\\d{2}))?");
    private static final Pattern SECONDS_PATTERN = Pattern.compile("(\\d+)\\s*(с|s|сек|sec)");

 

    private final EventListener<WorldChangeEvent> onWorldChange = event -> clearAll();

    private final EventListener<KeyPressEvent> onKeyPress = event -> {
        if (resetBind.isKey(event.getKey()) && event.getAction() == 1) {
            clearAll();
            if (mc.player != null) {
                Astral.getInstance().getNotificationManager()
                        .addNotificationOther(NotificationType.SUCCESS, "Warden Helper", "Сундуки сброшены!");
            }
        }
    };

    private final EventListener<ClientPlayerTickEvent> onTick = event -> {
        if (mc.player == null || mc.world == null || !isInWardenZone()) return;
        updateTimersFromEntities();
        updateGPSAndNotifications();
    };

    private final EventListener<Render3DEvent> on3DRender = event -> {
        if (mc.world == null || mc.player == null) return;

        MatrixStack matrices = event.getMatrices();
        Camera camera        = event.getCamera();
        Vec3d cam            = camera.getPos();

        RenderSystem.enableBlend();
        RenderSystem.disableDepthTest();
        RenderSystem.disableCull();
        RenderSystem.blendFunc(SrcFactor.SRC_ALPHA, DstFactor.ONE);
        RenderSystem.setShader(ShaderProgramKeys.POSITION_COLOR);

     
        BufferBuilder quadsBuffer = RenderSystem.renderThreadTesselator()
                .begin(DrawMode.QUADS, VertexFormats.POSITION_COLOR);

        for (BlockEntity be : WorldUtility.blockEntities) {
            if (!isWardenChest(be)) continue;
            BlockPos pos = be.getPos();
            chestDataMap.computeIfAbsent(pos, ChestData::new);
            ColorRGBA color = getESPColor(chestDataMap.get(pos));
            Box box = new Box(pos).offset(-cam.getX(), -cam.getY(), -cam.getZ());
            Draw3DUtility.renderFilledBox(matrices, quadsBuffer, box, color.withAlpha(50.0F));
        }

        RenderUtility.buildBuffer(quadsBuffer);

       
        BufferBuilder linesBuffer = RenderSystem.renderThreadTesselator()
                .begin(DrawMode.DEBUG_LINES, VertexFormats.POSITION_COLOR);

        for (BlockEntity be : WorldUtility.blockEntities) {
            if (!isWardenChest(be)) continue;
            BlockPos pos    = be.getPos();
            ColorRGBA color = getESPColor(chestDataMap.getOrDefault(pos, new ChestData(pos)));
            Box box         = new Box(pos).offset(-cam.getX(), -cam.getY(), -cam.getZ());
            Draw3DUtility.renderOutlinedBox(matrices, linesBuffer, box, color.withAlpha(200.0F));
            Draw3DUtility.renderBoxInternalDiagonals(matrices, linesBuffer, box, color.withAlpha(120.0F));
        }

        RenderUtility.buildBuffer(linesBuffer);

        RenderSystem.defaultBlendFunc();
        RenderSystem.enableCull();
        RenderSystem.enableDepthTest();
        RenderSystem.disableBlend();
    };

 

    private void clearAll() {
        chestDataMap.clear();
        gpsVisited.clear();
        notified.clear();
        currentGPSTarget = null;
    }

    private boolean isWardenChest(BlockEntity be) {
        return be instanceof ChestBlockEntity || be instanceof TrappedChestBlockEntity;
    }

    private boolean isInWardenZone() {
        return Math.abs(mc.player.getX() - WARDEN_X) <= ZONE_RADIUS
                && Math.abs(mc.player.getZ() - WARDEN_Z) <= ZONE_RADIUS;
    }

    private void updateTimersFromEntities() {
        for (Map.Entry<BlockPos, ChestData> entry : chestDataMap.entrySet()) {
            BlockPos pos  = entry.getKey();
            ChestData data = entry.getValue();
            boolean found  = false;

            Box searchBox = new Box(pos).expand(1.0, 3.0, 1.0);
            for (ArmorStandEntity stand : mc.world.getEntitiesByClass(
                    ArmorStandEntity.class, searchBox, ArmorStandEntity::hasCustomName)) {

                String name = stand.getCustomName().getString()
                        .replaceAll("§[0-9a-fk-or]", "");
                long seconds = parseTimeToSeconds(name);
                if (seconds >= 0) {
                    data.setTimer(seconds);
                    found = true;
                    break;
                }
            }

            if (!found) data.hasTimer = false;
        }
    }

    private long parseTimeToSeconds(String str) {
        Matcher m1 = TIME_PATTERN.matcher(str);
        if (m1.find()) {
            if (m1.group(3) == null)
                return (long) Integer.parseInt(m1.group(1)) * 60 + Integer.parseInt(m1.group(2));
            return (long) Integer.parseInt(m1.group(1)) * 3600
                    + (long) Integer.parseInt(m1.group(2)) * 60
                    + Integer.parseInt(m1.group(3));
        }
        Matcher m2 = SECONDS_PATTERN.matcher(str);
        if (m2.find()) return Long.parseLong(m2.group(1));

        String digits = str.replaceAll("[^0-9]", "").trim();
        if (digits.isEmpty()) return -1L;
        long val = Long.parseLong(digits);
        return (val > 0 && val < 36000) ? val : -1L;
    }

    private void updateGPSAndNotifications() {
      
        if (currentGPSTarget != null
                && mc.player.squaredDistanceTo(Vec3d.ofCenter(currentGPSTarget)) <= 100.0) {
            mc.player.networkHandler.sendChatCommand("gps off");
            currentGPSTarget = null;
        }

        for (Map.Entry<BlockPos, ChestData> entry : chestDataMap.entrySet()) {
            BlockPos  pos  = entry.getKey();
            ChestData data = entry.getValue();
            if (!data.hasTimer) continue;

            float t = data.getTimeLeft();

            if (t <= 0.0f) {
                if (autoGPS.isEnabled() && !gpsVisited.contains(pos))
                    sendGPS(pos);
                if (notifications.isEnabled() && !notified.contains(pos)) {
                    Astral.getInstance().getNotificationManager()
                            .addNotificationOther(NotificationType.SUCCESS, "Warden Helper",
                                    "Сундук готов! [" + pos.getX() + " " + pos.getZ() + "]");
                    notified.add(pos);
                }
            } else if (t <= 20.0f) {
                if (autoGPS.isEnabled() && !gpsVisited.contains(pos))
                    sendGPS(pos);
                if (notifications.isEnabled() && !notified.contains(pos)) {
                    Astral.getInstance().getNotificationManager()
                            .addNotificationOther(NotificationType.INFO, "Warden Helper",
                                    "Сундук через " + (int) t + " сек! [" + pos.getX() + " " + pos.getZ() + "]");
                    notified.add(pos);
                }
            }
        }
    }

    private void sendGPS(BlockPos pos) {
        mc.player.networkHandler.sendChatCommand("gps set " + pos.getX() + " " + pos.getZ());
        gpsVisited.add(pos);
        currentGPSTarget = pos;
    }

 

    private ColorRGBA getESPColor(ChestData data) {
        if (!data.hasTimer) return COLOR_INACTIVE;
        float t = data.getTimeLeft();
        if (t <= 0.0f) {
            float p = (float) ((Math.sin(System.currentTimeMillis() / 200.0) * 0.3) + 0.7);
            return new ColorRGBA(0, (int)(255 * p), (int)(128 * p), 220);
        }
        if (t > 120.0f) return COLOR_DEFAULT;
        if (t > 20.0f)  return lerpColor(COLOR_DEFAULT, COLOR_WARN,  1.0f - ((t - 20.0f) / 100.0f));
        return              lerpColor(COLOR_WARN,    COLOR_READY, 1.0f - (t / 20.0f));
    }

    private static ColorRGBA lerpColor(ColorRGBA a, ColorRGBA b, float t) {
        t = Math.max(0f, Math.min(1f, t));
        return new ColorRGBA(
                (int)(a.getRed()   + (b.getRed()   - a.getRed())   * t),
                (int)(a.getGreen() + (b.getGreen() - a.getGreen()) * t),
                (int)(a.getBlue()  + (b.getBlue()  - a.getBlue())  * t),
                (int)(a.getAlpha() + (b.getAlpha() - a.getAlpha()) * t)
        );
    }

 

    private static class ChestData {
        boolean hasTimer  = false;
        private long timerEndMs = 0L;

        ChestData(BlockPos pos) {}

        void setTimer(long secondsLeft) {
            this.timerEndMs = System.currentTimeMillis() + secondsLeft * 1000L;
            this.hasTimer   = true;
        }

        float getTimeLeft() {
            return (timerEndMs - System.currentTimeMillis()) / 1000.0f;
        }
    }
}
с найта паста паста
 
Назад
Сверху Снизу