本文整理汇总了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();
}
示例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();
}
示例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);
}
示例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);
}
示例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());
}
示例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);
}
示例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());
}
示例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());
}
示例9: serverLoad
import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //导入方法依赖的package包/类
@EventHandler
public void serverLoad(FMLServerStartingEvent e) {
SERVER = e.getServer();
e.registerServerCommand(new NemesisSystemCommand());
}
示例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());
}
示例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());
}