Java 类net.minecraftforge.fml.common.Mod.EventHandler 实例源码

项目:Wopper    文件:Wopper.java   
@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();
}
项目:BetterBeginningsReborn    文件:ModMain.java   
@EventHandler
public void preInit(FMLPreInitializationEvent e)
{
    LogUtil.logDebug("Starting pre-initialization...");

    configFile = BBConfigFolderLoader.getConfigFile(e);
    configFile.load();
    BBConfig.initialize();
    BBConfig.syncConfig(configFile);

    MinecraftForge.EVENT_BUS.register(eventHandler);

    network = NetworkRegistry.INSTANCE.newSimpleChannel("bbchannel");
    network.registerMessage(PacketNetherBrickOvenFuelLevel.PacketHandler.class,
        PacketNetherBrickOvenFuelLevel.class, 0, Side.CLIENT);
    network.registerMessage(PacketCampfireState.PacketHandler.class,
        PacketCampfireState.class, 1, Side.CLIENT);

    RegisterTileEntities.register();
    FuelRegistry.addDefaultFuels();
    ElementRegistry.init();
    proxy.preInit(e);
}
项目:Halloween    文件:HalloweenMod.java   
@EventHandler
public static void onServerStopped(FMLServerStoppedEvent event)
{
    if (ModConfiguration.halloweenCheckInterval > 0)
    {
        // stop the scheduler
        scheduler.schedule(new Runnable()
        {
            @Override
            public void run()
            {
                handle.cancel(true);
            }

        }, 0, TimeUnit.SECONDS);
    }
}
项目:DebugServerInfo    文件:DebugServerInfo.java   
@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();
}
项目:UniversalRemote    文件:UniversalRemote.java   
@EventHandler
  public void preInit(FMLPreInitializationEvent event){
    Util.logger = new Logger(event.getModLog());

    // find the fields we need regardless of obs
    OpenGuiWrapper.findFields();

    // register event handlers
    MinecraftForge.EVENT_BUS.register(new Registrar());
    MinecraftForge.EVENT_BUS.register(new VersionTracker());
    MinecraftForge.EVENT_BUS.register(PlayerWorldSyncServer.INSTANCE);

// setup networking
    RemoteGuiNetworkManager.INSTANCE.preInit(event);

    VersionTracker.register(new UniversalRemoteVersionProvider());

    proxy.preInit(event);

    // fix broken config issues
    UniversalRemoteConfiguration.validateConfig();
  }
