本文整理汇总了C#中SMP.World.PopulateChunk方法的典型用法代码示例。如果您正苦于以下问题:C# World.PopulateChunk方法的具体用法?C# World.PopulateChunk怎么用?C# World.PopulateChunk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SMP.World
的用法示例。
在下文中一共展示了World.PopulateChunk方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PostLoad
public void PostLoad(World w)
{
try
{
if (!populated && w.ChunkExists(x + 1, z + 1) && w.ChunkExists(x, z + 1) && w.ChunkExists(x + 1, z))
w.PopulateChunk(x, z);
if (w.ChunkExists(x - 1, z) && !GetChunk(x - 1, z, w).populated && w.ChunkExists(x - 1, z + 1) && w.ChunkExists(x, z + 1))
w.PopulateChunk(x - 1, z);
if (w.ChunkExists(x, z - 1) && !GetChunk(x, z - 1, w).populated && w.ChunkExists(x + 1, z - 1) && w.ChunkExists(x + 1, z))
w.PopulateChunk(x, z - 1);
if (w.ChunkExists(x - 1, z - 1) && !GetChunk(x - 1, z - 1, w).populated && w.ChunkExists(x, z - 1) && w.ChunkExists(x - 1, z))
w.PopulateChunk(x - 1, z - 1);
}
catch { }
if (physChecks != null)
{
w.physics.AddChunkChecks(physChecks);
physChecks = null;
}
}
示例2: PostLoad
public void PostLoad(World w)
{
try
{
if (!populated && w.ChunkExists(x + 1, z + 1) && w.ChunkExists(x, z + 1) && w.ChunkExists(x + 1, z))
w.PopulateChunk(x, z);
if (w.ChunkExists(x - 1, z) && !GetChunk(x - 1, z, w).populated && w.ChunkExists(x - 1, z + 1) && w.ChunkExists(x, z + 1))
w.PopulateChunk(x - 1, z);
if (w.ChunkExists(x, z - 1) && !GetChunk(x, z - 1, w).populated && w.ChunkExists(x + 1, z - 1) && w.ChunkExists(x + 1, z))
w.PopulateChunk(x, z - 1);
if (w.ChunkExists(x - 1, z - 1) && !GetChunk(x - 1, z - 1, w).populated && w.ChunkExists(x, z - 1) && w.ChunkExists(x - 1, z))
w.PopulateChunk(x - 1, z - 1);
}
catch { }
if (physChecks != null)
{
w.physics.AddChunkChecks(physChecks);
physChecks = null;
}
if (entityLoad.Count > 0)
{
foreach (Entity e in entityLoad)
{
Entity.Entities.Add(e.id, e);
e.UpdateChunks(false, false);
}
entityLoad.Clear();
}
byte bType;
for (int xx = 0; xx < Width; xx++)
for (int zz = 0; zz < Depth; zz++)
for (int yy = 0; yy < Height; yy++)
{
bType = GetBlock(xx, yy, zz);
if (bType < 0 || bType > 122) UNCHECKEDPlaceBlock(xx, yy, zz, 0);
}
}
示例3: PostLoad
public void PostLoad(World w)
{
try
{
if (!populated && w.ChunkExists(x + 1, z + 1) && w.ChunkExists(x, z + 1) && w.ChunkExists(x + 1, z))
w.PopulateChunk(x, z);
if (w.ChunkExists(x - 1, z) && !GetChunk(x - 1, z, w).populated && w.ChunkExists(x - 1, z + 1) && w.ChunkExists(x, z + 1))
w.PopulateChunk(x - 1, z);
if (w.ChunkExists(x, z - 1) && !GetChunk(x, z - 1, w).populated && w.ChunkExists(x + 1, z - 1) && w.ChunkExists(x + 1, z))
w.PopulateChunk(x, z - 1);
if (w.ChunkExists(x - 1, z - 1) && !GetChunk(x - 1, z - 1, w).populated && w.ChunkExists(x, z - 1) && w.ChunkExists(x - 1, z))
w.PopulateChunk(x - 1, z - 1);
}
catch { }
if (physChecks != null)
{
w.physics.AddChunkChecks(physChecks);
physChecks = null;
}
byte bType;
for (int xx = 0; xx < Width; xx++)
for (int zz = 0; zz < Depth; zz++)
for (int yy = 0; yy < Height; yy++)
{
bType = GetBlock(xx, yy, zz);
if (bType < 0 || bType > 122) UNCHECKEDPlaceBlock(xx, yy, zz, 0);
}
}