本文整理匯總了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");
}