Cleanup comments, formatting, etc
By: Travis Watkins <amaranth@ubuntu.com>
This commit is contained in:
@@ -8,8 +8,8 @@ import org.bukkit.help.HelpTopic;
|
||||
|
||||
public class CommandAliasHelpTopic extends HelpTopic {
|
||||
|
||||
private String aliasFor;
|
||||
private HelpMap helpMap;
|
||||
private final String aliasFor;
|
||||
private final HelpMap helpMap;
|
||||
|
||||
public CommandAliasHelpTopic(String alias, String aliasFor, HelpMap helpMap) {
|
||||
this.aliasFor = aliasFor.startsWith("/") ? aliasFor : "/" + aliasFor;
|
||||
|
||||
@@ -8,16 +8,15 @@ import org.bukkit.help.HelpTopic;
|
||||
* This is a help topic implementation for general topics registered in the help.yml file.
|
||||
*/
|
||||
public class CustomHelpTopic extends HelpTopic {
|
||||
|
||||
private final String permissionNode;
|
||||
|
||||
|
||||
public CustomHelpTopic(String name, String shortText, String fullText, String permissionNode) {
|
||||
this.permissionNode = permissionNode;
|
||||
this.name = name;
|
||||
this.shortText = shortText;
|
||||
this.fullText = shortText + "\n" + fullText;
|
||||
}
|
||||
|
||||
|
||||
public boolean canSee(CommandSender sender) {
|
||||
if (sender instanceof ConsoleCommandSender) {
|
||||
return true;
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.List;
|
||||
public class CustomIndexHelpTopic extends IndexHelpTopic {
|
||||
private List<String> futureTopics;
|
||||
private final HelpMap helpMap;
|
||||
|
||||
|
||||
public CustomIndexHelpTopic(HelpMap helpMap, String name, String shortText, String permission, List<String> futureTopics, String preamble) {
|
||||
super(name, shortText, permission, new HashSet<HelpTopic>(), preamble);
|
||||
this.helpMap = helpMap;
|
||||
@@ -34,7 +34,7 @@ public class CustomIndexHelpTopic extends IndexHelpTopic {
|
||||
setTopicsCollection(topics);
|
||||
futureTopics = null;
|
||||
}
|
||||
|
||||
|
||||
return super.getFullText(sender);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@ package org.bukkit.craftbukkit.help;
|
||||
* A HelpTopicAmendment represents the contents of a topic amendment from the help.yml
|
||||
*/
|
||||
public class HelpTopicAmendment {
|
||||
private String topicName;
|
||||
private String shortText;
|
||||
private String fullText;
|
||||
private String permission;
|
||||
private final String topicName;
|
||||
private final String shortText;
|
||||
private final String fullText;
|
||||
private final String permission;
|
||||
|
||||
public HelpTopicAmendment(String topicName, String shortText, String fullText, String permission) {
|
||||
this.fullText = fullText;
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.bukkit.help.HelpTopic;
|
||||
*/
|
||||
public class MultipleCommandAliasHelpTopic extends HelpTopic {
|
||||
|
||||
private MultipleCommandAlias alias;
|
||||
private final MultipleCommandAlias alias;
|
||||
|
||||
public MultipleCommandAliasHelpTopic(MultipleCommandAlias alias) {
|
||||
this.alias = alias;
|
||||
|
||||
@@ -145,7 +145,7 @@ public class SimpleHelpMap implements HelpMap {
|
||||
}
|
||||
|
||||
// Add alias sub-index
|
||||
Collection<HelpTopic> filteredTopics = Collections2.<HelpTopic>filter(helpTopics.values(), Predicates.instanceOf(CommandAliasHelpTopic.class));
|
||||
Collection<HelpTopic> filteredTopics = Collections2.filter(helpTopics.values(), Predicates.instanceOf(CommandAliasHelpTopic.class));
|
||||
if (!filteredTopics.isEmpty()) {
|
||||
addTopic(new IndexHelpTopic("Aliases", "Lists command aliases", null, filteredTopics));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user