本文整理汇总了Java中cpw.mods.fml.common.event.FMLPreInitializationEvent.getSuggestedConfigurationFile方法的典型用法代码示例。如果您正苦于以下问题:Java FMLPreInitializationEvent.getSuggestedConfigurationFile方法的具体用法?Java FMLPreInitializationEvent.getSuggestedConfigurationFile怎么用?Java FMLPreInitializationEvent.getSuggestedConfigurationFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cpw.mods.fml.common.event.FMLPreInitializationEvent
的用法示例。
在下文中一共展示了FMLPreInitializationEvent.getSuggestedConfigurationFile方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ProspectingConfiguration
import cpw.mods.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
public ProspectingConfiguration(FMLPreInitializationEvent e) {
final Configuration config = new Configuration(e.getSuggestedConfigurationFile());
config.load();
// this.nugget_amount = config.getInt("Nuggets Per Chunk", "General", 1, 0, 999999999, "The number of nuggets that can be prospected in a chunk, if it has applicable ore in it.");
this.chunk_expiry = config.getInt("Chunk Expiry", "Caching", 300, 1, 999999999, "The number of seconds until a chunk's cache expires. After the cache expires, the chunk will be re-scanned for ore when it is prospected.");
this.nugget_chance = config.getFloat("Nugget Chance", "Probabilities", 0.8f, 0f, 1f, "The chance that a chunk will have nuggets. The number of nuggets produced is determined by the \"Ore Per Nugget\" setting");
this.ore_per_nugget = config.getInt("Ore Per Nugget", "Probabilities", 50, 0, 4096, "The number of ore, on average, that will produce 1 nugget in a chunk. For example, if this value is 50, and a chunk has 100 iron ore, you can expect to get 2 nuggets from the chunk through prospecting.");
this.ore_per_nugget_deviation = config.getInt("Ore Per Nugget Deviation", "Probabilities", 10, 0, 4096, "The maximum deviation for nugget calculations. Your value for \"Ore Per Nugget\" well be randomly modified +- this value when calculating nuggets.");
this.max_nuggets = config.getInt("Maximum Nugget Count", "Probabilities", 5, 0, 4096, "The maximum number of nuggets to spawn in a given chunk for each ore.");
this.flower_chance = config.getFloat("Flower Chance", "Probabilities", 0.8f, 0f, 1f, "The chance that a given chunk will produce flowers, if it contains ore. The number of flowers produced is determined by the \"Ore Per Flower\" setting.");
this.flower_false_chance = config.getFloat("Flower False Positive Chance", "Probabilities", 0.05f, 0f, 1f, "This chance that a chunk will have some indicator flowers spawn despite having no ore.");
this.ore_per_flower = config.getInt("Ore Per Flower", "Probabilities", 50, 0, 4096, "The number of ore, on average, that it takes to produce 1 flower on the surface.");
this.ore_per_flower_deviation = config.getInt("Ore Per Flower Deviation", "Probabilities", 10, 0, 4096, "The maximum deviation for flower calculations. Your value for \"Ore Per Flower\" well be randomly modified +- this value when calculating flowers.");
this.max_flowers = config.getInt("Maximum Flower Count", "Probabilities", 10, 0, 4096, "The maximum number of flowers to spawn in a given chunk for each type of ore.");
config.save();
}
示例2: LoadAll
import cpw.mods.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
/**
* This loads all of the data from the config file.
*/
public static void LoadAll(FMLPreInitializationEvent event)
{
config = new Configuration(event.getSuggestedConfigurationFile());
config.getConfigFile();
config.load();
config.save();
config.addCustomCategoryComment("Blocks", "Contains some settings about blocks.");
config.addCustomCategoryComment("ID", "Some settings to do with ID's");
config.addCustomCategoryComment("OreGeneration", "Contains some settings that are centered around ore generation");
config.addCustomCategoryComment("Minecraft", "Contains some settings that affect what this mod does when minecraft is loaded");
config.addCustomCategoryComment("Other", "Settings that don't fit in any other catagories");
config.addCustomCategoryComment("ProjectE", "Contains settings which affect ProjectE and this mod.");
config.addCustomCategoryComment("Extra Utilities", "Adds settings which affect Extra Utilities and this mod.");
config.addCustomCategoryComment("AutoBlocks", "A section which contains all of the auto blocks for this mod");
config.addCustomCategoryComment("AutoItem", "A section which contains all of the auto items for this mod");
config.load();
config.save();
Write();
HandleCompat();
config.save();
}
示例3: preInit
import cpw.mods.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
public void preInit(FMLPreInitializationEvent e)
{
config = new Configuration(e.getSuggestedConfigurationFile());
config.setCategoryRequiresMcRestart(Configuration.CATEGORY_GENERAL, false);
config.setCategoryRequiresWorldRestart(Configuration.CATEGORY_GENERAL, false);
config.setCategoryRequiresMcRestart("NoGroup", false);
config.setCategoryRequiresWorldRestart("NoGroup", false);
config.setCategoryComment(Configuration.CATEGORY_GENERAL, "Valid colors are: AQUA, BLACK, BLUE, BOLD, DARK_AQUA, DARK_BLUE, DARK_GRAY, DARK_GREEN, DARK_PURPLE, DARK_RED, GOLD, GRAY, GREEN, ITALIC, LIGHT_PURPLE, OBFUSCATED, RED, RESET, STRIKETHROUGH, UNDERLINE, WHITE, YELLOW.");
config.setCategoryComment("NoGroup", "Here you can configure the tag and color of the unassigned group.");
ConfigHandler.getConfig(config);
super.preInit(e);
}
示例4: preInit
import cpw.mods.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent e)
{
config = new Configuration(e.getSuggestedConfigurationFile());
ConfigurationKorTech.syncConfig();
this.proxy.preInit(e);
}
示例5: preInit
import cpw.mods.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
long time = System.nanoTime();
cfg = new Config(new Configuration(event.getSuggestedConfigurationFile()));
ContentRegistry.preInit();
logger.info("Finished pre-init in %d ms", (System.nanoTime() - time) / 1000000);
}
示例6: ConfigLoader
import cpw.mods.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
public ConfigLoader(FMLPreInitializationEvent event)
{
logger = event.getModLog();
config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
load();
}
示例7: preInit
import cpw.mods.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
Config.vrCreeperSwellDistance = config.get(Configuration.CATEGORY_GENERAL, "vrCreeperSwellDistance", 1.75, "Distance at which creepers swell and explode for VR players. Default: 1.75").getDouble(1.75D);
if (config.hasChanged()) config.save();
}
示例8: preInit
import cpw.mods.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent e) {
log = e.getModLog();
//MinecraftForge.EVENT_BUS.register(this);
//FMLCommonHandler.instance().bus().register(this);
config = new Configuration(e.getSuggestedConfigurationFile());
//config.load();
tab = CreativeTab.instance;
item = new ItemPackage();
GameRegistry.registerItem(item, "cheatycomputers.package");
}
示例9: preInit
import cpw.mods.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@Mod.EventHandler
@SideOnly(Side.CLIENT)
public void preInit(FMLPreInitializationEvent e)
{
Configuration config = new Configuration(e.getSuggestedConfigurationFile());
config.load();
//读取配置文件
ConfigVar.onlinecheck = config.get("Online", "Check", false).getBoolean();
ConfigVar.version = config.get("Online", "Version", "v1.0").getString();
ConfigVar.url = config.get("Online", "url", "http://127.0.0.1/").getString();
ConfigVar.IsTwoAddress = config.get("Server", "1sTwoAddress", false).getBoolean();
ConfigVar.ServerAddress = config.get("Server", "Address1", "127.0.0.1").getString();
ConfigVar.ServerAddress1 = config.get("Server", "Address2", "127.0.0.1").getString();
ConfigVar.Captain = config.get("Server", "Captain", "Minecraft 1.7.10").getString();
ConfigVar.announcement = config.get("Server", "Announcement", "").getString();
ConfigVar.announcementmove = config.get("Server", "AnnouncementMove", false).getBoolean();
ConfigVar.debug = config.get("General", "debugMode", false).getBoolean();
ConfigVar.ChangeLogFilename = config.get("Online", "ChangelogFilename", "NewMenuChangelog.txt").getString();
ConfigVar.JsonFilename = config.get("Online", "JsonFilename", "NewMenu.json").getString();
config.save();
//结束读取
if(ConfigVar.onlinecheck)
{
this.changeLog = InternetUtil.LoadText(ConfigVar.url + "/" + ConfigVar.ChangeLogFilename);
this.jsonString = InternetUtil.LoadText(ConfigVar.url + "/" + ConfigVar.JsonFilename);
}
Display.setTitle(ConfigVar.Captain);
MinecraftForge.EVENT_BUS.register(NewMenuHandler.instance);
}
示例10: preInit
import cpw.mods.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
BaseDir = new File(event.getModConfigurationDirectory(), Version.MOD_ID);
Config = new FairyConfig(event.getSuggestedConfigurationFile());
if (!BaseDir.exists())
BaseDir.mkdir();
proxy.preInit();
}
示例11: preinit
import cpw.mods.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@EventHandler
public void preinit(FMLPreInitializationEvent event)
{
Configuration config = null;
File cfgFile = event.getSuggestedConfigurationFile();
try {
config = new Configuration(cfgFile);
isOcean = config.getBoolean("is ocean", "general", true, "Enabling this will cause the overworld to be an ocean world");
instantDrown = config.getBoolean("instant drown", "general", true, "Enabling this will cause you to drown instantly when you run out of air bubbles");
//treasureItems = config.getStringList("items", "treasure", new String[] {"minecraft:gold_nugget:0=50,1:4", "minecraft:melon_seeds:0=10,1:10", "minecraft:gold_ingot:0=10,1:2", "minecraft:golden_apple:0=10,1:1"}, "List of items to use in treasure generation. Use this format: modid:itemName:metaId=weight,qtyMin:qtyMax");
} catch(Exception e) {
FMLLog.severe("[EvilOcean] Error loading config, deleting file and resetting");
e.printStackTrace();
if(cfgFile.exists()) {
cfgFile.delete();
}
config = new Configuration(cfgFile);
}
if(config.hasChanged()) {
config.save();
}
generators.put("raft", new RaftPlatform());
MinecraftForge.EVENT_BUS.register(this);
}
示例12: loadConfig
import cpw.mods.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@EventHandler
public void loadConfig(FMLPreInitializationEvent evt) {
File configFile = evt.getSuggestedConfigurationFile();
config = new Config(new Configuration(configFile));
Coreder.DEBUGGER.info("Loading config file");
config.initialize().load().save();
if (config.homestuck) {
Coreder.echo("EVERYBODY OUT OF THE GOD DAMN WAY.");
Coreder.echo("YOU GOT A PROCESSOR FULL OF MINECRAFT, A MOD FULL OF LOADED SETTINGS, AND A LOG FULL OF TEXT.");
}
else {
Coreder.echo("Configuration loaded");
}
}
示例13: readConfig
import cpw.mods.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
private void readConfig(FMLPreInitializationEvent event) {
Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());
allowDebugDevice = cfg.getBoolean("allowDebugDevice", Configuration.CATEGORY_GENERAL, defaultAllowDebugDevice,
"Whether to make the debugging device available.\nThis writes to the Minecraft log under computer control; you should\ndisable this unless you're debugging something that you can't debug any\nother way.\nDoes not provide input, only output.\n");
logUIFErrors = cfg.getBoolean("logUIFErrors", Configuration.CATEGORY_GENERAL, defaultLogUIFErrors,
"Whether to log the reason for rejecting invalid UIF transmissions.\nThis writes to the Minecraft log under (partial) computer control; you\nshould disable this unless you're debugging something that you can't\ndebug any other way.\n");
biosOptional = cfg.getBoolean("biosOptional", Configuration.CATEGORY_GENERAL, defaultBIOSOptional,
"Whether computers with no EEPROM installed will use the Standard BIOS.\nThis is a pretty cheaty option, but may be necessary, since there is not\ncurrently a crafting recipe for the Standard BIOS.\nIf the Standard BIOS is missing from your jar, this option will have no\neffect.\n");
logInvokes = cfg.getBoolean("logInvokes", Configuration.CATEGORY_GENERAL, defaultLogInvokes,
"Log ALL invokes, replies, and signals to the Minecraft log!\nYou should pretty seriously consider never enabling this.\n");
logDeadlineSlippage = cfg.getBoolean("logDeadlineSlippage", Configuration.CATEGORY_GENERAL, defaultLogDeadlineSlippage,
"Log whenever runThreaded terminates due to a missed deadline.\nMainly useful for debugging OCMOS.\n");
maxInvokeSize = cfg.getInt("maxInvokeSize", Configuration.CATEGORY_GENERAL, defaultMaxInvokeSize, 128, 1<<30,
"The maximum size, in bytes, an outgoing command can take. The higher you\nset this option, the more memory a malicious program can consume.\n");
deadlineMilliseconds = cfg.getInt("deadlineMilliseconds", Configuration.CATEGORY_GENERAL, defaultDeadlineMilliseconds, 0, 100000000,
"The maximum amount of time that runThreaded can run before giving up on\nmeeting the cycle budget. This option is a workaround for a difficult-\nto-debug hang in the OCMOS MMU, and should also help on overloaded\nservers.\n0 = no deadline\n");
banksPerMebibyte = cfg.getInt("banksPerMebibyte", Configuration.CATEGORY_GENERAL, defaultBanksPerMebibyte, 1, 1<<30,
"The number of 4096-byte banks a RAM module provides, per mebibyte of\nmemory it would provide a Lua computer.\n65C02 computers require MUCH less memory to perform a task than Lua\ncomputers do. The default attempts to provide a comfortable amount of\nmemory, without making large memory modules pointless.\n");
cpuCyclesPerTick = getTierBasedIntList(cfg, "cpuCyclesPerTick", Configuration.CATEGORY_GENERAL, defaultCpuCyclesPerTick,
"CPU cycles per Minecraft tick, at each CPU tier.\nDefault values are 25000, 50000, 100000 (500KHz/1MHz/2MHz)");
ramTier1Latency = getTierBasedIntList(cfg, "ramTier1Latency", Configuration.CATEGORY_GENERAL, defaultRamTier1Latency,
"CPU cycles per tier 1 RAM access, at each CPU tier.");
ramTier2Latency = getTierBasedIntList(cfg, "ramTier2Latency", Configuration.CATEGORY_GENERAL, defaultRamTier2Latency,
"CPU cycles per tier 2 RAM access, at each CPU tier.");
ramTier3Latency = getTierBasedIntList(cfg, "ramTier3Latency", Configuration.CATEGORY_GENERAL, defaultRamTier3Latency,
"CPU cycles per tier 3 RAM access, at each CPU tier.");
romLatency = getTierBasedIntList(cfg, "romLatency", Configuration.CATEGORY_GENERAL, defaultRomLatency,
"CPU cycles per ROM access, at each CPU tier.");
ioLatency = getTierBasedIntList(cfg, "ioLatency", Configuration.CATEGORY_GENERAL, defaultIoLatency,
"CPU cycles per IO-space access, at each CPU tier.");
for(int n = 0; n < 3; ++n) {
if(cpuCyclesPerTick[n] < 1) cpuCyclesPerTick[n] = 1;
if(ramTier1Latency[n] < 1) ramTier1Latency[n] = 1;
if(ramTier2Latency[n] < 1) ramTier2Latency[n] = 1;
if(ramTier3Latency[n] < 1) ramTier3Latency[n] = 1;
if(romLatency[n] < 1) romLatency[n] = 1;
if(ioLatency[n] < 1) ioLatency[n] = 1;
}
cfg.getCategory(Configuration.CATEGORY_GENERAL).setPropertyOrder(new ArrayList<String>(Arrays.asList("cpuCyclesPerTick","deadlineMilliseconds","logDeadlineSlippage","banksPerMebibyte","romLatency","ramTier1Latency","ramTier2Latency","ramTier3Latency","ioLatency","allowDebugDevice","logUIFErrors","logInvokes","maxInvokeSize","biosOptional")));
cfg.save();
}
示例14: ConfigLoader
import cpw.mods.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
public ConfigLoader(FMLPreInitializationEvent event) {
config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
load();
}
示例15: preInit
import cpw.mods.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
this.config = new Configuration(event.getSuggestedConfigurationFile()); // Starting config
this.config.load(); // And loading it up
breakGlass = this.config.get("generic", "Can we break glass and other fragile things with our projectiles? (default true)", true).getBoolean();
sendBlockBreak = this.config.get("generic", "Do we send a BlockBreak event when breaking things with our projectiles? (default true)", true).getBoolean();
useModels = this.config.get("generic", "Are we using models or icons for held weapons? (default true for models. False for icons)", true).getBoolean();
noCreative = this.config.get("generic", "Are we removing disabled weapons from the creative menu too? (default false. On there, but uncraftable)", false).getBoolean();
allowTurret = this.config.get("Arms Assistant", "Am I enabled? (default true)", true).getBoolean();
restrictTurretRange = this.config.get("Arms Assistant", "Is my firing range limited to a maximum of 32 blocks? (default true. Set false for 'Shoot as far as your weapon can handle'.)", true).getBoolean();
// Item registry here
this.registerAmmo();
this.registerWeapons(event.getSide().isClient());
this.registerProjectiles();
this.registerBlocks();
addAllProps(event, this.config); // All items are registered now. Making recipes and recording props
this.config.save(); // Done with config, saving it
PacketHandler.initPackets(); // Used for sending particle packets, so I can do my thing purely on the server side
// Registering the Arms Assistant
EntityRegistry.registerModEntity(Entity_AA.class, "quiverchevsky_turret", 0, this, 80, 1, true);
//EntityRegistry.registerModEntity(Entity_BB.class, "quiverchevsky_flyingBB", 1, this, 80, 1, true);
proxy.registerTurretRenderer();
// Do I have to register a crafting listener of sorts? To what end?
RecipeSorter.register("quiverchevsky:recipehandler", Recipe_ERA.class, RecipeSorter.Category.SHAPED, "after:minecraft:shapeless");
RecipeSorter.register("quiverchevsky:recipehandler_2", Recipe_Weapon.class, RecipeSorter.Category.SHAPED, "after:minecraft:shapeless");
RecipeSorter.register("quiverchevsky:recipehandler_3", Recipe_Ammo.class, RecipeSorter.Category.SHAPELESS, "after:minecraft:shapeless");
Listener listener = new Listener();
FMLCommonHandler.instance().bus().register(listener);
MinecraftForge.EVENT_BUS.register(listener);
if (event.getSide().isServer()) { return; } // Client-only from this point.
ListenerClient listenerClient = new ListenerClient();
FMLCommonHandler.instance().bus().register(listenerClient);
MinecraftForge.EVENT_BUS.register(listenerClient);
}