本文整理汇总了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)
{
}
;
}
示例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();
}
}
示例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)
{
}
;
}
示例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;
}
示例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("=============================================================");
}
}
示例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);
}
示例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);
}
示例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)
{
}
;
}
示例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);
}
示例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);
}
}
示例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;
}
示例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();
}
}
示例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;
}
示例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;
}
}
}
示例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);
}