@Mod.EventHandler public void init(FMLInitializationEvent event) { Configurator.configure(new File("config/" + MODID + ".cfg")); GameRegistry.registerWorldGenerator(new Decorator(), 4096); FMLCommonHandler.instance().bus().register(this); MinecraftForge.EVENT_BUS.register(this); }
@Mod.EventHandler public void init(FMLInitializationEvent event) { proxy.init(event); ItemLoader.LoadItems(); //BlockLoader.loadBlocks(); Recipes.registerRecpies(); //EntityLoader.LoadEntitys(); //OreDict.addores(); Achievements.loadAchievements(); Stats.RegisterStats(); PlayerChecker.checkPlayer(username); LootRegistry.registerLoot(); }
@Mod.EventHandler public void init(FMLInitializationEvent event) { proxy.init(event); // register CommonProxy as our GuiHandler NetworkRegistry.INSTANCE.registerGuiHandler(MODID, new CommonProxy()); ItemLoader.LoadItems(); BlockLoader.loadBlocks(); Recipes.registerRecpies(); EntityLoader.LoadEntitys(); OreDict.addores(); //Achievements.loadAchievements(); //Stats.RegisterStats(); GameRegistry.registerWorldGenerator(new ModWorldGen(), 0); }
@Mod.EventHandler public void init(FMLInitializationEvent event) { proxy.init(event); ItemLoader.LoadItems(); BlockLoader.loadBlocks(); Recipes.registerRecpies(); EntityLoader.LoadEntitys(); OreDict.addores(); Achievements.loadAchievements(); Stats.RegisterStats(); EntityRegistry.registerModEntity(EntityGiantSnowBall.class, "GiantSnowBall", EntityRegistry.findGlobalUniqueEntityId(), MODID, 80, 3, true); proxy.registerRenderThings(); GameRegistry.registerTileEntity(TileEntityBulb.class, "Bulb"); TileEntity.addMapping(TileEntityBulb.class, "Bulb_Mapping"); BulbModelID = 72; }
@Mod.EventHandler public void postInit(FMLPostInitializationEvent event) { { //Thread.currentThread().setName("EpicProportionsMod"); MinecraftForge.EVENT_BUS.register(new WorldGenModFlower(BlockLoader.blockFlowerChocolate)); MinecraftForge.EVENT_BUS.register(new WorldGenModFlower(BlockLoader.blockFlowerForJen)); MinecraftForge.EVENT_BUS.register(new WorldGenModFlower(BlockLoader.blockFlowerLove)); MinecraftForge.EVENT_BUS.register(new WorldGenModFlower(BlockLoader.blockFlowerPinkHeart)); MinecraftForge.EVENT_BUS.register(new WorldGenModFlower(BlockLoader.blockFlowerRainbow)); MinecraftForge.EVENT_BUS.register(new WorldGenModFlower(BlockLoader.blockFlowerRedHeart)); MinecraftForge.EVENT_BUS.register(new CustomPresentDrops()); MinecraftForge.EVENT_BUS.register(new VersionChecker()); MinecraftForge.EVENT_BUS.register(new CommandModInfo()); //MinecraftForge.EVENT_BUS.register(new PotionLoader(33, false, 8171462)); //MinecraftForge.EVENT_BUS.register(new PotionLoader(33, false, 8171462)); MinecraftForge.EVENT_BUS.register(new WorldGenPumpkin_Pat()); MinecraftForge.EVENT_BUS.register(new WorldGenPumpkin_Jen()); MinecraftForge.EVENT_BUS.register(new StructureVillagePieces()); //MinecraftForge.EVENT_BUS.register(new Yggdrasil()); MinecraftForge.EVENT_BUS.register(new LogHelper()); //MinecraftForge.EVENT_BUS.register(new CommandModInfo()); //MinecraftForge.EVENT_BUS.register(new BiomeGenPat(getBIOME_ID_PAT())); //MinecraftForge.EVENT_BUS.register(new BiomeGenJen(getBIOME_ID_JEN())); //MinecraftForge.EVENT_BUS.register(new WorldProviderEpicProportions()); //MinecraftForge.EVENT_BUS.register(new EpicProportionsBiomes(ENTITY_ID_0, null)); //MinecraftForge.EVENT_BUS.register(new RenderGuiHandler()); //MinecraftForge.ORE_GEN_BUS.register(new BiomeDecorator()); Recipes.registerRecpies(); MinecraftForge.EVENT_BUS.register(new CommandChangelog()); //MUhTTawz.maAzeRcL(); } }
@Mod.EventHandler @SideOnly(Side.SERVER) public void serverStart(FMLServerStartingEvent event) { if (INSTANCE == null) INSTANCE = this; if (SERVER == null) SERVER = event.getServer(); if (COMMAND == null) COMMAND = new WBCommand(); // Load (or create new) config files Config.load(false); // our one real command, though it does also have aliases "wb" and "worldborder" event.registerServerCommand(COMMAND); if ( Config.preventBlockPlace() ) enableBlockPlaceListener(true); if ( Config.preventMobSpawn() ) enableMobSpawnListener(true); if ( Config.getDenyEnderpearl() ) enableEnderPearlListener(true); DynMapFeatures.registerListener(); }
@Mod.EventHandler public void init(FMLInitializationEvent event) { //Load Mod Items ModItems.init(); //Load Mod Blocks ModBlocks.init(); //Load Mod Recipes ModRecipes.init(); //Register Renders on client side proxy.initRenders(); //Register GuiHandler NetworkRegistry.INSTANCE.registerGuiHandler(INSTANCE, new GuiHandler()); //Register Mod Compat CompatHandler.init(event); //Register Leave drops MinecraftForge.EVENT_BUS.register(EventDrops.instancemain); //Register Mod World Gen ModWorldGen.init(); }
@Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { log = event.getModLog(); FMLCommonHandler.instance().bus().register(EventHandlers.I); MinecraftForge.EVENT_BUS.register(EventHandlers.I); cfg = new Configuration(event.getSuggestedConfigurationFile()); doConfig(cfg); if (TFCTweaksLoadingPlugin.DISABLE_ASM) { log.warn("********************************************************************************************"); log.warn(" You have disabled ASM tweaks. All FluidHacks have been disabled."); log.warn("Please don't include this in your pack config. This is to be considered a DEBUG option only!"); log.warn("********************************************************************************************"); } else { FluidHacks.doTheMagic(); } }
@Mod.EventHandler public void serverStarted(FMLServerStartedEvent event) { try { FileUtils.writeStringToFile(new File(DimensionManager.getCurrentSaveRootDirectory(), "seed.txt"), String.valueOf(DimensionManager.getWorld(0).getSeed())); WorldExplorer.jsonFile = new File(DimensionManager.getCurrentSaveRootDirectory(), "WorldExplorer.json"); } catch (IOException e) { e.printStackTrace(); } if (autoPregen_enabled && !WorldExplorer.jsonFile.exists()) { ChunkCoordinates spawn = MinecraftServer.getServer().worldServers[0].getSpawnPoint(); WorldExplorer.start(MinecraftServer.getServer(), spawn.posX >> 4, spawn.posZ >> 4, autoPregen_size / 16); } }
@Mod.EventHandler void postInit(FMLPostInitializationEvent event) { if (Loader.isModLoaded("EE3")) { Stopwatch watch = Stopwatch.createStarted(); AELog.info("Post Initialization ( started )"); RegisterCrafting.initRecipes(); RegisterFurnace.initRecipes(); RegisterFacade.initRecipes(); RegisterGrinder.initRecipes(); RegisterInscriber.initRecipes(); RegisterWorld.initRecipes(); //RecipeRegistryProxy.dumpRecipeRegistryToLog(); AELog.info("Post Initialization ( ended after " + watch.elapsed(TimeUnit.MILLISECONDS) + "ms )"); } }
@Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { Tab.init(); Base.init(); Config.init(event.getSuggestedConfigurationFile()); FMLCommonHandler.instance().bus().register(new Config()); ItemStackHolderInjector.INSTANCE.inject(); if (Loader.isModLoaded("Botania")) { Botania.preInit(); } if (Loader.isModLoaded("ThermalExpansion")) { TE_Intergration.preInit(); } LogHelper.info("Pre Initialization Complete"); }
@Mod.EventHandler public void init (FMLInitializationEvent event) { ItemStackHolderInjector.INSTANCE.inject(); Blocks.init(); OreDicHelper.init(); SlabHelper.init(); CraftingHelper.init(); if (Loader.isModLoaded("Botania")) { Botania.init(); } if (Loader.isModLoaded("ThermalExpansion")) { TE_Intergration.init(); } LogHelper.info("Initialization Complete"); }
@Mod.EventHandler public void postInit (FMLPostInitializationEvent event) { ItemStackHolderInjector.INSTANCE.inject(); if (Loader.isModLoaded("Botania")) { Botania.postInit(); } if (Loader.isModLoaded("ThermalExpansion")) { TE_Intergration.postInit(); } LogHelper.info("Post Initialization Complete"); }
@Mod.EventHandler public static void init(FMLInitializationEvent event) { GameRegistry.addRecipe(new ShapedOreRecipe(blockCastingFrame, new Object[] {"xxx", "x x", "xxx", 'x', "rodStone"})); LiquidCasting casting = TConstruct.getBasinCasting(); //Get fluids for (FluidType type : FluidType.fluidTypes.values()) { FluidStack fluid = new FluidStack(type.fluid, TConstruct.blockLiquidValue); //Recipes CastingRecipe rec = casting.getCastingRecipe(fluid, null); if (rec != null) ThermalExpansionHelper.addTransposerFill(energyCost, new ItemStack(blockCastingFrame), rec.getResult(), fluid, false); } }
@Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { //sys = new NumericSystem(); //for testing configRoot = new File(event.getModConfigurationDirectory(), "eqlib/"); configRoot.mkdir(); mainConfigDir = new File(configRoot,"eqlib.cfg"); mainConfig = new Configuration(mainConfigDir); mainConfig.load(); RecipeRegistry.oreDictBlacklist = mainConfig.getStringList("oreDictBlacklist", "general", new String[0], "A blacklist of ore dictionary entries NOT to equate."); mainConfig.save(); modsConfigDir = new File(configRoot, "mods/"); modsConfigDir.mkdir(); }
@Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { logger.info(TextHelper.localize("info." + ModInformation.ID + ".console.load.preInit")); ConfigManager.getInstance().init(event.getModConfigurationDirectory()); powerUpManager.init(); ItemRegistry.registerItems(); BlockRegistry.registerBlocks(); PotionRegistry.registerPotions(); EntityRegistry.register(); FMLCommonHandler.instance().bus().register(eventHandler); NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler()); }
@Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { // config ConfigHandler.init(event.getSuggestedConfigurationFile()); // proxy proxy.init(); proxy.registerRenderers(); proxy.registerEvents(); // data BlockData.init(); ItemData.init(); TileData.init(); MultiblockData.init(); // recipes Recipes.registerRecipes(); }
@Mod.EventHandler public void preInit(FMLPreInitializationEvent event){ if (event.getSide() == Side.SERVER) { logger.info("Client side only mod - not doing anything on the server!"); return; } }
@Mod.EventHandler public void serverStarting(FMLServerStartingEvent event) { event.registerServerCommand(new CommandInvite()); event.registerServerCommand(new CommandPregen()); deserializePreload(new File(getSaveFolder(), "pregenData.json")); }
@Mod.EventHandler public void serverStopping(FMLServerStoppingEvent event) { if (!CreeperHost.instance.active) return; serverOn = false; serializePreload(); pregenTasks.clear(); }
@Mod.EventHandler public void preInit(FMLPreInitializationEvent e) { if (!CreeperHost.instance.active) return; MinecraftForge.EVENT_BUS.register(this); FMLCommonHandler.instance().bus().register(this); logger = e.getModLog(); }
@Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { TechnicalBlock.registerBlocks(); TechnicalItem.registerItems(); TechnicalTools.registerTools(); GameRegistry.registerWorldGenerator(this.eventWorldGen, 0); proxy.registerTileEntities(); ((Item) Item.itemRegistry.getObject("water_bucket")).setMaxStackSize(16); for (int i = 0; i < 5; ++i) { VillagerRegistry.instance().registerVillageTradeHandler(i, new TradeHandler()); } Potion[] potionTypes; for (Field f : Potion.class.getDeclaredFields()) { f.setAccessible(true); try { if (f.getName().equals("potionTypes") || f.getName().equals("field_76425_a")) { Field modfield = Field.class.getDeclaredField("modifiers"); modfield.setAccessible(true); modfield.setInt(f, f.getModifiers() & ~Modifier.FINAL); potionTypes = (Potion[]) f.get(null); final Potion[] newPotionTypes = new Potion[256]; System.arraycopy(potionTypes, 0, newPotionTypes, 0, potionTypes.length); f.set(null, newPotionTypes); } } catch (Exception e) { e.printStackTrace(); } } MinecraftForge.EVENT_BUS.register(new TechnicalEventHooks()); MinecraftForge.ORE_GEN_BUS.register(new TechnicalOreGenEventHooks()); }
@Mod.EventHandler public void init(FMLInitializationEvent event) { proxy.registerNetworkStuff(); NetworkRegistry.INSTANCE.registerGuiHandler(this, new TechnicalGuiHandler()); TechnicalItem.removeVanillaRecipes(); Recipes.init(); FMLCommonHandler.instance().bus().register(new EventListener()); radioactivityPotion = (new PotionTechnical(radioactivityPotionId, true, 0)).setIconIndex(0, 0).setPotionName("potion.radioactivityPotion"); TechnicalAchievement.init(); AchievementPage.registerAchievementPage(technicalAchievementPage); }
@Mod.EventHandler public void onInit(FMLInitializationEvent e){ /* REGISTERS ALL COMMON THINGS SO FOR BOTH SERVER AND CLIENT... */ LOTRAddonsItems.registerRings(); LOTRAddonsBlocks.registerBlocks(); LOTRAddonsEntities.registerEntities(); NetworkRegistry.INSTANCE.registerGuiHandler(LOTRAddons.lotrAddons, new GuiHandler()); }
@Mod.EventHandler public void serverLoading(FMLServerStartingEvent event) { logger.info("Registering commands."); event.registerServerCommand(new CreateIslandsCommand()); event.registerServerCommand(new DeleteIslandCommand()); event.registerServerCommand(new JoinIslandCommand()); event.registerServerCommand(new ListIslandsCommand()); event.registerServerCommand(new RenameIslandCommand()); event.registerServerCommand(new SaveIslandsCommand()); event.registerServerCommand(new SetIslandSpawnCommand()); logger.info("Finished registering commands."); loadIslands(); loadChestLoot(); }
@Mod.EventHandler public void postInit(FMLPostInitializationEvent event) throws IOException { BufferedReader br = new BufferedReader(new FileReader(islands.getPath())); if (br.readLine() == null) { logger.info("Islands file empty, placing a default value."); IslandCreator.islandLocations.put("default", new IslandCreator.IslandPos(0, 60, 0)); try { saveIslands(IslandCreator.islandLocations); } catch (IOException e) { e.printStackTrace(); } } br.close(); }
@Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { TaserItemsAndBlocks.initItems(); TaserItemsAndBlocks.initBlocks(); TaserRecipes.registerRecipes(); //Logs log.info("Pre Init!"); log.info(TaserReference.modid + " IS STARTING UP..........................."); }
@Mod.EventHandler public void preInit(FMLPreInitializationEvent event){ GameRegistry.registerBlock(new GenericOre("Iron"), "GenericOre"); GameRegistry.registerTileEntity(OreTile.class, "GenericTile"); GameRegistry.registerBlock(new Miner(), "Miner"); GameRegistry.registerTileEntity(MinerTile.class, "MinerTile"); DescriptionHandler.init(); NetworkHandler.init(); }
/** * This is the first pass of logic in this mod. */ @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { PreInitEvent e; e = new PreInitEvent(); e.Go(event); }
/** * This is the second pass of logic in this mod. */ @Mod.EventHandler public void init(FMLInitializationEvent event) { InitEvent e; e = new InitEvent(); e.Go(event); }
/** * This is the third pass of logic in this mod. */ @Mod.EventHandler public void postInit(FMLPostInitializationEvent event) { PostInitEvent e; e = new PostInitEvent(); e.Go(event); }
@Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { LogHelper.info("Hello Minecraft!"); TE_LOADED = Loader.isModLoaded("ThermalExpansion"); OC_LOADED = Loader.isModLoaded("OpenComputers"); RFU_NET_WRAPPER = NetworkRegistry.INSTANCE.newSimpleChannel("rfu"); proxy.preInit(event); LogHelper.info("PreInit complete"); }
@Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { LogHelper.info("Hello Minecraft!"); TE_LOADED = Loader.isModLoaded("ThermalExpansion"); OC_LOADED = Loader.isModLoaded("OpenComputers"); CC_LOADED = Loader.isModLoaded("ComputerCraft"); RFU_NET_WRAPPER = NetworkRegistry.INSTANCE.newSimpleChannel("rfu"); proxy.preInit(event); LogHelper.info("PreInit complete"); }
@Mod.EventHandler public void init(FMLInitializationEvent event) { NetworkRegistry.INSTANCE.registerGuiHandler(this, new UIHandler()); LOTRRItems.register(); LOTRRBlocks.register(); LOTRRTileEntities.register(); proxy.init(event); }
@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); }
@Mod.EventHandler public void serverStart(FMLServerStartingEvent e) { MinecraftServer server = getServer(); ICommandManager iCommandManager = server.getCommandManager(); ServerCommandManager serverCommandManager = (ServerCommandManager)iCommandManager; serverCommandManager.registerCommand(new CommandHandler()); }
/** * Given WorldBorder's dependency on dedicated server classes and is designed for * use in multiplayer environments, we don't load anything on the client */ @Mod.EventHandler @SideOnly(Side.CLIENT) public void clientPreInit(FMLPreInitializationEvent event) { Log.error("This mod is intended only for use on servers"); Log.error("Please consider removing this mod from your installation"); }
@Mod.EventHandler @SideOnly(Side.SERVER) public void serverStop(FMLServerStoppingEvent event) { DynMapFeatures.removeAllBorders(); Config.storeFillTask(); }
@Mod.EventHandler @SuppressWarnings("unused") public void preinit(FMLPreInitializationEvent event) { loadMeta(modMetadata); DeveloperBossTexture.downloadTexture();//開発者のスキンのダウンロード AntiMatterModRegistry.registerPreInit(event); AMMRegistry.INSTANCE.handlePreInit(); OreDictionaryRegister.OreDictionaryRegisterPreInit(event); proxy.registerClientInfo(); }
@Mod.EventHandler @SuppressWarnings("unused") public void init(FMLInitializationEvent event) { proxy.registerRenderer(); AntiMatterModRegistry.registerInit(event); AMMRegistry.INSTANCE.handleInit(); RecipeRegister.beforeRemoveRecipeinit(event); RecipeRegister.RecipeRegisterInit(event); RecipeRegister.afterRemoveRecipeinit(event); }