项目:Thermionics    文件:Thermionics.java   
@EventHandler
public void onInit(FMLInitializationEvent e) {
    proxy.init();
    //TODO: When smores has ore voting stabilized, update and re-enable this
    //NBTTagCompound oresTag = new NBTTagCompound();
    //oresTag.setBoolean("oreCopper", true);
    //oresTag.setBoolean("ingotCopper", true);
    //oresTag.setBoolean("dustCopper", true);
    //oresTag.setBoolean("gearCopper", true);
    //oresTag.setBoolean("plateCopper", true);
    //FMLInterModComms.sendMessage("smores", "recipeVote", oresTag);

    //Thermionics machines are *unusually* safe for charset to carry around
    FMLInterModComms.sendMessage("charset", "addCarry", ThermionicsBlocks.FIREBOX.getRegistryName());
    FMLInterModComms.sendMessage("charset", "addCarry", ThermionicsBlocks.OVEN.getRegistryName());
    FMLInterModComms.sendMessage("charset", "addCarry", ThermionicsBlocks.BATTERY_LEAD.getRegistryName()); //Avoid creative battery carry!
    FMLInterModComms.sendMessage("charset", "addCarry", ThermionicsBlocks.HAMMER_MILL.getRegistryName());
    FMLInterModComms.sendMessage("charset", "addCarry", ThermionicsBlocks.MOTOR_CONVECTION.getRegistryName());
    FMLInterModComms.sendMessage("charset", "addCarry", ThermionicsBlocks.SERGER.getRegistryName());
}
项目:Device-Mod-Apps    文件:Main.java   
@EventHandler
public void init(FMLInitializationEvent e) {
    proxy.init(e);

    ApplicationMusicPlayer.registerDefaultSong(new ListedSong("C418 - Cat", SoundEvents.RECORD_CAT,         183000000));
    ApplicationMusicPlayer.registerDefaultSong(new ListedSong("C418 - Blocks", SoundEvents.RECORD_BLOCKS,   327000000));
    ApplicationMusicPlayer.registerDefaultSong(new ListedSong("C418 - Chirp", SoundEvents.RECORD_CHIRP,     183000000));
    ApplicationMusicPlayer.registerDefaultSong(new ListedSong("C418 - Far", SoundEvents.RECORD_FAR,         152400000));
    ApplicationMusicPlayer.registerDefaultSong(new ListedSong("C418 - Mall", SoundEvents.RECORD_MALL,       190200000));
    ApplicationMusicPlayer.registerDefaultSong(new ListedSong("C418 - Mellohi", SoundEvents.RECORD_MELLOHI, 81600000));
    ApplicationMusicPlayer.registerDefaultSong(new ListedSong("C418 - Stal", SoundEvents.RECORD_STAL,       138000000));
    ApplicationMusicPlayer.registerDefaultSong(new ListedSong("C418 - Strad", SoundEvents.RECORD_STRAD,     184800000));
    ApplicationMusicPlayer.registerDefaultSong(new ListedSong("C418 - Wait", SoundEvents.RECORD_WAIT,       214800000));
    ApplicationMusicPlayer.registerDefaultSong(new ListedSong("C418 - Ward", SoundEvents.RECORD_WARD,       246600000));
    //ApplicationMusicPlayer.registerDefaultSong(new ListedSong("C418 - 11",    SoundEvents.RECORD_11,        66600000));
    ApplicationMusicPlayer.registerDefaultSong(new ListedSong("C418 - 13", SoundEvents.RECORD_13,           154800000));
}
项目:Elicitation    文件:Elicitation.java   
@EventHandler
  public void preInit(FMLPreInitializationEvent event)
  {

NetworkRegistry.INSTANCE.registerGuiHandler(Elicitation.instance, new GuiHandler());
Items.setup();
  }
项目:minecraft-territorialdealings    文件:Main.java   
@EventHandler
  public void serverLoad(FMLServerStartingEvent event)
  {
this.worldDir = event.getServer().getFolderName();  // Hand me that world name

_SaveData save = SaveHandler.loadFactionsFromFile(Main.configDir, Main.worldDir);

if (save == null)
{
    save = new _SaveData(); // Init
}

TerritoryHandler.setSaveData(save);
  }
