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

top.hendrixshen.magiclib.compat.modmenu.ModMenuCompatApi Maven / Gradle / Ivy

There is a newer version: 0.7.398+fe2125a-beta
Show newest version
package top.hendrixshen.magiclib.compat.modmenu;

import io.github.prospector.modmenu.api.ModMenuApi;

//#if MC > 11404
//$$ import io.github.prospector.modmenu.api.ConfigScreenFactory;
//#else
import java.util.function.Function;
//#endif
import net.minecraft.class_437;

public interface ModMenuCompatApi extends ModMenuApi {
    ConfigScreenFactoryCompat getConfigScreenFactoryCompat();

    String getModIdCompat();

    @Override
    //#if MC > 11404
    //$$ default ConfigScreenFactory getModConfigScreenFactory() {
    //#else
    default Function getConfigScreenFactory() {
    //#endif
        return (screen) -> this.getConfigScreenFactoryCompat().create(screen);
    }

    //#if MC <= 11404
    @Override
    default String getModId() {
        return this.getModIdCompat();
    }
    //#endif

    @FunctionalInterface
    interface ConfigScreenFactoryCompat {
        S create(class_437 screen);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy