Вопрос Помогите с гетом тпса exp 2.0

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
22 Дек 2024
Сообщения
15
Реакции
0
Всем привет, я пытаюсь сделать геттер тпса, спастил с жирафа (да я пастер), короче все сделал добавил в худ, пытаюсь зайди на любой сервер и пишет то что на скрине,
вот коды

hud:
Expand Collapse Copy
    private void watermark(MatrixStack stack) {
        int debugTPS = (int)Jiraf.getInstance().getTpsCalc().getTPS();
        Render2D.drawRoundedCorner(74.0F + Fonts.msSemiBold[13].getWidth(cord) + Fonts.msSemiBold[13].getWidth(text), 19.5F, 21.0F + (float)debugTPS, 14.0F, 4.0F, (new Color(24, 24, 24, 240)).getRGB());
        Fonts.msSemiBold[13].drawString(stack, "Tps " + debugTPS, (double)(88.5F + Fonts.msSemiBold[13].getWidth(cord) + Fonts.msSemiBold[13].getWidth(text)), (double)25.0F, (new Color(255, 255, 255, 255)).getRGB());

    }
Сам геттертпса

TPSCalc:
Expand Collapse Copy
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package wtf.expensive.util.misc;

import com.google.common.eventbus.Subscribe;
import wtf.expensive.Jiraf;
import wtf.expensive.events.impl.packet.EventPackets;
import net.minecraft.network.play.server.SUpdateTimePacket;
import net.minecraft.util.math.MathHelper;

public class TPSCalc {
    private float TPS = 20.0F;
    private float adjustTicks = 0.0F;
    private long timestamp;

    public TPSCalc() {
        Jiraf.getInstance().getEventBus().register(this);
    }

    [USER=1474073]@Subscribe[/USER]
    private void onPacket(EventPackets e) {
        if (e.isReceive() && e.getPacket() instanceof SUpdateTimePacket) {
            this.updateTPS();
        }

    }

    private void updateTPS() {
        long delay = System.nanoTime() - this.timestamp;
        float maxTPS = 20.0F;
        float rawTPS = maxTPS * (1.0E9F / (float)delay);
        float boundedTPS = MathHelper.clamp(rawTPS, 0.0F, maxTPS);
        this.TPS = (float)this.round((double)boundedTPS);
        this.adjustTicks = boundedTPS - maxTPS;
        this.timestamp = System.nanoTime();
    }

    public double round(double input) {
        return (double)Math.round(input * (double)100.0F) / (double)100.0F;
    }

    public float getTPS() {
        return this.TPS;
    }

    public float getAdjustTicks() {
        return this.adjustTicks;
    }

    public long getTimestamp() {
        return this.timestamp;
    }
}
Код из жирафа

Jiraf:
Expand Collapse Copy
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package wtf.expensive;

import com.google.common.eventbus.EventBus;
import wtf.expensive.events.impl.game.EventKey;
import wtf.expensive.util.TPSCalc;

public class Jiraf {
    public static UserData userData;
    public boolean playerOnServer = false;
    public static final String CLIENT_NAME = "boostanull solutions";
    private static Jiraf instance;
    private final EventBus eventBus = new EventBus();
    private TPSCalc tpsCalc;
    private final EventKey eventKey = new EventKey(-1);

    public Jiraf() {
        instance = this;
        this.clientLoad();
    }

    private void clientLoad() {
        this.tpsCalc = new TPSCalc();
        this.eventBus.register(this);
    }

    public boolean isPlayerOnServer() {
        return this.playerOnServer;
    }

    public EventBus getEventBus() {
        return this.eventBus;
    }

    public TPSCalc getTpsCalc() {
        return this.tpsCalc;
    }

    public EventKey getEventKey() {
        return this.eventKey;
    }

    public static Jiraf getInstance() {
        return instance;
    }

    public static class UserData {
        final String dontuser;
        final int dontuid;

        public String getDontuser() {
            return this.dontuser;
        }

        public int getDontuid() {
            return this.dontuid;
        }

        public UserData(String dontuser, int dontuid) {
            this.dontuser = dontuser;
            this.dontuid = dontuid;
        }
    }
}
Кто сможет помочь пишите как пофиксить, если надо смогу закинуть рублей 100-150, понимаю что мало но буду благодарен
 

Вложения

  • Снимок экрана 2025-04-19 090624.png
    Снимок экрана 2025-04-19 090624.png
    10.2 KB · Просмотры: 54
Назад
Сверху Снизу