@@ -17,6 +17,7 @@ public class CustomHelpTopic extends HelpTopic {
|
||||
this.fullText = shortText + "\n" + fullText;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSee(CommandSender sender) {
|
||||
if (sender instanceof ConsoleCommandSender) {
|
||||
return true;
|
||||
|
||||
@@ -34,6 +34,7 @@ public class MultipleCommandAliasHelpTopic extends HelpTopic {
|
||||
fullText = ChatColor.GOLD + "Alias for: " + ChatColor.WHITE + getShortText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSee(CommandSender sender) {
|
||||
if (amendedPermission == null) {
|
||||
if (sender instanceof ConsoleCommandSender) {
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.bukkit.help.HelpTopicFactory;
|
||||
*/
|
||||
public class MultipleCommandAliasHelpTopicFactory implements HelpTopicFactory<MultipleCommandAlias> {
|
||||
|
||||
@Override
|
||||
public HelpTopic createTopic(MultipleCommandAlias multipleCommandAlias) {
|
||||
return new MultipleCommandAliasHelpTopic(multipleCommandAlias);
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ public class SimpleHelpMap implements HelpMap {
|
||||
registerHelpTopicFactory(MultipleCommandAlias.class, new MultipleCommandAliasHelpTopicFactory());
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized HelpTopic getHelpTopic(String topicName) {
|
||||
if (topicName.equals("")) {
|
||||
return defaultTopic;
|
||||
@@ -66,10 +67,12 @@ public class SimpleHelpMap implements HelpMap {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<HelpTopic> getHelpTopics() {
|
||||
return helpTopics.values();
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void addTopic(HelpTopic topic) {
|
||||
// Existing topics take priority
|
||||
if (!helpTopics.containsKey(topic.getName())) {
|
||||
@@ -77,10 +80,12 @@ public class SimpleHelpMap implements HelpMap {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void clear() {
|
||||
helpTopics.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getIgnoredPlugins() {
|
||||
return yaml.getIgnoredPlugins();
|
||||
}
|
||||
@@ -216,6 +221,7 @@ public class SimpleHelpMap implements HelpMap {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerHelpTopicFactory(Class commandClass, HelpTopicFactory factory) {
|
||||
if (!Command.class.isAssignableFrom(commandClass) && !CommandExecutor.class.isAssignableFrom(commandClass)) {
|
||||
throw new IllegalArgumentException("commandClass must implement either Command or CommandExecutor!");
|
||||
@@ -225,6 +231,7 @@ public class SimpleHelpMap implements HelpMap {
|
||||
|
||||
private class IsCommandTopicPredicate implements Predicate<HelpTopic> {
|
||||
|
||||
@Override
|
||||
public boolean apply(HelpTopic topic) {
|
||||
return topic.getName().charAt(0) == '/';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user