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