本文整理汇总了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();
}
示例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.
}
示例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);
}
}
示例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();
}
示例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() );
}
示例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");
}