From fa817a7c8b944381b75b90fac7df0834358b3d24 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Wed, 30 Nov 2016 17:58:56 +1100 Subject: [PATCH] Also restrict with /skin bot and /model bot --- MCGalaxy/Commands/CPE/CmdModel.cs | 7 ++++++- MCGalaxy/Commands/CPE/CmdSkin.cs | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/MCGalaxy/Commands/CPE/CmdModel.cs b/MCGalaxy/Commands/CPE/CmdModel.cs index 67dba4027..ec65fdc0e 100644 --- a/MCGalaxy/Commands/CPE/CmdModel.cs +++ b/MCGalaxy/Commands/CPE/CmdModel.cs @@ -18,7 +18,7 @@ using System; using MCGalaxy.Bots; -namespace MCGalaxy.Commands.CPE { +namespace MCGalaxy.Commands.CPE { public class CmdModel : EntityPropertyCmd { public override string name { get { return "model"; } } public override string shortcut { get { return "setmodel"; } } @@ -40,6 +40,11 @@ namespace MCGalaxy.Commands.CPE { } protected override void SetBotData(Player p, PlayerBot bot, string[] args) { + if (p != null && !bot.level.BuildAccess.CheckDetailed(p)) { + Player.Message(p, "Hence, you cannot the model of that bot."); + return; + } + string model = GetModel(p, args, 2); bot.model = model; Entities.UpdateModel(bot.id, model, bot.level, null); diff --git a/MCGalaxy/Commands/CPE/CmdSkin.cs b/MCGalaxy/Commands/CPE/CmdSkin.cs index 1f264025a..799cdd5f5 100644 --- a/MCGalaxy/Commands/CPE/CmdSkin.cs +++ b/MCGalaxy/Commands/CPE/CmdSkin.cs @@ -37,6 +37,11 @@ namespace MCGalaxy.Commands.CPE { } protected override void SetBotData(Player p, PlayerBot bot, string[] args) { + if (p != null && !bot.level.BuildAccess.CheckDetailed(p)) { + Player.Message(p, "Hence, you cannot the skin of that bot."); + return; + } + string skin = GetSkin(p, args, 2, bot.name); if (skin == null) return; bot.SkinName = skin;