本文整理汇总了C#中World.isBlockOpaqueCube方法的典型用法代码示例。如果您正苦于以下问题:C# World.isBlockOpaqueCube方法的具体用法?C# World.isBlockOpaqueCube怎么用?C# World.isBlockOpaqueCube使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类World
的用法示例。
在下文中一共展示了World.isBlockOpaqueCube方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: canPlaceBlockAt
public override bool canPlaceBlockAt(World world, int i, int j, int k)
{
if (world.isBlockOpaqueCube(i - 1, j, k))
{
return true;
}
if (world.isBlockOpaqueCube(i + 1, j, k))
{
return true;
}
if (world.isBlockOpaqueCube(i, j, k - 1))
{
return true;
}
if (world.isBlockOpaqueCube(i, j, k + 1))
{
return true;
}
return world.isBlockOpaqueCube(i, j - 1, k);
}
示例2: onItemUse
public override bool onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k,
int l)
{
if (l != 1)
{
return false;
}
j++;
var blockbed = (BlockBed) Block.bed;
int i1 = MathHelper.floor_double(((entityplayer.rotationYaw*4F)/360F) + 0.5D) & 3;
sbyte byte0 = 0;
sbyte byte1 = 0;
if (i1 == 0)
{
byte1 = 1;
}
if (i1 == 1)
{
byte0 = -1;
}
if (i1 == 2)
{
byte1 = -1;
}
if (i1 == 3)
{
byte0 = 1;
}
if (world.isAirBlock(i, j, k) && world.isAirBlock(i + byte0, j, k + byte1) &&
world.isBlockOpaqueCube(i, j - 1, k) && world.isBlockOpaqueCube(i + byte0, j - 1, k + byte1))
{
world.setBlockAndMetadataWithNotify(i, j, k, blockbed.blockID, i1);
world.setBlockAndMetadataWithNotify(i + byte0, j, k + byte1, blockbed.blockID, i1 + 8);
itemstack.stackSize--;
return true;
}
else
{
return false;
}
}
示例3: onBlockPlaced
public override void onBlockPlaced(World world, int i, int j, int k, int l)
{
int i1 = world.getBlockMetadata(i, j, k);
int j1 = i1 & 8;
i1 &= 7;
if (l == 1 && world.isBlockOpaqueCube(i, j - 1, k))
{
i1 = 5 + world.rand.nextInt(2);
}
if (l == 2 && world.isBlockOpaqueCube(i, j, k + 1))
{
i1 = 4;
}
if (l == 3 && world.isBlockOpaqueCube(i, j, k - 1))
{
i1 = 3;
}
if (l == 4 && world.isBlockOpaqueCube(i + 1, j, k))
{
i1 = 2;
}
if (l == 5 && world.isBlockOpaqueCube(i - 1, j, k))
{
i1 = 1;
}
world.setBlockMetadataWithNotify(i, j, k, i1 + j1);
}
示例4: onNeighborBlockChange
public override void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
if (checkIfAttachedToBlock(world, i, j, k))
{
int i1 = world.getBlockMetadata(i, j, k) & 7;
bool flag = false;
if (!world.isBlockOpaqueCube(i - 1, j, k) && i1 == 1)
{
flag = true;
}
if (!world.isBlockOpaqueCube(i + 1, j, k) && i1 == 2)
{
flag = true;
}
if (!world.isBlockOpaqueCube(i, j, k - 1) && i1 == 3)
{
flag = true;
}
if (!world.isBlockOpaqueCube(i, j, k + 1) && i1 == 4)
{
flag = true;
}
if (!world.isBlockOpaqueCube(i, j - 1, k) && i1 == 5)
{
flag = true;
}
if (flag)
{
dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k));
world.setBlockWithNotify(i, j, k, 0);
}
}
}
示例5: canPlaceBlockAt
public override bool canPlaceBlockAt(World world, int i, int j, int k)
{
int l = world.getBlockId(i, j, k);
return (l == 0 || blocksList[l].blockMaterial.getIsLiquid()) && world.isBlockOpaqueCube(i, j - 1, k);
}