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