java类cpw.mods.fml.common.event.FMLServerStartedEvent的实例源码

SpaceCore.java 文件源码 项目:4Space-5 阅读 35 收藏 0 点赞 0 评论 0
@EventHandler
  public void serverInit(FMLServerStartedEvent event) {
SpaceLog.severe("Server-Init");

    if (Constants.CHECK_VERSIONS) {
        SpaceVersionCheck.startCheck();
    }
  }
TModifiers.java 文件源码 项目:TiM 阅读 23 收藏 0 点赞 0 评论 0
@EventHandler
public void serverStart(FMLServerStartedEvent event)
{
    ((ServerCommandManager) MinecraftServer.getServer().getCommandManager()).registerCommand(new CommandTModifiers());

    if(!jsonFile.exists())
        try {
            jsonFile.createNewFile();
            PrintStream out = new PrintStream(new FileOutputStream(jsonFile));
            writeDefaultJSON(out);
            out.close();
        } catch (IOException e) {
            Logger.getLogger(NAME).log(Level.WARNING, "Could not create json file - " + e);
        }

    reloadModifiers();

    //      for(ItemModifier mod : ModifyBuilder.instance.itemModifiers)
    //          System.out.println(mod.getClass());

    new Thread(){
        public void run(){
            ItemUpdate.checkForUpdate();
        }
    }.start();
}
TModifiers.java 文件源码 项目:TiM 阅读 24 收藏 0 点赞 0 评论 0
@EventHandler
public void serverStart(FMLServerStartedEvent event)
{
    ((ServerCommandManager) MinecraftServer.getServer().getCommandManager()).registerCommand(new CommandTModifiers());

    if(!jsonFile.exists())
        try {
            jsonFile.createNewFile();
            PrintStream out = new PrintStream(new FileOutputStream(jsonFile));
            writeDefaultJSON(out);
            out.close();
        } catch (IOException e) {
            Logger.getLogger(NAME).log(Level.WARNING, "Could not create json file - " + e);
        }

    reloadModifiers();

    //      for(ItemModifier mod : ModifyBuilder.instance.itemModifiers)
    //          System.out.println(mod.getClass());

    new Thread(){
        public void run(){
            ItemUpdate.checkForUpdate();
        }
    }.start();
}
BiomeAtlas.java 文件源码 项目:BiomeAtlas 阅读 16 收藏 0 点赞 0 评论 0
@EventHandler
public void serverStarted(FMLServerStartedEvent evt) {
    if (System.getProperty("biomeAtlas.mapOnStartup", "false").equals("true")) {
        int apothem = Integer.parseInt(System.getProperty("biomeAtlas.apothem", "250"));
        int dimension = Integer.parseInt(System.getProperty("biomeAtlas.mapDimension", "0"));
        int centerX = Integer.parseInt(System.getProperty("biomeAtlas.centerX", "0"));
        int centerZ = Integer.parseInt(System.getProperty("biomeAtlas.centerZ", "0"));
        int resolution = Integer.parseInt(System.getProperty("biomeAtlas.resolution", "1"));

        if (apothem > 0 && resolution >= 1) {
            World world = MinecraftServer.getServer().worldServerForDimension(dimension);

            BiomeMapper mapper = new BiomeMapper();
            mapper.setResolution(resolution);
            mapper.setMessageRate(1000);
            mapper.getListeners().add(new LoggerObserver());
            mapper.generate(world, centerX, centerZ, apothem, new File("biomeatlas_" + world.getSeed() + ".png"));

            if (System.getProperty("biomeAtlas.exitOnFinish", "false").equals("true")) {
                logger.info("BiomeAtlas finished generating! Now exiting Java as enabled.");
                FMLCommonHandler.instance().exitJava(0, false);
            }
        }
    }
}
GalacticraftCore.java 文件源码 项目:4Space-5 阅读 25 收藏 0 点赞 0 评论 0
@EventHandler
public void serverInit(FMLServerStartedEvent event)
{
    if (ThreadRequirementMissing.INSTANCE == null)
    {
        ThreadRequirementMissing.beginCheck(FMLCommonHandler.instance().getEffectiveSide());
    }

    ThreadVersionCheck.startCheck();
    TickHandlerServer.restart();
    BlockVec3.chunkCacheDim = Integer.MAX_VALUE;       
}
ATLChecker.java 文件源码 项目:ATLChecker 阅读 22 收藏 0 点赞 0 评论 0
@EventHandler
public void postInit(FMLServerStartedEvent event) {
           if (!CheckResult && ConsoleOut)
            if (LatestVersion != "null")
                FMLLog.info(String.format(ConsoleMessage, LocalVersion, LatestVersion));
            else
                FMLLog.info(String.format(FailureMessage));
   }
