本文整理汇总了C#中World.getBlockMetadata方法的典型用法代码示例。如果您正苦于以下问题:C# World.getBlockMetadata方法的具体用法?C# World.getBlockMetadata怎么用?C# World.getBlockMetadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类World
的用法示例。
在下文中一共展示了World.getBlockMetadata方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: isIndirectlyPoweringTo
public override bool isIndirectlyPoweringTo(World world, int i, int j, int k, int l)
{
int i1 = world.getBlockMetadata(i, j, k);
if ((i1 & 8) == 0)
{
return false;
}
int j1 = i1 & 7;
if (j1 == 5 && l == 1)
{
return true;
}
if (j1 == 4 && l == 2)
{
return true;
}
if (j1 == 3 && l == 3)
{
return true;
}
if (j1 == 2 && l == 4)
{
return true;
}
return j1 == 1 && l == 5;
}
示例2: blockActivated
public override bool blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
{
int l = world.getBlockMetadata(i, j, k);
if (l > 0)
{
ejectRecord(world, i, j, k, l);
return true;
}
else
{
return false;
}
}
示例3: onItemUse
public override bool onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k,
int l)
{
if (world.getBlockId(i, j, k) == Block.jukebox.blockID && world.getBlockMetadata(i, j, k) == 0)
{
world.setBlockMetadataWithNotify(i, j, k, (shiftedIndex - record13.shiftedIndex) + 1);
world.playRecord(recordName, i, j, k);
itemstack.stackSize--;
return true;
}
else
{
return false;
}
}
示例4: blockActivated
public override bool blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
{
if (world.singleplayerWorld)
{
return true;
}
int l = world.getBlockMetadata(i, j, k);
int i1 = l & 7;
int j1 = 8 - (l & 8);
world.setBlockMetadataWithNotify(i, j, k, i1 + j1);
world.markBlocksDirty(i, j, k, i, j, k);
world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "random.click", 0.3F,
j1 <= 0 ? 0.5F : 0.6F);
world.notifyBlocksOfNeighborChange(i, j, k, blockID);
if (i1 == 1)
{
world.notifyBlocksOfNeighborChange(i - 1, j, k, blockID);
}
else if (i1 == 2)
{
world.notifyBlocksOfNeighborChange(i + 1, j, k, blockID);
}
else if (i1 == 3)
{
world.notifyBlocksOfNeighborChange(i, j, k - 1, blockID);
}
else if (i1 == 4)
{
world.notifyBlocksOfNeighborChange(i, j, k + 1, blockID);
}
else
{
world.notifyBlocksOfNeighborChange(i, j - 1, k, blockID);
}
return true;
}
示例5: checkIfAttachedToBlock
private bool checkIfAttachedToBlock(World world, int i, int j, int k)
{
if (!canPlaceBlockAt(world, i, j, k))
{
dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k));
world.setBlockWithNotify(i, j, k, 0);
return false;
}
else
{
return true;
}
}
示例6: 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);
}
}
}
示例7: onBlockRemoval
public override void onBlockRemoval(World world, int i, int j, int k)
{
int l = world.getBlockMetadata(i, j, k);
if ((l & 8) > 0)
{
world.notifyBlocksOfNeighborChange(i, j, k, blockID);
int i1 = l & 7;
if (i1 == 1)
{
world.notifyBlocksOfNeighborChange(i - 1, j, k, blockID);
}
else if (i1 == 2)
{
world.notifyBlocksOfNeighborChange(i + 1, j, k, blockID);
}
else if (i1 == 3)
{
world.notifyBlocksOfNeighborChange(i, j, k - 1, blockID);
}
else if (i1 == 4)
{
world.notifyBlocksOfNeighborChange(i, j, k + 1, blockID);
}
else
{
world.notifyBlocksOfNeighborChange(i, j - 1, k, blockID);
}
}
base.onBlockRemoval(world, i, j, k);
}
示例8: 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);
}