Also restrict with /skin bot and /model bot

This commit is contained in:
UnknownShadow200 2016-11-30 17:58:56 +11:00
parent 0ea046961a
commit fa817a7c8b
2 changed files with 11 additions and 1 deletions

View File

@ -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);

View File

@ -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;