Skip to content
Permalink
Browse files

Don't duplicate valid models string

  • Loading branch information...
UnknownShadow200 committed Sep 20, 2017
1 parent a53fd6e commit 8d45e1a86596a3165782d358827967c5daefd3b5
Showing with 9 additions and 13 deletions.
  1. +8 −12 fCraft/Commands/CpeCommands.cs
  2. +1 −1 fCraft/Commands/InfoCommands.cs
@@ -52,6 +52,7 @@ static class CpeCommands {
if (name == null) name = player.Name;
return Server.FindPlayerOrPrintMatches(player, name, SearchOptions.IncludeSelf);
}
const string validModels = "Valid models: &SAny Block Name/ID, Chibi, Chicken, Creeper, Giant, Humanoid, Pig, Sheep, Skeleton, Spider, Zombie";

#region AddEntity

@@ -64,13 +65,13 @@ static class CpeCommands {
Help = "Commands for manipulating entities. For help and usage for the individual options, use /help ent <option>.",
HelpSections = new Dictionary<string, string>{
{ "create", "&H/Ent create <entity name> <model> <skin>&N&S" +
"Creates a new entity with the given name. Valid models are chibi, chicken, creeper, giant, human, pig, sheep, skeleton, spider, zombie, or any block ID/Name." },
"Creates a new entity with the given name. " + validModels},
{ "remove", "&H/Ent remove <entity name> <world>&N&S" +
"Removes the given entity." },
{ "removeall", "&H/Ent removeAll&N&S" +
"Removes all entities from the world."},
{ "model", "&H/Ent model <entity name> <model>&N&S" +
"Changes the model of an entity to the given model. Valid models are chibi, chicken, creeper, giant, human, pig, sheep, skeleton, spider, zombie, or any block ID/Name."},
"Changes the model of an entity to the given model. " + validModels},
{ "list", "&H/Ent list <world>&N&S" +
"Prints out a list of all the entites on the server."},
{ "bring", "&H/Ent bring <entity name>&N&S" +
@@ -171,21 +172,18 @@ static class CpeCommands {
if (cmd.HasNext) {
string model = cmd.Next().ToLower();
if (string.IsNullOrEmpty(model)) {
player.Message(
"Usage is /Ent model <bot> <model>. Valid models are chibi, chicken, creeper, giant, human, pig, sheep, skeleton, spider, zombie, or any block ID/Name.");
player.Message("Usage is /Ent model <bot> <model>. " + validModels);
break;
}
model = ParseModel(player, model);
if (model == null) {
player.Message(
"That wasn't a valid entity model! Valid models are chibi, chicken, creeper, giant, human, pig, sheep, skeleton, spider, zombie, or any block ID/Name.");
player.Message("That wasn't a valid entity model! " + validModels);
break;
}
player.Message("Changed entity model to {0}.", model);
entity.ChangeModel(model);
} else {
player.Message(
"Usage is /Ent model <bot> <model>. Valid models are chibi, chicken, creeper, giant, human, pig, sheep, skeleton, spider, zombie, or any block ID/Name.");
player.Message("Usage is /Ent model <bot> <model>. " + validModels);
}
break;
case "bring":
@@ -285,8 +283,7 @@ static class CpeCommands {
Permissions = new[] { Permission.ReadStaffChat },
Usage = "/Model [Player] [Model]",
IsConsoleSafe = true,
Help = "Change the Model or Skin of [Player]!&N" +
"Valid models: &S[Any Block Name or ID#], Chibi, Chicken, Creeper, Giant, Humanoid, Pig, Sheep, Skeleton, Spider, Zombie",
Help = "Change the Model or Skin of [Player]!&N" + validModels,
Handler = ModelHandler
};

@@ -300,8 +297,7 @@ static class CpeCommands {
Permissions = new[] { Permission.Chat },
Usage = "/AFKModel [Player] [Model]",
IsConsoleSafe = true,
Help = "Changes the model of a player when they are AFK.&N" +
"Valid models: &S [Any Block Name or ID#], Chibi, Chicken, Creeper, Giant, Humanoid, Pig, Sheep, Skeleton, Spider, Zombie!",
Help = "Changes the model of a player when they are AFK.&N" + validModels,
Handler = AFKModelHandler
};

@@ -878,7 +878,7 @@ static void ListStaffHandler(Player player, CommandReader cmd)
string names = members.Take(max).JoinToString(", ", p => p.ClassyName);

string format = " {0} &S(&f{1}&S): {2}{3}";
if (members.Length > members.Length) format += " &S{4} more";
if (members.Length > max) format += " &S{4} more";
player.Message( format, rank.ClassyName, members.Length, rank.Color, names, members.Length - max );
}

0 comments on commit 8d45e1a

Please sign in to comment.
You can’t perform that action at this time.