Проблемы с открытием Gui

Версия Minecraft
1.19.3
API
Fabric
33
1
Я создал Gui с помощью owo-lib но не получается открыть саму менюшку с помощью придмета. Пробовал с помощью MinecraftClient.getIntance().setScreen(new LevelingScreen)
На вики странице мода не нашёл этого.
 
33
1
есть только setScreen() и по идеи это тоже самое но когда я это вожу intelliJ IDEA ругается.
Вот код:
LevelingScreen:
package net.baraban4ik.leveling.gui;


import io.wispforest.owo.ui.base.BaseOwoScreen;
import io.wispforest.owo.ui.base.BaseUIModelScreen;
import io.wispforest.owo.ui.component.LabelComponent;
import io.wispforest.owo.ui.container.FlowLayout;
import io.wispforest.owo.ui.core.OwoUIAdapter;
import net.baraban4ik.leveling.interfaces.StatsContainer;
import net.minecraft.client.MinecraftClient;
import net.minecraft.text.Text;
import org.jetbrains.annotations.NotNull;

public class LevelingScreen extends BaseUIModelScreen<FlowLayout> {


    protected LevelingScreen(Class<FlowLayout> rootComponentClass, DataSource source) {
        super(rootComponentClass, DataSource.file("leveling_gui_model.xml"));

    }

    @Override
    protected void build(FlowLayout rootComponent) {
        StatsContainer Stats = (StatsContainer) MinecraftClient.getInstance().getSession();

        rootComponent.childById(LabelComponent.class, "test-label").text(Text.of(Float.toString(Stats.getStats("Level"))));
    }
}
 
Последнее редактирование:
Сверху