Add Override annotations where appropriate

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2019-04-28 11:38:01 +10:00
parent c7281b2159
commit bfea9a3269
140 changed files with 1021 additions and 0 deletions

View File

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

View File

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

View File

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

View File

@@ -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) == '/';
}