项目:CompositeGear    文件:CompositeGear.java   
@EventHandler
public void afterModsLoaded(FMLPostInitializationEvent event)
{
    if (Loader.isModLoaded(Compats.IC2)) {
        ItemsCG.loadRecipes();
    }
}
项目:CompositeGear    文件:CompositeGear.java   
@EventHandler
public void load(FMLPreInitializationEvent event)
{
    modLog = event.getModLog();
    ConfigurationCG.init(event.getSuggestedConfigurationFile());

    if (proxy.isClient()) {
        getIC2Tab();
    }

    ItemsCG.load();
}
项目:HeroUtils    文件:Tesla.java   
@EventHandler
public void preInit (FMLPreInitializationEvent event) {

    CapabilityManager.INSTANCE.register(ITeslaConsumer.class, new CapabilityTeslaConsumer<ITeslaConsumer>(), BaseTeslaContainer.class);
    CapabilityManager.INSTANCE.register(ITeslaProducer.class, new CapabilityTeslaProducer<ITeslaProducer>(), BaseTeslaContainer.class);
    CapabilityManager.INSTANCE.register(ITeslaHolder.class, new CapabilityTeslaHolder<ITeslaHolder>(), BaseTeslaContainer.class);
}
项目:VanillaExtras    文件:ModCore.java   
@EventHandler
public void serverStarting(FMLServerStartingEvent event) {
    PacketHandler.NETWORKINSTANCE.registerMessage(PacketGetWorker.Handler.class, PacketGetWorker.class,
            PacketHandler.nextID(), Side.SERVER);
    PacketHandler.NETWORKINSTANCE.registerMessage(PacketReturnWorker.Handler.class, PacketReturnWorker.class,
            PacketHandler.nextID(), Side.CLIENT);
    event.registerServerCommand(new MainCmd());
    event.registerServerCommand(new GamemodeCmd());
}
项目:Game-Stages    文件:GameStages.java   
@EventHandler
public void preInit (FMLPreInitializationEvent event) {

    // Packets
    NETWORK.register(PacketStage.class, Side.CLIENT);
    NETWORK.register(PacketStageAll.class, Side.CLIENT);
    NETWORK.register(PacketRequestClientSync.class, Side.SERVER);

    CapabilityManager.INSTANCE.register(IStageData.class, new Storage(), DefaultStageData.class);
    MinecraftForge.EVENT_BUS.register(new PlayerDataHandler());
    BookshelfRegistry.addCommand(COMMAND);
    BookshelfRegistry.addGameRule(GAME_RULE_SHARE_STAGES);
}
项目:TinyCreatures    文件:CommonProxy.java   
@EventHandler
public void preInit(FMLPreInitializationEvent event){
    proxy.preInit(event);
    registerBlocks();
    registerItems();
    registerFuelHandlers();
    registerTileEntities();
    registerWorldGenerators();
}
项目:BetterBeginningsReborn    文件:ModMain.java   
@EventHandler
public void init(FMLInitializationEvent e)
{
    proxy.init(e);

    BBConfigFolderLoader.loadRemovedRecipes(e);

    RemoveRecipes.remove();
    if (BBConfig.moduleFurnaces)
    {
        RemoveRecipes.removeFurnaceRecipes();
    }

    RegisterRecipes.addShapelessRecipes();
    RegisterRecipes.addShapedRecipes();
    RegisterRecipes.addAdvancedRecipes();
    RegisterRecipes.addFurnaceRecipes();
    InfusionRepairUtil.registerVanillaEnchantsConfig();
    TileEntitySmelterBase.registerDefaultBoosters();

    BBConfigFolderLoader.loadRecipes(e);
    if(!BBConfigFolderLoader.wasLoadingSuccessfull())
    {
        LogUtil.log(Level.ERROR, "If you have not modified the JSON recipe files, they may be corrupt. Please delete them and relaunch Minecraft, they will be regenerated."
            + "\n If you have modified them, check your modifications are correct.");
        FMLCommonHandler.instance().exitJava(0, false);
    }
}
项目:minecraft-hue    文件:HueMod.java   
/**
 * Save the instance of the command manager and initialize the commands.
 *
 * @param event The server starting event that was fired.
 */
