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


Java FMLServerStartingEvent.getServer方法代碼示例

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


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

示例1: serverStart

import net.minecraftforge.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:abused,項目名稱:World-Border,代碼行數:26,代碼來源:WorldBorder.java

示例2: serverStarting

import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //導入方法依賴的package包/類
/**
 * Save the instance of the command manager and initialize the commands.
 *
 * @param event The server starting event that was fired.
 */
@EventHandler
public void serverStarting(FMLServerStartingEvent event) {
    MinecraftServer server = event.getServer();
    HueManager hueManager = HueManager.getInstance();
    hueManager.setMinecraftServer(server);
    this.listener.setWorld(server.getEntityWorld());
    this.commandManager = (ServerCommandManager) server.getCommandManager();
    this.initCommands();
}
 
開發者ID:remcohaszing,項目名稱:minecraft-hue,代碼行數:15,代碼來源:HueMod.java

示例3: serverLoad

import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //導入方法依賴的package包/類
@EventHandler
public void serverLoad(FMLServerStartingEvent event) {
  server = event.getServer();
  gameProfiles = new GameProfiles(server);
  event.registerServerCommand(new WolCommand());
  event.registerServerCommand(new LuaCommand());
  ChunkLoaderTicketSupport.enableTicketSupport(instance);
}
 
開發者ID:wizards-of-lua,項目名稱:wizards-of-lua,代碼行數:9,代碼來源:WizardsOfLua.java

示例4: onServerStart

import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //導入方法依賴的package包/類
@Mod.EventHandler
@SuppressWarnings("unused")
public void onServerStart(FMLServerStartingEvent event) {
    Account.clear();

    minecraftServer = event.getServer();
    File file = getWorldDir(minecraftServer.getEntityWorld());
    if (file == null) return;

    Account.setLocation(new File(file, "EnderPay-accounts"));

    registerCommands(event);
}
 
開發者ID:kamildanak,項目名稱:EnderPay,代碼行數:14,代碼來源:EnderPay.java

示例5: registerCommands

import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //導入方法依賴的package包/類
private void registerCommands(FMLServerStartingEvent event) {
    MinecraftServer server = event.getServer();
    ICommandManager command = server.getCommandManager();
    ServerCommandManager manager = (ServerCommandManager) command;
    manager.registerCommand(new CommandWallet());
    manager.registerCommand(new CommandBalance());
    manager.registerCommand(new CommandPay());
}
 
開發者ID:kamildanak,項目名稱:EnderPay,代碼行數:9,代碼來源:EnderPay.java

示例6: serverStarting

import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //導入方法依賴的package包/類
@Mod.EventHandler
public void serverStarting(FMLServerStartingEvent event){
	MinecraftServer server = event.getServer();

	ICommandManager cmdmng = server.getCommandManager();
	if (cmdmng instanceof ServerCommandManager && cmdmng instanceof CommandHandler) {
		CommandHandler cmdhnd = (CommandHandler) cmdmng;
		TaleCraftCommands.register(cmdhnd);
	}

	// By calling this method, we create the ServerMirror for the given server.
	ServerHandler.getServerMirror(server);
}
 
開發者ID:tiffit,項目名稱:TaleCraft,代碼行數:14,代碼來源:TaleCraft.java

示例7: onServerStart

import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //導入方法依賴的package包/類
@EventHandler
public void onServerStart(FMLServerStartingEvent event) {
	MinecraftServer server = event.getServer();
	ServerCommandManager manager = (ServerCommandManager)server.getCommandManager();
	
	manager.registerCommand(new CommandMiniBosses());
}
 
開發者ID:Tyler1555,項目名稱:Mini-Bosses,代碼行數:8,代碼來源:MiniBosses.java

示例8: serverStart

import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //導入方法依賴的package包/類
@EventHandler
public void serverStart(FMLServerStartingEvent event){
	MinecraftServer server = event.getServer();
	ICommandManager command = server.getCommandManager();
	ServerCommandManager serverCommand = ((ServerCommandManager) command);
	serverCommand.registerCommand(new CommandRoguelike());
}
 
開發者ID:Greymerk,項目名稱:minecraft-roguelike,代碼行數:8,代碼來源:Roguelike.java

示例9: serverLoad

import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //導入方法依賴的package包/類
@EventHandler
public void serverLoad(FMLServerStartingEvent e) {
	SERVER = e.getServer();
	e.registerServerCommand(new NemesisSystemCommand());
}
 
開發者ID:ToroCraft,項目名稱:NemesisSystem,代碼行數:6,代碼來源:NemesisSystem.java

示例10: serverStarting

import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //導入方法依賴的package包/類
public void serverStarting(@Nonnull final FMLServerStartingEvent event) {
	final MinecraftServer server = event.getServer();
	final ICommandManager command = server.getCommandManager();
	final ServerCommandManager serverCommand = (ServerCommandManager) command;
	serverCommand.registerCommand(new CommandDS());
}
 
開發者ID:OreCruncher,項目名稱:DynamicSurroundings,代碼行數:7,代碼來源:Proxy.java

示例11: onServerStarting

import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //導入方法依賴的package包/類
public void onServerStarting(FMLServerStartingEvent evt) {
    MinecraftServer server = evt.getServer();
    ServerCommandManager cmdman = (ServerCommandManager) server.getCommandManager(); 
    cmdman.registerCommand(new CommandDragon());
}
 
開發者ID:ata4,項目名稱:dragon-mounts,代碼行數:6,代碼來源:CommonProxy.java


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