当前位置: 首页>>代码示例>>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;未经允许,请勿转载。