本文整理汇总了Java中net.minecraftforge.fml.common.event.FMLPreInitializationEvent.getModConfigurationDirectory方法的典型用法代码示例。如果您正苦于以下问题:Java FMLPreInitializationEvent.getModConfigurationDirectory方法的具体用法?Java FMLPreInitializationEvent.getModConfigurationDirectory怎么用?Java FMLPreInitializationEvent.getModConfigurationDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.fml.common.event.FMLPreInitializationEvent
的用法示例。
在下文中一共展示了FMLPreInitializationEvent.getModConfigurationDirectory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
public void preInit(FMLPreInitializationEvent e) {
MinecraftForge.EVENT_BUS.register(new ForgeEventHandlers());
McJtyLib.preInit(e);
CommandHandler.registerCommands();
MeeCreeps.api.registerFactories();
File directory = e.getModConfigurationDirectory();
config = new Configuration(new File(directory.getPath(), "meecreeps.cfg"));
Config.readConfig();
SimpleNetworkWrapper network = mcjty.lib.network.PacketHandler.registerMessages(MeeCreeps.MODID, "meecreeps");
MeeCreepsMessages.registerMessages(network);
// Initialization of blocks and items typically goes here:
ModEntities.init();
}
示例2: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent e) {
Configuration config = new Configuration(new File(e.getModConfigurationDirectory(), "creativezone.cfg"));
config.load();
// Check interval (seconds)
checkInterval = config.getInt("ScanInterval", "config", 1, 1, 60,
"Sets the interval (in seconds) for scanning player locations");
// Creative zone radius
zoneRadius = config.getInt("ZoneRadius", "config", 25, 5, 1000,
"Sets the radius of the creative zone");
Property whiteListProp = config.get("config", "Whitelist", new String[0],
"Gets the list of whitelisted users");
for (String s : whiteListProp.getStringList()) {
whitelist.add(s);
}
config.save();
}
示例3: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
public void preInit(FMLPreInitializationEvent e) {
File directory = e.getModConfigurationDirectory();
config = new Configuration(new File(directory.getPath(), "lanolin.cfg"));
Config.readConfig();
MinecraftForge.EVENT_BUS.register(new EventHandlerCommon());
}
示例4: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
public void preInit(FMLPreInitializationEvent e) {
// Read configuration file
File directory = e.getModConfigurationDirectory();
config = new Configuration(new File(directory.getPath(), "mobblocker.cfg"));
Config.readConfig();
// Initializes blocks
ModBlocks.init();
// Initialized TOP and Waila compatibility
MainCompatHandler.registerWaila();
MainCompatHandler.registerTOP();
}
示例5: getConfigFile
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
public static Configuration getConfigFile(FMLPreInitializationEvent e)
{
configFolder = new File(e.getModConfigurationDirectory(), FOLDERNAME);
File file = new File(e.getModConfigurationDirectory(), FOLDERNAME + "/" + CONFIG_FILENAME);
return new Configuration(file);
}
示例6: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event){
configDir = new File(event.getModConfigurationDirectory(), "MobOptions");
if(!configDir.exists())
configDir.mkdirs();
JSONEquipmentReader.makeEquipmentJSON();
ConfigHandler.createConfigs(event);
CapabilityStats.register();
MinecraftForge.EVENT_BUS.register(new MobOptionsEventHandler());
}
示例7: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
public void preInit(FMLPreInitializationEvent event)
{
// Handle configuration
File configDir = event.getModConfigurationDirectory();
config = new Configuration(new File(configDir.getPath(), "simplechunks.cfg"));
try
{
config.load();
GeneralConfig.readConfig(config);
}
catch (Exception e)
{
SimpleChunks.logger.error("Error loading config file!", e);
}
finally
{
if (config.hasChanged())
{
config.save();
}
}
// Integrate with other mods
if (Loader.isModLoaded("theoneprobe"))
{
TOPCompat.register();
}
// Register chunkloading callback
ForgeChunkManager.setForcedChunkLoadingCallback(SimpleChunks.instance, new ChunkLoadingHandler());
}
示例8: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent e)
{
log = e.getModLog();
setupMetadata(e.getModMetadata());
configFile = new Configuration(new File(e.getModConfigurationDirectory(), "Purificati Magicae.cfg"));
config.setup(configFile);
debug = LogManager.getLogger(MODID + "-debug");
proxy.setupDrawables();
getSipRegistry().register();
TileRegistry.register();
CapabilityRegistry.register();
EntityRegistry.register();
getPapyrusRegistry().setup();
getExpressionRegistry().setup();
PMStructureProcessorRegistry.setup();
getMagibenchRegistry().setup();
proxy.setupIfTiers();
proxy.preInit();
}
示例9: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
if (!SchemaHelper.testSchemaVersionNumbers(Loader.instance().activeModContainer().getVersion()))
throw new RuntimeException("This mod has been incorrectly built; check schema version numbers.");
if (event.getModMetadata().version.equals("${version}"))
{
// The mcmod.info version number is populated by gradle; if we've been built without gradle,
// via eclipse say, then we can just use the internal version number instead, which comes to us from the version.properties file.
// (There's no real benefit to doing this; it just looks nicer in the Mod GUI if the version number is filled in.)
event.getModMetadata().version = Loader.instance().activeModContainer().getVersion();
}
// Load the correct configs (client or server)
File configDir = event.getModConfigurationDirectory();
File sessionConfigFile = new File(configDir, MODID + event.getSide().toString() + ".cfg");
File permanentConfigFile = new File(configDir, MODID + event.getSide().toString() + "Permanent.cfg");
this.sessionConfig = new Configuration(sessionConfigFile);
this.sessionConfig.load();
this.permanentConfig = new Configuration(permanentConfigFile);
this.permanentConfig.load();
AddressHelper.update(this.sessionConfig);
ScreenHelper.update(this.permanentConfig);
network = NetworkRegistry.INSTANCE.newSimpleChannel("Malmo");
network.registerMessage(ObservationFromFullStatsImplementation.FullStatsRequestMessageHandler.class, ObservationFromFullStatsImplementation.FullStatsRequestMessage.class, 1, Side.SERVER);
network.registerMessage(ObservationFromGridImplementation.GridRequestMessageHandler.class, ObservationFromGridImplementation.GridRequestMessage.class, 2, Side.SERVER);
network.registerMessage(MalmoMessageHandler.class, MalmoMessage.class, 3, Side.CLIENT); // Malmo messages from server to client
network.registerMessage(SimpleCraftCommandsImplementation.CraftMessageHandler.class, SimpleCraftCommandsImplementation.CraftMessage.class, 4, Side.SERVER);
network.registerMessage(AbsoluteMovementCommandsImplementation.TeleportMessageHandler.class, AbsoluteMovementCommandsImplementation.TeleportMessage.class, 5, Side.SERVER);
network.registerMessage(MalmoMessageHandler.class, MalmoMessage.class, 6, Side.SERVER); // Malmo messages from client to server
network.registerMessage(InventoryCommandsImplementation.InventoryMessageHandler.class, InventoryCommandsImplementation.InventoryMessage.class, 7, Side.SERVER);
network.registerMessage(DiscreteMovementCommandsImplementation.UseActionMessageHandler.class, DiscreteMovementCommandsImplementation.UseActionMessage.class, 8, Side.SERVER);
network.registerMessage(DiscreteMovementCommandsImplementation.AttackActionMessageHandler.class, DiscreteMovementCommandsImplementation.AttackActionMessage.class, 9, Side.SERVER);
}
示例10: 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();
}
示例11: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
MinecraftForge.EVENT_BUS.register(EventHandler.class);
initPlugins(event.getAsmData());
File configDir = event.getModConfigurationDirectory();
File modsDir = new File(configDir.getParent(), "mods");
registerPackets();
NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler());
ModLoader.initMods(modsDir);
}
示例12: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
log.info("PreInitializing");
configFile = event.getModConfigurationDirectory();
proxy.preInit();
}
示例13: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
public static void preInit(FMLPreInitializationEvent e) {
modConfigDir = e.getModConfigurationDirectory();
mainConfig = new Configuration(new File(modConfigDir.getPath() + File.separator + "incontrol", "main.cfg"));
readMainConfig();
}
示例14: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
public static void preInit(FMLPreInitializationEvent e) {
modConfigDir = e.getModConfigurationDirectory();
mainConfig = new Configuration(new File(modConfigDir.getPath(), "lector.cfg"));
readMainConfig();
}
示例15: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
public static void preInit(FMLPreInitializationEvent e) {
modConfigDir = e.getModConfigurationDirectory();
mainConfig = new Configuration(new File(modConfigDir.getPath(), "intwheel.cfg"));
readMainConfig();
}