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