@EventHandler
public void serverStarting(FMLServerStartingEvent event) {
    MinecraftServer server = event.getServer();
    HueManager hueManager = HueManager.getInstance();
    hueManager.setMinecraftServer(server);
    this.listener.setWorld(server.getEntityWorld());
    this.commandManager = (ServerCommandManager) server.getCommandManager();
    this.initCommands();
}
项目:ExPetrum    文件:ExPetrum.java   
@EventHandler
public void preInit(FMLPreInitializationEvent evt)
{
    containerOfSelf = Loader.instance().activeModContainer();
    this.setDevEnvironment();
    ExPMisc.modLogger.log(LogLevel.Debug, "ExPetrum pre initializing.");
       AbstractRegistry.registries.add(proxy);
    AbstractRegistry.registries.forEach(reg -> reg.preInit(evt));
    ExPMisc.modLogger.log(LogLevel.Debug, "ExPetrum pre initialized.");
}
项目:Proyecto-DASI    文件:MalmoMod.java   
@EventHandler
public void init(FMLInitializationEvent event)
{
    if (event.getSide().isClient())
    {
        this.client = new MalmoModClient();
        this.client.init(event);
    }
    if (event.getSide().isServer())
    {
        this.server = new MalmoModServer();
        this.server.init(event);
    }
}
项目:Infernum    文件:Infernum.java   
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
    MinecraftForge.EVENT_BUS.register(new EventHandlerClient());
    MinecraftForge.EVENT_BUS.register(new EventHandlerCommon());
    MinecraftForge.EVENT_BUS.register(new RenderKnowledgeTome());
    proxy.preInit();
}
项目:UraniumBigReactor    文件:UraniumBigReactorMod.java   
@EventHandler
public void init(FMLPostInitializationEvent event)
{
    ReactorInterior.registerFluid("ic2coolant", 0.66F, 0.95F, 6F, IHeatEntity.conductivityDiamond);
    ReactorInterior.registerFluid("ic2uu_matter", 0.9F, 0.99F, 18F, IHeatEntity.conductivityDiamond);

    Reactants.registerReactant("uFuel", 0, 0x46c81a);
    Reactants.registerReactant("plutonium", 1, 0xaaaaaa);
    ReactorConversions.register("uFuel", "plutonium");

    Reactants.registerSolid("uraniumFuel", "uFuel");
    Reactants.registerSolid("tinyPlutonium", "plutonium");
    Item uraniumFuel = Item.getByNameOrId("ic2:nuclear");
    if(uraniumFuel != null)
    {
        OreDictionary.registerOre("uraniumFuel", uraniumFuel);
        OreDictionary.registerOre("tinyPlutonium", new ItemStack(uraniumFuel, 1, 7));
    }
    else
    {
        OreDictionary.registerOre("tinyPlutonium", new ItemStack(Item.getByNameOrId("bigreactors:ingotMetals"), 0, 1));
    }

    Fluid fluidUranium = FluidRegistry.getFluid("uraniumfuel");
    if(fluidUranium != null)
        Reactants.registerFluid(fluidUranium, "uFuel");
}
项目:LagssieMC    文件:Lagssie.java   
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
    logger = LogManager.getLogger("lagssie");
    config = new Configuration(event.getSuggestedConfigurationFile());

    intervalClient = config.getFloat("intervalClient", "general", 0.25f, 0f, 1000.0f, "If the client is stuck longer than this amount of time (in seconds), dump a stacktrace of what it is doing. Set to 0 to disable.");
    intervalServer = config.getFloat("intervalServer", "general", 0.25f, 0f, 1000.0f, "If the server is stuck longer than this amount of time (in seconds), dump a stacktrace of what it is doing. Set to 0 to disable.");

    config.save();
}
项目:ExPetrum    文件:ExPetrum.java   
@EventHandler
public void init(FMLInitializationEvent evt)
{
    ExPMisc.modLogger.log(LogLevel.Debug, "ExPetrum initializing.");
    AbstractRegistry.registries.forEach(reg -> reg.init(evt));
    ExPMisc.modLogger.log(LogLevel.Debug, "ExPetrum initialized.");
}
项目:OnTheRails    文件:OnTheRails.java   
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
    OneMeterRail block = new OneMeterRail(Material.CIRCUITS);
    block.setRegistryName("one_meter_rail");
    GameRegistry.register(block);

    proxy.preInit();

}
项目:Torched    文件:Torched.java   
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
    proxy.preInitMod();

    channel = new PacketChannel(Torched.MOD_NAME, PacketKeyEvent.class);

    UpdateChecker.registerMod(new UpdateChecker.ModVersionInfo(MOD_NAME, iChunUtil.VERSION_OF_MC, VERSION, false));
}
项目:craftsman    文件:Main.java   
@EventHandler
public void init(FMLServerStartingEvent event) {
    event.registerServerCommand(new Pyramid());
    event.registerServerCommand(new Stairs());
    event.registerServerCommand(new Maze());

    event.registerServerCommand(new Turtle());
    event.registerServerCommand(new Cube());
    event.registerServerCommand(new Frame());
    event.registerServerCommand(new Line());
    event.registerServerCommand(new Circle());
    event.registerServerCommand(new FillCircle());
    event.registerServerCommand(new Sphere());
    event.registerServerCommand(new Face());
}
项目:Teleporting-XP    文件:TeleportingXP.java   
@EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
    World world = FMLCommonHandler.instance().getMinecraftServerInstance().getEntityWorld();

    world.getGameRules().setOrCreateGameRule("teleportXP", "false");
}
项目:Etheric    文件:Etheric.java   
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
    PacketHandler.registerMessages();

    File directory = event.getModConfigurationDirectory();
       config = new Configuration(new File(directory.getPath(), "etheric.cfg"));
       Config.readConfig();

       CapabilityManager.INSTANCE.register(IQuintessenceCapability.class, new QuintessenceCapabilityStorage(), DefaultQuintessenceCapability.class);

    proxy.preInit(event);

    GameRegistry.registerWorldGenerator(new EthericWorldGenerator(), 0);
}
项目:VillagerInventory    文件:VillagerInventoryMod.java   
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
    // initialize the configuration
    ModConfiguration.initializeConfiguration();

    // register the key bindings
    if (event.getSide() == Side.CLIENT) ModKeyBindings.registerKeyBindings();

    // register the network messages
    NETWORK.registerMessage(VillagerCareerMessage.MessageHandler.class, VillagerCareerMessage.class, 0, Side.CLIENT);
    NETWORK.registerMessage(ConfigSyncMessage.MessageHandler.class, ConfigSyncMessage.class, 1, Side.CLIENT);
    NETWORK.registerMessage(ConfigSyncMessage.MessageHandler.class, ConfigSyncMessage.class, 2, Side.SERVER);
    NETWORK.registerMessage(EntityFlagMessage.MessageHandler.class, EntityFlagMessage.class, 3, Side.SERVER);
}
项目:Geolosys    文件:Geolosys.java   
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
    LOGGER = event.getModLog();
    MinecraftForge.EVENT_BUS.register(new Config(event.getSuggestedConfigurationFile()));
    configOres = getOresConfig(event.getModConfigurationDirectory());
    clientRegistry = new ClientRegistry();
    MinecraftForge.EVENT_BUS.register(clientRegistry);
    chunkOreGen = new ChunkData();
    userStates = new ArrayList<>();

    ORE = new BlockOre();
    ORE_VANILLA = new BlockOreVanilla();
    ORE_SAMPLE = new BlockSample();
    ORE_SAMPLE_VANILLA = new BlockSampleVanilla();
    CLUSTER = new ItemCluster();
    ALMANAC = new ItemFieldManual();
    if (Config.getInstance().enableIngots)
    {
        INGOT = new ItemIngot();
    }
    if (Config.getInstance().enableProPick)
    {
        PRO_PICK = new ItemProPick();
    }

    registerGeolosysOreGen();
    registerVanillaOreGen();
}
项目:VanillaExtras    文件:ModCore.java   
@EventHandler
public void preInit(FMLPreInitializationEvent e) {
    VExConfig.preInit();
    ModBlocks.init();
    ModItems.init();
    GameRegistry.registerTileEntity(TileEntityBlockBreaker.class, Refs.MOD_ID + ":blockBreaker");
    proxy.preInit(e);

}
项目:LagGoggles    文件:Main.java   
@EventHandler
public void postinit(FMLPostInitializationEvent e) {
    proxy.postinit(e);
}
项目:BaseFoods    文件:BaseFoods.java   
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
    PROXY.postInit(event);
}
项目:Lithium-Forge    文件:LithiumMod.java   
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
    mainResourceLocation = new ResourceLocation(event.getModConfigurationDirectory() + "/lithium/images/");

}
项目:Dynamic-GUIs    文件:DynamicGUIs.java   
@EventHandler
public static void preInit(FMLPreInitializationEvent event) {
    PROXY.preInit(event);
}
项目:trumpet-skeleton    文件:TrumpetSkeleton.java   
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
    MinecraftForge.EVENT_BUS.register(this);
    LootTableList.register(ENTITIES_TRUMPET_SKELETON_LOOT_TABLE);
    proxy.preInit(event);
}
项目:MineCamera    文件:MineCamera.java   
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
    ServerCatchFile=event.getSourceFile().getParentFile().toString()+"\\minecamera\\serverdata\\";
    ClientCatchFile=event.getSourceFile().getParentFile().toString()+"\\minecamera\\catchdata\\";
    proxy.preInit(event);
}
项目:MineCamera    文件:MineCamera.java   
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
    proxy.postInit(event);
}
项目:EasyCraft    文件:EasyCraft.java   
@EventHandler
public void init(FMLInitializationEvent event) {
    proxy.init(event);
}