当前位置: 首页>>代码示例>>C#>>正文


C# World.setBlockMetadataWithNotify方法代码示例

本文整理汇总了C#中CraftyServer.Core.World.setBlockMetadataWithNotify方法的典型用法代码示例。如果您正苦于以下问题:C# World.setBlockMetadataWithNotify方法的具体用法?C# World.setBlockMetadataWithNotify怎么用?C# World.setBlockMetadataWithNotify使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CraftyServer.Core.World的用法示例。


在下文中一共展示了World.setBlockMetadataWithNotify方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: blockActivated

 public override bool blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
 {
     int l = world.getBlockMetadata(i, j, k);
     int i1 = (l & 0xc) >> 2;
     i1 = i1 + 1 << 2 & 0xc;
     world.setBlockMetadataWithNotify(i, j, k, i1 | l & 3);
     return true;
 }
开发者ID:riverar,项目名称:Crafty,代码行数:8,代码来源:BlockRedstoneRepeater.cs

示例2: onBlockAdded

 public override void onBlockAdded(World world, int i, int j, int k)
 {
     if (!world.singleplayerWorld)
     {
         world.setBlockMetadataWithNotify(i, j, k, 15);
         func_4038_g(world, i, j, k);
     }
 }
开发者ID:riverar,项目名称:Crafty,代码行数:8,代码来源:BlockMinecartTrack.cs

示例3: updateTick

 public override void updateTick(World world, int i, int j, int k, Random random)
 {
     if (random.nextInt(5) == 0)
     {
         if (isWaterNearby(world, i, j, k))
         {
             world.setBlockMetadataWithNotify(i, j, k, 7);
         }
         else
         {
             int l = world.getBlockMetadata(i, j, k);
             if (l > 0)
             {
                 world.setBlockMetadataWithNotify(i, j, k, l - 1);
             }
             else if (!isCropsNearby(world, i, j, k))
             {
                 world.setBlockWithNotify(i, j, k, dirt.blockID);
             }
         }
     }
 }
开发者ID:riverar,项目名称:Crafty,代码行数:22,代码来源:BlockSoil.cs

示例4: 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);
         }
     }
 }
开发者ID:riverar,项目名称:Crafty,代码行数:16,代码来源:BlockSapling.cs

示例5: onBlockPlaced

 public override void onBlockPlaced(World world, int i, int j, int k, int l)
 {
     int i1 = world.getBlockMetadata(i, j, k);
     if ((i1 == 0 || l == 2) && world.isBlockOpaqueCube(i, j, k + 1))
     {
         i1 = 2;
     }
     if ((i1 == 0 || l == 3) && world.isBlockOpaqueCube(i, j, k - 1))
     {
         i1 = 3;
     }
     if ((i1 == 0 || l == 4) && world.isBlockOpaqueCube(i + 1, j, k))
     {
         i1 = 4;
     }
     if ((i1 == 0 || l == 5) && world.isBlockOpaqueCube(i - 1, j, k))
     {
         i1 = 5;
     }
     world.setBlockMetadataWithNotify(i, j, k, i1);
 }
开发者ID:riverar,项目名称:Crafty,代码行数:21,代码来源:BlockLadder.cs

示例6: onBlockAdded

 public override void onBlockAdded(World world, int i, int j, int k)
 {
     if (world.isBlockOpaqueCube(i - 1, j, k))
     {
         world.setBlockMetadataWithNotify(i, j, k, 1);
     }
     else if (world.isBlockOpaqueCube(i + 1, j, k))
     {
         world.setBlockMetadataWithNotify(i, j, k, 2);
     }
     else if (world.isBlockOpaqueCube(i, j, k - 1))
     {
         world.setBlockMetadataWithNotify(i, j, k, 3);
     }
     else if (world.isBlockOpaqueCube(i, j, k + 1))
     {
         world.setBlockMetadataWithNotify(i, j, k, 4);
     }
     else if (world.isBlockOpaqueCube(i, j - 1, k))
     {
         world.setBlockMetadataWithNotify(i, j, k, 5);
     }
     dropTorchIfCantStay(world, i, j, k);
 }
开发者ID:riverar,项目名称:Crafty,代码行数:24,代码来源:BlockTorch.cs

示例7: blockActivated

 public override bool blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
 {
     int l = world.getBlockMetadata(i, j, k);
     int i1 = l & 7;
     int j1 = 8 - (l & 8);
     if (j1 == 0)
     {
         return true;
     }
     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, 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);
     }
     world.func_22074_c(i, j, k, blockID, tickRate());
     return true;
 }
开发者ID:riverar,项目名称:Crafty,代码行数:36,代码来源:BlockButton.cs