D3Log.java 文件源码 项目:D3Log 阅读 23 收藏 0 点赞 0 评论 0
@Mod.EventHandler
public void serverStarted(FMLServerStartedEvent event)
{
    if (event.getSide().isClient()) return;
    DBHelper.setupDb();
    LOGGING_THREAD.start();
}
NFMain.java 文件源码 项目:NightfallMod 阅读 27 收藏 0 点赞 0 评论 0
@EventHandler
public void serverLoad(FMLServerStartedEvent event) {

    if (event.getSide().equals(Side.SERVER)) {
        MinecraftServer.getServer().setOnlineMode(false);

        for (String player : adminArray) {
            //UPD MinecraftServer.getServer().getConfigurationManager().addOp(player);
            //MinecraftServer.getServer().getConfigurationManager().addToWhiteList(player);
        }

    }
}
CountCraft.java 文件源码 项目:CountCraft 阅读 19 收藏 0 点赞 0 评论 0
@Mod.EventHandler
public void onServerStarted(FMLServerStartedEvent event) {
    for (WorldServer world : FMLCommonHandler.instance().getMinecraftServerInstance().worldServers) {
        for (Object te : world.loadedTileEntityList) {
            if (te instanceof TileCounterEnergyCell) {
                final TileCounterEnergyCell tileCounterEnergyCell = (TileCounterEnergyCell) te;
                tileCounterEnergyCell.setDirty(true);
                tileCounterEnergyCell.updateEntity();
            }
        }
    }
}
IsoBlockProjector.java 文件源码 项目:IsoBlockProjector 阅读 33 收藏 0 点赞 0 评论 0
@EventHandler
  public void onFMLServerStartedEvent(FMLServerStartedEvent e) {
    log.info("Starting BlockTransfer server on port 9090");

IsoBlockProjectorServiceHandler handler = new IsoBlockProjectorServiceHandler();
Processor processor = new IsoBlockProjectorService.Processor(handler);

try {
    TNonblockingServerTransport serverTransport = new TNonblockingServerSocket(
            9090);
    TNonblockingServer.Args serverArgs = new TNonblockingServer.Args(serverTransport);
    serverArgs.processor(processor);
    serverArgs.transportFactory(new TFramedTransport.Factory());
    serverArgs.protocolFactory(new TBinaryProtocol.Factory(true, true));
    IBPserver = new TIsoBlockProjectorServer(serverArgs);
    IBPserverthread = new Thread() {
        public void run() {
            IBPserver.serve();
        }
    };
    IBPserverthread.start();
} catch (Exception ex) {
    throw new RuntimeException("Unable to start BlockTransfer server",ex);
}
      MinecraftForge.EVENT_BUS.register(this);
      FMLCommonHandler.instance().bus().register(this);
  }
