本文整理汇总了C#中CraftyServer.Core.World.getBlockLightValue方法的典型用法代码示例。如果您正苦于以下问题:C# World.getBlockLightValue方法的具体用法?C# World.getBlockLightValue怎么用?C# World.getBlockLightValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CraftyServer.Core.World
的用法示例。
在下文中一共展示了World.getBlockLightValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: updateTick
public override void updateTick(World world, int i, int j, int k, Random random)
{
if (world.singleplayerWorld)
{
return;
}
if (world.getBlockLightValue(i, j + 1, k) < 4 && world.getBlockMaterial(i, j + 1, k).getCanBlockGrass())
{
if (random.nextInt(4) != 0)
{
return;
}
world.setBlockWithNotify(i, j, k, dirt.blockID);
}
else if (world.getBlockLightValue(i, j + 1, k) >= 9)
{
int l = (i + random.nextInt(3)) - 1;
int i1 = (j + random.nextInt(5)) - 3;
int j1 = (k + random.nextInt(3)) - 1;
if (world.getBlockId(l, i1, j1) == dirt.blockID && world.getBlockLightValue(l, i1 + 1, j1) >= 4 &&
!world.getBlockMaterial(l, i1 + 1, j1).getCanBlockGrass())
{
world.setBlockWithNotify(l, i1, j1, grass.blockID);
}
}
}
示例2: updateTick
public override void updateTick(World world, int i, int j, int k, Random random)
{
base.updateTick(world, i, j, k, random);
if (world.getBlockLightValue(i, j + 1, k) >= 9 && random.nextInt(5) == 0)
{
int l = world.getBlockMetadata(i, j, k);
if (l < 15)
{
world.setBlockMetadataWithNotify(i, j, k, l + 1);
}
else
{
func_21027_b(world, i, j, k, random);
}
}
}
示例3: canBlockStay
public override bool canBlockStay(World world, int i, int j, int k)
{
return (world.getBlockLightValue(i, j, k) >= 8 || world.canBlockSeeTheSky(i, j, k)) &&
canThisPlantGrowOnThisBlockID(world.getBlockId(i, j - 1, k));
}