本文整理汇总了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());
}
}
}
}
}
示例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());
}
}
}
}
示例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);
}
}
}
}
示例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;
}
示例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);
}
}
示例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
}
}
示例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;
}
示例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());
}
}
}
}
}
示例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));
}
}
示例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);
}
}
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
}
}
示例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);
}
}