當前位置: 首頁>>代碼示例>>Java>>正文


Java FMLPreInitializationEvent.getSuggestedConfigurationFile方法代碼示例

本文整理匯總了Java中net.minecraftforge.fml.common.event.FMLPreInitializationEvent.getSuggestedConfigurationFile方法的典型用法代碼示例。如果您正苦於以下問題:Java FMLPreInitializationEvent.getSuggestedConfigurationFile方法的具體用法?Java FMLPreInitializationEvent.getSuggestedConfigurationFile怎麽用?Java FMLPreInitializationEvent.getSuggestedConfigurationFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraftforge.fml.common.event.FMLPreInitializationEvent的用法示例。


在下文中一共展示了FMLPreInitializationEvent.getSuggestedConfigurationFile方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: preLoad

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
@Mod.EventHandler
public void preLoad(FMLPreInitializationEvent event)
{
    Configuration config = new Configuration(event.getSuggestedConfigurationFile());
    config.load();

    config.addCustomCategoryComment("general", "General settings");
    fancyWeightage = config.getInt("fancyWeightage", "general", 80, 0, 100, "Weightage of llamas wearing parts of their outfit, in percentage% (0-100)");
    randomizeParts = config.getInt("randomizeParts", "general", 1, 0, 1, "0 = Render the entire outfit (except disabled parts)\n1 = Randomly choose which parts of the outfit to render (per llama)");
    disabledParts = config.getStringList("disabledParts", "general", disabledParts, "Disable parts of the outfit", new String[] { "hat", "monocle", "pipe", "bowtie", "fez", "moustache" });

    if(config.hasChanged())
    {
        config.save();
    }

    MinecraftForge.EVENT_BUS.register(this);
}
 
開發者ID:iChun,項目名稱:BetterThanLlamas,代碼行數:19,代碼來源:BetterThanLlamas.java

示例2: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
@EventHandler
public void preInit(FMLPreInitializationEvent event){
    Configuration config = new Configuration(event.getSuggestedConfigurationFile());
    config.load();

    canBeDeactivated = config.getBoolean("canBeDeactivated", Configuration.CATEGORY_GENERAL, true, "If the wopper can be deactivated using redstone");
    wopperSpeed = config.getInt("speed", Configuration.CATEGORY_GENERAL, 10, 1, 1000, "The amount of ticks that have to pass before the wopper does a movement action again");

    if(config.hasChanged()){
        config.save();
    }

    blockWopper = new BlockWopper("wopper");
    GameRegistry.registerTileEntity(TileEntityWopper.class, MOD_ID+":wopper");

    proxy.preInit();
}
 
開發者ID:Ellpeck,項目名稱:Wopper,代碼行數:18,代碼來源:Wopper.java

示例3: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
    logger = event.getModLog();

    config = new Configuration(event.getSuggestedConfigurationFile());
    doConfig();

    int id = 1; // Don't use 0, more easy debug.
    snw = NetworkRegistry.INSTANCE.newSimpleChannel(MOD_ID);

    snw.registerMessage(Request.Handler.class, Request.class, id++, Side.SERVER);
    snw.registerMessage(Data.Handler.class, Data.class, id++, Side.CLIENT);

    proxy.preInit();
}
 
開發者ID:dries007,項目名稱:DebugServerInfo,代碼行數:17,代碼來源:DebugServerInfo.java