示例8: func_21030_c

 private void func_21030_c(World world, int i, int j, int k, EntityPlayer entityplayer)
 {
     if (entityplayer.health < 20)
     {
         entityplayer.heal(3);
         int l = world.getBlockMetadata(i, j, k) + 1;
         if (l >= 6)
         {
             world.setBlockWithNotify(i, j, k, 0);
         }
         else
         {
             world.setBlockMetadataWithNotify(i, j, k, l);
             world.markBlockAsNeedsUpdate(i, j, k);
         }
     }
 }
开发者ID:riverar,项目名称:Crafty,代码行数:17,代码来源:BlockCake.cs

示例9: updateTick

 public override void updateTick(World world, int i, int j, int k, Random random)
 {
     if (world.isAirBlock(i, j + 1, k))
     {
         int l;
         for (l = 1; world.getBlockId(i, j - l, k) == blockID; l++)
         {
         }
         if (l < 3)
         {
             int i1 = world.getBlockMetadata(i, j, k);
             if (i1 == 15)
             {
                 world.setBlockWithNotify(i, j + 1, k, blockID);
                 world.setBlockMetadataWithNotify(i, j, k, 0);
             }
             else
             {
                 world.setBlockMetadataWithNotify(i, j, k, i1 + 1);
             }
         }
     }
 }
开发者ID:riverar,项目名称:Crafty,代码行数:23,代码来源:BlockReed.cs

示例10: updateTick

 public override void updateTick(World world, int i, int j, int k, Random random)
 {
     int l = func_301_g(world, i, j, k);
     byte byte0 = 1;
     if (blockMaterial == Material.lava && !world.worldProvider.isHellWorld)
     {
         byte0 = 2;
     }
     bool flag = true;
     if (l > 0)
     {
         int i1 = -100;
         field_659_a = 0;
         i1 = func_307_e(world, i - 1, j, k, i1);
         i1 = func_307_e(world, i + 1, j, k, i1);
         i1 = func_307_e(world, i, j, k - 1, i1);
         i1 = func_307_e(world, i, j, k + 1, i1);
         int j1 = i1 + byte0;
         if (j1 >= 8 || i1 < 0)
         {
             j1 = -1;
         }
         if (func_301_g(world, i, j + 1, k) >= 0)
         {
             int l1 = func_301_g(world, i, j + 1, k);
             if (l1 >= 8)
             {
                 j1 = l1;
             }
             else
             {
                 j1 = l1 + 8;
             }
         }
         if (field_659_a >= 2 && blockMaterial == Material.water)
         {
             if (world.isBlockOpaqueCube(i, j - 1, k))
             {
                 j1 = 0;
             }
             else if (world.getBlockMaterial(i, j - 1, k) == blockMaterial && world.getBlockMetadata(i, j, k) == 0)
             {
                 j1 = 0;
             }
         }
         if (blockMaterial == Material.lava && l < 8 && j1 < 8 && j1 > l && random.nextInt(4) != 0)
         {
             j1 = l;
             flag = false;
         }
         if (j1 != l)
         {
             l = j1;
             if (l < 0)
             {
                 world.setBlockWithNotify(i, j, k, 0);
             }
             else
             {
                 world.setBlockMetadataWithNotify(i, j, k, l);
                 world.func_22074_c(i, j, k, blockID, tickRate());
                 world.notifyBlocksOfNeighborChange(i, j, k, blockID);
             }
         }
         else if (flag)
         {
             func_22024_i(world, i, j, k);
         }
     }
     else
     {
         func_22024_i(world, i, j, k);
     }
     if (func_312_l(world, i, j - 1, k))
     {
         if (l >= 8)
         {
             world.setBlockAndMetadataWithNotify(i, j - 1, k, blockID, l);
         }
         else
         {
             world.setBlockAndMetadataWithNotify(i, j - 1, k, blockID, l + 8);
         }
     }
     else if (l >= 0 && (l == 0 || func_309_k(world, i, j - 1, k)))
     {
         bool[] aflag = func_4035_j(world, i, j, k);
         int k1 = l + byte0;
         if (l >= 8)
         {
             k1 = 1;
         }
         if (k1 >= 8)
         {
             return;
         }
         if (aflag[0])
         {
             func_311_f(world, i - 1, j, k, k1);
         }
//.........这里部分代码省略.........
开发者ID:riverar,项目名称:Crafty,代码行数:101,代码来源:BlockFlowing.cs

示例11: setStateIfMobInteractsWithPlate

 private void setStateIfMobInteractsWithPlate(World world, int i, int j, int k)
 {
     bool flag = world.getBlockMetadata(i, j, k) == 1;
     bool flag1 = false;
     float f = 0.125F;
     List list = null;
     if (triggerMobType == EnumMobType.everything)
     {
         list = world.getEntitiesWithinAABBExcludingEntity(null,
                                                           AxisAlignedBB.getBoundingBoxFromPool(i + f, j,
                                                                                                k + f,
                                                                                                (i + 1) -
                                                                                                f,
                                                                                                j +
                                                                                                0.25D,
                                                                                                (k + 1) -
                                                                                                f));
     }
     if (triggerMobType == EnumMobType.mobs)
     {
         list = world.getEntitiesWithinAABB(typeof (EntityLiving),
                                            AxisAlignedBB.getBoundingBoxFromPool(i + f, j, k + f,
                                                                                 (i + 1) - f,
                                                                                 j + 0.25D,
                                                                                 (k + 1) - f));
     }
     if (triggerMobType == EnumMobType.players)
     {
         list = world.getEntitiesWithinAABB(typeof (EntityPlayer),
                                            AxisAlignedBB.getBoundingBoxFromPool(i + f, j, k + f,
                                                                                 (i + 1) - f,
                                                                                 j + 0.25D,
                                                                                 (k + 1) - f));
     }
     if (list.size() > 0)
     {
         flag1 = true;
     }
     if (flag1 && !flag)
     {
         world.setBlockMetadataWithNotify(i, j, k, 1);
         world.notifyBlocksOfNeighborChange(i, j, k, blockID);
         world.notifyBlocksOfNeighborChange(i, j - 1, k, blockID);
         world.markBlocksDirty(i, j, k, i, j, k);
         world.playSoundEffect(i + 0.5D, j + 0.10000000000000001D, k + 0.5D,
                               "random.click", 0.3F, 0.6F);
     }
     if (!flag1 && flag)
     {
         world.setBlockMetadataWithNotify(i, j, k, 0);
         world.notifyBlocksOfNeighborChange(i, j, k, blockID);
         world.notifyBlocksOfNeighborChange(i, j - 1, k, blockID);
         world.markBlocksDirty(i, j, k, i, j, k);
         world.playSoundEffect(i + 0.5D, j + 0.10000000000000001D, k + 0.5D,
                               "random.click", 0.3F, 0.5F);
     }
     if (flag1)
     {
         world.func_22074_c(i, j, k, blockID, tickRate());
     }
 }
开发者ID:riverar,项目名称:Crafty,代码行数:61,代码来源:BlockPressurePlate.cs

示例12: updateTick

 public override void updateTick(World world, int i, int j, int k, Random random)
 {
     if (world.singleplayerWorld)
     {
         return;
     }
     int l = world.getBlockMetadata(i, j, k);
     if ((l & 8) == 0)
     {
         return;
     }
     world.setBlockMetadataWithNotify(i, j, k, l & 7);
     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);
     }
     world.playSoundEffect(i + 0.5D, j + 0.5D, k + 0.5D, "random.click", 0.3F, 0.5F);
     world.markBlocksDirty(i, j, k, i, j, k);
 }
