当前位置: 首页>>代码示例>>Java>>正文


Java ConfigBase类代码示例

本文整理汇总了Java中me.ichun.mods.ichunutil.common.core.config.ConfigBase的典型用法代码示例。如果您正苦于以下问题:Java ConfigBase类的具体用法?Java ConfigBase怎么用?Java ConfigBase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ConfigBase类属于me.ichun.mods.ichunutil.common.core.config包,在下文中一共展示了ConfigBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: WindowSetStringArray

import me.ichun.mods.ichunutil.common.core.config.ConfigBase; //导入依赖的package包/类
public WindowSetStringArray(GuiConfigs parent, int w, int h, int minW, int minH, ConfigBase conf, ConfigBase.PropInfo info)
{
    super(parent, 0, 0, w, h, minW, minH, "ichunutil.config.gui.setStringArray", true);
    this.parent = parent;
    this.config = conf;
    this.prop = info;

    elements.add(new ElementButton(this, width / 2 - 30, height - 25, 60, 16, 3, false, 2, 1, "gui.done"));

    try
    {
        String[] vals = (String[])info.field.get(config);
        for(int i = 0; i < vals.length; i++)
        {
            elements.add(new ElementTextInput(this, 10, i * 18 + 20, width - 20, 12, i, prop.comment, vals[i]));
        }
    }
    catch(Exception ignored)
    {
    }
    ;
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:23,代码来源:WindowSetStringArray.java

示例2: save

import me.ichun.mods.ichunutil.common.core.config.ConfigBase; //导入依赖的package包/类
public void save()
{
    ConfigBase config = null;
    for(Tree tree : trees)
    {
        if(tree.element != null)
        {
            tree.config.save();
            break;
        }
    }
    if(ConfigHandler.configKeybind.hasChanged())
    {
        ConfigHandler.configKeybind.save();
    }
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:17,代码来源:ElementPropSetter.java

示例3: WindowSetIntArray

import me.ichun.mods.ichunutil.common.core.config.ConfigBase; //导入依赖的package包/类
public WindowSetIntArray(GuiConfigs parent, int w, int h, int minW, int minH, ConfigBase conf, ConfigBase.PropInfo info)
{
    super(parent, 0, 0, w, h, minW, minH, "ichunutil.config.gui.setIntArray", true);
    this.parent = parent;
    this.config = conf;
    this.prop = info;

    elements.add(new ElementButton(this, width / 2 - 30, height - 25, 60, 16, 3, false, 2, 1, "gui.done"));

    try
    {
        int[] vals = (int[])info.field.get(config);
        for(int i = 0; i < vals.length; i++)
        {
            elements.add(new ElementTextInputNumber(this, 10, i * 18 + 20, width - 20, 12, i, prop.comment, Integer.toString(vals[i]), false));
        }
    }
    catch(Exception ignored)
    {
    }
    ;
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:23,代码来源:WindowSetIntArray.java

示例4: GuiConfigs

import me.ichun.mods.ichunutil.common.core.config.ConfigBase; //导入依赖的package包/类
public GuiConfigs(GuiScreen screen)
{
    VARIABLE_LEVEL = 0;

    Minecraft mc = Minecraft.getMinecraft();

    oriScale = mc.gameSettings.guiScale;
    mc.gameSettings.guiScale = 2;

    oriScreen = screen;

    windowConfigs = new WindowConfigs(this, 0, 0, 0, 0, 0, 0);
    windowCats = new WindowCats(this, 0, 0, 0, 0, 0, 0);
    windowSetter = new WindowSetter(this, 0, 0, 0, 0, 0, 0);
    addWindowOnTop(windowConfigs);
    addWindowOnTop(windowCats);
    addWindowOnTop(windowSetter);

    for(ConfigBase config : ConfigHandler.configs)
    {
        config.enterConfigScreen();
    }

    tooltipTime = 0;
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:26,代码来源:GuiConfigs.java

示例5: postInit

import me.ichun.mods.ichunutil.common.core.config.ConfigBase; //导入依赖的package包/类
public void postInit()
{
    iChunUtil.oreDictBlockCompactRawPorkchop = OreDictionary.getOres("blockCompactRawPorkchop");

    for(ConfigBase cfg : ConfigHandler.configs)
    {
        cfg.setup();
    }

    if(!(iChunUtil.config.eulaAcknowledged.equalsIgnoreCase("true") || iChunUtil.config.eulaAcknowledged.equalsIgnoreCase(getPlayerName())))
    {
        iChunUtil.LOGGER.info("=============================================================");
        iChunUtil.LOGGER.info(I18n.translateToLocal("ichunutil.eula.message"));
        iChunUtil.LOGGER.info(I18n.translateToLocal("ichunutil.eula.messageServer"));
        iChunUtil.LOGGER.info("=============================================================");
    }
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:18,代码来源:ProxyCommon.java

示例6: WindowSetKeyBind

import me.ichun.mods.ichunutil.common.core.config.ConfigBase; //导入依赖的package包/类
public WindowSetKeyBind(GuiConfigs parent, int w, int h, int minW, int minH, String msg, ConfigBase conf, ConfigBase.PropInfo info)
{
    super(parent, 0, 0, w, h, minW, minH, "ichunutil.config.gui.setKeyBind", true);
    this.parent = parent;
    this.config = conf;
    this.prop = info;
    message = msg;
    hook = new ElementKeyBindHook(this, 0, 0, 0, 0, 0, true);
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:10,代码来源:WindowSetKeyBind.java

示例7: draw

import me.ichun.mods.ichunutil.common.core.config.ConfigBase; //导入依赖的package包/类
public void draw(int mouseX, int mouseY) //4 pixel border?
{
    if(parent.windowCats.configs.selectedIdentifier.isEmpty())
    {
        return;
    }
    else
    {
        for(me.ichun.mods.ichunutil.client.gui.window.element.ElementListTree.Tree tree : parent.windowCats.configs.trees)
        {
            if(tree.selected)
            {
                ConfigBase.CategoryInfo cat = (ConfigBase.CategoryInfo)tree.attachedObject;
                if(!cat.equals(selectedCat) && parent.windowCats.selectedConfig != null)
                {
                    props.saveTimeout = 0;
                    props.save();

                    selectedCat = cat;
                    titleLocale = cat.name;

                    props.trees.clear();
                    props.sliderProg = 0.0D;
                    for(ConfigBase.PropInfo prop : parent.windowCats.selectedConfig.categories.get(selectedCat))
                    {
                        props.createTree(parent.windowCats.selectedConfig, prop, 17);
                    }
                }
            }
        }
    }
    super.draw(mouseX, mouseY);
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:34,代码来源:WindowSetter.java

示例8: WindowSetNestedIntArray

import me.ichun.mods.ichunutil.common.core.config.ConfigBase; //导入依赖的package包/类
public WindowSetNestedIntArray(GuiConfigs parent, int w, int h, int minW, int minH, ConfigBase conf, ConfigBase.PropInfo info)
{
    super(parent, 0, 0, w, h, minW, minH, "ichunutil.config.gui.setIntArray", true);
    this.parent = parent;
    this.config = conf;
    this.prop = info;

    elements.add(new ElementButton(this, width / 2 - 30, height - 25, 60, 16, 3, false, 2, 1, "gui.done"));

    try
    {
        NestedIntArray vals = (NestedIntArray)info.field.get(config);
        int i = 0;
        for(Map.Entry<Integer, ArrayList<Integer>> e : vals.values.entrySet())
        {
            elements.add(new ElementTextInputNumber(this, 10, i * 18 + 20, 40, 12, i * 100, prop.comment, Integer.toString(e.getKey()), false));
            ArrayList<Integer> nest = e.getValue();
            for(int j = 0; j < nest.size(); j++)
            {
                elements.add(new ElementTextInputNumber(this, 52 + (j * 39), i * 18 + 20, 40, 12, i * 100 + (j + 1), prop.comment, Integer.toString(nest.get(j)), false));
            }
            i++;
        }
    }
    catch(Exception ignored)
    {
    }
    ;
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:30,代码来源:WindowSetNestedIntArray.java

示例9: draw

import me.ichun.mods.ichunutil.common.core.config.ConfigBase; //导入依赖的package包/类
public void draw(int mouseX, int mouseY) //4 pixel border?
{
    if(parent.windowConfigs.configs.selectedIdentifier.isEmpty())
    {
        return;
    }
    else
    {
        for(me.ichun.mods.ichunutil.client.gui.window.element.ElementListTree.Tree tree : parent.windowConfigs.configs.trees)
        {
            if(tree.selected)
            {
                ConfigBase conf = (ConfigBase)tree.attachedObject;
                if(conf != selectedConfig)
                {
                    //NEW SELECTED CONFIG;
                    selectedConfig = conf;
                    titleLocale = selectedConfig.getModName();
                    configs.selectedIdentifier = "";
                    configs.trees.clear();

                    for(Map.Entry<ConfigBase.CategoryInfo, ArrayList<ConfigBase.PropInfo>> e : selectedConfig.categories.entrySet())
                    {
                        configs.createTree(null, e.getKey(), 13, 0, false, false);
                    }
                }
            }
        }
    }
    super.draw(mouseX, mouseY);
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:32,代码来源:WindowCats.java

示例10: WindowConfigs

import me.ichun.mods.ichunutil.common.core.config.ConfigBase; //导入依赖的package包/类
public WindowConfigs(IWorkspace parent, int x, int y, int w, int h, int minW, int minH)
{
    super(parent, x, y, w, h, minW, minH, "ichunutil.config.gui.options", true);

    elements.add(new ElementButton(this, 10, height - 22, 60, 16, -1, false, 0, 1, "gui.done"));

    configs = new ElementListTree(this, BORDER_SIZE + 1, BORDER_SIZE + 1 + 10, width - (BORDER_SIZE * 2 + 2), height - BORDER_SIZE - 22 - 16, 3, false, false);
    elements.add(configs);

    for(ConfigBase config : ConfigHandler.configs)
    {
        configs.createTree(null, config, 13, 0, false, false);
    }
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:15,代码来源:WindowConfigs.java

示例11: onGuiClosed

import me.ichun.mods.ichunutil.common.core.config.ConfigBase; //导入依赖的package包/类
@Override
public void onGuiClosed()
{
    for(ConfigBase config : ConfigHandler.configs)
    {
        config.exitConfigScreen();
    }

    Keyboard.enableRepeatEvents(false);

    Minecraft.getMinecraft().gameSettings.guiScale = oriScale;
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:13,代码来源:GuiConfigs.java

示例12: onClientConnection

import me.ichun.mods.ichunutil.common.core.config.ConfigBase; //导入依赖的package包/类
@SubscribeEvent
public void onClientConnection(FMLNetworkEvent.ClientConnectedToServerEvent event)
{
    connectingToServer = true;

    if(iChunUtil.userIsPatron)
    {
        patronUpdateServerAsPatron = true;
    }

    for(ConfigBase conf : ConfigHandler.configs)
    {
        conf.storeSession();
    }
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:16,代码来源:EventHandlerClient.java

示例13: onClientDisconnect

import me.ichun.mods.ichunutil.common.core.config.ConfigBase; //导入依赖的package包/类
public void onClientDisconnect()
{
    EntityTrackerHandler.onClientDisconnect();
    PatronEffectRenderer.onClientDisconnect();

    GrabHandler.grabbedEntities.get(Side.CLIENT).clear();

    for(ConfigBase conf : ConfigHandler.configs)
    {
        conf.resetSession();
    }

    EntityHelper.profileCache = null;
    EntityHelper.sessionService = null;
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:16,代码来源:EventHandlerClient.java

示例14: execute

import me.ichun.mods.ichunutil.common.core.config.ConfigBase; //导入依赖的package包/类
@Override
public void execute(Side side, EntityPlayer player)
{
    for(ConfigBase conf : ConfigHandler.configs)
    {
        if(conf.getModId().equals(modId))
        {
            for(Field field : conf.sessionProp)
            {
                try
                {
                    field.setAccessible(true);
                    if(vars.containsKey(field.getName()))
                    {
                        Object ori = field.get(conf);
                        field.set(conf, vars.get(field.getName()));
                        conf.onSessionChange(field, ori);
                    }
                }
                catch(Exception ignored)
                {
                }
            }
            conf.onReceiveSession();
            break;
        }
    }
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:29,代码来源:PacketSession.java

示例15: onPlayerLogin

import me.ichun.mods.ichunutil.common.core.config.ConfigBase; //导入依赖的package包/类
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event)
{
    for(ConfigBase conf : ConfigHandler.configs)
    {
        if(!conf.sessionProp.isEmpty())
        {
            conf.sendPlayerSession(event.player);
        }
    }
    iChunUtil.channel.sendTo(new PacketPatrons(null), event.player);
    iChunUtil.channel.sendTo(new PacketUserShouldShowUpdates(iChunUtil.config.versionNotificationTypes == 0 || (iChunUtil.config.versionNotificationTypes == 1 && ((EntityPlayerMP)event.player).mcServer.getPlayerList().canSendCommands(event.player.getGameProfile()))), event.player);
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:14,代码来源:EventHandlerServer.java


注:本文中的me.ichun.mods.ichunutil.common.core.config.ConfigBase类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。