示例4: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event){
    config = new Configuration(event.getSuggestedConfigurationFile());
    config.load();
    COMPASSX_PROPERTY = config.get("hidden", ConfigValues.COMPASSX_NAME, ConfigValues.COMPASSX_DEFAULT, I18n.format(ConfigValues.COMPASSX_NAME+".tooltip"));
    COMPASSY_PROPERTY = config.get("hidden", ConfigValues.COMPASSY_NAME, ConfigValues.COMPASSY_DEFAULT, I18n.format(ConfigValues.COMPASSY_NAME+".tooltip"));
    TARGETX_PROPERTY = config.get(Configuration.CATEGORY_GENERAL, ConfigValues.TARGETX_NAME, ConfigValues.TARGETX_DEFAULT, I18n.format(ConfigValues.TARGETX_NAME+".tooltip"));
    TARGETZ_PROPERTY = config.get(Configuration.CATEGORY_GENERAL, ConfigValues.TARGETZ_NAME, ConfigValues.TARGETZ_DEFAULT, I18n.format(ConfigValues.TARGETZ_NAME+".tooltip"));
    XALIGNMENT_PROPERTY = config.get("hidden", ConfigValues.XALIGNMENT_NAME, ConfigValues.XALIGNMENT_DEFAULT.name(), I18n.format(ConfigValues.XALIGNMENT_NAME+".tooltip"));
    YALIGNMENT_PROPERTY = config.get("hidden", ConfigValues.YALIGNMENT_NAME, ConfigValues.YALIGNMENT_DEFAULT.name(), I18n.format(ConfigValues.YALIGNMENT_NAME+".tooltip"));
    syncConfig();

    GameRegistry.register(uhccompass);
    ModelLoader.setCustomModelResourceLocation(uhccompass, 0, new ModelResourceLocation(MODID+":uhccompass", "inventory"));

    MinecraftForge.EVENT_BUS.register(new ClientEvents());
    MinecraftForge.EVENT_BUS.register(new RenderEvents());
    MinecraftForge.EVENT_BUS.register(keyHandler = new KeyHandler());
}
 
開發者ID:The-Fireplace-Minecraft-Mods,項目名稱:UHC-Compass,代碼行數:20,代碼來源:UHCCompass.java

示例5: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
public void preInit(FMLPreInitializationEvent event) {
    IFRegistries.poke();

    CraftingHelper.register(new ResourceLocation(Reference.MOD_ID, "configuration_value"), new ConfigurationConditionFactory());
    random = new Random();

    FluidsRegistry.registerFluids();
    BlockRegistry.poke();

    MinecraftForge.EVENT_BUS.register(new BlockRegistry());
    MinecraftForge.EVENT_BUS.register(new ItemRegistry());
    MinecraftForge.EVENT_BUS.register(new StrawRegistry());
    MinecraftForge.EVENT_BUS.register(new MeatFeederTickHandler());
    MinecraftForge.EVENT_BUS.register(new MobDeathHandler());
    MinecraftForge.EVENT_BUS.register(new WorldTickHandler());
    MinecraftForge.EVENT_BUS.register(new PlantRecollectableRegistryHandler());
    MinecraftForge.EVENT_BUS.register(new FakePlayerRideEntityHandler());
    MinecraftForge.EVENT_BUS.register(new PlantInteractorHarvestDropsHandler());

    NetworkRegistry.INSTANCE.registerGuiHandler(IndustrialForegoing.instance, new GuiHandler());

    CustomConfiguration.config = new Configuration(event.getSuggestedConfigurationFile());
    CustomConfiguration.config.load();
    CustomConfiguration.sync();
    CustomConfiguration.configValues = new HashMap<>();
    CustomConfiguration.configValues.put("useTEFrames", CustomConfiguration.config.getBoolean("useTEFrames", Configuration.CATEGORY_GENERAL, true, "Use Thermal Expansion Machine Frames instead of Tesla Core Lib"));

    if (Loader.isModLoaded("crafttweaker")) CraftTweakerHelper.register();

    EntityRegistry.registerModEntity(new ResourceLocation(Reference.MOD_ID, "pink_slime"), EntityPinkSlime.class, "pink_slime", 135135, IndustrialForegoing.instance, 32, 1, false, 10485860, 16777215);
    PINK_SLIME_LOOT = LootTableList.register(new ResourceLocation(Reference.MOD_ID, "entities/pink_slime"));
}
 
開發者ID:Buuz135,項目名稱:Industrial-Foregoing,代碼行數:33,代碼來源:CommonProxy.java

