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


Java FMLServerStartingEvent類代碼示例

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


FMLServerStartingEvent類屬於net.minecraftforge.fml.common.event包,在下文中一共展示了FMLServerStartingEvent類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: onServerStart

import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@EventHandler
public static void onServerStart(FMLServerStartingEvent event) {
	log.info("Server Start");
	proxy.serverStart();
	Transformers.injectNewFillCmd(event.getServer());
	if (isMapEnabled) {
		event.registerServerCommand(new CommandWaypoint(false));
		event.registerServerCommand(new CommandWaypoint(true));
		Minimap.init(new File(TomsModUtils.getSavedFile(), Reference.worldDirConfigName));
	}
	if (Config.enableResearchSystem)
		event.registerServerCommand(new CommandResearch());
	GlobalFields.EnderMemoryObj = new Object[][][][]{{new Object[65536][2]}, TomsModUtils.fillObject(65536)};
	if (isCCLoaded)
		GlobalFields.EnderMemoryIComputerAccess.clear();
	WorldHandler.onServerStart(new File(TomsModUtils.getSavedFile(), "chunkData"));
	PlayerHandler.onServerStart(new File(TomsModUtils.getSavedFile(), "playerData"));
	Config.printWarnings();
	log.info("Loading Completed");
}
 
開發者ID:tom5454,項目名稱:Toms-Mod,代碼行數:21,代碼來源:CoreInit.java

示例3: onServerStarting

import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@EventHandler
public void onServerStarting(FMLServerStartingEvent event) {
    ICommandManager manager = event.getServer().getCommandManager();
    if (manager instanceof ServerCommandManager) {
        ((ServerCommandManager) manager).registerCommand(CommandManager.INSTANCE);
    }

    if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
        Progression.logger.log(Level.INFO, "How did a client get in the server start?");
        return;
    }

    
    //Remap all relevant data, Loads in the server data
    RemappingHandler.reloadServerData(JSONLoader.getServerTabData(RemappingHandler.getHostName()), false);
    
    World world = FMLCommonHandler.instance().getMinecraftServerInstance().worldServers[0];
    data = (PlayerSavedData) world.loadItemData(PlayerSavedData.class, MODNAME);
    if (data == null) {
        createWorldData();
    }
}
 
開發者ID:joshiejack,項目名稱:Progression,代碼行數:23,代碼來源:Progression.java

示例4: registerCommands

import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
/**
 * Method for handling main registering call from FMLServerStartingEvent.
 *
 * @see FMLServerStartingEvent
 *
 * @param event FMLServerStartingEvent.
 */
public void registerCommands(FMLServerStartingEvent event) {
    timeLapse.resetStartTime();
    HCoreLibMain.logHelper.info("Registering commands...");

    if (event != null) {

        for (String commandName : commandMap.keySet()) {
            event.registerServerCommand(commandMap.get(commandName));
            HCoreLibMain.logHelper.info("Command:", commandName, "was registered!");
        }

        HCoreLibMain.logHelper.info("Finished registering commands successfully! (",
                timeLapse.getEffectiveTimeSince(), "ms ).");
    }

    else HCoreLibMain.logHelper.severe("Error registering commands... FMLServerStartingEvent is null!");

    regComplete = true;
}
 
開發者ID:hockeyhurd,項目名稱:HCoreLib,代碼行數:27,代碼來源:CommandHandler.java

示例5: serverStart

import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@EventHandler
public void serverStart(FMLServerStartingEvent event){
	
	if(ForgeGenerator.getInstance() == null) {
		new ForgeGenerator();
	}

	/* when playing singleplayer this lets us update Gens by restarting the world
	 * instead of restarting the game */
	GenManager genManager;
	//if(GenManager.getInstance() == null) {
		genManager = new GenManager();
	/*} else {
		genManager = GenManager.getInstance();
	}*/
       Gen[] gens = FileHandler.parseAllGens();
       if(gens != null) {
       	for (int i = 0; i < gens.length; i++) {
   			genManager.addGen(gens[i]);
   		}
       }
       
}
 
開發者ID:mickelus,項目名稱:customgen,代碼行數:24,代碼來源:Customgen.java

示例6: serverStarting

import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@EventHandler
public void serverStarting(FMLServerStartingEvent event) {
    Iterator<CommandModule> modules = Iterators.forArray(
            new RegionCommands(),
            new OperationCommands(),
            new SessionCommands());
    modules.forEachRemaining(m -> m.addCommands(event::registerServerCommand));
}
 
