本文整理汇总了C#中World.setBlockMetadataWithNotify方法的典型用法代码示例。如果您正苦于以下问题:C# World.setBlockMetadataWithNotify方法的具体用法?C# World.setBlockMetadataWithNotify怎么用?C# World.setBlockMetadataWithNotify使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类World
的用法示例。
在下文中一共展示了World.setBlockMetadataWithNotify方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
}
示例2: ejectRecord
public void ejectRecord(World world, int i, int j, int k, int l)
{
world.playRecord(null, i, j, k);
world.setBlockMetadataWithNotify(i, j, k, 0);
int i1 = (Item.record13.shiftedIndex + l) - 1;
float f = 0.7F;
double d = (world.rand.nextFloat()*f) + (1.0F - f)*0.5D;
double d1 = (world.rand.nextFloat()*f) + (1.0F - f)*0.20000000000000001D +
0.59999999999999998D;
double d2 = (world.rand.nextFloat()*f) + (1.0F - f)*0.5D;
var entityitem = new EntityItem(world, i + d, j + d1, k + d2,
new ItemStack(i1, 1, 0));
entityitem.delayBeforeCanPickup = 10;
world.entityJoinedWorld(entityitem);
}
示例3: 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;
}
示例4: 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);
}
示例5: onBlockPlacedBy
public override void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving)
{
int l = MathHelper.floor_double(((entityliving.rotationYaw*4F)/360F) + 0.5D) & 3;
world.setBlockMetadataWithNotify(i, j, k, l);
}