本文整理汇总了C#中SMP.World.BlockChange方法的典型用法代码示例。如果您正苦于以下问题:C# World.BlockChange方法的具体用法?C# World.BlockChange怎么用?C# World.BlockChange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SMP.World
的用法示例。
在下文中一共展示了World.BlockChange方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Normal
public void Normal(World w, int x, int y, int z, byte type)
{
byte dist, tile;
byte height = (byte)(rand.nextInt(4) + 3);
byte top = (byte)(height - 2);
short xx, yy, zz;
int xxx, yyy, zzz;
for (yy = 0; yy <= height; yy++)
{
yyy = y + yy;
tile = tile = w.GetBlock(x, yyy, z);
if (tile == (byte)Blocks.Air || (yyy == y && tile == (byte)Blocks.Sapling))
w.BlockChange(x, yyy, z, (byte)Blocks.Wood, type);
}
for (yy = top; yy <= height + 1; yy++)
{
dist = yy > height - 1 ? (byte)1 : (byte)2;
for (xx = (short)-dist; xx <= dist; xx++)
{
for (zz = (short)-dist; zz <= dist; zz++)
{
xxx = x + xx;
yyy = y + yy;
zzz = z + zz;
tile = w.GetBlock(xxx, yyy, zzz);
//Server.s.Log(String.Format("{0} {1} {2}", xxx, yyy, zzz));
if ((xxx == x && zzz == z && yy <= height) || tile != (byte)Blocks.Air)
continue;
if (Math.Abs(xx) == dist && Math.Abs(zz) == dist)
{
if (yy > height) continue;
if (rand.nextInt(2) == 0)
w.BlockChange(xxx, yyy, zzz, (byte)Blocks.Leaves, type);
}
else
w.BlockChange(xxx, yyy, zzz, (byte)Blocks.Leaves, type);
}
}
}
}