From 7b50b25c8a17d6ac8470f65af0a20a4a30162056 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Tue, 2 Aug 2016 18:58:17 +1000 Subject: [PATCH] Now /voice no longer shows + before their name in chat. --- Chat/Chat.cs | 12 ++++++------ Commands/Fun/CmdFlipHeads.cs | 6 ++---- Commands/Information/CmdHasirc.cs | 3 +-- Commands/Moderation/CmdVoice.cs | 1 - Commands/other/CmdBack.cs | 6 ++---- Commands/other/CmdMove.cs | 4 ++-- Commands/other/CmdReport.cs | 5 ++--- Commands/other/CmdRide.cs | 1 + Commands/other/CmdSummon.cs | 1 + Player/Player.Handlers.cs | 3 ++- Player/Player.cs | 4 ++-- 11 files changed, 21 insertions(+), 25 deletions(-) diff --git a/Chat/Chat.cs b/Chat/Chat.cs index 4add312f8..10fe90a03 100644 --- a/Chat/Chat.cs +++ b/Chat/Chat.cs @@ -25,7 +25,7 @@ namespace MCGalaxy { public static void GlobalChatLevel(Player from, string message, bool showname) { if (showname) - message = "" + from.color + from.voicestring + from.color + from.prefix + from.name + ": &f" + message; + message = "" + from.FullName + ": &f" + message; Player[] players = PlayerInfo.Online.Items; foreach (Player p in players) { if (p.level == from.level && p.Chatroom == null) @@ -40,9 +40,9 @@ namespace MCGalaxy { public static void GlobalChatRoom(Player from, string message, bool showname) { string rawMessage = message; - if ( showname ) { - message = " " + from.color + from.voicestring + from.color + from.prefix + from.name + ": &f" + message; - } + if (showname) + message = " " + from.FullName + ": &f" + message; + Player[] players = PlayerInfo.Online.Items; foreach (Player p in players) { if (p.Chatroom != null) @@ -53,9 +53,9 @@ namespace MCGalaxy { public static void ChatRoom(Player from, string message, bool showname, string chatroom) { string rawMessage = message; - string messageforspy = ( " " + from.color + from.voicestring + from.color + from.prefix + from.name + ": &f" + message ); + string messageforspy = " " + from.FullName + ": &f" + message; if (showname) - message = " " + from.color + from.voicestring + from.color + from.prefix + from.name + ": &f" + message; + message = " " + from.FullName + ": &f" + message; Player[] players = PlayerInfo.Online.Items; foreach (Player p in players) { diff --git a/Commands/Fun/CmdFlipHeads.cs b/Commands/Fun/CmdFlipHeads.cs index 067751659..abf2f4aaa 100644 --- a/Commands/Fun/CmdFlipHeads.cs +++ b/Commands/Fun/CmdFlipHeads.cs @@ -15,10 +15,8 @@ or implied. See the Licenses for the specific language governing permissions and limitations under the Licenses. */ -namespace MCGalaxy.Commands { - - public sealed class CmdFlipHeads : Command { - +namespace MCGalaxy.Commands { + public sealed class CmdFlipHeads : Command { public override string name { get { return "flipheads"; } } public override string shortcut { get { return ""; } } public override string type { get { return CommandTypes.Other; } } diff --git a/Commands/Information/CmdHasirc.cs b/Commands/Information/CmdHasirc.cs index 38a88ea24..19f8e1895 100644 --- a/Commands/Information/CmdHasirc.cs +++ b/Commands/Information/CmdHasirc.cs @@ -15,8 +15,7 @@ or implied. See the Licenses for the specific language governing permissions and limitations under the Licenses. */ -namespace MCGalaxy.Commands { - +namespace MCGalaxy.Commands { public sealed class CmdHasirc : Command { public override string name { get { return "hasirc"; } } public override string shortcut { get { return "irc"; } } diff --git a/Commands/Moderation/CmdVoice.cs b/Commands/Moderation/CmdVoice.cs index 69ddaf2de..334db5197 100644 --- a/Commands/Moderation/CmdVoice.cs +++ b/Commands/Moderation/CmdVoice.cs @@ -40,7 +40,6 @@ namespace MCGalaxy.Commands { who.SendMessage("You have received voice status."); } who.voice = !who.voice; - who.voicestring = who.voice ? "&f+" : ""; } public override void Help(Player p) { diff --git a/Commands/other/CmdBack.cs b/Commands/other/CmdBack.cs index f812331d7..c941f2f21 100644 --- a/Commands/other/CmdBack.cs +++ b/Commands/other/CmdBack.cs @@ -15,10 +15,8 @@ or implied. See the Licenses for the specific language governing permissions and limitations under the Licenses. */ -namespace MCGalaxy.Commands -{ - public sealed class CmdBack : Command - { +namespace MCGalaxy.Commands { + public sealed class CmdBack : Command { public override string name { get { return "back"; } } public override string shortcut { get { return ""; } } public override string type { get { return CommandTypes.Other; } } diff --git a/Commands/other/CmdMove.cs b/Commands/other/CmdMove.cs index 4c5fd5988..22c1284d4 100644 --- a/Commands/other/CmdMove.cs +++ b/Commands/other/CmdMove.cs @@ -16,6 +16,7 @@ permissions and limitations under the Licenses. */ using System; + namespace MCGalaxy.Commands { public sealed class CmdMove : Command { public override string name { get { return "move"; } } @@ -25,8 +26,7 @@ namespace MCGalaxy.Commands { public override LevelPermission defaultRank { get { return LevelPermission.Banned; } } public CmdMove() { } - public override void Use(Player p, string message) - { + public override void Use(Player p, string message) { // /move name map // /move x y z // /move name x y z diff --git a/Commands/other/CmdReport.cs b/Commands/other/CmdReport.cs index e5e4687dc..97ee4ce17 100644 --- a/Commands/other/CmdReport.cs +++ b/Commands/other/CmdReport.cs @@ -19,10 +19,9 @@ */ using System; using System.IO; + namespace MCGalaxy.Commands { - - public sealed class CmdReport : Command { - + public sealed class CmdReport : Command { public override string name { get { return "report"; } } public override string shortcut { get { return ""; } } public override string type { get { return CommandTypes.Moderation; } } diff --git a/Commands/other/CmdRide.cs b/Commands/other/CmdRide.cs index cb3c5096b..ddb8b4b5d 100644 --- a/Commands/other/CmdRide.cs +++ b/Commands/other/CmdRide.cs @@ -16,6 +16,7 @@ permissions and limitations under the Licenses. */ using System.Threading; + namespace MCGalaxy.Commands { public sealed class CmdRide : Command { public override string name { get { return "ride"; } } diff --git a/Commands/other/CmdSummon.cs b/Commands/other/CmdSummon.cs index bb53b5eac..195a4dfd2 100644 --- a/Commands/other/CmdSummon.cs +++ b/Commands/other/CmdSummon.cs @@ -17,6 +17,7 @@ */ using System; using System.Threading; + namespace MCGalaxy.Commands { public sealed class CmdSummon : Command { public override string name { get { return "summon"; } } diff --git a/Player/Player.Handlers.cs b/Player/Player.Handlers.cs index 2d130d632..6b62ccea8 100644 --- a/Player/Player.Handlers.cs +++ b/Player/Player.Handlers.cs @@ -811,7 +811,8 @@ return; onTrain = false; trainGrab = false; ushort x = (ushort)(pos[0] / 32), y = (ushort)(pos[1] / 32), z = (ushort)(pos[2] / 32); string deathMsg = Block.Props[b].DeathMessage; - if (deathMsg != null) Chat.GlobalChatLevel(this, String.Format(deathMsg, ColoredName), false); + if (deathMsg != null) Chat.GlobalChatLevel(this, String.Format(deathMsg, ColoredName), false); + if (b == Block.rockethead) level.MakeExplosion(x, y, z, 0); if (b == Block.creeper) level.MakeExplosion(x, y, z, 1); if (b == Block.rock || b == Block.stone) { diff --git a/Player/Player.cs b/Player/Player.cs index ffea9987f..d36b6db11 100644 --- a/Player/Player.cs +++ b/Player/Player.cs @@ -157,11 +157,11 @@ namespace MCGalaxy { string msg_NT = message, msg_NN = message, msg_NNNT = message; if (showname) { string msg = ": &f" + message; - string pre = from.voicestring + from.color + from.prefix; + string pre = from.color + from.prefix; message = pre + from.DisplayName + msg; // Titles + Nickname msg_NN = pre + from.truename + msg; // Titles + Account name - pre = from.voicestring + (from.group.prefix == "" ? "" : "&f" + from.group.prefix); + pre = from.group.prefix == "" ? "" : "&f" + from.group.prefix; msg_NT = pre + from.color + from.DisplayName + msg; // Nickname msg_NNNT = pre + from.color + from.truename + msg; // Account name }