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