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


C# Player.GetDatapass方法代码示例

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


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

示例1: CatchBlock2

 public void CatchBlock2(Player sender, BlockChangeEventArgs args)
 {
     args.Unregister();
     Vector3S FirstBlock = (Vector3S)sender.GetDatapass("CmdDatapassExample_FirstBlock");
     Vector3S SecondBlock = new Vector3S(args.X, args.Z, args.Y);
     sender.SendMessage("This is where we would initiate a Cuboid!");
 }
开发者ID:Maicke98,项目名称:MCForge-Vanilla,代码行数:7,代码来源:CmdDatapassExample.cs

示例2: BlockChange1

 void BlockChange1(Player sender, BlockChangeEventArgs args) {
     CatchPos cpos = (CatchPos)sender.GetDatapass(Name);
     cpos.pos = new Vector3S((short)args.X, (short)args.Z, (short)args.Y);
     args.Cancel();
     sender.OnPlayerBlockChange.Normal -= BlockChange1;
     sender.SetDatapass(Name, cpos);
     sender.OnPlayerBlockChange.Normal += BlockChange2;
 }
开发者ID:nullpic,项目名称:MCForge-Vanilla,代码行数:8,代码来源:CmdWrite.cs

示例3: CatchBlock2

 public void CatchBlock2(Player p, BlockChangeEventArgs args)
 {
     p.OnPlayerBlockChange.Normal -= new Event<Player, BlockChangeEventArgs>.EventHandler(CatchBlock2);
     CatchPos cpos = (CatchPos)p.GetDatapass(this.Name);
     cpos.pos2 = new Vector3S(args.X, args.Z, args.Y);
     args.Cancel();
     Replace(cpos, p);
 }
开发者ID:headdetect,项目名称:MCForge6-Vanilla,代码行数:8,代码来源:CmdReplace.cs

示例4: CatchBlock

 public void CatchBlock(Player sender, BlockChangeEventArgs args)
 {
     CatchPos cpos = (CatchPos)sender.GetDatapass("CmdReplace_cpos"); ;
     cpos.pos = new Vector3S(args.X, args.Y, args.Z);
     args.Unregister();
     args.Cancel();
     sender.SetDatapass("CmdReplace_cpos", cpos);
     sender.OnPlayerBlockChange.Normal += new BlockChangeEvent.EventHandler(CatchBlock2);
 }
开发者ID:Maicke98,项目名称:MCForge-Vanilla,代码行数:9,代码来源:CmdReplace.cs

示例5: CatchBlock

 //public void CatchBlock(Player p, ushort x, ushort z, ushort y, byte NewType, bool placed, object DataPass)
 public void CatchBlock(Player sender, BlockChangeEventArgs args)
 {
     CatchPos cpos = (CatchPos)sender.GetDatapass("CmdReplaceNot_cpos");
     cpos.pos = new Vector3S(args.X, args.Z, args.Y);
     args.Unregister();
     sender.SetDatapass("CmdReplaceNot_cpos", cpos);
     sender.OnPlayerBlockChange.Normal += new BlockChangeEvent.EventHandler(CatchBlock2);
     //p.CatchNextBlockchange(CatchBlock2, (object)cpos);
 }
开发者ID:Maicke98,项目名称:MCForge-Vanilla,代码行数:10,代码来源:CmdReplaceNot.cs

示例6: CatchBlock1

 public void CatchBlock1(Player p, BlockChangeEventArgs args)
 {
     CatchPos cpos = (CatchPos)p.GetDatapass(this.Name);
     cpos.pos = new Vector3S(args.X, args.Z, args.Y);
     args.Cancel();
     p.OnPlayerBlockChange.Normal -= new Event<Player, BlockChangeEventArgs>.EventHandler(CatchBlock1);
     p.SetDatapass(this.Name, cpos);
     p.OnPlayerBlockChange.Normal += new BlockChangeEvent.EventHandler(CatchBlock2);
 }
开发者ID:headdetect,项目名称:MCForge6-Vanilla,代码行数:9,代码来源:CmdReplace.cs

示例7: BlockChange2

 void BlockChange2(Player sender, BlockChangeEventArgs args) {
     //string direction = null;
     sender.OnPlayerBlockChange.Normal -= BlockChange2;
     CatchPos cpos = (CatchPos)sender.GetDatapass(this.Name);
     foreach (Vector3S v in BlockString(cpos.message, cpos.pos, new Vector3S(args.X, args.Z, args.Y), sender.Level.Size)) {
         sender.Level.BlockChange(v, args.Holding, sender);
     }
     args.Cancel();
     return;
 }
