Java 类net.minecraftforge.fml.common.event.FMLServerStoppingEvent 实例源码

项目:TechnicalDimensions    文件:ModDimensions.java   
public static void unloadAll(FMLServerStoppingEvent serverStoppingEvent) {
    File worldFile = new File(FMLCommonHandler.instance().getSavesDirectory(), FMLCommonHandler.instance().getMinecraftServerInstance().getFolderName());
    File dataFile = new File(worldFile, fileName);

    if (dimDataList == null || dimDataList.isEmpty()) {
        return;
    }
    Gson gson = new GsonBuilder().setPrettyPrinting().create();
    String json = gson.toJson(dimDataList);
    try {
        if (dataFile.exists()) {
            dataFile.delete();
        }
        FileUtils.writeStringToFile(dataFile, json);
    } catch (IOException e) {
        e.printStackTrace();
    }

    for (DimData data : dimDataList) {
        DimensionManager.unloadWorld(data.id);
        DimensionManager.unregisterDimension(data.id);
    }
    dimDataList.clear();
    dimDataHashMap.clear();
}
项目:HardVox    文件:HardVox.java   
@EventHandler
public void serverStopping(FMLServerStoppingEvent event) {
    // cancel running tasks
    SessionManager.getInstance().getAllSessions().forEachRemaining(sess -> {
        sess.taskManager.cancelTasks();
    });
    SessionManager.getInstance().clearAllSessions();
}
项目:CreeperHostGui    文件:CreeperHostServer.java   
@Mod.EventHandler
public void serverStopping(FMLServerStoppingEvent event)
{
    if (!CreeperHost.instance.active)
        return;
    serverOn = false;
    serializePreload();
    pregenTasks.clear();
}
项目:Mods    文件:TF2weapons.java   
@Mod.EventHandler
public void serverStop(FMLServerStoppingEvent event) {
    //MapList.nameToData.clear();
    //MapList.buildInAttributes.clear();

    File output = new File(((AnvilSaveConverter) server.getActiveAnvilConverter()).savesDirectory, server.getFolderName() + "/teleports.dat");
    NBTTagCompound tagRoot = new NBTTagCompound();
    NBTTagCompound tag = new NBTTagCompound();
    tagRoot.setTag("Teleporters", tag);

    for (Entry<UUID, TeleporterData[]> entry : EntityTeleporter.teleporters.entrySet()) {
        NBTTagCompound exitTag = new NBTTagCompound();
        for (int i = 0; i < EntityTeleporter.TP_PER_PLAYER; i++) {
            TeleporterData blockPos = entry.getValue()[i];
            if (blockPos != null)
                exitTag.setIntArray(Integer.toString(i), new int[] { blockPos.getX(), blockPos.getY(), blockPos.getZ(), blockPos.id, blockPos.dimension});
        }
        tag.setTag(entry.getKey().toString(), exitTag);
    }
    tagRoot.setInteger("TPCount", EntityTeleporter.tpCount);

    try {
        CompressedStreamTools.writeCompressed(tagRoot, new FileOutputStream(output));
    } catch (IOException e) {
        e.printStackTrace();
    }

    EntityTeleporter.teleporters.clear();
    EntityTeleporter.tpCount = 0;
    if(udpServer != null) {
        udpServer.stopServer();
        udpServer = null;
    }
}
项目:World-Border    文件:WorldBorder.java   
@Mod.EventHandler
@SideOnly(Side.SERVER)
public void serverStop(FMLServerStoppingEvent event)
{
    DynMapFeatures.removeAllBorders();
    Config.storeFillTask();
}
项目:Toms-Mod    文件:CoreInit.java   
@EventHandler
public static void onServerStop(FMLServerStoppingEvent event) {
    log.info("Stopping the Server");
    PlayerHandler.cleanup();
    if (isMapEnabled)
        Minimap.close();
    WorldHandler.stopServer();
    TomsModUtils.setServer(null);
    log.info("Server Stopped");
}
项目:TaleCraft    文件:TaleCraft.java   
@Mod.EventHandler
public void serverStopping(FMLServerStoppingEvent event)
{
    // Calling this method destroys all server instances that exist,
    // because the 'event' given above does NOT give us the server-instance that is being stopped.
    ServerHandler.destroyServerMirror(null);
}
项目:MC-realTimeClock    文件:RealTimeClock.java   
@Mod.EventHandler
public void onServerStopping(FMLServerStoppingEvent event){
    if(event.getSide()==Side.CLIENT){
        //when the server stops (hopefully this is the right event), save the state of the clock
        ModLogger.logInfo("Saving clock state for the next reload");
        ConfigurationHandler.setValueDisplay(Clock.isEnabled());
    }
}
项目:SlackMC    文件:Slack.java   
@EventHandler
@SideOnly(Side.SERVER)
public void onServerStopping(FMLServerStoppingEvent event)
{
    if (senderConnected)
    {
        slackSender.sendToSlack(SlackCommandSender.getInstance(), Messages.General.SERVER_STOPPED);
    }
}
项目:Cannibalism    文件:Cannibalism.java   
@EventHandler
public void serverStop(FMLServerStoppingEvent event)
{
    log.info("[Cannibalism] Writing playerdata to file...");
    io.write(data.getDatabase());
    log.info("[Cannibalism] Completed");

}
项目:GriefGuardian    文件:GriefGuardian.java   
@EventHandler
public void onServerStopping(FMLServerStoppingEvent event){
    _dal.stopAllThreads();

    for (WorldServer ws : MinecraftServer.getServer().worldServers){
        ClaimManager.instance.saveAllClaims(ws);
    }
}
项目:minecraft-territorialdealings    文件:Main.java   
@EventHandler
  public void serverStopping(FMLServerStoppingEvent event)
  {
SaveHandler.saveFactionsToFile();
  }
