本文整理汇总了Java中cpw.mods.fml.common.Mod.PreInit类的典型用法代码示例。如果您正苦于以下问题:Java PreInit类的具体用法?Java PreInit怎么用?Java PreInit使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PreInit类属于cpw.mods.fml.common.Mod包,在下文中一共展示了PreInit类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: preInit
import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent event) {
apLogger.setParent(FMLLog.getLogger());
apLogger.info("[Apocalyptic] Starting pre-initialization");
apLogger.info("[Apocalyptic] Loading configuration");
isServer = event.getSide().isServer();
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
tePerChunk = config.get("general", "TileEntitiesPerChunk", 900).getInt(900);
silverfishChance = config.get("general", "SilverfishSpawnChance", 0.001).getDouble(0.001);
transferLimit = config.get("transfer", "limit", new String[]{"0:0:0", "1:X:1"}).getStringList();
transferTagRemove = config.get("transfer", "tag-remove", new String[]{"0:0", "1:X"}).getStringList();
//databaseURL = config.get("database", "URL", "jdbc:mysql://site.ru:3306/database").getString();
//databaseUsername = config.get("database", "Username", "Username").getString();
//databasePassword = config.get("database", "Password", "Password").getString();
config.load();
config.save();
this.initCustomPotions(event);
apLogger.info("[Apocalyptic] Pre-initialization completed");
}
示例2: preInit
import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent event) {
logger = Logger.getLogger(ID);
logger.setParent(FMLLog.getLogger());
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
post_url = config.get(config.CATEGORY_GENERAL, "post_url", "http://localhost/post/", "This is the url of which the mod posts updates to.").value;
identifier = config.get(config.CATEGORY_GENERAL, "identifier", "knownplayers", "This string determines the value of the id field in the post request.").value;
debug = config.get(Configuration.CATEGORY_GENERAL, "debug", false, "Enable debuging?").getBoolean(true);
event_login = config.get("event", "login", true, "Send POST on player login?").getBoolean(true);
event_logout = config.get("event", "logout", true, "Send POST on player logout?").getBoolean(true);
event_respawn = config.get("event", "respawn", true, "Send POST on player respawn?").getBoolean(true);
event_changedimension = config.get("event", "changedimension", true, "Send POST when player changes world?").getBoolean(true);
config.save();
logger.info("debug: " + debug);
logger.info("identifier: " + identifier);
logger.info("post_url: " + post_url);
logger.info("event_login: " + event_login);
logger.info("event_logout: " + event_logout);
logger.info("event_respawn: " + event_respawn);
logger.info("event_changedimension: " + event_changedimension);
}
示例3: preLoad
import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preLoad(FMLPreInitializationEvent event) {
NetworkRegistry.instance().registerGuiHandler(this, this.proxy);
Configuration conf = new Configuration(
new File(Loader.instance().getConfigDir(), "OilCraft.cfg"));
conf.load();
OilGenerator.makeInstance(
conf.get("blocks", "Oil_Generator", 500).getInt(), 0);
int stillId = conf.get("blocks", "Oil_Still", 601).getInt();
OilStill.makeInstance(stillId, 7);
// Minecraft makes the silly assumption that the block Id of the flow
// version of a liquid is 1 less than the still version of that same
// liquid. In this way it can build a connection between the two blocks
// so they can spawn each other.
OilFlow.makeInstance(stillId - 1, 7);
conf.save();
proxy.preInit();
}
示例4: preInit
import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent event){
// super Log Helper init for LEDLights
LogHelper.init();
// Load config to get our IDs and so
ConfigHandler.init(event.getSuggestedConfigurationFile());
// Loading blocks
ModBlocks.init();
ModItems.init();
ModCrafting.init();
ClientProxy.setCustomRenderers();
}
示例5: preInit
import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent event) {
// Register the Sound Handler (Client only)
MinecraftForge.EVENT_BUS.register(new SoundHandler());
// Initialize the log helper
LogHelper.init();
// Initialize the Blocks and Items
BlockHelper.init();
ItemHelper.init();
// Initialize the Recipes and Dungeon loot
RecipeHelper.init();
LootHelper.init();
// Register the OreGenerator
GameRegistry.registerWorldGenerator(new OreWorldGeneratorEnd());
GameRegistry.registerWorldGenerator(new OreWorldGeneratorOverWorld());
GameRegistry.registerWorldGenerator(new OreWorldGeneratorNether());
// Initialize the CapeHelper
CapeHelper.init();
// Initialize the Entitys
EntityHelper.init();
// Set the name for the creative tab
LanguageRegistry.instance().addStringLocalization("itemGroup." + Reference.MOD_ID, "Mythical Gods Mod");
}
示例6: preInit
import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent event) {
PaleoPacketHandler.registerChannel();
proxy.registerRenders();
ConfigurationHandler.init(new File(event.getModConfigurationDirectory().getAbsolutePath()
+ File.separator + Reference.CHANNEL_NAME + File.separator + Reference.MOD_ID
+ ".cfg"));
LocalizationHandler.loadLanguages();
ModItem.init();
ModBlock.init();
proxy.PreInitRenders();
WorkTableCogHelper.initRecipes();
MixingTableHelper.initRecipes();
ModLoaded.PreInit_modloaded();
}
示例7: preInit
import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent event) {
// TODO: Read configuration files for blocks and items
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
//someConfigFlag = Boolean.parseBoolean(config.get(ConfigCategory_Generic, "someConfig", "true").value);
config.addCustomCategoryComment(ConfigCategory_Generic, "All generic settings for questcraft");
Property someConfig = config.get(ConfigCategory_Generic, "someConfig", "true");
someConfig.comment = "Configure some configuration setting (true/false). Default true";
someConfigFlag = someConfig.getBoolean(true);
Property questInstanceItemIDProperty = config.get(ConfigCategory_Generic, "quest-instance-item-id", "5000");
questInstanceItemIDProperty.comment = "Item ID used for quest instance items";
questInstanceItemID = questInstanceItemIDProperty.getInt(5000);
config.save();
}
示例8: preInit
import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent event) {
// Initialize localization
LocalizationHandler.loadLanguages();
// Initialize the configuration file
ConfigurationHandler.init(new File(event.getModConfigurationDirectory().getAbsolutePath() + File.separator + Reference.CHANNEL_NAME + File.separator + Reference.MOD_ID + ".cfg"));
// Initialize WorldGen
GameRegistry.registerWorldGenerator(new WorldGeneratorEI());
ModBlocks.init(); // Initialize blocks
ModItems.init(); // Initialize items
ModOres.init(); // Initialize ores
ModBiomes.init(); // Initialize Biomes
ModWorlds.init(); // Initialize Dimension
ModRecipes.init(); //initialize recipes
}
示例9: preInit
import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
/**
* This is were you load up blocks/items
*
* @param event
*/
@PreInit
public void preInit(FMLPreInitializationEvent event) {
log(Level.INFO, "PreInitializing " + Reference.MOD_ID + " version: " + meta.version);
LocalizationHandler.loadLanguages();
// Initialize the configuration
ConfigurationHandler.init(new File(event.getModConfigurationDirectory().getAbsolutePath() + File.separator
+ Reference.CHANNEL_NAME + File.separator + Reference.MOD_ID + ".cfg"));
ModBlocks.init();
ModItems.init();
ModContent.init();
GameRegistry.registerWorldGenerator(genManager);
NetworkRegistry.instance().registerGuiHandler(this, proxy);
}
示例10: preInit
import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent event) {
LocalizationHandler.loadLanguages();
ConfigurationHandler.init(new File(event.getModConfigurationDirectory()
.getAbsolutePath()
+ File.separator
+ Reference.CHANNEL_NAME
+ File.separator + Reference.MOD_ID + ".cfg"));
// Initialize mod blocks
ModBlocks.init();
// Initialize mod items
ModItems.init();
GameRegistry.registerWorldGenerator(new OreGenerator());
}
示例11: preInit
import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent ev) {
AmitLogger.info("PreInit");
File file = ev.getSuggestedConfigurationFile();
Amitcraft.config = new AmitConfig(file);
AmitLogger.info("%s file %s", file.exists() ? "Loaded" : "Created", file.getName());
Amitcraft.config.load();
for (IDelegate d : this.delegates)
d.getIds(Amitcraft.config);
Amitcraft.config.save();
GameRegistry.registerPlayerTracker(new UpdateNotifier());
NetworkRegistry.instance().registerGuiHandler(Amitcraft.instance, new GuiHandler());
MinecraftForge.EVENT_BUS.register(new SoundHandler());
}
示例12: preInit
import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent event) {
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
boolean checkForDatabaseUpdates = config.get("general", "Check for database updates", true).getBoolean(true);
modDirectory = new File(event.getModConfigurationDirectory().getParent());
if (!DBHelper.has(checkForDatabaseUpdates)) {
throw new RuntimeException("Can not start Pixelmon without SQLite jar or database!!! Please reinstall!!");
}
if (Loader.isModLoaded("Pokemobs"))
System.exit(1);
event.getModMetadata().version = "2.2";
MaemeConfig.loadConfig(config);
}
示例13: preInit
import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent event) {
//load the last good configuration
config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
readConfig();
}
示例14: preInit
import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent event) {
logger = Logger.getLogger(ID);
logger.setParent(FMLLog.getLogger());
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
// post_url = config.get(config.CATEGORY_GENERAL, "post_url",
// "http://localhost/post/",
// "This is the url of which the mod posts updates to.").value;
identifier = config.get(config.CATEGORY_GENERAL, "identifier", "commandforwarder", "This string determines the value of the id field in the post request.").value;
debug = config.get(Configuration.CATEGORY_GENERAL, "debug", false, "Enable debuging?").getBoolean(true);
ConfigCategory cmdcat = config.getCategory("commands");
cmdcat.setComment("This is a list of command=url.");
Map<String, Property> cmdmap = cmdcat.getValues();
if (cmdmap.isEmpty()) {
config.get("commands", "example", "http://localhost/post/");
}
for (Map.Entry i : cmdmap.entrySet()) {
String k = (String) i.getKey();
Property v = (Property) i.getValue();
Command cmd = new Command(k, v.value);
this.commands.add(cmd);
}
// public Map<String,Property> getValues()
config.save();
logger.info("debug: " + debug);
logger.info("identifier: " + identifier);
// logger.info("post_url: " + post_url);
}
示例15: preInit
import cpw.mods.fml.common.Mod.PreInit; //导入依赖的package包/类
@PreInit
public void preInit(FMLPreInitializationEvent event) {
LogHelper.init();
LocalizationHandler.loadLanguages();
ConfigurationHandler.init(new File(event.getModConfigurationDirectory()
.getAbsolutePath()
+ File.separator
+ Reference.CHANNEL_NAME
+ File.separator + Reference.MOD_ID + ".cfg"));
ModBlocks.init();
ModItems.init();
}