From 565e4282565bad59cb229179de9c0a6799534865 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Wed, 28 Jun 2017 22:15:00 +1000 Subject: [PATCH] Better help for mute/freeze, add a ConfigByte attribute. --- MCGalaxy/Commands/Moderation/CmdFreeze.cs | 2 +- MCGalaxy/Commands/Moderation/CmdMute.cs | 2 +- MCGalaxy/Commands/World/CmdCopyLVL.cs | 2 +- MCGalaxy/Config/OtherAttributes.cs | 2 +- MCGalaxy/Levels/AccessController.cs | 4 ++-- MCGalaxy/Levels/LevelConfig.cs | 12 ++++++------ MCGalaxy/Levels/LevelEnv.cs | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/MCGalaxy/Commands/Moderation/CmdFreeze.cs b/MCGalaxy/Commands/Moderation/CmdFreeze.cs index aa3a7ae2f..f4fbb58b0 100644 --- a/MCGalaxy/Commands/Moderation/CmdFreeze.cs +++ b/MCGalaxy/Commands/Moderation/CmdFreeze.cs @@ -58,7 +58,7 @@ namespace MCGalaxy.Commands.Moderation { public override void Help(Player p) { Player.Message(p, "%T/freeze [name] [timespan] "); - Player.Message(p, "%HStops [name] from moving for [timespan] time, or until manually unfrozen."); + Player.Message(p, "%HPrevents [name] from moving for [timespan], or until manually unfrozen."); Player.Message(p, "%HFor , @number can be used as a shortcut for that rule."); } } diff --git a/MCGalaxy/Commands/Moderation/CmdMute.cs b/MCGalaxy/Commands/Moderation/CmdMute.cs index 2830170b9..4bb2162e4 100644 --- a/MCGalaxy/Commands/Moderation/CmdMute.cs +++ b/MCGalaxy/Commands/Moderation/CmdMute.cs @@ -66,7 +66,7 @@ namespace MCGalaxy.Commands.Moderation { public override void Help(Player p) { Player.Message(p, "%T/mute [player] [timespan] "); - Player.Message(p, "%HMutes or unmutes that player."); + Player.Message(p, "%HMutes player for [timespan], or unmutes that player."); Player.Message(p, "%HFor , @number can be used as a shortcut for that rule."); } } diff --git a/MCGalaxy/Commands/World/CmdCopyLVL.cs b/MCGalaxy/Commands/World/CmdCopyLVL.cs index adc4cbd3e..e9975f016 100644 --- a/MCGalaxy/Commands/World/CmdCopyLVL.cs +++ b/MCGalaxy/Commands/World/CmdCopyLVL.cs @@ -45,7 +45,7 @@ namespace MCGalaxy.Commands.World { if (src == null) return; if (!Formatter.ValidName(p, dst, "level")) return; if (LevelInfo.MapExists(dst)) { Player.Message(p, "The level \"" + dst + "\" already exists."); return; } - + try { LevelActions.CopyLevel(src, dst); } catch (System.IO.IOException) { diff --git a/MCGalaxy/Config/OtherAttributes.cs b/MCGalaxy/Config/OtherAttributes.cs index be0426d9b..5b8671b8a 100644 --- a/MCGalaxy/Config/OtherAttributes.cs +++ b/MCGalaxy/Config/OtherAttributes.cs @@ -19,7 +19,7 @@ using System; namespace MCGalaxy.Config { - public sealed class ConfigIntAttribute : ConfigAttribute { + public class ConfigIntAttribute : ConfigAttribute { /// Minimum integer allowed for a value. public int MinValue; diff --git a/MCGalaxy/Levels/AccessController.cs b/MCGalaxy/Levels/AccessController.cs index 21ef35f69..426e0a5e4 100644 --- a/MCGalaxy/Levels/AccessController.cs +++ b/MCGalaxy/Levels/AccessController.cs @@ -242,7 +242,7 @@ namespace MCGalaxy { Logger.Log(LogType.UserActivity, "{0} rank changed to {1} on {2}.", type, grp.trueName, lvl.name); Chat.MessageLevel(lvl, type + " rank changed to " + grp.ColoredName + "%S."); if (p != null && p.level != lvl) - Player.Message(p, "{0} rank changed to {1} %Son {2}%S.", type, grp.ColoredName, lvl.ColoredName); + Player.Message(p, "{0} rank changed to {1} %Son {2}%S.", type, grp.ColoredName, ColoredName); } /// Messages all player on the level (and source player) notifying them that the @@ -261,7 +261,7 @@ namespace MCGalaxy { Logger.Log(LogType.UserActivity, "{0} on {1}", msg, lvl.name); Chat.MessageLevel(lvl, msg); if (p != null && p.level != lvl) - Player.Message(p, "{0} on %S{1}", msg, lvl.ColoredName); + Player.Message(p, "{0} on %S{1}", msg, ColoredName); } diff --git a/MCGalaxy/Levels/LevelConfig.cs b/MCGalaxy/Levels/LevelConfig.cs index 4a72770cd..3be54f7fa 100644 --- a/MCGalaxy/Levels/LevelConfig.cs +++ b/MCGalaxy/Levels/LevelConfig.cs @@ -50,8 +50,8 @@ namespace MCGalaxy { public int JailZ; // Environment settings - [ConfigInt("Weather", "Env", null, 0, 0, 2)] - public int Weather; + [ConfigByte("Weather", "Env", null, 0, 0, 2)] + public byte Weather; [ConfigString("Texture", "Env", null, "", true, null, NetUtils.StringSize)] public string Terrain = ""; [ConfigString("TexturePack", "Env", null, "", true, null, NetUtils.StringSize)] @@ -95,11 +95,11 @@ namespace MCGalaxy { [ConfigInt("weather-fade", "Env", null, 128, short.MinValue, short.MaxValue)] public int WeatherFade = 128; /// The block which will be displayed on the horizon. - [ConfigInt("HorizonBlock", "Env", null, Block.water, 0, 255)] - public int HorizonBlock = Block.water; + [ConfigByte("HorizonBlock", "Env", null, Block.water)] + public byte HorizonBlock = Block.water; /// The block which will be displayed on the edge of the map. - [ConfigInt("EdgeBlock", "Env", null, Block.blackrock, 0, 255)] - public int EdgeBlock = Block.blackrock; + [ConfigByte("EdgeBlock", "Env", null, Block.blackrock)] + public byte EdgeBlock = Block.blackrock; /// Whether exponential fog mode is used client-side. [ConfigBool("ExpFog", "Env", null, false)] public bool ExpFog; diff --git a/MCGalaxy/Levels/LevelEnv.cs b/MCGalaxy/Levels/LevelEnv.cs index 9d9bb3cb9..22597148d 100644 --- a/MCGalaxy/Levels/LevelEnv.cs +++ b/MCGalaxy/Levels/LevelEnv.cs @@ -52,7 +52,7 @@ namespace MCGalaxy { } public static void SetBlock(Player p, string value, EnvProp prop, - string variable, byte defValue, ref int target) { + string variable, byte defValue, ref byte target) { if (IsResetString(value)) { Player.Message(p, "Reset {0} for {1} %Sto normal", variable, p.level.ColoredName); target = defValue; @@ -113,7 +113,7 @@ namespace MCGalaxy { } - static bool CheckBlock(Player p, string value, string variable, ref int modify) { + static bool CheckBlock(Player p, string value, string variable, ref byte modify) { ExtBlock block; if (!CommandParser.GetBlock(p, value, out block)) return false;