diff --git a/MCGalaxy/Chat/Colors.cs b/MCGalaxy/Chat/Colors.cs index e9d4465d5..9c9a341f3 100644 --- a/MCGalaxy/Chat/Colors.cs +++ b/MCGalaxy/Chat/Colors.cs @@ -220,9 +220,8 @@ namespace MCGalaxy { len -= 4; i += 4; // And then with "s://" or "://" ? - if (len >= 4 && chars[i] == 's' && chars[i + 1] == ':' && chars[i + 2] == '/' && chars[i + 3] == '/') return true; - if (len >= 3 && chars[i] == ':' && chars[i + 1] == '/' && chars[i + 2] == '/') return true; - return false; + if (chars[i] == 's') { len--; i++; } + return len >= 3 && chars[i] == ':' && chars[i + 1] == '/' && chars[i + 2] == '/'; } static void Escape(char[] chars, int start, int end) { diff --git a/MCGalaxy/Commands/World/CmdMuseum.cs b/MCGalaxy/Commands/World/CmdMuseum.cs index 8eb85cc8b..dd4977f64 100644 --- a/MCGalaxy/Commands/World/CmdMuseum.cs +++ b/MCGalaxy/Commands/World/CmdMuseum.cs @@ -71,8 +71,8 @@ namespace MCGalaxy.Commands.World { } public override void Help(Player p) { - p.Message("%T/Museum [map] [restore]"); - p.Message("%HAllows you to access a restore of the map entered. Works on unloaded maps"); + p.Message("%T/Museum [map] [backup]"); + p.Message("%HTeleports you to a backup of the given map."); } } } diff --git a/MCGalaxy/Commands/building/CmdSphere.cs b/MCGalaxy/Commands/building/CmdSphere.cs index a22ce4fcd..c5ac15680 100644 --- a/MCGalaxy/Commands/building/CmdSphere.cs +++ b/MCGalaxy/Commands/building/CmdSphere.cs @@ -84,7 +84,7 @@ namespace MCGalaxy.Commands.Building { } public override void Help(Player p) { - p.Message("%T/Sphere "); + p.Message("%T/Sphere "); p.Message("%HCreates a sphere, with first point as centre, and second for radius"); p.Message("%T/Sphere [mode] "); p.Message("%HModes: &fsolid/hollow/circle/hollowcircle"); diff --git a/MCGalaxy/Generator/MapGen.cs b/MCGalaxy/Generator/MapGen.cs index 761459702..d3fb712e3 100644 --- a/MCGalaxy/Generator/MapGen.cs +++ b/MCGalaxy/Generator/MapGen.cs @@ -45,20 +45,16 @@ namespace MCGalaxy.Generator { return simpleGens.ContainsKey(s.ToLower()); } - /// Outputs list of all map generator themes to the given player. public static void PrintThemes(Player p) { p.Message("Simple themes: " + simpleGens.Keys.Join(", ")); p.Message("Advanced themes: " + advGens.Keys.Join(", ")); } - /// Retrieves the list of theme names of simple map generators. public static IEnumerable SimpleThemeNames { get { return simpleGens.Keys; } } - /// Retrieves the list of theme names of advanced map generators. public static IEnumerable AdvancedThemeNames { get { return advGens.Keys; } } - /// Returns whether the given axis length is acceptable for map generation. public static bool OkayAxis(int len) { return len >= 16 && len <= 8192 && (len % 16) == 0; } diff --git a/MCGalaxy/Levels/AccessController.cs b/MCGalaxy/Levels/AccessController.cs index a25d13bbf..696d39c5b 100644 --- a/MCGalaxy/Levels/AccessController.cs +++ b/MCGalaxy/Levels/AccessController.cs @@ -47,7 +47,7 @@ namespace MCGalaxy { if (Whitelisted.CaselessContains(name)) return AccessResult.Whitelisted; if (rank < Min) return AccessResult.BelowMinRank; - if (rank > Max && MaxCmd != null && CommandExtraPerms.Find(MaxCmd, 1).UsableBy(rank)) { + if (rank > Max && MaxCmd != null && !CommandExtraPerms.Find(MaxCmd, 1).UsableBy(rank)) { return AccessResult.AboveMaxRank; } return AccessResult.Allowed; diff --git a/MCGalaxy/Levels/IO/MapFormats.cs b/MCGalaxy/Levels/IO/MapFormats.cs index 1708bccda..2f627df76 100644 --- a/MCGalaxy/Levels/IO/MapFormats.cs +++ b/MCGalaxy/Levels/IO/MapFormats.cs @@ -25,27 +25,20 @@ namespace MCGalaxy.Levels.IO { /// Reads/Loads block data (and potentially metadata) encoded in a particular format. public abstract class IMapImporter { - /// The file extension of this format. public abstract string Extension { get; } - /// Reads the data for a level from a file containing data encoded in this format. - /// Whether metadata should be loaded. public Level Read(string path, string name, bool metadata) { using (FileStream fs = File.OpenRead(path)) return Read(fs, name, metadata); } - /// Reads the data for a level from a file containing data encoded in this format. - /// Whether metadata should be loaded. public abstract Level Read(Stream src, string name, bool metadata); - /// Reads the dimensions for a level from a file containing data encoded in this format. public Vec3U16 ReadDimensions(string path) { using (FileStream fs = File.OpenRead(path)) return ReadDimensions(fs); } - /// Reads the dimensions for a level from a file containing data encoded in this format. public abstract Vec3U16 ReadDimensions(Stream src); public static List Formats = new List() { @@ -70,17 +63,14 @@ namespace MCGalaxy.Levels.IO { /// Writes/Saves block data (and potentially metadata) encoded in a particular format. public abstract class IMapExporter { - /// The file extension of this format. public abstract string Extension { get; } - /// Saves the data encoded in this format for a level to a file. public void Write(string path, Level lvl) { using (FileStream fs = File.Create(path)) { Write(fs, lvl); } } - /// Saves the data encoded in this format for a level to a file. public abstract void Write(Stream dst, Level lvl); public static List Formats = new List() { diff --git a/MCGalaxy/Player/Warp.cs b/MCGalaxy/Player/Warp.cs index a4d3ff44d..1f151f23b 100644 --- a/MCGalaxy/Player/Warp.cs +++ b/MCGalaxy/Player/Warp.cs @@ -35,7 +35,6 @@ namespace MCGalaxy { public List Items = new List(); public string Filename; - /// Finds the warp whose name caselessly equals the given name. public Warp Find(string name) { foreach (Warp wp in Items) { if (wp.Name.CaselessEq(name)) return wp; @@ -43,38 +42,31 @@ namespace MCGalaxy { return null; } - /// Returns whether a warp with the given name exists. public bool Exists(string name) { return Find(name) != null; } - /// Creates a new warp with the given name, located at the - /// player's current position, orientation, and level. public void Create(string name, Player p) { Warp warp = new Warp(); - InitWarp(warp, name, p); + Make(warp, name, p); Items.Add(warp); Save(); } - void InitWarp(Warp warp, string name, Player p) { + void Make(Warp warp, string name, Player p) { warp.Pos = p.Pos; warp.Name = name; warp.Yaw = p.Rot.RotY; warp.Pitch = p.Rot.HeadX; warp.Level = p.level.name; } - /// Moves the given warp to the target - /// player's position, orientation, and map. public void Update(Warp warp, Player p) { - InitWarp(warp, warp.Name, p); + Make(warp, warp.Name, p); Save(); } - /// Removes the given warp. public void Remove(Warp warp, Player p) { Items.Remove(warp); Save(); } - /// Attempts to move the given player to the given warp. public void Goto(Warp warp, Player p) { if (!p.level.name.CaselessEq(warp.Level)) { PlayerActions.ChangeMap(p, warp.Level); @@ -89,7 +81,6 @@ namespace MCGalaxy { } - /// Loads the list of warps from the file located at Filename. public void Load() { if (!File.Exists(Filename)) return; using (StreamReader r = new StreamReader(Filename)) { @@ -116,7 +107,6 @@ namespace MCGalaxy { } } - /// Saves this list of warps to Filename. public void Save() { using (StreamWriter w = new StreamWriter(Filename)) { foreach (Warp warp in Items) {