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