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


Java IProgressUpdate類代碼示例

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


IProgressUpdate類屬於net.minecraft.util包,在下文中一共展示了IProgressUpdate類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: saveAllWorlds

import net.minecraft.util.IProgressUpdate; //導入依賴的package包/類
/**
 * par1 indicates if a log message should be output.
 */
protected void saveAllWorlds(boolean dontLog)
{
    if (!this.worldIsBeingDeleted)
    {
        for (WorldServer worldserver : this.worldServers)
        {
            if (worldserver != null)
            {
                if (!dontLog)
                {
                    logger.info("Saving chunks for level \'" + worldserver.getWorldInfo().getWorldName() + "\'/" + worldserver.provider.getDimensionName());
                }

                try
                {
                    worldserver.saveAllChunks(true, (IProgressUpdate)null);
                }
                catch (MinecraftException minecraftexception)
                {
                    logger.warn(minecraftexception.getMessage());
                }
            }
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:29,代碼來源:MinecraftServer.java

示例2: saveAllWorlds

import net.minecraft.util.IProgressUpdate; //導入依賴的package包/類
/**
 * par1 indicates if a log message should be output.
 */
public void saveAllWorlds(boolean isSilent)
{
    for (WorldServer worldserver : this.worldServers)
    {
        if (worldserver != null)
        {
            if (!isSilent)
            {
                LOG.info("Saving chunks for level \'{}\'/{}", new Object[] {worldserver.getWorldInfo().getWorldName(), worldserver.provider.getDimensionType().getName()});
            }

            try
            {
                worldserver.saveAllChunks(true, (IProgressUpdate)null);
            }
            catch (MinecraftException minecraftexception)
            {
                LOG.warn(minecraftexception.getMessage());
            }
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:26,代碼來源:MinecraftServer.java

示例3: saveAllChunks

import net.minecraft.util.IProgressUpdate; //導入依賴的package包/類
/**
 * Saves all chunks to disk while updating progress bar.
 */
public void saveAllChunks(final boolean saveAll, final IProgressUpdate progress) throws MinecraftException {
	if (this.chunkProvider.canSave()) {
		if (progress != null) {
			progress.displayProgressMessage("Saving level");
		}

		this.saveLevel();

		if (progress != null) {
			progress.resetProgresAndWorkingMessage("Saving chunks");
		}

		this.chunkProvider.saveChunks(saveAll, progress);
		MinecraftForge.EVENT_BUS.post(new WorldEvent.Save(this));

		for (final Chunk chunk : this.theChunkProviderServer.func_152380_a()) {
			if (chunk != null && !this.thePlayerManager.func_152621_a(chunk.xPosition, chunk.zPosition)) {
				this.theChunkProviderServer.unloadChunksIfNotNearSpawn(chunk.xPosition, chunk.zPosition);
			}
		}
	}
}
 
開發者ID:OreCruncher,項目名稱:Jiffy,代碼行數:26,代碼來源:WorldServer.java

示例4: saveChunks

import net.minecraft.util.IProgressUpdate; //導入依賴的package包/類
/**
 * Two modes of operation: if passed true, save all Chunks in one go. If
 * passed false, save up to two chunks. Return true if all chunks have been
 * saved.
 */
public boolean saveChunks(final boolean saveAll, final IProgressUpdate notUsed) {
	int saveLimit = saveAll ? 0 : 25;

	for (int i = 0; i < this.newLoadedChunk; i++) {
		final Chunk chunk = this.theLoadedChunks[i];
		if (saveAll)
			this.safeSaveExtraChunkData(chunk);

		if (chunk.needsSaving(saveAll)) {
			this.safeSaveChunk(chunk);
			chunk.isModified = false;
			if (--saveLimit == 0)
				return false;
		}
	}

	return true;
}
 
開發者ID:OreCruncher,項目名稱:Jiffy,代碼行數:24,代碼來源:ChunkProviderServer.java

示例5: saveAllChunks

import net.minecraft.util.IProgressUpdate; //導入依賴的package包/類
/**
 * Saves all chunks to disk while updating progress bar.
 */
public void saveAllChunks(boolean par1, IProgressUpdate par2IProgressUpdate) throws MinecraftException
{
    if (this.chunkProvider.canSave())
    {
        if (par2IProgressUpdate != null)
        {
            par2IProgressUpdate.displayProgressMessage("Saving level");
        }

        this.saveLevel();

        if (par2IProgressUpdate != null)
        {
            par2IProgressUpdate.resetProgresAndWorkingMessage("Saving chunks");
        }

        this.chunkProvider.saveChunks(par1, par2IProgressUpdate);
    }
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:23,代碼來源:WorldServer.java

示例6: saveAllChunks

import net.minecraft.util.IProgressUpdate; //導入依賴的package包/類
/**
 * @author jamierocks - 25th October 2016
 * @reason Disable vanilla ChunkGC
 */
@Overwrite
public void saveAllChunks(boolean p_73044_1_, IProgressUpdate progressCallback) throws MinecraftException {
    if (this.chunkProvider.canSave()) {
        if (progressCallback != null) {
            progressCallback.displaySavingString("Saving level");
        }

        this.saveLevel();

        if (progressCallback != null) {
            progressCallback.displayLoadingString("Saving chunks");
        }

        this.chunkProvider.saveChunks(p_73044_1_, progressCallback);

        // Neptune - Disable vanilla ChunkGC
        // for (net.minecraft.world.chunk.Chunk chunk : Lists.newArrayList(this.theChunkProviderServer.func_152380_a())) {
        //     if (chunk != null && !this.thePlayerManager.hasPlayerInstance(chunk.xPosition, chunk.zPosition)) {
        //         this.theChunkProviderServer.dropChunk(chunk.xPosition, chunk.zPosition);
        //     }
        // }
        // Neptune - end
    }
}
 
開發者ID:NeptunePowered,項目名稱:NeptuneMod,代碼行數:29,代碼來源:MixinWorldServer_Performance.java

示例7: func_73151_a

import net.minecraft.util.IProgressUpdate; //導入依賴的package包/類
public boolean func_73151_a(boolean p_73151_1_, IProgressUpdate p_73151_2_) {
   int var3 = 0;

   for(int var4 = 0; var4 < this.field_73245_g.size(); ++var4) {
      Chunk var5 = (Chunk)this.field_73245_g.get(var4);
      if(p_73151_1_) {
         this.func_73243_a(var5);
      }

      if(var5.func_76601_a(p_73151_1_)) {
         this.func_73242_b(var5);
         var5.field_76643_l = false;
         ++var3;
         if(var3 == 24 && !p_73151_1_) {
            return false;
         }
      }
   }

   return true;
}
 
開發者ID:HATB0T,項目名稱:RuneCraftery,代碼行數:22,代碼來源:ChunkProviderServer.java

示例8: func_71267_a

import net.minecraft.util.IProgressUpdate; //導入依賴的package包/類
protected void func_71267_a(boolean p_71267_1_) {
   if(!this.field_71290_O) {
      WorldServer[] var2 = this.field_71305_c;
      int var3 = var2.length;

      for(int var4 = 0; var4 < var3; ++var4) {
         WorldServer var5 = var2[var4];
         if(var5 != null) {
            if(!p_71267_1_) {
               this.func_98033_al().func_98233_a("Saving chunks for level \'" + var5.func_72912_H().func_76065_j() + "\'/" + var5.field_73011_w.func_80007_l());
            }

            try {
               var5.func_73044_a(true, (IProgressUpdate)null);
            } catch (MinecraftException var7) {
               this.func_98033_al().func_98236_b(var7.getMessage());
            }
         }
      }

   }
}
 
開發者ID:HATB0T,項目名稱:RuneCraftery,代碼行數:23,代碼來源:MinecraftServer.java

示例9: saveAllChunks

import net.minecraft.util.IProgressUpdate; //導入依賴的package包/類
/**
 * Saves all chunks to disk while updating progress bar.
 */
public void saveAllChunks(boolean par1, IProgressUpdate par2IProgressUpdate) throws MinecraftException
{
    if (this.chunkProvider.canSave())
    {
        if (par2IProgressUpdate != null)
        {
            par2IProgressUpdate.displayProgressMessage("Saving level");
        }

        this.saveLevel();

        if (par2IProgressUpdate != null)
        {
            par2IProgressUpdate.resetProgresAndWorkingMessage("Saving chunks");
        }

        this.chunkProvider.saveChunks(par1, par2IProgressUpdate);
        MinecraftForge.EVENT_BUS.post(new WorldEvent.Save(this));
    }
}
 
開發者ID:HATB0T,項目名稱:RuneCraftery,代碼行數:24,代碼來源:WorldServer.java

示例10: saveAllChunks

import net.minecraft.util.IProgressUpdate; //導入依賴的package包/類
/**
 * Saves all chunks to disk while updating progress bar.
 */
public void saveAllChunks(boolean p_73044_1_, IProgressUpdate progressCallback) throws MinecraftException
{
    if (this.chunkProvider.canSave())
    {
        if (progressCallback != null)
        {
            progressCallback.displaySavingString("Saving level");
        }

        this.saveLevel();

        if (progressCallback != null)
        {
            progressCallback.displayLoadingString("Saving chunks");
        }

        this.chunkProvider.saveChunks(p_73044_1_, progressCallback);

        for (Chunk chunk : Lists.newArrayList(this.theChunkProviderServer.func_152380_a()))
        {
            if (chunk != null && !this.thePlayerManager.hasPlayerInstance(chunk.xPosition, chunk.zPosition))
            {
                this.theChunkProviderServer.dropChunk(chunk.xPosition, chunk.zPosition);
            }
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:31,代碼來源:WorldServer.java

示例11: convertFile

import net.minecraft.util.IProgressUpdate; //導入依賴的package包/類
private void convertFile(File p_75813_1_, Iterable<File> p_75813_2_, WorldChunkManager p_75813_3_, int p_75813_4_, int p_75813_5_, IProgressUpdate p_75813_6_)
{
    for (File file1 : p_75813_2_)
    {
        this.convertChunks(p_75813_1_, file1, p_75813_3_, p_75813_4_, p_75813_5_, p_75813_6_);
        ++p_75813_4_;
        int i = (int)Math.round(100.0D * (double)p_75813_4_ / (double)p_75813_5_);
        p_75813_6_.setLoadingProgress(i);
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:11,代碼來源:AnvilSaveConverter.java

示例12: saveChunks

import net.minecraft.util.IProgressUpdate; //導入依賴的package包/類
/**
 * Two modes of operation: if passed true, save all Chunks in one go.  If passed false, save up to two chunks.
 * Return true if all chunks have been saved.
 */
public boolean saveChunks(boolean p_73151_1_, IProgressUpdate progressCallback)
{
    int i = 0;
    List<Chunk> list = Lists.newArrayList(this.loadedChunks);

    for (int j = 0; j < ((List)list).size(); ++j)
    {
        Chunk chunk = (Chunk)list.get(j);

        if (p_73151_1_)
        {
            this.saveChunkExtraData(chunk);
        }

        if (chunk.needsSaving(p_73151_1_))
        {
            this.saveChunkData(chunk);
            chunk.setModified(false);
            ++i;

            if (i == 24 && !p_73151_1_)
            {
                return false;
            }
        }
    }

    return true;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:34,代碼來源:ChunkProviderServer.java

示例13: saveAllChunks

import net.minecraft.util.IProgressUpdate; //導入依賴的package包/類
@Override
public void saveAllChunks(boolean all, IProgressUpdate progressCallback) throws MinecraftException {
	if (m_proxyWorld != null && Util.isPrefixInCallStack(m_modPrefix)) {
		m_proxyWorld.saveAllChunks(all, progressCallback);
	} else if (m_realWorld != null) {
		m_realWorld.saveAllChunks(all, progressCallback);
	} else {
		super.saveAllChunks(all, progressCallback);
	}
}
 
開發者ID:orbwoi,項目名稱:UniversalRemote,代碼行數:11,代碼來源:WorldServerProxy.java

示例14: saveAllChunks

import net.minecraft.util.IProgressUpdate; //導入依賴的package包/類
/**
 * Saves all chunks to disk while updating progress bar.
 */
public void saveAllChunks(boolean p_73044_1_, @Nullable IProgressUpdate progressCallback) throws MinecraftException
{
    ChunkProviderServer chunkproviderserver = this.getChunkProvider();

    if (chunkproviderserver.canSave())
    {
        if (progressCallback != null)
        {
            progressCallback.displaySavingString("Saving level");
        }

        this.saveLevel();

        if (progressCallback != null)
        {
            progressCallback.displayLoadingString("Saving chunks");
        }

        chunkproviderserver.saveChunks(p_73044_1_);

        for (Chunk chunk : Lists.newArrayList(chunkproviderserver.getLoadedChunks()))
        {
            if (chunk != null && !this.thePlayerManager.contains(chunk.xPosition, chunk.zPosition))
            {
                chunkproviderserver.unload(chunk);
            }
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:33,代碼來源:WorldServer.java

示例15: convertFile

import net.minecraft.util.IProgressUpdate; //導入依賴的package包/類
private void convertFile(File baseFolder, Iterable<File> regionFiles, BiomeProvider p_75813_3_, int p_75813_4_, int p_75813_5_, IProgressUpdate progress)
{
    for (File file1 : regionFiles)
    {
        this.convertChunks(baseFolder, file1, p_75813_3_, p_75813_4_, p_75813_5_, progress);
        ++p_75813_4_;
        int i = (int)Math.round(100.0D * (double)p_75813_4_ / (double)p_75813_5_);
        progress.setLoadingProgress(i);
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:11,代碼來源:AnvilSaveConverter.java


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