开发者ID:nullpic,项目名称:MCForge-Vanilla,代码行数:10,代码来源:CmdWrite.cs

示例8: CatchBlock

 //public void CatchBlock(Player p, ushort x, ushort z, ushort y, byte NewType, bool placed, object DataPass)
 public void CatchBlock(Player sender, BlockChangeEventArgs args) {
     args.Cancel();
     args.Unregister();
     sender.SendBlockChange(args.X, args.Z, args.Y, sender.Level.GetBlock(args.X, args.Z, args.Y));
     CatchPos cpos = (CatchPos)sender.GetDatapass("CmdMeasure_cpos");
     cpos.FirstBlock = new Vector3S(args.X, args.Z, args.Y);
     sender.SetDatapass("CmdMeasure_cpos", cpos);
     sender.OnPlayerBlockChange.Normal += new BlockChangeEvent.EventHandler(CatchBlock2);
     //p.CatchNextBlockchange(new Player.BlockChangeDelegate(CatchBlock2), (object)cpos);
 }
开发者ID:ninedrafted,项目名称:MCForge-Vanilla,代码行数:11,代码来源:CmdMeasure.cs

示例9: CatchBlock2

 //public void CatchBlock2(Player p, ushort x, ushort z, ushort y, byte NewType, bool placed, object DataPass)
 public void CatchBlock2(Player sender, BlockChangeEventArgs args) {
     args.Cancel();
     args.Unregister();
     sender.SendBlockChange(args.X, args.Z, args.Y, sender.Level.GetBlock(args.X, args.Z, args.Y));
     CatchPos cpos = (CatchPos)sender.GetDatapass("CmdMeasure_cpos");
     Vector3S FirstBlock = cpos.FirstBlock;
     ushort xx, zz, yy;
     int count = 0;
     for (xx = Math.Min((ushort)(FirstBlock.x), args.X); xx <= Math.Max((ushort)(FirstBlock.x), args.X); ++xx)
         for (zz = Math.Min((ushort)(FirstBlock.z), args.Z); zz <= Math.Max((ushort)(FirstBlock.z), args.Z); ++zz)
             for (yy = Math.Min((ushort)(FirstBlock.y), args.Y); yy <= Math.Max((ushort)(FirstBlock.y), args.Y); ++yy) {
                 if (cpos.ignore == null || !cpos.ignore.Contains(sender.Level.GetBlock(xx, zz, yy))) {
                     count++;
                 }
             }
     sender.SendMessage(count + " blocks are between (" + FirstBlock.x + ", " + FirstBlock.z + ", " + FirstBlock.y + ") and (" + args.X + ", " + args.Z + ", " + args.Y + ")");
 }
开发者ID:ninedrafted,项目名称:MCForge-Vanilla,代码行数:18,代码来源:CmdMeasure.cs

示例10: plist

        private void plist(Player sender, ChatEventArgs eventargs) {
            sender.OnPlayerChat.Normal -= new ChatEvent.EventHandler(plist);
            if (eventargs.Message.ToLower() != "yes" || sender.ExtraData.GetIfExist<object, object>("LastCmd") != "mapinfo" && sender.ExtraData.GetIfExist("LastCmd") != "mi")
                return;

            eventargs.Cancel();
            Level l = (Level)sender.GetDatapass("mapinfoLevel");
            List<Player> templist = Server.Players.FindAll((p) => { return p.Level == l; });

            if (templist.Count == 0) {
                sender.SendMessage("No one is on " + l.Name + ".");
                return;
            }
            if (templist.Count == 1 && sender.Level == l) {
                sender.SendMessage("No one besides you is on " + l.Name + ".");
                return;
            }

            templist.ForEach((p) => {
                sender.SendMessage(String.Concat(p.Color, p.Username));
            });
        }
开发者ID:ninedrafted,项目名称:MCForge-Vanilla,代码行数:22,代码来源:CmdMapInfo.cs

