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


C# Player.SendBlockchange方法代码示例

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


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

示例1: Blockchange1

 public void Blockchange1(Player p, ushort x, ushort y, ushort z, byte type)
 {
     p.ClearBlockchange();
     byte b = p.level.GetTile(x, y, z);
     p.SendBlockchange(x, y, z, b);
     CatchPos bp = (CatchPos)p.blockchangeObject;
     bp.x = x; bp.y = y; bp.z = z; p.blockchangeObject = bp;
     p.Blockchange += new Player.BlockchangeEventHandler(Blockchange2);
 }
开发者ID:AnthonyANI,项目名称:MCForge-MCLawl,代码行数:9,代码来源:CmdImageprint.cs

示例2: Blockchange1

 public void Blockchange1(Player p, ushort x, ushort y,ushort z,byte Type)
 {
     //get the pos of first block
     p.ClearBlockchange();
     byte t = p.level.GetTile(x, y, z);
     p.SendBlockchange(x, y, z, t);
     //undone change
     blox[0].x = x;
     blox[0].y = y;
     blox[0].z = z;
     p.Blockchange += new Player.BlockchangeEventHandler(Blockchange2);
 }
开发者ID:xShOtDoOdx,项目名称:MCForge-MCLawl,代码行数:12,代码来源:CmdGifToCin.cs

示例3: Blockchange2

        public void Blockchange2(Player p, ushort x, ushort y, ushort z, byte type)
        {
            working = true;
            p.ClearBlockchange();
            byte b = p.level.GetTile(x, y, z);
            p.SendBlockchange(x, y, z, b);

            Bitmap myBitmap = new Bitmap("extra/images/" + bitmaplocation + ".bmp");

            myBitmap.RotateFlip(RotateFlipType.RotateNoneFlipY);

            CatchPos cpos = (CatchPos)p.blockchangeObject;

            if (x == cpos.x && z == cpos.z) { Player.SendMessage(p, "No direction was selected"); return; }

            int direction;
            if (Math.Abs(cpos.x - x) > Math.Abs(cpos.z - z))
            {
                direction = 0;
                if (x <= cpos.x)
                {
                    direction = 1;
                }
            }
            else
            {
                direction = 2;
                if (z <= cpos.z)
                {
                    direction = 3;
                }
            }
            if (layer)
            {
                if (popType == 1) popType = 2;
                if (popType == 3) popType = 4;
            }
            List<FindReference.ColorBlock> refCol = FindReference.popRefCol(popType);
            FindReference.ColorBlock colblock;
            p.SendMessage("" + direction);
            Thread printThread = new Thread(new ThreadStart(delegate
            {
                double[] distance = new double[refCol.Count]; // Array of distances between color pulled from image to the referance colors.

                int position; // This is the block selector for when we find which distance is the shortest.

                for (int k = 0; k < myBitmap.Width; k++)
                {

                    for (int i = 0; i < myBitmap.Height; i++)
                    {
                        if (layer)
                        {
                            colblock.y = cpos.y;
                            if (direction <= 1)
                            {
                                if (direction == 0) { colblock.x = (ushort)(cpos.x + k); colblock.z = (ushort)(cpos.z - i); }
                                else { colblock.x = (ushort)(cpos.x - k); colblock.z = (ushort)(cpos.z + i); }
                                //colblock.z = (ushort)(cpos.z - i);
                            }
                            else
                            {
                                if (direction == 2) { colblock.z = (ushort)(cpos.z + k); colblock.x = (ushort)(cpos.x + i); }
                                else { colblock.z = (ushort)(cpos.z - k); colblock.x = (ushort)(cpos.x - i); }
                                //colblock.x = (ushort)(cpos.x - i);
                            }
                        }
                        else
                        {
                            colblock.y = (ushort)(cpos.y + i);
                            if (direction <= 1)
                            {

                                if (direction == 0) colblock.x = (ushort)(cpos.x + k);
                                else colblock.x = (ushort)(cpos.x - k);
                                colblock.z = cpos.z;
                            }
                            else
                            {
                                if (direction == 2) colblock.z = (ushort)(cpos.z + k);
                                else colblock.z = (ushort)(cpos.z - k);
                                colblock.x = cpos.x;
                            }
                        }

                        colblock.r = myBitmap.GetPixel(k, i).R;
                        colblock.g = myBitmap.GetPixel(k, i).G;
                        colblock.b = myBitmap.GetPixel(k, i).B;
                        colblock.a = myBitmap.GetPixel(k, i).A;

                        if (popType == 6)
                        {
                            if ((colblock.r + colblock.g + colblock.b) / 3 < (256 / 4))
                            {
                                colblock.type = Block.obsidian;
                            }
                            else if (((colblock.r + colblock.g + colblock.b) / 3) >= (256 / 4) && ((colblock.r + colblock.g + colblock.b) / 3) < (256 / 4) * 2)
                            {
                                colblock.type = Block.darkgrey;
                            }
//.........这里部分代码省略.........
开发者ID:PinEvil,项目名称:MCForge-Vanilla,代码行数:101,代码来源:CmdGifToCin.cs


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