开发者ID:riverar,项目名称:Crafty,代码行数:37,代码来源:BlockButton.cs

示例13: 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 == 2 && world.isBlockOpaqueCube(i, j, k + 1))
     {
         i1 = 4;
     }
     else if (l == 3 && world.isBlockOpaqueCube(i, j, k - 1))
     {
         i1 = 3;
     }
     else if (l == 4 && world.isBlockOpaqueCube(i + 1, j, k))
     {
         i1 = 2;
     }
     else if (l == 5 && world.isBlockOpaqueCube(i - 1, j, k))
     {
         i1 = 1;
     }
     else
     {
         i1 = func_22026_g(world, i, j, k);
     }
     world.setBlockMetadataWithNotify(i, j, k, i1 + j1);
 }
开发者ID:riverar,项目名称:Crafty,代码行数:27,代码来源:BlockButton.cs

示例14: 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;
     if (l == 0)
     {
         world.setBlockMetadataWithNotify(i, j, k, 2);
     }
     if (l == 1)
     {
         world.setBlockMetadataWithNotify(i, j, k, 1);
     }
     if (l == 2)
     {
         world.setBlockMetadataWithNotify(i, j, k, 3);
     }
     if (l == 3)
     {
         world.setBlockMetadataWithNotify(i, j, k, 0);
     }
 }
开发者ID:riverar,项目名称:Crafty,代码行数:20,代码来源:BlockStairs.cs

示例15: 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) + 2)%4;
     world.setBlockMetadataWithNotify(i, j, k, l);
     bool flag = func_22012_g(world, i, j, k, l);
     if (flag)
     {
         world.func_22074_c(i, j, k, blockID, 1);
     }
 }
开发者ID:riverar,项目名称:Crafty,代码行数:10,代码来源:BlockRedstoneRepeater.cs


注:本文中的CraftyServer.Core.World.setBlockMetadataWithNotify方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。