项目:minecraft-territorialdealings    文件:Main.java   
@EventHandler
  public void serverStopping(FMLServerStoppingEvent event)
  {
SaveHandler.saveFactionsToFile(Main.configDir, Main.worldDir, TerritoryHandler.getSaveData());
  }
项目:DynamicSurroundings    文件:DSurround.java   
@EventHandler
public void serverStopping(@Nonnull final FMLServerStoppingEvent event) {
    proxy.serverStopping(event);
}
项目:blockbuster    文件:Blockbuster.java   
@EventHandler
public void serverStopping(FMLServerStoppingEvent event)
{
    CommonProxy.manager.reset();
}
项目:Mob-Amputation    文件:MobAmputation.java   
@Mod.EventHandler
public void serverStopping(FMLServerStoppingEvent event)
{
    eventHandlerServer.headlessHarmer.clear();
    eventHandlerServer.headlessTime.clear();
}
项目:Tracer    文件:Tracer.java   
@Mod.EventHandler
public void serverStopping(final FMLServerStoppingEvent event) {
    proxy.serverStopping(event);
}
项目:morecommands    文件:CommonProxy.java   
/**
 * Called from the main mod class to do stuff before the server is stopping
 */
protected void serverStopping(FMLServerStoppingEvent event) {
    this.handler.onStateEvent(event);
}
项目:NOVA-Core    文件:NovaMinecraft.java   
@Mod.EventHandler
public void serverStopping(FMLServerStoppingEvent event) {
    Game.events().publish(new ServerEvent.Stop());
}
项目:BeeBarker    文件:BeeBarker.java   
@Mod.EventHandler
public void onServerStopping(FMLServerStoppingEvent event)
{
    BarkHelper.cooldown.clear();
    BarkHelper.pressState.clear();
}
项目:FastAsyncWorldedit    文件:ForgeMain.java   
@Mod.EventHandler
public void serverStopping(FMLServerStoppingEvent event) {
    for (EntityPlayerMP player : (List<EntityPlayerMP>)FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getPlayerList()) {
        handleQuit(player);
    }
}
项目:FastAsyncWorldedit    文件:ForgeMain.java   
@Mod.EventHandler
public void serverStopping(FMLServerStoppingEvent event) {
    for (EntityPlayerMP player : (List<EntityPlayerMP>)MinecraftServer.getServer().getConfigurationManager().playerEntityList) {
        handleQuit(player);
    }
}
项目:FastAsyncWorldedit    文件:ForgeMain.java   
@Mod.EventHandler
public void serverStopping(FMLServerStoppingEvent event) {
    for (EntityPlayerMP player : FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getPlayers()) {
        handleQuit(player);
    }
}
项目:FastAsyncWorldedit    文件:ForgeMain.java   
@Mod.EventHandler
public void serverStopping(FMLServerStoppingEvent event) {
    for (EntityPlayerMP player : (List<EntityPlayerMP>)FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getPlayerList()) {
        handleQuit(player);
    }
}
项目:FastAsyncWorldedit    文件:ForgeMain.java   
@Mod.EventHandler
public void serverStopping(FMLServerStoppingEvent event) {
    for (EntityPlayerMP player : FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getPlayers()) {
        handleQuit(player);
    }
}
项目:GuiltTrip    文件:GuiltTrip.java   
@Mod.EventHandler
public void serverShuttingDown(FMLServerStoppingEvent event)
{
    eventHandlerServer.playerKills.clear();
}
项目:Hard-Science    文件:HardScience.java   
@EventHandler
public void serverStopping(FMLServerStoppingEvent event)
{
    proxy.serverStopping(event);
}
项目:Hard-Science    文件:CommonProxy.java   
public void serverStopping(FMLServerStoppingEvent event)
{
    Simulator.instance().stop();
}
项目:Minecraft-Turn-Based-Battle-Mod    文件:ModMain.java   
@EventHandler
public void cleanup(FMLServerStoppingEvent event){
    proxy.cleanup();
}
项目:Laser-Level    文件:CommonProxy.java   
public void serverStopping(final FMLServerStoppingEvent event) {
}
项目:Laser-Level    文件:LaserLevel.java   
@Mod.EventHandler
public void serverStopping(final FMLServerStoppingEvent event) {
    proxy.serverStopping(event);
}
项目:DynamicSurroundings    文件:Proxy.java   
public void serverStopping(@Nonnull final FMLServerStoppingEvent event) {

    }
项目:Tracer    文件:CommonProxy.java   
public void serverStopping(final FMLServerStoppingEvent event) {

    }