示例11: CatchBlock2

        public void CatchBlock2(Player sender, BlockChangeEventArgs args)
        {
            CatchPos FirstBlock = (CatchPos)sender.GetDatapass("CmdReplaceNot_cpos");
            List<Pos> buffer = new List<Pos>();

            for (ushort xx = Math.Min((ushort)(FirstBlock.pos.x), args.X); xx <= Math.Max((ushort)(FirstBlock.pos.x), args.X); ++xx) {
                for (ushort zz = Math.Min((ushort)(FirstBlock.pos.z), args.Z); zz <= Math.Max((ushort)(FirstBlock.pos.z), args.Z); ++zz) {
                    for (ushort yy = Math.Min((ushort)(FirstBlock.pos.y), args.Y); yy <= Math.Max((ushort)(FirstBlock.pos.y), args.Y); ++yy) {
                        Vector3S loop = new Vector3S(xx, zz, yy);
                        if (sender.Level.GetBlock(loop) != FirstBlock.type) {
                            BufferAdd(buffer, loop);
                        }
                    }
                }
            }
            //Group Max Blocks permissions here
            sender.SendMessage(buffer.Count.ToString() + " blocks.");

            //Level Blockqueue .-.

            buffer.ForEach(delegate(Pos pos) {
                sender.Level.BlockChange((ushort)(pos.pos.x), (ushort)(pos.pos.z), (ushort)(pos.pos.y), FirstBlock.type2);
            });
        }
开发者ID:Maicke98,项目名称:MCForge-Vanilla,代码行数:24,代码来源:CmdReplaceNot.cs

示例12: BlockChange2

 void BlockChange2(Player sender, BlockChangeEventArgs args)
 {
     //string direction = null;
     sender.OnPlayerBlockChange.Normal -= BlockChange2;
     CatchPos cpos = (CatchPos)sender.GetDatapass(this.Name);
     foreach (Vector3S v in BlockString(cpos.message, cpos.pos, new Vector3S(args.X, args.Z, args.Y), sender.Level.CWMap.Size)) {
         BlockQueue.Addblock(sender, (ushort)v.x, (ushort)v.y, (ushort)v.z, args.Holding);
     }
     args.Cancel();
     return;
 }
开发者ID:headdetect,项目名称:MCForge6-Vanilla,代码行数:11,代码来源:CmdWrite.cs

示例13: add_Normal

 void add_Normal(Player sender, BlockChangeEventArgs args) {
     sender.OnPlayerBlockChange.Normal -= add_Normal;
     args.Cancel();
     string message = (string)sender.GetDatapass("MessageBlockMessage");
     add(sender.Level, args.X, args.Z, args.Y, message, sender);
 }
开发者ID:nullpic,项目名称:MCForge-Vanilla,代码行数:6,代码来源:PluginMessageBlock.cs

示例14: CatchBlock2

        public void CatchBlock2(Player sender, BlockChangeEventArgs args)
        {
            ushort x = args.X;
            ushort y = args.Y;
            ushort z = args.Z;
            byte NewType = args.Holding;
            bool placed = (args.Action == ActionType.Place);
            CatchPos FirstBlock = (CatchPos)sender.GetDatapass("CmdReplace_cpos"); ;
            unchecked {
                if (FirstBlock.type != (byte)-1) {
                    NewType = FirstBlock.type;
                }
            }
            List<Pos> buffer = new List<Pos>();

            for (ushort xx = Math.Min((ushort)(FirstBlock.pos.x), x); xx <= Math.Max((ushort)(FirstBlock.pos.x), x); ++xx) {
                for (ushort zz = Math.Min((ushort)(FirstBlock.pos.z), z); zz <= Math.Max((ushort)(FirstBlock.pos.z), z); ++zz) {
                    for (ushort yy = Math.Min((ushort)(FirstBlock.pos.y), y); yy <= Math.Max((ushort)(FirstBlock.pos.y), y); ++yy) {
                        Vector3S loop = new Vector3S(xx, zz, yy);
                        if (sender.Level.GetBlock(loop) == NewType) {
                            BufferAdd(buffer, loop);
                        }
                    }
                }
            }
            //Group Max Blocks permissions here
            sender.SendMessage(buffer.Count.ToString() + " blocks.");

            //Level Blockqueue .-.

            buffer.ForEach(delegate(Pos pos) {
                sender.Level.BlockChange((ushort)(pos.pos.x), (ushort)(pos.pos.z), (ushort)(pos.pos.y), FirstBlock.type2);
            });
        }
开发者ID:Maicke98,项目名称:MCForge-Vanilla,代码行数:34,代码来源:CmdReplace.cs

示例15: CatchBlock2

 public void CatchBlock2(Player p, BlockChangeEventArgs args)
 {
     p.OnPlayerBlockChange.Normal -= new Event<Player, BlockChangeEventArgs>.EventHandler(CatchBlock2);
     CatchPos cpos = (CatchPos)p.GetDatapass(this.Name);
     Cuboid(cpos, args.Holding, p, args.X, args.Y, args.Z);
     args.Cancel();
 }
开发者ID:Maicke98,项目名称:MCForge-Vanilla,代码行数:7,代码来源:CmdCuboid.cs


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