當前位置: 首頁>>代碼示例>>Java>>正文


Java FMLServerStartedEvent類代碼示例

本文整理匯總了Java中cpw.mods.fml.common.event.FMLServerStartedEvent的典型用法代碼示例。如果您正苦於以下問題:Java FMLServerStartedEvent類的具體用法?Java FMLServerStartedEvent怎麽用?Java FMLServerStartedEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FMLServerStartedEvent類屬於cpw.mods.fml.common.event包,在下文中一共展示了FMLServerStartedEvent類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: serverInit

import cpw.mods.fml.common.event.FMLServerStartedEvent; //導入依賴的package包/類
@EventHandler
  public void serverInit(FMLServerStartedEvent event) {
SpaceLog.severe("Server-Init");

  	if (Constants.CHECK_VERSIONS) {
  		SpaceVersionCheck.startCheck();
  	}
  }
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:9,代碼來源:SpaceCore.java

示例2: serverStart

import cpw.mods.fml.common.event.FMLServerStartedEvent; //導入依賴的package包/類
@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();
}
 
開發者ID:UnderMybrella,項目名稱:TiM,代碼行數:27,代碼來源:TModifiers.java

示例3: serverStarted

import cpw.mods.fml.common.event.FMLServerStartedEvent; //導入依賴的package包/類
@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);
            }
        }
    }
}
 
開發者ID:sk89q,項目名稱:BiomeAtlas,代碼行數:26,代碼來源:BiomeAtlas.java

示例4: serverInit

import cpw.mods.fml.common.event.FMLServerStartedEvent; //導入依賴的package包/類
@EventHandler
public void serverInit(FMLServerStartedEvent event)
{
    if (ThreadRequirementMissing.INSTANCE == null)
    {
        ThreadRequirementMissing.beginCheck(FMLCommonHandler.instance().getEffectiveSide());
    }

    ThreadVersionCheck.startCheck();
    TickHandlerServer.restart();
    BlockVec3.chunkCacheDim = Integer.MAX_VALUE;       
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:13,代碼來源:GalacticraftCore.java

示例5: postInit

import cpw.mods.fml.common.event.FMLServerStartedEvent; //導入依賴的package包/類
@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));
   }
 
開發者ID:nodecraft,項目名稱:ATLChecker,代碼行數:9,代碼來源:ATLChecker.java

示例6: serverStarted

import cpw.mods.fml.common.event.FMLServerStartedEvent; //導入依賴的package包/類
@Mod.EventHandler
public void serverStarted(FMLServerStartedEvent event)
{
    if (event.getSide().isClient()) return;
    DBHelper.setupDb();
    LOGGING_THREAD.start();
}
 
開發者ID:DoubleDoorDevelopment,項目名稱:D3Log,代碼行數:8,代碼來源:D3Log.java

示例7: serverLoad

import cpw.mods.fml.common.event.FMLServerStartedEvent; //導入依賴的package包/類
@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);
		}

	}
}
 
開發者ID:mookie1097,項目名稱:NightfallMod,代碼行數:14,代碼來源:NFMain.java

示例8: onServerStarted

import cpw.mods.fml.common.event.FMLServerStartedEvent; //導入依賴的package包/類
@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();
			}
		}
	}
}
 
開發者ID:Shirkit,項目名稱:CountCraft,代碼行數:13,代碼來源:CountCraft.java

示例9: onFMLServerStartedEvent

import cpw.mods.fml.common.event.FMLServerStartedEvent; //導入依賴的package包/類
@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);
  }
 
開發者ID:gentili,項目名稱:IsoBlockProjector,代碼行數:28,代碼來源:IsoBlockProjector.java

示例10: serverStart

import cpw.mods.fml.common.event.FMLServerStartedEvent; //導入依賴的package包/類
@EventHandler
public void serverStart(FMLServerStartedEvent event)
{
	for (int i = 0; i < ConfigRegistry.systems.size(); i++) {
		ConfigRegistry.systems.get(i).loadConfig(config);
	}
}
 
開發者ID:CreativeMD,項目名稱:CraftingManager,代碼行數:8,代碼來源:CraftingManagerMod.java

示例11: serverStarted

import cpw.mods.fml.common.event.FMLServerStartedEvent; //導入依賴的package包/類
@Mod.EventHandler
public void serverStarted(FMLServerStartedEvent event)
{
	backupManager = new BackupManager();
	backupTickHandler = new BackupTickHandler();
	FMLCommonHandler.instance().bus().register(backupTickHandler);
}
 
開發者ID:szernex,項目名稱:YetAnotherBackupMod,代碼行數:8,代碼來源:YABM.java

示例12: serverStarted

import cpw.mods.fml.common.event.FMLServerStartedEvent; //導入依賴的package包/類
@EventHandler
public void serverStarted(FMLServerStartedEvent event) {
    CommandHandler handler = (CommandHandler) MinecraftServer.getServer().getCommandManager();

    if ((Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment")) {
        handler.registerCommand(new CommandDebug());
    }
}
 
開發者ID:EnderWizards,項目名稱:libsandstone,代碼行數:9,代碼來源:Sandstone.java

示例13: serverStart

import cpw.mods.fml.common.event.FMLServerStartedEvent; //導入依賴的package包/類
@EventHandler
public void serverStart(FMLServerStartedEvent event) {
    for (ModuleInfo moduleInfo : modules) {
        if (moduleInfo.isEnabled) {
            moduleInfo.module.serverStart(event, modConfigDirectoryFile);
        }
    }
}
 
開發者ID:soultek101,項目名稱:projectzulu1.7.10-pre-1.3a,代碼行數:9,代碼來源:ProjectZulu_Core.java

示例14: OnServerStarted

import cpw.mods.fml.common.event.FMLServerStartedEvent; //導入依賴的package包/類
/**
 * 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
}
 
開發者ID:manageryzy,項目名稱:Minecraft-Forge-Class-Template,代碼行數:14,代碼來源:ExampleMod.java

示例15: validateFluids

import cpw.mods.fml.common.event.FMLServerStartedEvent; //導入依賴的package包/類
@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));
    }
}
 
開發者ID:MineMaarten,項目名稱:PneumaticCraft,代碼行數:9,代碼來源:PneumaticCraft.java


注:本文中的cpw.mods.fml.common.event.FMLServerStartedEvent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。