• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# SMP.BCS类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SMP.BCS的典型用法代码示例。如果您正苦于以下问题:C# BCS类的具体用法?C# BCS怎么用?C# BCS使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BCS类属于SMP命名空间,在下文中一共展示了BCS类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Blockclicked

        /// <summary>
        /// this one reverses the direction offset and returns the block id that was clicked
        /// this does not always need to be used, only if the direction offset has already been applied
        /// in the packet handling.
        /// </summary>
        /// <param name="p"></param>
        /// <param name="a"></param>
        /// <returns></returns>
        public static byte Blockclicked(Player p, BCS a)
        {
            int x = (int)a.pos.x;
            int y = (int)a.pos.y;
            int z = (int)a.pos.z;

            switch (a.Direction)
            {
                case 0: y++; break;
                case 1: y--; break;
                case 2: z++; break;
                case 3: z--; break;
                case 4: x++; break;
                case 5: x--; break;
            }

            return p.level.GetBlock(x, y, z);
        }
开发者ID:jamesphenry,项目名称:ForgeCraft,代码行数:26,代码来源:BlockChangeSystem.cs


示例2: EatCookie

 public static bool EatCookie(Player a, BCS b)
 {
     return false;
 }
开发者ID:TaFinalDestination,项目名称:ForgeCraft,代码行数:4,代码来源:BlockChangeSystem.cs


示例3: PlaceFence

 public static bool PlaceFence(Player a, BCS b)
 {
     return false;
 }
开发者ID:TaFinalDestination,项目名称:ForgeCraft,代码行数:4,代码来源:BlockChangeSystem.cs


示例4: PlaceCake

 public static bool PlaceCake(Player a, BCS b)
 {
     if (a.level.GetBlock((int)b.pos.x, (int)b.pos.y - 1, (int)b.pos.z) != 0)
     {
         a.level.BlockChange((int)b.pos.x, (int)b.pos.y, (int)b.pos.z, (byte)Blocks.CakeBlock, 0);
         return true;
     }
     return false;
 }
开发者ID:TaFinalDestination,项目名称:ForgeCraft,代码行数:9,代码来源:BlockChangeSystem.cs


示例5: PlaceButtonStone

        public static bool PlaceButtonStone(Player a, BCS b)
        {
            if (!BlockData.CanPlaceAgainst(Blockclicked(a, b))) return false;
            if (a.level.GetBlock((int)b.pos.x, (int)b.pos.y, (int)b.pos.z) != 0) return false;

            switch (b.Direction)
            {
                case (0):
                case (1):
                    return false;
                case ((byte)Directions.East):
                    b.Direction = (byte)Buttons.North;
                    break;
                case ((byte)Directions.West):
                    b.Direction = (byte)Buttons.South;
                    break;
                case ((byte)Directions.North):
                    b.Direction = (byte)Buttons.East;
                    break;
                case ((byte)Directions.South):
                    b.Direction = (byte)Buttons.West;
                    break;

                default:
                    return false;
            }

            a.level.BlockChange((int)b.pos.x, (int)b.pos.y, (int)b.pos.z, (byte)b.ID, b.Direction);
            if (Server.mode == 0) a.inventory.Remove(a.inventory.current_index, 1);
            return false;
        }
开发者ID:TaFinalDestination,项目名称:ForgeCraft,代码行数:31,代码来源:BlockChangeSystem.cs


示例6: PlaceBed

        public static bool PlaceBed(Player a, BCS b)
        {
            if (b.Direction != 1) return false;
            Point3 pos2 = b.pos;
            byte rot = DirectionByRotFlat(a, b);

            switch (rot)
            {
                case (byte)Directions.North:
                    rot = (byte)Bed.North;
                    break;
                case (byte)Directions.East:
                    rot = (byte)Bed.East;
                    break;
                case (byte)Directions.South:
                    rot = (byte)Bed.South;
                    break;
                case (byte)Directions.West:
                    rot = (byte)Bed.West;
                    break;
            }
            switch (rot)
            {
                case (byte)Bed.North:
                    pos2.x--;
                    break;
                case (byte)Bed.East:
                    pos2.z--;
                    break;
                case (byte)Bed.South:
                    pos2.x++;
                    break;
                case (byte)Bed.West:
                    pos2.z++;
                    break;
            }

            if (!BlockData.CanPlaceAgainst(a.level.GetBlock((int)b.pos.x, (int)b.pos.y - 1, (int)b.pos.z)) || !BlockData.CanPlaceAgainst(a.level.GetBlock((int)pos2.x, (int)pos2.y - 1, (int)pos2.z))) return false;
            a.level.BlockChange((int)b.pos.x, (int)b.pos.y, (int)b.pos.z, (byte)Blocks.Bed, rot);
            a.level.BlockChange((int)pos2.x, (int)pos2.y, (int)pos2.z, (byte)Blocks.Bed, (byte)(rot | 0x8));

            return true;
        }
开发者ID:TaFinalDestination,项目名称:ForgeCraft,代码行数:43,代码来源:BlockChangeSystem.cs