示例6: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
@EventHandler
public void preInit(FMLPreInitializationEvent event){
    config = new Configuration(event.getSuggestedConfigurationFile());
    config.load();
    defineConfigValues();

    potionTrust = new PotionTrust("trust");

    MinecraftForge.EVENT_BUS.register(new Events());
}
 
開發者ID:Ellpeck,項目名稱:TrustCircle,代碼行數:11,代碼來源:TrustCircle.java

示例7: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
    logger = event.getModLog();

    channel = NetworkRegistry.INSTANCE.newSimpleChannel(CHANNEL);

    int messageNumber = 0;
    channel.registerMessage(SwapItems.Handler.class, SwapItems.class, messageNumber++, Side.SERVER);
    channel.registerMessage(BeltContentsChange.Handler.class, BeltContentsChange.class, messageNumber++, Side.CLIENT);
    logger.debug("Final message number: " + messageNumber);

    File configurationFile = event.getSuggestedConfigurationFile();
    Config.loadConfig(configurationFile);
}
 
開發者ID:gigaherz,項目名稱:ToolBelt,代碼行數:16,代碼來源:ToolBelt.java

示例8: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
	instance = this;
	config = new CVCfg(event.getSuggestedConfigurationFile());
	VCLoggers.loggerMod.log(LogLevel.Fine, "%s created.", VCConsts.modname);
	Reflector.preloadClass("v0id.api.core.event.handler.VCEventHandler");
	VoidNetwork.networkManager = NetworkRegistry.INSTANCE.newSimpleChannel(VCConsts.modid + ".net");
	VoidNetwork.networkManager.registerMessage(VoidNetHandler.class, Packet.class, 0, Side.CLIENT);
	VoidNetwork.networkManager.registerMessage(VoidNetHandler.class, Packet.class, 0, Side.SERVER);
	if (config.dataHolder.recoveryMode)
	{
		VCLoggers.loggerMod.log(LogLevel.Warning, "Starting in recovery mode! No mod functionality will be available!");
	}
}
 
開發者ID:V0idWa1k3r,項目名稱:VoidApi,代碼行數:16,代碼來源:VoidApi.java

示例9: init

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
public static void init(FMLPreInitializationEvent e) {
	config = new Configuration(e.getSuggestedConfigurationFile());
	config.load();

	stoneballDamage = config.getFloat("stoneballDamage", Configuration.CATEGORY_GENERAL,
			2f, 0f, 4096f, "damage of stone ball");
	metalballDamage = config.getFloat("metalballDamage", Configuration.CATEGORY_GENERAL,
			6f, 0f, 4096f, "damage of metal ball");
	enderballDamage = config.getFloat("enderballDamage", Configuration.CATEGORY_GENERAL,
			10f, 0f, 4096f, "damage of ender ball");

	if (config.hasChanged())
		config.save();
}
 
開發者ID:arucil,項目名稱:mc-Slingshot,代碼行數:15,代碼來源:Config.java

示例10: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
	ModMetadata meta = event.getModMetadata();

	meta.authorList = Arrays.asList(new String[]{"bl4ckscor3"});
	meta.autogenerated = false;
	meta.description = "Adds a fast way to store XP and share it with your friends!";
	meta.modId = MOD_ID;
	meta.name = NAME;
	meta.version = VERSION;
	MinecraftForge.EVENT_BUS.register(new bl4ckscor3.mod.globalxp.handlers.EventHandler());
	config = new Config(event.getSuggestedConfigurationFile());
	network = NetworkRegistry.INSTANCE.newSimpleChannel(MOD_ID);
	network.registerMessage(new SPacketUpdateXPBlock.Handler(), SPacketUpdateXPBlock.class, 0, Side.CLIENT);
	network.registerMessage(new CPacketRequestXPBlockUpdate.Handler(), CPacketRequestXPBlockUpdate.class, 1, Side.SERVER);
	xp_block = new XPBlock(Material.IRON);
	GameData.register_impl(xp_block);
	GameData.register_impl(new ItemBlock(xp_block).setRegistryName(xp_block.getRegistryName().toString()));
	GameRegistry.registerTileEntity(TileEntityXPBlock.class, xp_block.getRegistryName().toString());
	serverProxy.loadModels();
	serverProxy.registerRenderers();
}
 
