Package codechicken.nei.api

Source Code of codechicken.nei.api.NEIInfo

package codechicken.nei.api;

import codechicken.nei.NEIClientConfig;
import codechicken.nei.config.OptionCycled;
import net.minecraft.world.World;

import java.util.LinkedList;

public class NEIInfo
{
    public static final LinkedList<INEIModeHandler> modeHandlers = new LinkedList<INEIModeHandler>();

    public static void load(World world) {
        OptionCycled modeOption = (OptionCycled) NEIClientConfig.getOptionList().getOption("inventory.cheatmode");
        modeOption.parent.synthesizeEnvironment();
        if(!modeOption.optionValid(modeOption.value())) {
            modeOption.copyGlobals();
            modeOption.cycle();
        }
    }

    public static boolean isValidMode(int mode) {
        for(INEIModeHandler handler : modeHandlers)
            if(!handler.isModeValid(mode))
                return false;
       
        return true;
    }
}
TOP

Related Classes of codechicken.nei.api.NEIInfo

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.