@Override public void registerHandlers() { OreDicHandler.registerWildCards(); MaricultureHandlers.biomeType = new BiomeTypeHandler(); MaricultureHandlers.smelter = new LiquifierHandler(); MaricultureHandlers.casting = new IngotCastingHandler(); MaricultureHandlers.vat = new VatHandler(); MaricultureHandlers.anvil = new TileAnvil(); MaricultureHandlers.upgrades = new UpgradeHandler(); MaricultureHandlers.modules = new ModulesHandler(); GameRegistry.registerFuelHandler(new FuelHandler()); GameRegistry.registerWorldGenerator(new WorldGenHandler(), 1); MinecraftForge.EVENT_BUS.register(new GuiItemToolTip()); MinecraftForge.EVENT_BUS.register(new OreDicHandler()); FMLCommonHandler.instance().bus().register(new ServerFMLEvents()); FMLCommonHandler.instance().bus().register(new ClientFMLEvents()); if (RetroGeneration.ENABLED) MinecraftForge.EVENT_BUS.register(new RetroGen()); // Initalise our Side Helper List<Integer> sides = new ArrayList<Integer>(); for (int i = 0; i < 6; i++) { sides.add(i); } BlockTransferHelper.sides = sides; }
@EventHandler public void preInit(FMLPreInitializationEvent event) { config = new Configuration(event.getSuggestedConfigurationFile()); // gets default config file this.instance = this; FMLCommonHandler.instance().bus().register(worldgen); MinecraftForge.EVENT_BUS.register(worldgen); FMLCommonHandler.instance().bus().register(versionChecker); MinecraftForge.EVENT_BUS.register(versionChecker); FMLCommonHandler.instance().bus().register(this); MinecraftForge.EVENT_BUS.register(this); ClientCommandHandler.instance.registerCommand(new VersionCommand()); fluids.setupFluids(); fluids.setupFluidBlocks(); items.setupItems(); items.registerItems(); items.registerItemsOreDict(); blocks.setupBlocks(); blocks.registerBlocks(); blocks.registerBlocksOreDict(); blocks.setupHarvestLevels(); recipes.setupShapelessCrafting(); recipes.setupShapedCrafting(); recipes.setupSmelting(); worldgen.setupWorldgen(); mobs.setupMobs(); proxy.registerRenderers(); }
@Mod.EventHandler public void init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(instance); MinecraftForge.EVENT_BUS.register(proxy); NetworkRegistry.instance().registerGuiHandler(instance, new ExplorationGuiHandler()); proxy.init(); }
@Override public void registerEventHandlers() { super.registerEventHandlers(); WMClientEventHandler eventhandler = new WMClientEventHandler(); FMLCommonHandler.instance().bus().register(eventhandler); MinecraftForge.EVENT_BUS.register(eventhandler); MinecraftForge.EVENT_BUS.register( new GuiOverlayReloaded(FMLClientHandler.instance().getClient())); }
@EventHandler public void preLoad(FMLPreInitializationEvent event) { snw = NetworkRegistry.INSTANCE.newSimpleChannel(modid); snw.registerMessage(TimeTravelerPacketHandler.class, Message.class, 0, Side.CLIENT); FMLCommonHandler.instance().bus().register(new TTEventHandler()); FMLCommonHandler.instance().bus().register(new Ticker()); MinecraftForge.EVENT_BUS.register(new TTEventHandler()); MinecraftForge.EVENT_BUS.register(new Ticker()); }
public void load() { Mw mw = new Mw(this.config); MinecraftForge.EVENT_BUS.register(new EventHandler(mw)); Object eventhandler = new MwKeyHandler(); FMLCommonHandler.instance().bus().register(eventhandler); MinecraftForge.EVENT_BUS.register(eventhandler); // temporary workaround for user defined key bindings not being loaded // at game start. see https://github.com/MinecraftForge/FML/issues/378 // for more info. Minecraft.getMinecraft().gameSettings.loadOptions(); }
@EventHandler public void preInit(FMLPreInitializationEvent event) { ConfigHandler.init(event.getSuggestedConfigurationFile()); ModItem.init(); ModBlock.init(); ModTile.init(); MinecraftForge.EVENT_BUS.register(new EntityLivingHandler()); MinecraftForge.EVENT_BUS.register(new EntityPlayerHandler()); proxy.initSounds(); proxy.initRenderers(); }
@SuppressWarnings("unchecked") @Init public void load(FMLInitializationEvent event) { // Register the GUI Handler NetworkRegistry.instance().registerGuiHandler(instance, proxy); // Register the PlayerDestroyItem Handler MinecraftForge.EVENT_BUS.register(new PlayerDestroyItemHandler()); // Register the Item Pickup Handler MinecraftForge.EVENT_BUS.register(new ItemEventHandler()); // Register the EntityLiving Handler MinecraftForge.EVENT_BUS.register(new EntityLivingHandler()); MinecraftForge.EVENT_BUS.register(new ActionRequestHandler()); MinecraftForge.EVENT_BUS.register(new WorldTransmutationHandler()); GameRegistry.registerCraftingHandler(new CraftingHandler()); // Register the DrawBlockHighlight Handler proxy.registerDrawBlockHighlightHandler(); // Initialize mod tile entities proxy.registerTileEntities(); // Initialize custom rendering and pre-load textures (Client only) proxy.initRenderingAndTextures(); // Add in the ability to dye Alchemical Bags CraftingManager.getInstance().getRecipeList().add(new RecipesAlchemicalBagDyes()); // Register the Fuel Handler GameRegistry.registerFuelHandler(new FuelHandler()); // Quick test to see that sending an encoded recipe to be added to the recipe registry works FMLInterModComms.sendMessage( Reference.MOD_ID, InterModComms.ADD_RECIPE, NBTHelper.encodeRecipeAsNBT( Item.bucketWater, Arrays.asList(Item.bucketEmpty, Block.waterStill))); FMLInterModComms.sendMessage( Reference.MOD_ID, InterModComms.ADD_RECIPE, NBTHelper.encodeRecipeAsNBT( Item.bucketLava, Arrays.asList(Item.bucketEmpty, Block.lavaStill))); }
public static void init(FMLPreInitializationEvent event) { // Init boolean isRender = getRenderSetting(event.getSuggestedConfigurationFile()); mc = Minecraft.getMinecraft(); chatHandler = new ChatHandler(); entityKillHandler = new EntityKillHandler(); renderHandler = new RenderHandler(mc, isRender); keyInputHandler = new KeyInputHandler(renderHandler, event.getSuggestedConfigurationFile()); KeyBindler.init(); // Register handlers MinecraftForge.EVENT_BUS.register(chatHandler); MinecraftForge.EVENT_BUS.register(entityKillHandler); MinecraftForge.EVENT_BUS.register(renderHandler); FMLCommonHandler.instance().bus().register(keyInputHandler); }
@Override public CategoryConfigManagerBuilder getConfig() { return new CategoryConfigManagerBuilder("Other") .addValue( "enableAnimalAITweak", "true", Type.BOOLEAN, "Enable changing the animals AI to make them run from their attackers.", property -> { if (property.getBoolean()) { if (aiManager == null) { aiManager = new AITweaksManager(); MinecraftForge.EVENT_BUS.register(aiManager); } } else { if (aiManager != null) { MinecraftForge.EVENT_BUS.unregister(aiManager); aiManager = null; } } }) .addValue( "enableNonSolidLeaves", "true", Type.BOOLEAN, "Enable tweak to make leaves blocks non-solid (like vines).", property -> { Hea3venTweaks.setConfig( "NonSolidLeaves.enabled", Boolean.toString(property.getBoolean())); }, true, true); }
public void setupRenderers() { RedPowerCore.customBlockModel = RenderingRegistry.getNextAvailableRenderId(); RedPowerCore.nullBlockModel = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerBlockHandler( RedPowerCore.customBlockModel, new CoreProxyClient$RenderHandler()); MinecraftForge.EVENT_BUS.register(new RenderHighlight()); }
@EventHandler public void preInit(FMLPreInitializationEvent e) { MinecraftForge.EVENT_BUS.register(new EventHookContainer()); NetworkRegistry.instance().registerGuiHandler(this, new GuiHandler()); ConfigHandler.init(e.getSuggestedConfigurationFile()); if (ModInfo.updateInfo) UpdateChecker.init(); }
@EventHandler public void initialize(FMLInitializationEvent evt) { // MinecraftForge.registerConnectionHandler(new ConnectionHandler()); ActionManager.registerTriggerProvider(new DefaultTriggerProvider()); ActionManager.registerActionProvider(new DefaultActionProvider()); if (BuildCraftCore.modifyWorld) { MinecraftForge.EVENT_BUS.register(new SpringPopulate()); } if (BuildCraftCore.loadDefaultRecipes) { loadRecipes(); } EntityRegistry.registerModEntity( EntityRobot.class, "bcRobot", EntityIds.ROBOT, instance, 50, 1, true); EntityRegistry.registerModEntity( EntityPowerLaser.class, "bcLaser", EntityIds.LASER, instance, 50, 1, true); EntityRegistry.registerModEntity( EntityEnergyLaser.class, "bcEnergyLaser", EntityIds.ENERGY_LASER, instance, 50, 1, true); EntityList.classToStringMapping.remove(EntityRobot.class); EntityList.classToStringMapping.remove(EntityPowerLaser.class); EntityList.classToStringMapping.remove(EntityEnergyLaser.class); EntityList.stringToClassMapping.remove("BuildCraft|Core.bcRobot"); EntityList.stringToClassMapping.remove("BuildCraft|Core.bcLaser"); EntityList.stringToClassMapping.remove("BuildCraft|Core.bcEnergyLaser"); CoreProxy.proxy.initializeRendering(); CoreProxy.proxy.initializeEntityRendering(); Localization.addLocalization("/lang/buildcraft/", DefaultProps.DEFAULT_LANGUAGE); }
public static void initiate() { if (!loaderRegistered) { loaderRegistered = true; MinecraftForge.EVENT_BUS.register(INSTANCE); } }
@Override public void registerGuiHandler() { NetworkRegistry.INSTANCE.registerGuiHandler( TerraFirmaCraft.instance, new com.bioxx.tfc.Handlers.Client.GuiHandler()); // Register Gui Event Handler MinecraftForge.EVENT_BUS.register(new com.bioxx.tfc.Handlers.Client.GuiHandler()); }
@PreInit public void preInit(FMLPreInitializationEvent event) { WCConfig.preInit(event); WCMCMod.preInit(event); WCBlockIDs.init(); WCItemIDs.init(); WCRecipes.init(); WCAchievements.init(); MinecraftForge.EVENT_BUS.register(new EventSounds()); MinecraftForge.EVENT_BUS.register(new EventHookHandler()); NetworkRegistry.instance().registerGuiHandler(this, guiHandler); GameRegistry.registerPickupHandler(itemHandler); DimensionManager.registerProviderType(DIM, WorldProviderWarp.class, true); DimensionManager.registerDimension(DIM, DIM); }
public ItemElectricBootsTraveller(int id, int par3, int par4) { super(id, EnumArmorMaterial.DIAMOND, par3, par4); this.setMaxDamage(27); this.setMaxStackSize(1); this.setCreativeTab(CreativeTab.tabTombenpotter); if (ticks()) MinecraftForge.EVENT_BUS.register(this); }
@Mod.EventHandler public void init(FMLInitializationEvent event) { instance = this; proxy.registerEvents(); NetworkRegistry.INSTANCE.registerGuiHandler(this, guiHandler); MinecraftForge.EVENT_BUS.register(this); }
@EventHandler public void preInit(FMLPreInitializationEvent event) { weaponSpear = new WeaponSpear() .setUnlocalizedName("weaponSpear") .setTextureName(References.MODID + ":weaponSpear") .setCreativeTab(this.tabArkCraft); itemLongneckRifle = new ItemLongneckRifle() .setUnlocalizedName("itemLongneckRifle") .setTextureName(References.MODID + ":itemLongneckRifle") .setCreativeTab(this.tabArkCraft); GameRegistry.registerItem(weaponSpear, "weapon_spear"); GameRegistry.registerItem(itemLongneckRifle, "itemLongneckRifle"); blockWoodenDoor = new BlockWoodenDoor(Material.wood).setBlockName("blockWoodenDoor"); GameRegistry.registerBlock(blockWoodenDoor, "blockWoodenDoor"); if (event.getSide().isClient()) { FMLCommonHandler.instance().bus().register(new TickClientHandlerEvent()); MinecraftForge.EVENT_BUS.register(new TickClientHandlerEvent()); } }
@EventHandler public void preInit(FMLPreInitializationEvent evt) { ResonantInduction.LOGGER.setParent(FMLLog.getLogger()); NetworkRegistry.instance().registerGuiHandler(this, proxy); Modstats.instance().getReporter().registerMod(this); Settings.CONFIGURATION.load(); // Register Forge Events MinecraftForge.EVENT_BUS.register(ResourceGenerator.INSTANCE); MinecraftForge.EVENT_BUS.register(new TextureHookHandler()); blockMachinePart = contentRegistry.createBlock(BlockMachineMaterial.class, ItemBlockMetadata.class); /** Melting dusts */ blockDust = contentRegistry .createBlock("dust", BlockDust.class, null, TileDust.class) .setCreativeTab(null); blockRefinedDust = contentRegistry .createBlock("refinedDust", BlockDust.class, null, TileDust.class) .setCreativeTab(null); // Items itemRubble = new ItemOreResource(Settings.getNextItemID("oreRubble"), "oreRubble"); itemDust = new ItemOreResource(Settings.getNextItemID("oreDust"), "oreDust"); itemRefinedDust = new ItemOreResource(Settings.getNextItemID("oreRefinedDust"), "oreRefinedDust"); itemBucketMixture = new ItemOreResourceBucket(Settings.getNextItemID("bucketMixture"), "bucketMixture", false); itemBucketMolten = new ItemOreResourceBucket(Settings.getNextItemID("bucketMolten"), "bucketMolten", true); itemBiomass = contentRegistry.createItem(ItemBiomass.class); GameRegistry.registerItem(itemRubble, itemRubble.getUnlocalizedName()); GameRegistry.registerItem(itemDust, itemDust.getUnlocalizedName()); GameRegistry.registerItem(itemRefinedDust, itemRefinedDust.getUnlocalizedName()); GameRegistry.registerItem(itemBucketMixture, itemBucketMixture.getUnlocalizedName()); GameRegistry.registerItem(itemBucketMolten, itemBucketMolten.getUnlocalizedName()); // Already registered with ContentRegistry // GameRegistry.registerTileEntity(TileMaterial.class, "ri_material"); GameRegistry.registerTileEntity(TileFluidMixture.class, "ri_fluid_mixture"); proxy.preInit(); TabRI.ITEMSTACK = new ItemStack(blockMachinePart); }
public static void registerHandlers() { FMLCommonHandler.instance().bus().register(new TickHandlerClient()); FMLCommonHandler.instance().bus().register(new KeyHandlerClient()); ClientRegistry.registerKeyBinding(KeyHandlerClient.galaxyMap); ClientRegistry.registerKeyBinding(KeyHandlerClient.openFuelGui); ClientRegistry.registerKeyBinding(KeyHandlerClient.toggleAdvGoggles); MinecraftForge.EVENT_BUS.register(new ClientProxyCore()); }
public void register() { MinecraftForge.EVENT_BUS.register(this); GameRegistry.registerItem(itemTest, "itemTest"); Minecraft.getMinecraft() .getRenderItem() .getItemModelMesher() .register(itemTest, 0, new ModelResourceLocation("airix:itemTest", "inventory")); }
@EventHandler public void load(FMLInitializationEvent event) { LanguageRegistry.instance().addStringLocalization("itemGroup.Pistronics2", "Pistronics 2"); PacketData.init(); proxy.registerTileEntities(); NetworkRegistry.instance().registerGuiHandler(this, new GuiHandler()); MinecraftForge.EVENT_BUS.register(arrowEventHandler); }
@Mod.EventHandler public void postInit(FMLPostInitializationEvent event) { if (event.getSide().isClient()) { ClientProxy.initRenderer(); } // config syncing MinecraftForge.EVENT_BUS.register(new ConfigSync()); }
@PreInit public void preInit(FMLPreInitializationEvent event) { ConfigPrecious.init(); creativeTab = MetallurgyCore.getNewCreativeTab("Precious Metals", 0); alloys = new MetalSet(new AlloyPreciousEnum()); ores = new MetalSet(new OrePreciousEnum()); try { PreciousChest = new FC_BlockChest(ConfigPrecious.PreciousChestID) .setHardness(0.5F) .setResistance(.1F) .setBlockName("PreciousChest"); Mint = new FM_BlockMint(ConfigPrecious.PreciousMintID) .setHardness(0.5F) .setResistance(.1F) .setBlockName("Mint"); MintStorage = new FM_BlockMintStorage(ConfigPrecious.PreciousMintLoaderID) .setHardness(0.5F) .setResistance(.1F) .setBlockName("MintStorage"); Coin = new ItemCoins(ConfigPrecious.ItemStartID + 248) .setItemName("Coin") .setCreativeTab(MetallurgyPrecious.creativeTab) .setIconIndex(8); Stack = new ItemCoins(ConfigPrecious.ItemStartID + 247) .setItemName("Stack") .setCreativeTab(MetallurgyPrecious.creativeTab) .setIconIndex(24); Bag = new ItemCoins(ConfigPrecious.ItemStartID + 246) .setItemName("Bag") .setCreativeTab(MetallurgyPrecious.creativeTab) .setIconIndex(40); Bullion = new ItemCoins(ConfigPrecious.ItemStartID + 245) .setItemName("Bullion") .setCreativeTab(MetallurgyPrecious.creativeTab) .setIconIndex(56); GoldCog = new MetallurgyItem(ConfigPrecious.ItemStartID + 249, "/shadow/MetallurgyCoins.png") .setIconIndex(2) .setItemName("GoldCog") .setCreativeTab(MetallurgyPrecious.creativeTab); } catch (IllegalArgumentException e) { MetallurgyCore.blockError(e); throw e; } MinecraftForge.EVENT_BUS.register(new AlloyRecipes()); }
@Override public void init(FMLInitializationEvent event) { super.init(event); ClientCommandHandler.instance.registerCommand(new ClientCommandsVC()); MinecraftForge.EVENT_BUS.register(this); FMLCommonHandler.instance().bus().register(this); MinecraftForge.EVENT_BUS.register(new RenderFog()); if (VintageCraftConfig.rearrangeCreativeTabs) { int i = 0; CreativeTabs[] tabs = new CreativeTabs[CreativeTabs.creativeTabArray.length]; for (CreativeTabs tab : CreativeTabs.creativeTabArray) { if (tab instanceof CreativeTabsVC) { if (i == 5 || i == 11) i++; // don't touch search tab or inventory tab tab.tabIndex = i; tabs[i++] = tab; } } tabs[5] = CreativeTabs.tabAllSearch; tabs[11] = CreativeTabs.tabInventory; i = 7; for (CreativeTabs tab : CreativeTabs.creativeTabArray) { if (!(tab instanceof CreativeTabsVC) && !tab.getTabLabel().equals("search") && !tab.getTabLabel().equals("inventory")) { if (i == 11) i++; tab.tabIndex = i; tabs[i++] = tab; } } CreativeTabs.creativeTabArray = tabs; /*for (CreativeTabs tab : CreativeTabs.creativeTabArray) { System.out.println(tab.getTabLabel() + ": " + tab.tabIndex); }*/ } }
@EventHandler public void init(FMLInitializationEvent event) throws Exception { packetPipeline.registerMessage( AnvilTechniquePacket.Handler.class, AnvilTechniquePacket.class, 0, Side.SERVER); packetPipeline.registerMessage( ChunkPutNbtPacket.Handler.class, ChunkPutNbtPacket.class, 1, Side.CLIENT); packetPipeline.registerMessage( ChunkRemoveNbtPacket.Handler.class, ChunkRemoveNbtPacket.class, 2, Side.CLIENT); packetPipeline.registerMessage( SoundEffectToServerPacket.Handler.class, SoundEffectToServerPacket.class, 3, Side.SERVER); packetPipeline.registerMessage( MechanicalNetworkNBTPacket.ClientHandler.class, MechanicalNetworkNBTPacket.class, 4, Side.CLIENT); packetPipeline.registerMessage( StartMeteorShowerPacket.ClientHandler.class, StartMeteorShowerPacket.class, 5, Side.CLIENT); packetPipeline.registerMessage( WorldDataPacket.ClientHandler.class, WorldDataPacket.class, 6, Side.CLIENT); packetPipeline.registerMessage( CarpentryTechniquePacket.Handler.class, CarpentryTechniquePacket.class, 7, Side.SERVER); BlocksVC.init(); ItemsVC.init(); AchievementsVC.init(); FMLCommonHandler.instance().bus().register(this); MinecraftForge.EVENT_BUS.register(this); proxy.registerTileEntities(); NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy); System.out.println("vcraft has init."); GameRegistry.registerWorldGenerator(new WorldGenDeposits(), 4); WorldType.DEFAULT = WorldTypeVC.DEFAULT; WorldType.FLAT = WorldTypeVC.FLAT; // DimensionManager.unregisterDimension(-1); DimensionManager.unregisterDimension(0); DimensionManager.unregisterDimension(1); // DimensionManager.unregisterProviderType(-1); DimensionManager.unregisterProviderType(0); DimensionManager.unregisterProviderType(1); DimensionManager.registerProviderType(0, WorldProviderVC.class, true); DimensionManager.registerProviderType(1, WorldProviderVC.class, false); // DimensionManager.registerDimension(-1, -1); DimensionManager.registerDimension(0, 0); DimensionManager.registerDimension(1, 1); proxy.init(event); }
public void load() { if (ABORT) { log("Failed to load dependencies! Not loading Flan's Mod."); return; } log("Loading Flan's mod."); MinecraftForge.EVENT_BUS.register(this); }
@Mod.EventHandler public void init(FMLInitializationEvent event) { // MinecraftForge.EVENT_BUS.register(new DqmEventHandler()); instance = this; new MobSpawnRegister(); if (this.conf.endoraFix > 0) { MinecraftForge.EVENT_BUS.register(new EndoraHandler()); } }
@EventHandler // used in 1.6.2 // @Init // used in 1.5.2 public void load(FMLInitializationEvent event) { // proxy.registerRenderers(); MinecraftForge.EVENT_BUS.register(new VampireEventHandler()); LanguageRegistry.addName(BloodtapEmpty, "Empty Bloodtap"); LanguageRegistry.addName(Bloodtap, "Filled Bloodtap"); LanguageRegistry.addName(BottledBlood, "Bottle of Blood"); // Recipes GameRegistry.addRecipe( new ItemStack(BloodtapEmpty), "xxx", "zyx", 'x', new ItemStack(Item.stick), 'y', new ItemStack(Item.glassBottle), 'z', new ItemStack(Item.ingotIron)); GameRegistry.addRecipe( new ItemStack(RunicBrick), "rdr", "dod", "rdr", 'r', new ItemStack(Item.redstone), 'd', new ItemStack(Item.diamond), 'o', new ItemStack(Block.obsidian)); LanguageRegistry.addName(RuneCraftingTable, "Runecrafting Table"); MinecraftForge.setBlockHarvestLevel(RuneCraftingTable, "pickaxe", 2); GameRegistry.registerBlock(RuneCraftingTable, "RuneCraftingTable"); LanguageRegistry.addName(RunicBrick, "Runic Brick"); MinecraftForge.setBlockHarvestLevel(RunicBrick, "pickaxe", 5); GameRegistry.registerBlock(RunicBrick, "RunicBrick"); LanguageRegistry.instance() .addStringLocalization("achievement.vampirism", "en_US", "Became a vampire!"); LanguageRegistry.instance() .addStringLocalization("achievement.vampirism.desc", "en_US", "You (sort of) died!"); LanguageRegistry.instance() .addStringLocalization("achievement.immortality", "en_US", "Became an original"); LanguageRegistry.instance() .addStringLocalization( "achievement.immortality.desc", "en_US", "Hope you made the right call."); AchievementPage.registerAchievementPage(page1); }