開發者ID:bl4ckscor3,項目名稱:GlobalXP,代碼行數:24,代碼來源:GlobalXP.java

示例11: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent e)
{
	/* Taken from ATG */
	config = new ConfigHandler(e.getSuggestedConfigurationFile());
    worldType = new WorldTypeATG("ExampleMod");
    /* End taken from ATG */
	proxy.preInit(e);
}
 
開發者ID:stuebz88,項目名稱:modName,代碼行數:10,代碼來源:ExampleMod.java

示例12: loadConfig

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
public static void loadConfig(FMLPreInitializationEvent event) {
	
	Configuration config = new Configuration(event.getSuggestedConfigurationFile());
	config.load();
	
	dropRate = config.get("misc", "startingSeedDropRate", 5, "Drop weight for the mod's starting seed. The higher the number, the more often it'll drop.").getInt();
	
	cropNormal = config.get("plants", "canPlantNormieSeeds", true).getBoolean();
	cropPrecision = config.get("plants", "canPlantPrecisionSeeds", true).getBoolean();
	cropDirigible = config.get("plants", "canPlantDirigibleSeeds", true).getBoolean();
	cropWeepingbells = config.get("plants", "canPlantWeepingbellSeeds", true).getBoolean();
	cropKnowledge = config.get("plants", "canPlantKnowledgeSeeds", true).getBoolean();
	cropEnderlily = config.get("plants", "canPlantEnderlilySeeds", true).getBoolean();
	cropMillennium = config.get("plants", "canPlantMillenniumSeeds", true).getBoolean();
	cropMerlinia = config.get("plants", "canPlantMerliniaSeeds", true).getBoolean();
	cropInvisibilia = config.get("plants", "canPlantInvisibiliaSeeds", true).getBoolean();
	cropMusica = config.get("plants", "canPlantMusicaSeeds", true).getBoolean();
	cropFeroxia = config.get("plants", "canPlantFeroxiaSeeds", true).getBoolean();
	cropCinderbella = config.get("plants", "canPlantCinderbellaSeeds", true).getBoolean();
	cropCollis = config.get("plants", "canPlantCollisSeeds", true).getBoolean();
	cropMaryjane = config.get("plants", "canPlantMaryjaneSeeds", true).getBoolean();
	cropEula = config.get("plants", "canPlantEulaSeeds", true).getBoolean();
	cropDyeius = config.get("plants", "canPlantDyeiusSeeds", true).getBoolean();
	cropCobblonia = config.get("plants", "canPlantCobbloniaSeeds", true).getBoolean();
	cropAbstract = config.get("plants", "canPlantAbstractSeeds", true).getBoolean();
	cropWafflonia = config.get("plants", "canPlantCliqiaSeeds", true).getBoolean();
	cropDevilsnare = config.get("plants", "canPlantDevilSnare", true).getBoolean();
	cropPixelsius = config.get("plants", "canPlantPixelsius", true).getBoolean();
	cropArtisia = config.get("plants", "canPlantArtisia", true).getBoolean();
	cropMalleatoris = config.get("plants", "canPlantMalleatoris", true).getBoolean();
	cropPetramia = config.get("plants", "canPlantPetramia", true).getBoolean();
	
	config.save();
}
 
開發者ID:bafomdad,項目名稱:uniquecrops,代碼行數:35,代碼來源:UCConfig.java

