示例#1
0
 public override void PlayerUse(Player p, string[] parameters, string fullCommand)
 {
     if (parameters.Length == 0)
     {
         PlayerHelp(p);
         return;
     }
     Level level = Level.Find(parameters[0]);
     if (level == null) p.SendMessage("Not found!");
     else
     p.SwitchMap(level);
 }
示例#2
0
 public override void PlayerUse(Player p, string[] parameters, string fullCommand)
 {
     p._enableWaterMode = !p._enableWaterMode;
     p.SendMessage("Water mode is now: " + p._enableWaterMode);
 }
示例#3
0
        public override void PlayerUse(Player p, string[] parameters, string fullCommand)
        {
            if (parameters.Length == 0)
            {
                PlayerHelp(p);
                return;
            }

            if (parameters[0].Equals("create", StringComparison.OrdinalIgnoreCase) || parameters[0].Equals("new", StringComparison.OrdinalIgnoreCase))
            {
                if (parameters.Length == 2)
                {
                    Level lfind = Level.Find(parameters[1]);
                    if (lfind != null)
                    {
                        //Called when a player types /level create <name> or /level new <name> and the name is already used for another level
                        p.SendMessage("Level Already Exists!");
                    }
                    else
                    {
                        //Called when a player types /level create <name> or /level new <name> and the name isn't already a level
                        Level level = new Level(parameters[1], 256, 256, 256);
                    }
                }
                else if (parameters.Length == 3)
                {
                    //Called when a player types /level create <name> <type> or /level new <name> <type>
                    if (parameters[2].Equals("flatgrass", StringComparison.OrdinalIgnoreCase))
                    {
                        Level level = new Level(parameters[1], 256, 256, 256, parameters[2]);
                    }
                    else if (parameters[2].Equals("pixel", StringComparison.OrdinalIgnoreCase))
                    {
                        Level level = new Level(parameters[1], 256, 256, 256, parameters[2]);
                    }
                    else
                    {
                        //Called when a player types /level create <name> <type> or /level new <name> <type> and the type is invalid.
                        p.SendMessage("Invalid world type! Valid types are flatgrass and pixel.");
                    }
                }
                else
                {
                    //This is called when the player types /level create or /level new
                    Level level = new Level("temporary", 256, 256, 256);
                }
            }
            if (parameters[0].Equals("load", StringComparison.OrdinalIgnoreCase))
            {
                //This is called when the player types /level load
                if (parameters.Length < 2) { PlayerHelp(p); return; }
                Level level = Level.Find(parameters[1]);
                if (level != null) p.SendMessage("Level Already Loaded! found!");
                else
                {
                    new Level(parameters[1], false);
                }
            }
            if (parameters[0].Equals("unload", StringComparison.OrdinalIgnoreCase))
            {
                //This is called when the player types /level unload
                if (parameters.Length < 2) { PlayerHelp(p); return; }
                Level level = Level.Find(parameters[1]);
                if (level == null) p.SendMessage("Level not found!");
                else
                {
                    level.Unload();
                }
            }
        }
示例#4
0
 public override void PlayerHelp(Player p)
 {
     p.SendMessage("Invalid command usages!");
 }
示例#5
0
 public override void PlayerUse(Player p, string[] parameters, string fullCommand)
 {
     p.EnableHistoryMode = !p.EnableHistoryMode;
     p.SendMessage("History mode is now: " + p.EnableHistoryMode);
 }
示例#6
0
 public override void PlayerUse(Player p, string[] parameters, string fullCommand)
 {
     p.Level.FullSave();
 }
示例#7
0
 internal bool PlayerBlockChange(Player changer, ushort x, ushort y, ushort z, byte type)
 {
     if (BlockChange(x, y, z, type))
     {
         try
         {
             Server.HistoryController.SetData(Name, PosToInt(x, y, z), type, changer.UID);
         }
         catch (Exception e)
         {
             Console.WriteLine(e.Message);
             Console.WriteLine(e.StackTrace);
         }
         return true;
     }
     return false;
 }
示例#8
0
 public virtual void OnPlace(Player p, Level level, int pos)
 {
 }
示例#9
0
 public virtual void OnBreak(Player p, Level level, int pos)
 {
 }