本文整理汇总了C#中World.IsAirBlock方法的典型用法代码示例。如果您正苦于以下问题:C# World.IsAirBlock方法的具体用法?C# World.IsAirBlock怎么用?C# World.IsAirBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类World
的用法示例。
在下文中一共展示了World.IsAirBlock方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: generate
public override bool generate(World world, java.util.Random random, int i, int j, int k)
{
if (world.GetBlock(i, j + 1, k) != (byte)Blocks.Netherrack)
{
return false;
}
if (world.GetBlock(i, j, k) != 0 && world.GetBlock(i, j, k) != (byte)Blocks.Netherrack)
{
return false;
}
int l = 0;
if (world.GetBlock(i - 1, j, k) == (byte)Blocks.Netherrack)
{
l++;
}
if (world.GetBlock(i + 1, j, k) == (byte)Blocks.Netherrack)
{
l++;
}
if (world.GetBlock(i, j, k - 1) == (byte)Blocks.Netherrack)
{
l++;
}
if (world.GetBlock(i, j, k + 1) == (byte)Blocks.Netherrack)
{
l++;
}
if (world.GetBlock(i, j - 1, k) == (byte)Blocks.Netherrack)
{
l++;
}
int i1 = 0;
if (world.IsAirBlock(i - 1, j, k))
{
i1++;
}
if (world.IsAirBlock(i + 1, j, k))
{
i1++;
}
if (world.IsAirBlock(i, j, k - 1))
{
i1++;
}
if (world.IsAirBlock(i, j, k + 1))
{
i1++;
}
if (world.IsAirBlock(i, j - 1, k))
{
i1++;
}
if (l == 4 && i1 == 1)
{
world.SetBlock(i, j, k, (byte)field_4250_a);
world.physics.AddCheck(i, j, k);
//Block.blocksList[field_4250_a].updateTick(world, i, j, k, random);
}
return true;
}
示例2: generate
public override bool generate(World world, java.util.Random random, int i, int j, int k)
{
if (world.GetBlock(i, j + 1, k) != (byte)Blocks.Stone)
{
return false;
}
if (world.GetBlock(i, j - 1, k) != (byte)Blocks.Stone)
{
return false;
}
if (world.GetBlock(i, j, k) != 0 && world.GetBlock(i, j, k) != (byte)Blocks.Stone)
{
return false;
}
int l = 0;
if (world.GetBlock(i - 1, j, k) == (byte)Blocks.Stone)
{
l++;
}
if (world.GetBlock(i + 1, j, k) == (byte)Blocks.Stone)
{
l++;
}
if (world.GetBlock(i, j, k - 1) == (byte)Blocks.Stone)
{
l++;
}
if (world.GetBlock(i, j, k + 1) == (byte)Blocks.Stone)
{
l++;
}
int i1 = 0;
if (world.IsAirBlock(i - 1, j, k))
{
i1++;
}
if (world.IsAirBlock(i + 1, j, k))
{
i1++;
}
if (world.IsAirBlock(i, j, k - 1))
{
i1++;
}
if (world.IsAirBlock(i, j, k + 1))
{
i1++;
}
if (l == 3 && i1 == 1)
{
world.SetBlock(i, j, k, (byte)liquidBlockId);
world.physics.AddCheck(i, j, k, true);
//world.scheduledUpdatesAreImmediate = true;
//Block.blocksList[liquidBlockId].updateTick(world, i, j, k, random);
//world.scheduledUpdatesAreImmediate = false;
}
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 < 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;
}
示例4: 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.GetBlock(i1, j1 - 1, k1) == (byte)Blocks.Grass && world.CanPlaceAt((byte)Blocks.Pumpkin, i1, j1, k1))
{
world.SetBlock(i1, j1, k1, (byte)Blocks.Pumpkin, (byte)random.nextInt(4));
}
}
return true;
}
示例5: 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;
}
示例6: generate
public override bool generate(World world, java.util.Random random, int i, int j, int k)
{
if (!world.IsAirBlock(i, j, k) || world.GetBlock(i, j - 1, k) != field_40207_a)
{
return false;
}
int l = random.nextInt(32) + 6;
int i1 = random.nextInt(4) + 1;
for (int j1 = i - i1; j1 <= i + i1; j1++)
{
for (int l1 = k - i1; l1 <= k + i1; l1++)
{
int j2 = j1 - i;
int l2 = l1 - k;
if (j2 * j2 + l2 * l2 <= i1 * i1 + 1 && world.GetBlock(j1, j - 1, l1) != field_40207_a)
{
return false;
}
}
}
for (int k1 = j; k1 < j + l && k1 < world.worldYMax; k1++)
{
for (int i2 = i - i1; i2 <= i + i1; i2++)
{
for (int k2 = k - i1; k2 <= k + i1; k2++)
{
int i3 = i2 - i;
int j3 = k2 - k;
if (i3 * i3 + j3 * j3 <= i1 * i1 + 1)
{
world.SetBlock(i2, k1, k2, (byte)Blocks.Obsidian);
}
}
}
}
// TODO
/*EntityEnderCrystal entityendercrystal = new EntityEnderCrystal(world);
entityendercrystal.setLocationAndAngles((float)i + 0.5F, j + l, (float)k + 0.5F, random.nextFloat() * 360F, 0.0F);
world.entityJoinedWorld(entityendercrystal);*/
world.SetBlock(i, j + l, k, (byte)Blocks.Bedrock);
return true;
}
示例7: 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;
}
示例8: 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;
}
示例9: generate
public override bool generate(World world, java.util.Random random, int i, int j, int k)
{
i -= 8;
for(k -= 8; j > 0 && world.IsAirBlock(i, j, k); j--) { }
j -= 4;
bool[] aflag = new bool[2048];
int l = random.nextInt(4) + 4;
for(int i1 = 0; i1 < l; i1++)
{
double d = random.nextDouble() * 6D + 3D;
double d1 = random.nextDouble() * 4D + 2D;
double d2 = random.nextDouble() * 6D + 3D;
double d3 = random.nextDouble() * (16D - d - 2D) + 1.0D + d / 2D;
double d4 = random.nextDouble() * (8D - d1 - 4D) + 2D + d1 / 2D;
double d5 = random.nextDouble() * (16D - d2 - 2D) + 1.0D + d2 / 2D;
for(int j4 = 1; j4 < 15; j4++)
{
for(int k4 = 1; k4 < 15; k4++)
{
for(int l4 = 1; l4 < 7; l4++)
{
double d6 = ((double)j4 - d3) / (d / 2D);
double d7 = ((double)l4 - d4) / (d1 / 2D);
double d8 = ((double)k4 - d5) / (d2 / 2D);
double d9 = d6 * d6 + d7 * d7 + d8 * d8;
if(d9 < 1.0D)
{
aflag[(j4 * 16 + k4) * 8 + l4] = true;
}
}
}
}
}
for(int j1 = 0; j1 < 16; j1++)
{
for(int j2 = 0; j2 < 16; j2++)
{
for(int j3 = 0; j3 < 8; j3++)
{
bool flag = !aflag[(j1 * 16 + j2) * 8 + j3] && (j1 < 15 && aflag[((j1 + 1) * 16 + j2) * 8 + j3] || j1 > 0 && aflag[((j1 - 1) * 16 + j2) * 8 + j3] || j2 < 15 && aflag[(j1 * 16 + (j2 + 1)) * 8 + j3] || j2 > 0 && aflag[(j1 * 16 + (j2 - 1)) * 8 + j3] || j3 < 7 && aflag[(j1 * 16 + j2) * 8 + (j3 + 1)] || j3 > 0 && aflag[(j1 * 16 + j2) * 8 + (j3 - 1)]);
if(!flag)
{
continue;
}
byte block = world.GetBlock(i + j1, j + j3, k + j2);
if(j3 >= 4 && BlockData.IsLiquid(block))
{
return false;
}
if (j3 < 4 && !BlockData.IsSolid(block) && world.GetBlock(i + j1, j + j3, k + j2) != blockIndex)
{
return false;
}
}
}
}
for(int k1 = 0; k1 < 16; k1++)
{
for(int k2 = 0; k2 < 16; k2++)
{
for(int k3 = 0; k3 < 8; k3++)
{
if(aflag[(k1 * 16 + k2) * 8 + k3])
{
world.SetBlock(i + k1, j + k3, k + k2, (byte)(k3 < 4 ? blockIndex : 0));
}
}
}
}
for(int l1 = 0; l1 < 16; l1++)
{
for(int l2 = 0; l2 < 16; l2++)
{
for(int l3 = 4; l3 < 8; l3++)
{
if(aflag[(l1 * 16 + l2) * 8 + l3] && world.GetBlock(i + l1, (j + l3) - 1, k + l2) == (byte)Blocks.Dirt /*&& world.getSavedLightValue(EnumSkyBlock.Sky, i + l1, j + l3, k + l2) > 0*/) // TODO: Lighting stuffs!
{
world.SetBlock(i + l1, (j + l3) - 1, k + l2, (byte)Blocks.Grass);
}
}
}
}
if(BlockData.BlockMaterial((byte)blockIndex) == Material.Lava)
{
for(int i2 = 0; i2 < 16; i2++)
{
for(int i3 = 0; i3 < 16; i3++)
//.........这里部分代码省略.........
示例10: func_35314_b
protected void func_35314_b(World world, int i, int j, int k, StructureBoundingBox structureboundingbox)
{
int l = func_35306_a(i, k);
int i1 = func_35300_a(j);
int j1 = func_35296_b(i, k);
if(!structureboundingbox.isInBbVolume(l, i1, j1))
{
return;
}
for(; !world.IsAirBlock(l, i1, j1) && i1 < world.worldYMask; i1++)
{
world.SetBlock(l, i1, j1, 0, 0);
}
}
示例11: func_35303_b
protected void func_35303_b(World world, int i, int j, int k, int l, int i1, StructureBoundingBox structureboundingbox)
{
int j1 = func_35306_a(k, i1);
int k1 = func_35300_a(l);
int l1 = func_35296_b(k, i1);
if(!structureboundingbox.isInBbVolume(j1, k1, l1))
{
return;
}
for(; (world.IsAirBlock(j1, k1, l1) || BlockData.IsLiquid(world.GetBlock(j1, k1, l1))) && k1 > 1; k1--)
{
world.SetBlock(j1, k1, l1, (byte)i, (byte)j);
}
}
示例12: generate
public override bool generate(World world, java.util.Random random, int i, int j, int k)
{
byte byte0 = 3;
int l = random.nextInt(2) + 2;
int i1 = random.nextInt(2) + 2;
int j1 = 0;
for(int k1 = i - l - 1; k1 <= i + l + 1; k1++)
{
for(int j2 = j - 1; j2 <= j + byte0 + 1; j2++)
{
for(int i3 = k - i1 - 1; i3 <= k + i1 + 1; i3++)
{
byte block = world.GetBlock(k1, j2, i3);
if(j2 == j - 1 && !BlockData.IsSolid(block))
{
return false;
}
if (j2 == j + byte0 + 1 && !BlockData.IsSolid(block))
{
return false;
}
if((k1 == i - l - 1 || k1 == i + l + 1 || i3 == k - i1 - 1 || i3 == k + i1 + 1) && j2 == j && world.IsAirBlock(k1, j2, i3) && world.IsAirBlock(k1, j2 + 1, i3))
{
j1++;
}
}
}
}
if(j1 < 1 || j1 > 5)
{
return false;
}
for(int l1 = i - l - 1; l1 <= i + l + 1; l1++)
{
for(int k2 = j + byte0; k2 >= j - 1; k2--)
{
for(int j3 = k - i1 - 1; j3 <= k + i1 + 1; j3++)
{
if(l1 == i - l - 1 || k2 == j - 1 || j3 == k - i1 - 1 || l1 == i + l + 1 || k2 == j + byte0 + 1 || j3 == k + i1 + 1)
{
if(k2 >= 0 && !BlockData.IsSolid(world.GetBlock(l1, k2 - 1, j3)))
{
world.SetBlock(l1, k2, j3, 0);
continue;
}
if (!BlockData.IsSolid(world.GetBlock(l1, k2, j3)))
{
continue;
}
if(k2 == j - 1 && random.nextInt(4) != 0)
{
world.SetBlock(l1, k2, j3, (byte)Blocks.MossStone);
} else
{
world.SetBlock(l1, k2, j3, (byte)Blocks.CobbleStone);
}
} else
{
world.SetBlock(l1, k2, j3, 0);
}
}
}
}
for(int i2 = 0; i2 < 2; i2++)
{
label0:
for(int l2 = 0; l2 < 3; l2++)
{
int k3 = (i + random.nextInt(l * 2 + 1)) - l;
int l3 = j;
int i4 = (k + random.nextInt(i1 * 2 + 1)) - i1;
if(!world.IsAirBlock(k3, l3, i4))
{
continue;
}
int j4 = 0;
if (BlockData.IsSolid(world.GetBlock(k3 - 1, l3, i4)))
{
j4++;
}
if (BlockData.IsSolid(world.GetBlock(k3 + 1, l3, i4)))
{
j4++;
}
if(BlockData.IsSolid(world.GetBlock(k3, l3, i4 - 1)))
{
j4++;
}
if(BlockData.IsSolid(world.GetBlock(k3, l3, i4 + 1)))
{
j4++;
}
if(j4 != 1)
{
//.........这里部分代码省略.........
示例13: generate
public override bool generate(World world, java.util.Random random, int i, int j, int k)
{
if (!world.IsAirBlock(i, j, k))
{
return false;
}
if (world.GetBlock(i, j + 1, k) != (byte)Blocks.Netherrack)
{
return false;
}
world.SetBlock(i, j, k, (byte)Blocks.GlowstoneBlock);
for (int l = 0; l < 1500; l++)
{
int i1 = (i + random.nextInt(8)) - random.nextInt(8);
int j1 = j - random.nextInt(12);
int k1 = (k + random.nextInt(8)) - random.nextInt(8);
if (world.GetBlock(i1, j1, k1) != 0)
{
continue;
}
int l1 = 0;
for (int i2 = 0; i2 < 6; i2++)
{
int j2 = 0;
if (i2 == 0)
{
j2 = world.GetBlock(i1 - 1, j1, k1);
}
if (i2 == 1)
{
j2 = world.GetBlock(i1 + 1, j1, k1);
}
if (i2 == 2)
{
j2 = world.GetBlock(i1, j1 - 1, k1);
}
if (i2 == 3)
{
j2 = world.GetBlock(i1, j1 + 1, k1);
}
if (i2 == 4)
{
j2 = world.GetBlock(i1, j1, k1 - 1);
}
if (i2 == 5)
{
j2 = world.GetBlock(i1, j1, k1 + 1);
}
if (j2 == (byte)Blocks.GlowstoneBlock)
{
l1++;
}
}
if (l1 == 1)
{
world.SetBlock(i1, j1, k1, (byte)Blocks.GlowstoneBlock);
}
}
return true;
}