All Downloads are FREE. Search and download functionalities are using the official Maven repository.

top.hendrixshen.magiclib.impl.i18n.minecraft.MinecraftLanguageManager Maven / Gradle / Ivy

There is a newer version: 0.6.59
Show newest version
package top.hendrixshen.magiclib.impl.i18n.minecraft;

import lombok.Getter;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.class_310;
import top.hendrixshen.magiclib.MagicLib;
import top.hendrixshen.magiclib.api.event.minecraft.LanguageManagerListener;
import top.hendrixshen.magiclib.api.event.minecraft.MinecraftListener;
import top.hendrixshen.magiclib.impl.i18n.MagicLanguageManager;

@Environment(EnvType.CLIENT)
public class MinecraftLanguageManager implements LanguageManagerListener, MinecraftListener {
    @Getter
    private static final MinecraftLanguageManager instance = new MinecraftLanguageManager();

    private MinecraftLanguageManager() {
        MagicLib.getInstance().getEventManager().register(LanguageManagerListener.class, this);
        MagicLib.getInstance().getEventManager().register(MinecraftListener.class, this);
    }

    public static void init() {
        // NO-OP
    }

    @Override
    public void postLanguageReload() {
        MagicLanguageManager.getInstance().setCurrentCode(class_310.method_1551().field_1690.field_1883);
    }

    @Override
    public void postLanguageSelect() {
        // NO-OP
    }

    @Override
    public void postInit() {
        MagicLanguageManager.getInstance().setCurrentCode(class_310.method_1551().field_1690.field_1883);
        MagicLanguageManager.getInstance().registerLanguageProvider(ResourceLanguageProvider.getInstance());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy