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


Java FMLServerStartingEvent.getServer方法代碼示例

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


在下文中一共展示了FMLServerStartingEvent.getServer方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: serverStart

import cpw.mods.fml.common.event.FMLServerStartingEvent; //導入方法依賴的package包/類
@Mod.EventHandler
@SideOnly(Side.SERVER)
public void serverStart(FMLServerStartingEvent event)
{
    if (INSTANCE == null) INSTANCE = this;
    if (SERVER   == null) SERVER   = event.getServer();
    if (COMMAND  == null) COMMAND  = new WBCommand();

    // Load (or create new) config files
    Config.load(false);

    // our one real command, though it does also have aliases "wb" and "worldborder"
    event.registerServerCommand(COMMAND);

    if ( Config.preventBlockPlace() )
        enableBlockPlaceListener(true);

    if ( Config.preventMobSpawn() )
        enableMobSpawnListener(true);

    if ( Config.getDenyEnderpearl() )
        enableEnderPearlListener(true);

    DynMapFeatures.registerListener();
}
 
開發者ID:RoyCurtis,項目名稱:WorldBorder-Forge,代碼行數:26,代碼來源:WorldBorder.java

示例2: serverStart

import cpw.mods.fml.common.event.FMLServerStartingEvent; //導入方法依賴的package包/類
@EventHandler
public void serverStart(FMLServerStartingEvent event) {
	MinecraftServer mcserver = event.getServer();
	// Register commands
	((ServerCommandManager) mcserver.getCommandManager()).registerCommand(new CommandCreateView());
	// Start up the packet dispatcher we use for throttled data to client.
	ServerPacketDispatcher.getInstance().start(); //Note: This might need to be preceded by a force init of the ServerPacketDispatcher.  Doesn't seem to currently have any issues, though.
}
 
開發者ID:XCompWiz,項目名稱:LookingGlass,代碼行數:9,代碼來源:LookingGlass.java

示例3: NetworkManager

import cpw.mods.fml.common.event.FMLServerStartingEvent; //導入方法依賴的package包/類
public NetworkManager(FMLServerStartingEvent event) {
    server = event.getServer();

    portalCoords = new BidiMap<String, WorldPos>();
    portalNetwrks = new BidiArrayMap<String, String>();

    portalFile = new File(EnhancedPortals.proxy.getWorldDir(), "EP3_PortalLocations.json");
    networkFile = new File(EnhancedPortals.proxy.getWorldDir(), "EP3_PortalNetworks.json");

    try {
        loadAllData();
    } catch (Exception e) {
        EnhancedPortals.instance.getLogger().catching(e);
    }
}
 
開發者ID:enhancedportals,項目名稱:enhancedportals,代碼行數:16,代碼來源:NetworkManager.java

示例4: serverStart

import cpw.mods.fml.common.event.FMLServerStartingEvent; //導入方法依賴的package包/類
@Subscribe
public void serverStart(FMLServerStartingEvent event) {
	event.registerServerCommand(new CommandHandler(this));
	
	tpsTimer.schedule(new TimerTickTask(this), 1000, 1000);
	versionCheckDone = false;
	versionChecker.runVersionCheck();
	
	
	server = event.getServer();
}
 
開發者ID:wildex999,項目名稱:TickDynamic,代碼行數:12,代碼來源:TickDynamicMod.java

示例5: serverStarting

import cpw.mods.fml.common.event.FMLServerStartingEvent; //導入方法依賴的package包/類
@EventHandler
public void serverStarting( FMLServerStartingEvent event )
{
	MinecraftServer server = event.getServer();
	ISaveHandler save = server.worldServerForDimension( 0 ).getSaveHandler();
	
	petData.load( save.getMapFileFromName( "MEOW" ).getParentFile() );
}
 
開發者ID:spacechase0,項目名稱:UsefulPets,代碼行數:9,代碼來源:UsefulPets.java

示例6: serverStarting

import cpw.mods.fml.common.event.FMLServerStartingEvent; //導入方法依賴的package包/類
@EventHandler
public void serverStarting(FMLServerStartingEvent event) {
	MinecraftServer server= event.getServer();
	ServerCommandManager serverCommandManager = (ServerCommandManager) server.getCommandManager();
	serverCommandManager.registerCommand(new CommandNBTEdit());
	logger.fine("Server Starting -- Added \"/nbtedit\" command");
}
 
開發者ID:DavidGoldman,項目名稱:NBTEdit,代碼行數:8,代碼來源:NBTEdit.java


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