top.hendrixshen.magiclib.impl.i18n.minecraft.MinecraftLanguageManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of magiclib-minecraft-api-1.19.3-fabric Show documentation
Show all versions of magiclib-minecraft-api-1.19.3-fabric Show documentation
Unleash magic into Minecraft, infuse souls, ascend to heaven!
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