示例13: init

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
@Mod.EventHandler
public void init(FMLPreInitializationEvent event) {
	conf = new Configuration(event.getSuggestedConfigurationFile());
	syncConfig();
	SPIN_TIME=new DataParameter<Boolean>(spinID, DataSerializers.BOOLEAN);
	ForgeRegistries.ENCHANTMENTS.register(ench=new EnchantmentSpin().setRegistryName("rafradek_spin", "spin"));
	MinecraftForge.EVENT_BUS.register(this);
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:9,代碼來源:SpinToWin.java

示例14: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
public static void preInit(FMLPreInitializationEvent event) {
	configFile = event.getSuggestedConfigurationFile();
	configDirectory = event.getModConfigurationDirectory();
	configPreInit();
	config = new Configuration(configFile);
	configInit();
	config.getCategory(config.CATEGORY_GENERAL).remove("timeToDelete"); // Wouldn't work anywhere else for some reason
	config.save();
}
 
開發者ID:coehlrich,項目名稱:chunk-logger,代碼行數:10,代碼來源:ChunkLoggerConfig.java

示例15: preInit

import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //導入方法依賴的package包/類
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	proxy.preInit();
	
	CONFIG = new Configuration(event.getSuggestedConfigurationFile());
	CONFIG.setCategoryComment("neohell", "These keys affect how the world is generated, and whether it is generated.");
	CONFIG_SHOULD_REGISTER_NEOHELL = CONFIG.getBoolean("enabled", "neohell", CONFIG_SHOULD_REGISTER_NEOHELL,
			"Setting this to false disables neohell entirely, and this mod's blocks will be unobtainable unless tweaked in.");
	CONFIG_DIMENSION_ID_NEOHELL = CONFIG.getInt("id", "neohell", CONFIG_DIMENSION_ID_NEOHELL, Integer.MIN_VALUE, Integer.MAX_VALUE,
			"Remaps neohell to a different dimension ID, possibly causing it to replace a different dimension. May be catastrophically bad for existing maps.");
	CONFIG.save();
	if (CONFIG_SHOULD_REGISTER_NEOHELL) {
		if (DimensionManager.isDimensionRegistered(CONFIG_DIMENSION_ID_NEOHELL)) {
			//Nuking hell just makes it stronger
			DimensionManager.unregisterDimension(CONFIG_DIMENSION_ID_NEOHELL);
		}
		
		DimensionType neohellType = DimensionType.register("Neo-Hell", "_neohell", CONFIG_DIMENSION_ID_NEOHELL, WorldProviderNeoHell.class, false);
		DimensionManager.registerDimension(CONFIG_DIMENSION_ID_NEOHELL, neohellType);
		
		@SuppressWarnings("unused")
		WorldProvider provider = DimensionManager.createProviderFor(CONFIG_DIMENSION_ID_NEOHELL);
	}
	
	/* Obsidian is a glossy, vitreous rock, useful because when struck it easily forms conchoidal fractures,
	 * meaning you can hit it with an ordinary rock, and it shatters, making a super-sharp edge you can use for an
	 * axe head or a knife blade. It's frequently found
	 * just lying around volcanic islands. None of this describes what we see in Minecraft when we look at an
	 * obsidian block or the way we use that block.
	 */
	Blocks.OBSIDIAN.setUnlocalizedName("thermionics_world.basalt");
	Blocks.OBSIDIAN.setHardness(2.5f);
	Blocks.OBSIDIAN.setHarvestLevel("pickaxe",2);
	
	//Ender Chest and Enchantment Table should have the same hardness as raw Basalt
	Blocks.ENDER_CHEST.setHardness(2.5f);
	Blocks.ENCHANTING_TABLE.setHardness(2.5f);

	MinecraftForge.EVENT_BUS.register(this);
	MinecraftForge.EVENT_BUS.register(proxy);
	MinecraftForge.EVENT_BUS.register(TWBlocks.class);
	MinecraftForge.EVENT_BUS.register(TWItems.class);
	MinecraftForge.EVENT_BUS.register(BiomeRegistry.class);
}
 
開發者ID:elytra,項目名稱:ThermionicsWorld,代碼行數:45,代碼來源:ThermionicsWorld.java


注:本文中的net.minecraftforge.fml.common.event.FMLPreInitializationEvent.getSuggestedConfigurationFile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。