Browse Source

Version 0.10.7b for SpigotMC.

master
Stanislav Usenkov 9 years ago
parent
commit
cf16ff1f74
  1. 2
      pom.xml
  2. 39
      src/main/java/ru/simsonic/rscPermissions/Bukkit/Commands/CommandEntity.java

2
pom.xml

@ -4,7 +4,7 @@
<groupId>ru.simsonic</groupId> <groupId>ru.simsonic</groupId>
<artifactId>rscPermissions</artifactId> <artifactId>rscPermissions</artifactId>
<version>0.10.7b-SNAPSHOT</version> <version>0.10.7b</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>rscPermissions</name> <name>rscPermissions</name>

39
src/main/java/ru/simsonic/rscPermissions/Bukkit/Commands/CommandEntity.java

@ -49,32 +49,35 @@ public class CommandEntity
} }
public List<String> getHelpForType(TargetType type) public List<String> getHelpForType(TargetType type)
{ {
final List<String> answer = new ArrayList<>(16); final List<String> templt = new ArrayList<>(20);
final String typeName = type.name().toLowerCase();
switch(type) switch(type)
{ {
case GROUP: case GROUP:
case USER: case USER:
answer.add(String.format("{_YL}/rscp %s [new] <name> listgroups {_LS}- show list of parent groups", typeName)); templt.add("{_YL}/rscp {:T} [new] <name> listgroups {_LS}- show list of parent groups");
answer.add(String.format("{_YL}/rscp %s [new] <name> listpermissions {_LS}- show list of explicit permissions", typeName)); templt.add("{_YL}/rscp {:T} [new] <name> listpermissions {_LS}- show list of explicit permissions");
answer.add(String.format("{_YL}/rscp %s [new] <name> prefix {_LS}- view %s's prefix", typeName, typeName)); templt.add("{_YL}/rscp {:T} [new] <name> prefix {_LS}- view prefix");
answer.add(String.format("{_YL}/rscp %s [new] <name> suffix {_LS}- view %s's suffix", typeName, typeName)); templt.add("{_YL}/rscp {:T} [new] <name> suffix {_LS}- view suffix");
answer.add(String.format("{_YL}/rscp %s [new] <name> addgroup <group> [options]", typeName)); templt.add("{_YL}/rscp {:T} [new] <name> addgroup <group> [options]");
answer.add(String.format("{_YL}/rscp %s [new] <name> addpermission <[-]perm> [options]", typeName)); templt.add("{_YL}/rscp {:T} [new] <name> addpermission <[-]perm> [options]");
answer.add(String.format("{_YL}/rscp %s [new] <name> removegroup <group|id>", typeName)); templt.add("{_YL}/rscp {:T} [new] <name> removegroup <group|id>");
answer.add(String.format("{_YL}/rscp %s [new] <name> removepermission <perm|id>", typeName)); templt.add("{_YL}/rscp {:T} [new] <name> removepermission <perm|id>");
answer.add(String.format("{_YL}[options] {_LS}can be:")); templt.add("{_YL}[options] {_LS}can be:");
answer.add(String.format("{_LS}1. {_WH}destination <destination> {_LS} -- it is destination, yes.")); templt.add("{_LS}1. {_WH}destination <destination> {_LS} -- it is destination, yes.");
answer.add(String.format("{_LS}2. {_WH}expirience <levels> {_LS} -- NOT WORKING.")); templt.add("{_LS}2. {_WH}expirience <levels> {_LS} -- NOT WORKING.");
answer.add(String.format("{_LS}3. {_WH}lifitime <?!?> {_LS} -- NOT READY, will be like '1hours12min30s'.")); templt.add("{_LS}3. {_WH}lifitime <?!?> {_LS} -- NOT READY, will be like '1hours12min30s'.");
break; break;
case PLAYER: case PLAYER:
answer.add(String.format("{_YL}/rscp %s listgroups {_LS}- show resulting inheritance tree", typeName)); templt.add("{_YL}/rscp {:T} listgroups {_LS}- show resulting inheritance tree");
answer.add(String.format("{_YL}/rscp %s listpermissions {_LS}- show final calculated permissions", typeName)); templt.add("{_YL}/rscp {:T} listpermissions {_LS}- show final calculated permissions");
answer.add(String.format("{_YL}/rscp %s prefix {_LS}- show %s's prefix", typeName, typeName)); templt.add("{_YL}/rscp {:T} prefix {_LS}- show {:T}'s prefix");
answer.add(String.format("{_YL}/rscp %s suffix {_LS}- show %s's suffix", typeName, typeName)); templt.add("{_YL}/rscp {:T} suffix {_LS}- show {:T}'s suffix");
break; break;
} }
final List<String> answer = new ArrayList<>(20);
final String typeId = type.name().toLowerCase();
for(String line : templt)
answer.add(line.replace("{:T}", typeId));
return answer; return answer;
} }
public void onEntityCommandHub(CommandSender sender, TargetType type, String[] args) throws CommandAnswerException public void onEntityCommandHub(CommandSender sender, TargetType type, String[] args) throws CommandAnswerException

Loading…
Cancel
Save