開發者ID:kenzierocks,項目名稱:HardVox,代碼行數:9,代碼來源:HardVox.java

示例7: 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

示例8: serverStarting

import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@Mod.EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
    if (!CreeperHost.instance.active)
        return;
    event.registerServerCommand(new CommandInvite());
    event.registerServerCommand(new CommandPregen());
    deserializePreload(new File(getSaveFolder(), "pregenData.json"));
}
 
開發者ID:CreeperHost,項目名稱:CreeperHostGui,代碼行數:10,代碼來源:CreeperHostServer.java

示例9: init

import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@EventHandler
public void init(FMLServerStartingEvent event) {
    event.registerServerCommand(new Pyramid());
    event.registerServerCommand(new Stairs());
    event.registerServerCommand(new Maze());

    event.registerServerCommand(new Turtle());
    event.registerServerCommand(new Cube());
    event.registerServerCommand(new Frame());
    event.registerServerCommand(new Line());
    event.registerServerCommand(new Circle());
    event.registerServerCommand(new FillCircle());
    event.registerServerCommand(new Sphere());
    event.registerServerCommand(new Face());
}
 
開發者ID:JustinSDK,項目名稱:craftsman,代碼行數:16,代碼來源:Main.java

示例10: serverStarting

import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@EventHandler
public void serverStarting(FMLServerStartingEvent event) {
	PacketHandler.NETWORKINSTANCE.registerMessage(PacketGetWorker.Handler.class, PacketGetWorker.class,
			PacketHandler.nextID(), Side.SERVER);
	PacketHandler.NETWORKINSTANCE.registerMessage(PacketReturnWorker.Handler.class, PacketReturnWorker.class,
			PacketHandler.nextID(), Side.CLIENT);
	event.registerServerCommand(new MainCmd());
	event.registerServerCommand(new GamemodeCmd());
}
 
開發者ID:IvanSteklow,項目名稱:VanillaExtras,代碼行數:10,代碼來源:ModCore.java

示例11: serverStart

import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@Mod.EventHandler
public void serverStart(FMLServerStartingEvent event) {
	event.registerServerCommand(new GetPlayersInChunk());
	event.registerServerCommand(new GetPlayersInChunks());
	if (Loader.isModLoaded("ftbu")) {
		event.registerServerCommand(new GetPlayersInClaimedChunks());
	}
}
 
開發者ID:coehlrich,項目名稱:chunk-logger,代碼行數:9,代碼來源:ChunkLogger.java

示例12: serverStarting

import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
	World world = FMLCommonHandler.instance().getMinecraftServerInstance().getEntityWorld();
	
	world.getGameRules().setOrCreateGameRule("teleportXP", "false");
}
 
開發者ID:adudewithapc,項目名稱:Teleporting-XP,代碼行數:8,代碼來源:TeleportingXP.java

示例13: serverLoad

import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@EventHandler
  public void serverLoad(FMLServerStartingEvent event)
  {
this.worldFolder = event.getServer().getFolderName();	// Hand me that world name

SaveHandler.loadFactionsFromFile();
  }
 
開發者ID:Domochevsky,項目名稱:minecraft-territorialdealings,代碼行數:8,代碼來源:Main.java

示例14: serverLoad

import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@EventHandler
  public void serverLoad(FMLServerStartingEvent event)
  {
this.worldDir = event.getServer().getFolderName();	// Hand me that world name

_SaveData save = SaveHandler.loadFactionsFromFile(Main.configDir, Main.worldDir);

if (save == null)
{
	save = new _SaveData();	// Init
}

TerritoryHandler.setSaveData(save);
  }
 
開發者ID:Domochevsky,項目名稱:minecraft-territorialdealings,代碼行數:15,代碼來源:Main.java

示例15: serverStarting

import net.minecraftforge.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
public void serverStarting(FMLServerStartingEvent e)
{
    e.registerServerCommand(new CommandHead());
    e.registerServerCommand(new CommandSurvivalShortcut());
    e.registerServerCommand(new CommandCreativeShortcut());
    e.registerServerCommand(new CommandAdventureShortcut());
    e.registerServerCommand(new CommandSpectatorShortcut());
    e.registerServerCommand(new CommandSkull());
    e.registerServerCommand(new CommandDimTeleport());
}
 
開發者ID:GamingsModding,項目名稱:LittleThings-old,代碼行數:11,代碼來源:CommonProxy.java


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