本文整理匯總了Java中net.minecraft.world.ChunkCoordIntPair.chunkXZ2Int方法的典型用法代碼示例。如果您正苦於以下問題:Java ChunkCoordIntPair.chunkXZ2Int方法的具體用法?Java ChunkCoordIntPair.chunkXZ2Int怎麽用?Java ChunkCoordIntPair.chunkXZ2Int使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.world.ChunkCoordIntPair
的用法示例。
在下文中一共展示了ChunkCoordIntPair.chunkXZ2Int方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: loadChunk
import net.minecraft.world.ChunkCoordIntPair; //導入方法依賴的package包/類
/**
* loads or generates the chunk at the chunk location specified
*/
public Chunk loadChunk(int p_73158_1_, int p_73158_2_)
{
long i = ChunkCoordIntPair.chunkXZ2Int(p_73158_1_, p_73158_2_);
this.droppedChunksSet.remove(Long.valueOf(i));
Chunk chunk = (Chunk)this.id2ChunkMap.getValueByKey(i);
if (chunk == null)
{
chunk = this.loadChunkFromFile(p_73158_1_, p_73158_2_);
if (chunk == null)
{
if (this.serverChunkGenerator == null)
{
chunk = this.dummyChunk;
}
else
{
try
{
chunk = this.serverChunkGenerator.provideChunk(p_73158_1_, p_73158_2_);
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception generating new chunk");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Chunk to be generated");
crashreportcategory.addCrashSection("Location", String.format("%d,%d", new Object[] {Integer.valueOf(p_73158_1_), Integer.valueOf(p_73158_2_)}));
crashreportcategory.addCrashSection("Position hash", Long.valueOf(i));
crashreportcategory.addCrashSection("Generator", this.serverChunkGenerator.makeString());
throw new ReportedException(crashreport);
}
}
}
this.id2ChunkMap.add(i, chunk);
this.loadedChunks.add(chunk);
chunk.onChunkLoad();
chunk.populateChunk(this, this, p_73158_1_, p_73158_2_);
}
return chunk;
}