本文整理汇总了C#中World.CanBlockStay方法的典型用法代码示例。如果您正苦于以下问题:C# World.CanBlockStay方法的具体用法?C# World.CanBlockStay怎么用?C# World.CanBlockStay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类World
的用法示例。
在下文中一共展示了World.CanBlockStay方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: generate
public override bool generate(World world, java.util.Random random, int i, int j, int k)
{
for (int l = 0; l < 64; l++)
{
int i1 = (i + random.nextInt(8)) - random.nextInt(8);
int j1 = (j + random.nextInt(4)) - random.nextInt(4);
int k1 = (k + random.nextInt(8)) - random.nextInt(8);
if (world.IsAirBlock(i1, j1, k1) && world.CanBlockStay((byte)plantBlockId, i1, j1, k1))
{
world.SetBlock(i1, j1, k1, (byte)plantBlockId);
}
}
return true;
}
示例2: generate
public override bool generate(World world, java.util.Random random, int i, int j, int k)
{
for (int l = 0; ((l = world.GetBlock(i, j, k)) == 0 || l == (byte)Blocks.Leaves) && j > 0; j--) { }
for (int i1 = 0; i1 < 128; i1++)
{
int j1 = (i + random.nextInt(8)) - random.nextInt(8);
int k1 = (j + random.nextInt(4)) - random.nextInt(4);
int l1 = (k + random.nextInt(8)) - random.nextInt(8);
if (world.IsAirBlock(j1, k1, l1) && world.CanBlockStay((byte)field_28057_a, j1, k1, l1))
{
world.SetBlock(j1, k1, l1, (byte)field_28057_a, (byte)field_28056_b);
}
}
return true;
}
示例3: generate
public override bool generate(World world, java.util.Random random, int i, int j, int k)
{
for (int l = 0; l < 20; l++)
{
int i1 = (i + random.nextInt(4)) - random.nextInt(4);
int j1 = j;
int k1 = (k + random.nextInt(4)) - random.nextInt(4);
if (!world.IsAirBlock(i1, j1, k1) || BlockData.BlockMaterial(world.GetBlock(i1 - 1, j1 - 1, k1)) != Material.Water && BlockData.BlockMaterial(world.GetBlock(i1 + 1, j1 - 1, k1)) != Material.Water && BlockData.BlockMaterial(world.GetBlock(i1, j1 - 1, k1 - 1)) != Material.Water && BlockData.BlockMaterial(world.GetBlock(i1, j1 - 1, k1 + 1)) != Material.Water)
{
continue;
}
int l1 = 2 + random.nextInt(random.nextInt(3) + 1);
for (int i2 = 0; i2 < l1; i2++)
{
if (world.CanBlockStay((byte)Blocks.SugarCane, i1, j1 + i2, k1))
{
world.SetBlock(i1, j1 + i2, k1, (byte)Blocks.SugarCane);
}
}
}
return true;
}
示例4: generate
public override bool generate(World world, java.util.Random random, int i, int j, int k)
{
for (int l = 0; l < 10; l++)
{
int i1 = (i + random.nextInt(8)) - random.nextInt(8);
int j1 = (j + random.nextInt(4)) - random.nextInt(4);
int k1 = (k + random.nextInt(8)) - random.nextInt(8);
if (!world.IsAirBlock(i1, j1, k1))
{
continue;
}
int l1 = 1 + random.nextInt(random.nextInt(3) + 1);
for (int i2 = 0; i2 < l1; i2++)
{
if (world.CanBlockStay((byte)Blocks.Cactus, i1, j1 + i2, k1))
{
world.SetBlock(i1, j1 + i2, k1, (byte)Blocks.Cactus);
}
}
}
return true;
}