@Subscribe public void postInit(FMLPostInitializationEvent event){ int expMods = ShoulderTransformations.CODE_MODIFICATIONS; if(ShoulderTransformations.modifications != expMods){ logger.severe("Only found " + ShoulderTransformations.modifications + " code injections, but expected " + expMods); logger.severe("ShoulderSurfing should be disabled!"); } else { logger.info("Loaded " + ShoulderTransformations.modifications + " code injections, ShoulderSurfing good to go!"); } //create mc pointer ShoulderLoader sl = new ShoulderLoader(); sl.load(); //create tick handler st = new ShoulderTickHandler(); TickRegistry.registerTickHandler(st, Side.CLIENT); //register other events MinecraftForge.EVENT_BUS.register(new ShoulderEvents()); }
@Subscribe public void postInit(FMLPostInitializationEvent event){ int expMods = ShoulderTransformations.CODE_MODIFICATIONS; if(ShoulderTransformations.modifications != expMods){ logger.severe("Only found " + ShoulderTransformations.modifications + " code injections, but expected " + expMods); logger.severe("ShoulderSurfing should be disabled!"); } else { logger.info("Loaded " + ShoulderTransformations.modifications + " code injections, ShoulderSurfing good to go!"); } //create mc pointer ShoulderLoader sl = new ShoulderLoader(); sl.load(); //create tick handler st = new ShoulderTickHandler(); TickRegistry.registerTickHandler(st, Side.CLIENT); }
@Subscribe public void preInit(FMLPreInitializationEvent event) { try { this.gameTickHandler.setMod(mod); this.guiTickHandler.setMod(mod); TickRegistry.registerTickHandler(this.gameTickHandler, Side.CLIENT); TickRegistry.registerTickHandler(this.guiTickHandler, Side.CLIENT); GameRegistry.registerWorldGenerator(ModLoaderHelper.buildWorldGenHelper(mod)); GameRegistry.registerFuelHandler(ModLoaderHelper.buildFuelHelper(mod)); GameRegistry.registerCraftingHandler(ModLoaderHelper.buildCraftingHelper(mod)); GameRegistry.registerPickupHandler(ModLoaderHelper.buildPickupHelper(mod)); NetworkRegistry.instance().registerChatListener(ModLoaderHelper.buildChatListener(mod)); NetworkRegistry.instance().registerConnectionHandler(ModLoaderHelper.buildConnectionHelper(mod)); } catch (Exception e) { controller.errorOccurred(this, e); Throwables.propagateIfPossible(e); } }
@EventHandler public void preInit(FMLPreInitializationEvent e) { VersionCheck.updateCheckMRPG(MysticModInfo.NAME, MysticModInfo.VERSION, URL); TickRegistry.registerTickHandler(new ClientTickHandler(), Side.CLIENT); logger = Logger.getLogger(MysticModInfo.MODID); logger.setParent(FMLLog.getLogger()); final Configuration config = new Configuration( e.getSuggestedConfigurationFile()); MysticConfig.load(config); tab = new CreativeTabsMRPG(CreativeTabs.getNextID(), "tabMysticRPG"); MysticItems.init(); MysticBlocks.init(); MysticRecipes.init(); MysticDimensions.init(); // TODO Localize biomes and dimensions MysticBiomes.init(); LangUtil.addNames("/assets/" + MysticModInfo.MODID + "/lang/", languages); }
public void universalPreInit(FMLPreInitializationEvent event) { Configuration config = new Configuration(event.getSuggestedConfigurationFile()); packets = Network.newChannel("SevenCommons") .register(PacketSync.class, SYNC_PACKET_ID) .register(PacketInventoryName.class) .register(PacketContainerButton.class) .build(); ClassInfoUtil.preInit(); // initialize the lazy statics in the scheduler class Reflection.initialize(Scheduler.class); TickRegistry.registerTickHandler(new SCPlayerTicker(), Side.SERVER); GameRegistry.registerPlayerTracker(new SCPlayerTracker()); proxy.preInit(event); Syncing.registerFactory(Object.class, new BuiltinSyncers()); ToNbtFactories.registerFactory(Object.class, new DefaultNBTSerializers()); }
@EventHandler public void init(FMLInitializationEvent event) { new GuiHandler(); TickRegistry.registerTickHandler(new KeyTickHandler(), Side.SERVER); LogHelper.log(Level.INFO, "Preparing recipes"); Recipes.initShapedRecipes(); Recipes.initShapelessRecipes(); LogHelper.log(Level.INFO, "Preparing world generation"); GameRegistry.registerWorldGenerator(worldGen); LogHelper.log(Level.INFO, "Preparing renders"); proxy.registerRenderers(); LogHelper.log(Level.INFO, "Preparing entities"); EntityRegistry.registerModEntity(EntityBlastBlox.class, "BlastBlox", EntityRegistry.findGlobalUniqueEntityId(), this, 128, 1, true); if(ConfigBooleans.enableUpdateCheck){ LogHelper.log(Level.INFO, "Checking for new version"); NetworkRegistry.instance().registerConnectionHandler(new Update("Kingdom Keys", Reference.MOD_VER, "https://raw.github.com/Wehavecookies56/Kingdom-Keys/master/Version.txt")); final Side side = FMLCommonHandler.instance().getEffectiveSide(); } }
public static void init() { // Clear all lists listDevs.clear(); listTesters.clear(); // Retrieve all players in the lists try { retrievePlayerData(); } catch (IOException e) { e.printStackTrace(); } // Obtain texture files Minecraft.getMinecraft().renderEngine.obtainImageData(Reference.PATH_CAPES_DEV, new ImageBufferDownload()); Minecraft.getMinecraft().renderEngine.obtainImageData(Reference.PATH_CAPES_TESTER, new ImageBufferDownload()); // Register tickhandler to set the capes TickRegistry.registerTickHandler(new CapeTickHandler(), Side.CLIENT); }
@Override public void registerHandlers() { super.registerHandlers(); if (AddonConfig.useHUDStuff) { renderTickHandler = new RenderTickHandler(); TickRegistry.registerTickHandler(renderTickHandler, Side.CLIENT); } clientTickHandler = new ClientTickHandler(); TickRegistry.registerTickHandler(clientTickHandler, Side.CLIENT); ClientTickHandler.load(); commonTickHandler = new CommonTickHandler(); TickRegistry.registerTickHandler(commonTickHandler, Side.CLIENT); }
@EventHandler public void init(final FMLInitializationEvent event) { Agriculture.tab = new AgricultureTab("Agriculture"); LanguageRegistry.instance().addStringLocalization("itemGroup.Agriculture", "en_US", "Agriculture"); AgricultureItems.init(); AgricultureBlocks.init(); Agriculture.tab.setItemID(AgricultureBlocks.oven.blockID); AgricultureItems.setupItems(); GameRegistry.registerWorldGenerator(new WorldGenSalt(4)); GameRegistry.registerWorldGenerator(new WorldGenSpice(AgricultureBlocks.cinnamon.blockID)); GameRegistry.registerWorldGenerator(new WorldGenSpice(AgricultureBlocks.vanilla.blockID)); TickRegistry.registerTickHandler(new TickHandler(), Side.SERVER); NetworkRegistry.instance().registerGuiHandler(Agriculture.instance, Agriculture.proxy); Agriculture.proxy.registerEventHandlers(); Agriculture.proxy.registerRenderers(); registerTCCrop(AgricultureBlocks.peanut, 6); registerTCCrop(AgricultureBlocks.strawberry, 6); registerForestryCrop(AgricultureItems.strawberry.itemID, AgricultureItems.strawberry.getDamage(), AgricultureBlocks.strawberry.blockID, 6); registerForestryCrop(AgricultureItems.peanuts.itemID, AgricultureItems.peanuts.getDamage(), AgricultureBlocks.peanut.blockID, 6); }
@EventHandler public void init( FMLInitializationEvent event ) { Block.blocksList[ Block.mobSpawner.blockID ] = null; mobSpawner = new ToggleableMobSpawnerBlock( Block.mobSpawner.blockID ); // Associate our tile entity with the vanilla one. if ( event.getSide().equals( Side.CLIENT ) ) registerTileEntityRenderer(); try { Class c = TileEntity.class; Field nameToClassField = c.getDeclaredFields()[ 0 ]; Field classToNameField = c.getDeclaredFields()[ 1 ]; nameToClassField.setAccessible( true ); classToNameField.setAccessible( true ); Map nameToClassMap = ( Map ) nameToClassField.get( null ); Map classToNameMap = ( Map ) classToNameField.get( null ); nameToClassMap.put( "MobSpawner", ToggleableMobSpawnerTileEntity.class ); classToNameMap.put( ToggleableMobSpawnerTileEntity.class, "MobSpawner" ); } catch ( Exception exception ) { exception.printStackTrace(); } toggleKey = new KeyBinding( "Toggle Spawner Status", Keyboard.KEY_M ); renderKey = new KeyBinding( "Toggle Render Status", Keyboard.KEY_N ); keyHandler = new KeyHandler( new KeyBinding[] { toggleKey, renderKey } ); statRenderer = new StatusTextRenderer(); TickRegistry.registerTickHandler( keyHandler, Side.CLIENT ); TickRegistry.registerTickHandler( statRenderer, Side.CLIENT ); }
/** * Initialize the blocks, items, tick handler * @param evt */ @EventHandler public void load(FMLInitializationEvent evt) { guestBedBlock = new BlockGuestBed(bedBlockID).setHardness(0.2F).setUnlocalizedName("guest_bed").setTextureName("bed"); guestBedItem = (new ItemGuestBed(bedItemID)).setMaxStackSize(1).setUnlocalizedName("guest_bed").setTextureName("bed"); GameRegistry.registerBlock(guestBedBlock, "Guest Bed Block"); LanguageRegistry.addName(guestBedBlock, "Guest Bed"); GameRegistry.registerItem(guestBedItem, "Guest Bed Item"); LanguageRegistry.addName(guestBedItem, "Guest Bed"); TickRegistry.registerTickHandler(new TickHandlerSleep(), Side.SERVER); }
@Override public void tryEnableItemStackRenderer() { if (gl32_enabled) { TickRegistry.registerTickHandler( new RenderTickHandler(), Side.CLIENT ); } else { LogWrapper.severe( "OpenGL 3.2 not detected, mod data dump for images and item/block JSON data will not work!" ); } }
/** * Wireless Remote GUI */ // public static GuiRedstoneWirelessRemote guiWirelessRemote; @Override public void init() { TickRegistry.registerTickHandler(new ClientTickHandler(), Side.CLIENT); initGUIs(); super.init(); }
@EventHandler public void preInit(FMLPreInitializationEvent event) { addModFlags(); Configuration config = new Configuration( event.getSuggestedConfigurationFile()); new cfg().setConfig(config); if(isDebug()) { System.out.println("MineFantasy: Debug mode ACTIVE"); HeatableItem.requiresHeating = false; } removeRecipes(); GameRegistry.registerFuelHandler(new MineFantasyFuels()); TickRegistry.registerTickHandler(new ArmourTickHandlerMF(), FMLCommonHandler.instance().getSide()); TickRegistry.registerTickHandler(new ArmourTickHandlerMF(), Side.SERVER); TickRegistry.registerTickHandler(new HotItemTickHandler(), FMLCommonHandler.instance().getSide()); TickRegistry.registerTickHandler(new HotItemTickHandler(), Side.SERVER); proxy.registerTickHandlers(); proxy.registerRenderInformation(); NetworkRegistry.instance().registerGuiHandler(instance, proxy); if (client) { MinecraftForge.EVENT_BUS.register(new SoundManagerMF()); StatListMF.init(); } CrossbowAmmo.addCrossbowHandler(new CrossbowAmmoMF()); rebuildRecipes(); QuiverArrowRegistry.addArrowFireHandler(new QuiverArrowsMF()); }
@Subscribe public void init(FMLInitializationEvent event){ //load the keyboard bindings kbh = ShoulderKeybindings.registerKeybindings(); //create mc pointer mc = ModLoader.getMinecraftInstance(); //create tick handler st = new ShoulderTickHandler(); TickRegistry.registerTickHandler(st, Side.CLIENT); }
@Init public void load(FMLInitializationEvent event) { //load the keyboard bindings kbh = ShoulderKeybindings.registerKeybindings(); //create mc pointer mc = ModLoader.getMinecraftInstance(); //create tick handler st = new ShoulderTickHandler(); TickRegistry.registerTickHandler(st, Side.CLIENT); }
private void registerForgeHandlers() { ForgeHandlers handlers = new ForgeHandlers(); MinecraftForge.EVENT_BUS.register( handlers ); TickRegistry.registerTickHandler( handlers, Side.CLIENT ); BillundBlockRenderingHandler billundHandler = new BillundBlockRenderingHandler(); RenderingRegistry.registerBlockHandler( billundHandler ); BrickRenderer brickHandler = new BrickRenderer(); MinecraftForgeClient.registerItemRenderer( Billund.Items.brick.itemID, brickHandler ); RenderingRegistry.registerEntityRenderingHandler( EntityAirDrop.class, new RenderAirDrop() ); }
@EventHandler public void preInit(FMLPreInitializationEvent event) { Configurations.Load(event.getModConfigurationDirectory()); Registries.exatab = new ExATab("ExA"); Registries.oretab = new ExAOreTab("ExAOres"); Registries.registerItems(); Registries.registerBlocks(); Registries.registerRecipes(); Registries.exatab.initTab(new ItemStack(Registries.crookGold, 1, 0)); Registries.oretab.initTab(new ItemStack(Registries.cobaltOreItem, 1, 0)); MinecraftForge.EVENT_BUS.register(new AliquoEvents()); TickRegistry.registerTickHandler(new AliquoTickHandler(), Side.CLIENT); }
@Init // used in 1.5.2 public void load(FMLInitializationEvent event) { //proxy.registerKeyBindings(); TickRegistry.registerTickHandler(tickHandler, Side.CLIENT); NetworkRegistry.instance().registerConnectionHandler(new WDLConnectionHandler()); System.err.println("WDL loaded"); instance = this; }
@EventHandler public void load(FMLInitializationEvent event) { System.out.println("[FF] FysiksFun, by M. Broxvall "); System.out.println("[FF] Credits: Rubble sounds created by Dan Oberbaur; Earthquake/volcano sound created by Tim Kahn"); proxy.registerRenderers(); proxy.registerSounds(); eventListener = new EventListener(); MinecraftForge.EVENT_BUS.register(eventListener); /* * Let these modules load even when not used. Make it easier to not break * when disabled. */ Fluids.load(); Gases.load(); // TickRegistry.registerTickHandler(worldTickHandler, Side.CLIENT); TickRegistry.registerTickHandler(worldTickHandler, Side.SERVER); TickRegistry.registerTickHandler(serverTickHandler, Side.SERVER); TickRegistry.registerTickHandler(clientTickHandler, Side.CLIENT); rand = new Random(4711); for (int i = 0; i < 300; i++) { blockTickQueueRing[i] = (Object) new HashSet<BlockUpdateState>(); } BlockWorldSupport.init(); settings.worldSupportBlockID = Util.findBlockIdFromName(settings.worldSupportBlockString); if (settings.worldSupportBlockID == 0) { FysiksFun.logger.log(Level.SEVERE, "[FF] Cannot find block named '" + settings.worldSupportBlockString + "' as the world-support block"); } else FysiksFun.logger.log(Level.SEVERE, "[FF] Found block named'" + settings.worldSupportBlockString + "' as the world-support block, ID:" + settings.worldSupportBlockID); }
@Mod.EventHandler() private void init(FMLInitializationEvent event){ LOGGER.info("Registering TickHandlers"); TickRegistry.registerTickHandler(new ServerTickHandler(), Side.SERVER); TickRegistry.registerTickHandler(new ClientTickHandler(), Side.CLIENT); LOGGER.info("Registering GUI Handler"); NetworkRegistry.instance().registerGuiHandler(Exoskeleton.instance, new EXOGuiHandler()); LOGGER.info("Registering Blocks"); EXOBlocks.INSTANCE.registerBlocks(); LOGGER.info("Registering Items"); EXOItems.INSTANCE.registerItems(); }
/** * Register a KeyHandler to the game. This handler will be called on certain tick events * if any of its key is inactive or has recently changed state * * @param handler */ public static void registerKeyBinding(KeyHandler handler) { instance().keyHandlers.add(handler); if (!handler.isDummy) { TickRegistry.registerTickHandler(handler, Side.CLIENT); } }
@Override public void preInit() { super.preInit(); TickRegistry.registerTickHandler(new TickHandlerMailClient(), Side.CLIENT); triggerHasMail = new TriggerHasMail(Defaults.ID_TRIGGER_HASMAIL); lowPaper25 = new TriggerLowPaper(Defaults.ID_TRIGGER_LOWPAPER_25, 0.25f); lowPaper10 = new TriggerLowPaper(Defaults.ID_TRIGGER_LOWPAPER_10, 0.1f); lowPostage40 = new TriggerLowStamps(Defaults.ID_TRIGGER_LOWSTAMPS_40, 40); lowPostage20 = new TriggerLowStamps(Defaults.ID_TRIGGER_LOWSTAMPS_20, 20); lowInput25 = new TriggerLowInput(Defaults.ID_TRIGGER_LOWINPUT_25, 0.25f); lowInput10 = new TriggerLowInput(Defaults.ID_TRIGGER_LOWINPUT_10, 0.1f); highBuffer75 = new TriggerBuffer(Defaults.ID_TRIGGER_BUFFER_75, 0.75f); highBuffer90 = new TriggerBuffer(Defaults.ID_TRIGGER_BUFFER_90, 0.90f); int blockid = Config.getOrCreateBlockIdProperty("mail", Defaults.ID_BLOCK_MAIL); definitionMailbox = new MachineDefinition(blockid, Defaults.DEFINITION_MAILBOX_META, "forestry.Mailbox", MachineMailbox.class, ShapedRecipeCustom.createShapedRecipe(new Object[] { " # ", "#Y#", "XXX", Character.valueOf('#'), "ingotTin", Character.valueOf('X'), Block.chest, Character.valueOf('Y'), ForestryItem.sturdyCasing }, new ItemStack(blockid, 1, Defaults.DEFINITION_MAILBOX_META)) ).setFaces(87, 89, 88, 88, 88, 88, 87, 90); definitionTradestation = new MachineDefinition(blockid, Defaults.DEFINITION_TRADESTATION_META, "forestry.Tradestation", MachineTrader.class, ShapedRecipeCustom.createShapedRecipe(new Object[] { "Z#Z", "#Y#", "XWX", Character.valueOf('#'), new ItemStack(ForestryItem.tubes, 1, 2), Character.valueOf('X'), Block.chest, Character.valueOf('Y'), ForestryItem.sturdyCasing, Character.valueOf('Z'), new ItemStack(ForestryItem.tubes, 1, 3), Character.valueOf('W'), new ItemStack(ForestryItem.circuitboards, 1, 2) }, new ItemStack(blockid, 1, Defaults.DEFINITION_TRADESTATION_META) )).setFaces(87, 89, 105, 106, 88, 88, 87, 90); definitionPhilatelist = new MachineDefinition(blockid, Defaults.DEFINITION_PHILATELIST_META, "forestry.Philatelist", MachinePhilatelist.class).setFaces(87, 89, 103, 104, 103, 103, 87, 90); ForestryBlock.mail = new BlockBase(blockid, Material.iron, new MachineDefinition[] { definitionMailbox, definitionTradestation, definitionPhilatelist }).setBlockName("for.mail"); Item.itemsList[ForestryBlock.mail.blockID] = null; Item.itemsList[ForestryBlock.mail.blockID] = new ItemForestryBlock(ForestryBlock.mail.blockID - 256, "for.mail"); }
@Init public void load(FMLInitializationEvent event) { // GameRegistry.registerPlayerTracker(new PlayerTracker()); TickRegistry.registerTickHandler(new TickHandler(), Side.SERVER); // MinecraftForge.EVENT_BUS.register(new EventHandler()); logger.info("Loaded."); }
@Override public void registerRenders() { DecayingWorld.overlayGui = new OverhealGUI(); TickRegistry.registerTickHandler(DecayingWorld.overlayGui, Side.CLIENT); RenderingRegistry.registerEntityRenderingHandler(EntitySolidifier.class, new RenderSnowball(DecayingWorld.solidifier)); RenderingRegistry.registerEntityRenderingHandler(EntityLifeBomb.class, new RenderSnowball(DecayingWorld.lifebomb)); RenderingRegistry.registerEntityRenderingHandler(EntityTreant.class, new RenderTreant()); RenderingRegistry.registerEntityRenderingHandler(EntityBlinkDog.class, new RenderBlinkDog()); RenderingRegistry.registerEntityRenderingHandler(EntityEmpyreal.class, new RenderEmpyreal()); RenderingRegistry.registerEntityRenderingHandler(EntityFooDog.class, new RenderFooDog()); }
@EventHandler public void Init(FMLPostInitializationEvent event) { TickRegistry.registerTickHandler(new CommonTickHandler(), Side.SERVER); GameRegistry.registerCraftingHandler(new ACCraftingHandler()); if (ModCompatability.isBuildCraftLoaded()) { System.out.println("Loading BuildCraft Advanced Gear Recipes."); // RecipeAdder.craftingBC(); } RecipeAdder.craftingAll(); RecipeAdder.smeltingAll(); }
@SideOnly(Side.CLIENT) @Override public void engage() { super.engage(); TickRegistry.registerTickHandler(this, Side.CLIENT); }
@Mod.EventHandler public void init(FMLInitializationEvent event) { proxy.registerKeyBinding(); //Initialize Blocks BL2Blocks.initialize(); //Initialize Items BL2Items.initialize(); //Initialize LiquidStacks //BL2Liquid.initialize(); //Oredictionary for(int i=1;i<7;i++){ OreDictionary.registerOre("bullet", new ItemStack(BL2Items.bullets,1,i)); } //EntityLivingHandler MinecraftForge.EVENT_BUS.register(new EntityLivingHandler()); EntityRegistry.registerModEntity(EntityBullet.class, "Bullet", 1, this, 64, 10, true); EntityRegistry.registerModEntity(EntityGrenade.class, "Grenade", 2, this, 64, 10, true); BL2Tiles.registerTiles(); NetworkRegistry.instance().registerGuiHandler(this, new GUIHandler()); TickRegistry.registerTickHandler(this, Side.SERVER); proxy.registerRenderInformation(); proxy.registerRenderTickHandler(); proxy.registerItemRenderer(); proxy.initiateRendering(); NetworkRegistry.instance().registerGuiHandler(this, new BL2GuiHandler()); }
@EventHandler public void load(FMLInitializationEvent evt) { mcinstance = FMLClientHandler.instance().getClient(); nextUpdate = System.currentTimeMillis(); trackedEntities = new ArrayList<EntityLightAdapter>(); threadRunning = false; TickRegistry.registerTickHandler(new TickHandler(), Side.CLIENT); }
@EventHandler public void load(FMLInitializationEvent evt) { mcinstance = FMLClientHandler.instance().getClient(); nextUpdate = System.currentTimeMillis(); trackedPlayers = new ArrayList<OtherPlayerAdapter>(); threadRunning = false; TickRegistry.registerTickHandler(new TickHandler(), Side.CLIENT); }
@EventHandler public void load(FMLInitializationEvent evt) { mcinstance = FMLClientHandler.instance().getClient(); nextUpdate = System.currentTimeMillis(); trackedItems = new ArrayList<EntityItemAdapter>(); threadRunning = false; TickRegistry.registerTickHandler(new TickHandler(), Side.CLIENT); }
@EventHandler public void load(FMLInitializationEvent evt) { lightLevel = 0; enabled = false; lastWorld = null; TickRegistry.registerTickHandler(new TickHandler(), Side.CLIENT); }