当前位置: 首页>>代码示例>>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;未经允许,请勿转载。