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!");
 }
Пример #2
0
 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;
 }
Пример #3
0
 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);
 }
Пример #4
0
 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);
 }
Пример #5
0
 //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);
 }
Пример #6
0
 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);
 }
Пример #7
0
 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;
 }
Пример #8
0
 //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);
 }
Пример #9
0
 //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 + ")");
 }
Пример #10
0
        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));
            });
        }
Пример #11
0
        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);
            });
        }
Пример #12
0
 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;
 }
Пример #13
0
 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);
 }
Пример #14
0
        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);
            });
        }
Пример #15
0
 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();
 }
Пример #16
0
 public void CatchBlock2(Player p, BlockChangeEventArgs args)
 {
     p.OnPlayerBlockChange.Normal -= new Event<Player, BlockChangeEventArgs>.EventHandler(CatchBlock2);
     CatchPos cpos = (CatchPos)p.GetDatapass(this.Name);
     cpos.secondPos = new Vector3S(args.X, args.Z, args.Y);
     cpos.block = args.Holding;
     args.Cancel();
     Cuboid(cpos, p);
 }
Пример #17
0
 void SecondChange(Player p, BlockChangeEventArgs args)
 {
     try
     {
         p.OnPlayerBlockChange.Normal -= SecondChange;
         CatchPos cpos = (CatchPos)(p.GetDatapass(this.Name));
         for (int i = cpos.pos.x; i <= args.X; i++) { p.Level.BlockChange((ushort)(i), args.Z, args.Y, Block.BlockList.RED_CLOTH); }
         //args.Cancel();
     }
     catch { p.SendMessage("MEEP!"); }
 }