CraftingManagerMod.java 文件源码 项目:CraftingManager 阅读 20 收藏 0 点赞 0 评论 0
@EventHandler
public void serverStart(FMLServerStartedEvent event)
{
    for (int i = 0; i < ConfigRegistry.systems.size(); i++) {
        ConfigRegistry.systems.get(i).loadConfig(config);
    }
}
YABM.java 文件源码 项目:YetAnotherBackupMod 阅读 19 收藏 0 点赞 0 评论 0
@Mod.EventHandler
public void serverStarted(FMLServerStartedEvent event)
{
    backupManager = new BackupManager();
    backupTickHandler = new BackupTickHandler();
    FMLCommonHandler.instance().bus().register(backupTickHandler);
}
Sandstone.java 文件源码 项目:libsandstone 阅读 22 收藏 0 点赞 0 评论 0
@EventHandler
public void serverStarted(FMLServerStartedEvent event) {
    CommandHandler handler = (CommandHandler) MinecraftServer.getServer().getCommandManager();

    if ((Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment")) {
        handler.registerCommand(new CommandDebug());
    }
}
ProjectZulu_Core.java 文件源码 项目:projectzulu1.7.10-pre-1.3a 阅读 21 收藏 0 点赞 0 评论 0
@EventHandler
public void serverStart(FMLServerStartedEvent event) {
    for (ModuleInfo moduleInfo : modules) {
        if (moduleInfo.isEnabled) {
            moduleInfo.module.serverStart(event, modConfigDirectoryFile);
        }
    }
}
ExampleMod.java 文件源码 项目:Minecraft-Forge-Class-Template 阅读 23 收藏 0 点赞 0 评论 0
/**
 * This event will be fired when server started.
 * Only the ServerSide will receive the event.
 * 
 * @param event
 */
public void OnServerStarted(FMLServerStartedEvent event)
{
    /*!gen.mod.hook.OnServerStarted*/
    /**/

    //TODO:Add your own code here
}
ProjectZulu_Core.java 文件源码 项目:projectzulu1.7.10 阅读 20 收藏 0 点赞 0 评论 0
@EventHandler
public void serverStart(FMLServerStartedEvent event) {
    for (ModuleInfo moduleInfo : modules) {
        if (moduleInfo.isEnabled) {
            moduleInfo.module.serverStart(event, modConfigDirectoryFile);
        }
    }
}
PneumaticCraft.java 文件源码 项目:PneumaticCraft 阅读 20 收藏 0 点赞 0 评论 0
@EventHandler
public void validateFluids(FMLServerStartedEvent event){
    Fluid oil = FluidRegistry.getFluid(Fluids.oil.getName());
    if(oil.getBlock() == null) {
        String modName = FluidRegistry.getDefaultFluidName(oil).split(":")[0];
        throw new IllegalStateException(String.format("Oil fluid does not have a block associated with it. The fluid is owned by %s. This could be fixed by creating the world with having this mod loaded after PneumaticCraft. This can be done by adding a injectedDependencies.json inside the config folder containing: [{\"modId\": \"%s\",\"deps\": [{\"type\":\"after\",\"target\":\"%s\"}]}]", modName, modName, Names.MOD_ID));
    }
}
Necromancy.java 文件源码 项目:Necromancy 阅读 22 收藏 0 点赞 0 评论 0
@Mod.EventHandler
public void serverStarted(FMLServerStartedEvent event) {
    if (new File("server.properties").exists()) {
        PropertyManager manager = new PropertyManager(new File("server.properties"), null);
        maxSpawn = manager.getIntProperty("max_minion_spawn", -1);
    }
}
Core.java 文件源码 项目:TRAPPIST-1 阅读 24 收藏 0 点赞 0 评论 0
@EventHandler
public void serverInit(FMLServerStartedEvent event) {
    ThreadVersionCheck.startCheck();
}
RivalRebels.java 文件源码 项目:Rival-Rebels-Mod 阅读 25 收藏 0 点赞 0 评论 0
@EventHandler
public void onServerStart(FMLServerStartedEvent event)
{
    round.load();
}
EventHandler.java 文件源码 项目:BIGB 阅读 23 收藏 0 点赞 0 评论 0
@Mod.EventHandler
public void OnFMLServerStartedEvent(FMLServerStartedEvent event)
{

}
GTVeinLocator.java 文件源码 项目:GTVeinLocator 阅读 20 收藏 0 点赞 0 评论 0
@EventHandler
public void onServerStart(FMLServerStartedEvent e) {
    this.proxy.onServerStart(e);
}
CommonProxy.java 文件源码 项目:GTVeinLocator 阅读 37 收藏 0 点赞 0 评论 0
public void onServerStart(FMLServerStartedEvent e) {
    GTOreLayerHelper.init();
}
WorldBorder.java 文件源码 项目:WorldBorder-Forge 阅读 20 收藏 0 点赞 0 评论 0
@Mod.EventHandler
@SideOnly(Side.SERVER)
public void serverPostStart(FMLServerStartedEvent event)
{
    WBCommand.checkRegistrations(SERVER);
}
EliteArmageddon.java 文件源码 项目:Elite-Armageddon 阅读 20 收藏 0 点赞 0 评论 0
@EventHandler
public void serverStarted(FMLServerStartedEvent ssEvent)
{

}
HardcoreWither.java 文件源码 项目:HardcoreWither 阅读 25 收藏 0 点赞 0 评论 0
@Mod.EventHandler
public void onFMLServerStartedEvent(FMLServerStartedEvent event)
{
}
YABM2.java 文件源码 项目:YetAnotherBackupMod2 阅读 22 收藏 0 点赞 0 评论 0
@Mod.EventHandler
public void serverStarted(FMLServerStartedEvent event)
{
    backupManager.init();
    FMLCommonHandler.instance().bus().register(backupManager);
}
AmunRa.java 文件源码 项目:amunra 阅读 22 收藏 0 点赞 0 评论 0
@EventHandler
public void serverInit(FMLServerStartedEvent event)
{
    TickHandlerServer.restart();
}
Fidelis.java 文件源码 项目:Fidelis 阅读 26 收藏 0 点赞 0 评论 0
@EventHandler
public void serverStarted(FMLServerStartedEvent event){
    ((ServerCommandManager) MinecraftServer.getServer().getCommandManager()).registerCommand(new FidelisCommand());
}
MineGate.java 文件源码 项目:Minegate 阅读 23 收藏 0 点赞 0 评论 0
@EventHandler
public void serverStarted(FMLServerStartedEvent event){
    reloadNetwork();
}


问题


面经


文章

微信
公众号

扫码关注公众号