From f010bd3880da89ec3940dd737e4c06a8d6638628 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Thu, 21 Sep 2017 14:57:16 +1000 Subject: [PATCH] Kill off pointless /chain command, raise default perm of /summon to operator --- MCGalaxy/Commands/Fun/CmdTntWars.cs | 4 -- MCGalaxy/Commands/World/CmdSetspawn.cs | 6 +- MCGalaxy/Commands/other/CmdChain.cs | 96 -------------------------- MCGalaxy/Commands/other/CmdSummon.cs | 2 +- MCGalaxy/MCGalaxy_.csproj | 1 - 5 files changed, 4 insertions(+), 105 deletions(-) delete mode 100644 MCGalaxy/Commands/other/CmdChain.cs diff --git a/MCGalaxy/Commands/Fun/CmdTntWars.cs b/MCGalaxy/Commands/Fun/CmdTntWars.cs index 436b5a06d..38adf4e44 100644 --- a/MCGalaxy/Commands/Fun/CmdTntWars.cs +++ b/MCGalaxy/Commands/Fun/CmdTntWars.cs @@ -60,14 +60,10 @@ namespace MCGalaxy.Commands.Fun { DoScores(p, text); return; case "players": case "player": - case "ps": - case "pl": case "p": DoPlayers(p, text); break; case "health": - case "heal": case "hp": - case "hlth": DoHealth(p, text); break; case "setup": case "s": diff --git a/MCGalaxy/Commands/World/CmdSetspawn.cs b/MCGalaxy/Commands/World/CmdSetspawn.cs index 16a14e277..a0ea7a422 100644 --- a/MCGalaxy/Commands/World/CmdSetspawn.cs +++ b/MCGalaxy/Commands/World/CmdSetspawn.cs @@ -24,10 +24,10 @@ namespace MCGalaxy.Commands.World { public override bool SuperUseable { get { return false; } } public override void Use(Player p, string message) { - if (message.Length > 0) { Help(p); return; } + if (message.Length > 0) { Help(p); return; } if (!LevelInfo.ValidateAction(p, p.level.name, "set spawn of this level")) return; - Player.Message(p, "Spawn location set to your current position."); + Player.Message(p, "Spawn location set to your current location."); p.level.spawnx = (ushort)p.Pos.BlockX; p.level.spawny = (ushort)p.Pos.BlockY; p.level.spawnz = (ushort)p.Pos.BlockZ; @@ -39,7 +39,7 @@ namespace MCGalaxy.Commands.World { public override void Help(Player p) { Player.Message(p, "%T/SetSpawn"); - Player.Message(p, "%HSets the default spawn location of the map you are currently located in."); + Player.Message(p, "%HSets the spawn location of the map to your current location."); } } } diff --git a/MCGalaxy/Commands/other/CmdChain.cs b/MCGalaxy/Commands/other/CmdChain.cs deleted file mode 100644 index a0b99c3b4..000000000 --- a/MCGalaxy/Commands/other/CmdChain.cs +++ /dev/null @@ -1,96 +0,0 @@ -/* - Copyright 2011 MCForge - - Dual-licensed under the Educational Community License, Version 2.0 and - the GNU General Public License, Version 3 (the "Licenses"); you may - not use this file except in compliance with the Licenses. You may - obtain a copy of the Licenses at - - http://www.opensource.org/licenses/ecl2.php - http://www.gnu.org/licenses/gpl-3.0.html - - Unless required by applicable law or agreed to in writing, - software distributed under the Licenses are distributed on an "AS IS" - BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - or implied. See the Licenses for the specific language governing - permissions and limitations under the Licenses. - */ -using System; -using System.Threading; -using MCGalaxy.Maths; - -namespace MCGalaxy.Commands.Misc { - public sealed class CmdChain : Command { - public override string name { get { return "Chain"; } } - public override string type { get { return CommandTypes.Other; } } - public override bool museumUsable { get { return false; } } - public override LevelPermission defaultRank { get { return LevelPermission.Operator; } } - public override bool SuperUseable { get { return false; } } - - public override void Use(Player p, string message) { - if (!p.level.BuildAccess.CheckDetailed(p)) return; - - Level lvl = p.level; - int x = p.Pos.BlockX, y = p.Pos.BlockY, z = p.Pos.BlockZ; - if (x < 0 || z < 0 || x >= lvl.Width || z >= lvl.Length) { - Player.Message(p, "You must be inside the map to use this command."); return; - } - - int dirX = 0, dirZ = 0; - DirUtils.EightYaw(p.Rot.RotY, out dirX, out dirZ); - DoChain(p, (ushort)x, (ushort)y, (ushort)z, dirX, dirZ); - } - - void DoChain(Player p, ushort x, ushort y, ushort z, int dirX, int dirZ) { - Vec3U16 cur, next, target; - cur.X = next.X = target.X = x; - cur.Y = next.Y = target.Y = y; - cur.Z = next.Z = target.Z = z; - target.X = (ushort)(target.X + dirX); - target.Z = (ushort)(target.Z + dirZ); - - for (int i = 0; ; i++) { - cur.X = (ushort)(x + i * dirX); - cur.Z = (ushort)(z + i * dirZ); - next.X = (ushort)(cur.X + dirX); - next.Z = (ushort)(cur.Z + dirZ); - - if (next.X >= p.level.Width || next.Z >= p.level.Length) { - if (i == 0) return; - PullBack(p, cur, target, dirX, dirZ); - p.level.Blockchange(p, x, y, z, ExtBlock.Air); return; - } - - Thread.Sleep(250); - p.level.Blockchange(p, cur.X, cur.Y, cur.Z, (ExtBlock)Block.Mushroom); - if (!p.level.IsAirAt(next.X, next.Y, next.Z)) { - PullBack(p, next, target, dirX, dirZ); - p.level.Blockchange(p, x, y, z, ExtBlock.Air); return; - } - } - } - - void PullBack(Player p, Vec3U16 cur, Vec3U16 target, int dirX, int dirZ) { - ExtBlock block = p.level.GetBlock(cur.X, cur.Y, cur.Z); - p.level.Blockchange(p, cur.X, cur.Y, cur.Z, block); - - while (cur.X != target.X || cur.Z != target.Z) { - ExtBlock curBlock = p.level.GetBlock(cur.X, cur.Y, cur.Z); - if (curBlock == block) p.level.Blockchange(p, cur.X, cur.Y, cur.Z, ExtBlock.Air); - - cur.X = (ushort)(cur.X - dirX); cur.Z = (ushort)(cur.Z - dirZ); - if (cur.X >= p.level.Width || cur.Z >= p.level.Length) return; - - curBlock = p.level.GetBlock(cur.X, cur.Y, cur.Z); - if (curBlock.BlockID == Block.Mushroom) - p.level.Blockchange(p, cur.X, cur.Y, cur.Z, block); - Thread.Sleep(250); - } - } - - public override void Help(Player p) { - Player.Message(p, "%T/Chain"); - Player.Message(p, "%HShoots a chain of brown mushrooms and grabs a block and brings it back to the start."); - } - } -} \ No newline at end of file diff --git a/MCGalaxy/Commands/other/CmdSummon.cs b/MCGalaxy/Commands/other/CmdSummon.cs index 7a6d9942f..2f79456b8 100644 --- a/MCGalaxy/Commands/other/CmdSummon.cs +++ b/MCGalaxy/Commands/other/CmdSummon.cs @@ -24,7 +24,7 @@ namespace MCGalaxy.Commands.Misc { public override string shortcut { get { return "s"; } } public override string type { get { return CommandTypes.Other; } } public override bool museumUsable { get { return false; } } - public override LevelPermission defaultRank { get { return LevelPermission.AdvBuilder; } } + public override LevelPermission defaultRank { get { return LevelPermission.Operator; } } public override bool SuperUseable { get { return false; } } public override CommandAlias[] Aliases { get { return new[] { new CommandAlias("Fetch"), new CommandAlias("Bring"), new CommandAlias("BringAll", "all") }; } diff --git a/MCGalaxy/MCGalaxy_.csproj b/MCGalaxy/MCGalaxy_.csproj index 98ae665ce..d55e6dd59 100644 --- a/MCGalaxy/MCGalaxy_.csproj +++ b/MCGalaxy/MCGalaxy_.csproj @@ -332,7 +332,6 @@ -