示例7: OpenFurnace

 public static bool OpenFurnace(Player a, BCS b)
 {
     a.OpenWindow(WindowType.Furnace, b.pos);
     return false;
 }
开发者ID:TaFinalDestination,项目名称:ForgeCraft,代码行数:5,代码来源:BlockChangeSystem.cs


示例8: OpenDoor

 public static bool OpenDoor(Player a, BCS b)
 {
     byte type = a.level.GetBlock((int)b.pos.x, (int)b.pos.y, (int)b.pos.z);
     byte meta = a.level.GetMeta((int)b.pos.x, (int)b.pos.y, (int)b.pos.z);
     if ((meta & 0x8) == 0)
     {
         a.level.BlockChange((int)b.pos.x, (int)b.pos.y, (int)b.pos.z, type, (byte)(meta ^ 0x4));
         if (a.level.GetBlock((int)b.pos.x, (int)b.pos.y + 1, (int)b.pos.z) == type)
             a.level.BlockChange((int)b.pos.x, (int)b.pos.y + 1, (int)b.pos.z, type, (byte)((meta | 0x8) ^ 0x4));
     }
     else
     {
         a.level.BlockChange((int)b.pos.x, (int)b.pos.y, (int)b.pos.z, type, (byte)(meta ^ 0x4));
         if (a.level.GetBlock((int)b.pos.x, (int)b.pos.y - 1, (int)b.pos.z) == type)
             a.level.BlockChange((int)b.pos.x, (int)b.pos.y - 1, (int)b.pos.z, type, (byte)((meta ^ 0x8) ^ 0x4));
     }
     Player.GlobalSoundEffect(b.pos, 1003, a.level, a);
     return false;
 }
开发者ID:TaFinalDestination,项目名称:ForgeCraft,代码行数:19,代码来源:BlockChangeSystem.cs


示例9: EjectCd

 public static bool EjectCd(Player a, BCS b)
 {
     return false;
 }
开发者ID:TaFinalDestination,项目名称:ForgeCraft,代码行数:4,代码来源:BlockChangeSystem.cs


示例10: EatSoup

 public static bool EatSoup(Player a, BCS b)
 {
     return false;
 }
开发者ID:TaFinalDestination,项目名称:ForgeCraft,代码行数:4,代码来源:BlockChangeSystem.cs


示例11: EatPorkchopRaw

 public static bool EatPorkchopRaw(Player a, BCS b)
 {
     return false;
 }
开发者ID:TaFinalDestination,项目名称:ForgeCraft,代码行数:4,代码来源:BlockChangeSystem.cs


示例12: EatPorkchopCooked

 public static bool EatPorkchopCooked(Player a, BCS b)
 {
     return false;
 }
开发者ID:TaFinalDestination,项目名称:ForgeCraft,代码行数:4,代码来源:BlockChangeSystem.cs


示例13: EatGoldenApple

 public static bool EatGoldenApple(Player a, BCS b)
 {
     return false;
 }
开发者ID:TaFinalDestination,项目名称:ForgeCraft,代码行数:4,代码来源:BlockChangeSystem.cs


示例14: EatFishRaw

 public static bool EatFishRaw(Player a, BCS b)
 {
     return false;
 }
开发者ID:TaFinalDestination,项目名称:ForgeCraft,代码行数:4,代码来源:BlockChangeSystem.cs


示例15: EatFishCooked

 public static bool EatFishCooked(Player a, BCS b)
 {
     return false;
 }
开发者ID:TaFinalDestination,项目名称:ForgeCraft,代码行数:4,代码来源:BlockChangeSystem.cs


示例16: OpenCraftingTable

 public static bool OpenCraftingTable(Player a, BCS b)
 {
     a.OpenWindow(WindowType.Workbench, b.pos);
     return false;
 }
开发者ID:TaFinalDestination,项目名称:ForgeCraft,代码行数:5,代码来源:BlockChangeSystem.cs


示例17: OpenDispenser

 public static bool OpenDispenser(Player a, BCS b)
 {
     a.OpenWindow(WindowType.Dispenser, b.pos);
     return false;
 }
开发者ID:TaFinalDestination,项目名称:ForgeCraft,代码行数:5,代码来源:BlockChangeSystem.cs


示例18: FireBow

 public static bool FireBow(Player a, BCS b)
 {
     return false;
 }
开发者ID:TaFinalDestination,项目名称:ForgeCraft,代码行数:4,代码来源:BlockChangeSystem.cs


示例19: OpenEnchantmentTable

 public static bool OpenEnchantmentTable(Player a, BCS b)
 {
     a.OpenWindow(WindowType.EnchantmentTable, b.pos);
     return false;
 }
开发者ID:TaFinalDestination,项目名称:ForgeCraft,代码行数:5,代码来源:BlockChangeSystem.cs


示例20: GetInBed

 public static bool GetInBed(Player a, BCS b)
 {
     return false;
 }
开发者ID:TaFinalDestination,项目名称:ForgeCraft,代码行数:4,代码来源:BlockChangeSystem.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SMP.Player类代码示例发布时间:2022-05-26
下一篇:
C# SLua.LuaFunction类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap