createConditionContext
-public BukkitConditionContext createConditionContext(co.aikar.commands.CommandIssuer issuer,
+
- Overrides:
@@ -550,7 +550,7 @@ loadScripts(document, 'script');
log
-public void log(co.aikar.commands.LogLevel level,
+
@@ -562,14 +562,14 @@ loadScripts(document, 'script');
usePerIssuerLocale
-public boolean usePerIssuerLocale(boolean usePerIssuerLocale,
+public boolean usePerIssuerLocale(boolean usePerIssuerLocale,
boolean autoDetectFromClient)
getCommandPrefix
-
+
- Overrides:
getCommandPrefix in class co.aikar.commands.CommandManager<org.bukkit.command.CommandSender,BukkitCommandIssuer,org.bukkit.ChatColor,BukkitMessageFormatter,BukkitCommandExecutionContext,BukkitConditionContext>
@@ -579,7 +579,7 @@ loadScripts(document, 'script');
handleUncaughtException
-protected boolean handleUncaughtException(co.aikar.commands.BaseCommand scope,
+protected boolean handleUncaughtException(co.aikar.commands.BaseCommand scope,
co.aikar.commands.RegisteredCommand registeredCommand,
co.aikar.commands.CommandIssuer sender,
List<String> args,
diff --git a/docs/acf-bukkit/co/aikar/commands/BukkitLocales.html b/docs/acf-bukkit/co/aikar/commands/BukkitLocales.html
index 0e249331..77d30c4c 100644
--- a/docs/acf-bukkit/co/aikar/commands/BukkitLocales.html
+++ b/docs/acf-bukkit/co/aikar/commands/BukkitLocales.html
@@ -135,7 +135,7 @@ loadScripts(document, 'script');
-
Loads a file out of the plugins data folder by the given name
+
Loads a file out of the plugin's data folder by the given name
@@ -184,7 +184,7 @@ loadScripts(document, 'script');
loadYamlLanguageFile
-public boolean loadYamlLanguageFile(File file,
+
@@ -204,11 +204,11 @@ org.bukkit.configuration.InvalidConfigurationException
loadYamlLanguageFile
-public boolean loadYamlLanguageFile(String file,
+
-Loads a file out of the plugins data folder by the given name
+Loads a file out of the plugin's data folder by the given name
- Parameters:
file -
@@ -224,7 +224,7 @@ org.bukkit.configuration.InvalidConfigurationException
loadLanguage
-public boolean loadLanguage(org.bukkit.configuration.file.FileConfiguration config,
+public boolean loadLanguage(org.bukkit.configuration.file.FileConfiguration config,
Locale locale)
Loads every message from the Configuration object. Any nested values will be treated as namespace
so acf-core:\n\tfoo: bar will be acf-core.foo = bar
diff --git a/docs/acf-bukkit/index-all.html b/docs/acf-bukkit/index-all.html
index 281b8234..47d36337 100644
--- a/docs/acf-bukkit/index-all.html
+++ b/docs/acf-bukkit/index-all.html
@@ -287,7 +287,7 @@ loadScripts(document, 'script');
loadYamlLanguageFile(String, Locale) - Method in class co.aikar.commands.BukkitLocales
-Loads a file out of the plugins data folder by the given name
+Loads a file out of the plugin's data folder by the given name
locales - Variable in class co.aikar.commands.BukkitCommandManager
diff --git a/docs/acf-bukkit/src-html/co/aikar/commands/BukkitCommandIssuer.html b/docs/acf-bukkit/src-html/co/aikar/commands/BukkitCommandIssuer.html
index 1d9f6234..20f83f6d 100644
--- a/docs/acf-bukkit/src-html/co/aikar/commands/BukkitCommandIssuer.html
+++ b/docs/acf-bukkit/src-html/co/aikar/commands/BukkitCommandIssuer.html
@@ -60,52 +60,51 @@
047
048 @Override
049 public CommandSender getIssuer() {
-050 //noinspection unchecked
-051 return sender;
-052 }
-053
-054 public Player getPlayer() {
-055 return isPlayer() ? (Player) sender : null;
-056 }
-057
-058 @Override
-059 public @NotNull UUID getUniqueId() {
-060 if (isPlayer()) {
-061 return ((Player) sender).getUniqueId();
-062 }
-063
-064 //generate a unique id based of the name (like for the console command sender)
-065 return UUID.nameUUIDFromBytes(sender.getName().getBytes(StandardCharsets.UTF_8));
-066 }
-067
-068 @Override
-069 public CommandManager getManager() {
-070 return manager;
-071 }
-072
-073 @Override
-074 public void sendMessageInternal(String message) {
-075 sender.sendMessage(ACFBukkitUtil.color(message));
-076 }
-077
-078 @Override
-079 public boolean hasPermission(String name) {
-080 return sender.hasPermission(name);
-081 }
-082
-083 @Override
-084 public boolean equals(Object o) {
-085 if (this == o) return true;
-086 if (o == null || getClass() != o.getClass()) return false;
-087 BukkitCommandIssuer that = (BukkitCommandIssuer) o;
-088 return Objects.equals(sender, that.sender);
-089 }
-090
-091 @Override
-092 public int hashCode() {
-093 return Objects.hash(sender);
-094 }
-095}
+050 return sender;
+051 }
+052
+053 public Player getPlayer() {
+054 return isPlayer() ? (Player) sender : null;
+055 }
+056
+057 @Override
+058 public @NotNull UUID getUniqueId() {
+059 if (isPlayer()) {
+060 return ((Player) sender).getUniqueId();
+061 }
+062
+063 //generate a unique id based of the name (like for the console command sender)
+064 return UUID.nameUUIDFromBytes(sender.getName().getBytes(StandardCharsets.UTF_8));
+065 }
+066
+067 @Override
+068 public CommandManager getManager() {
+069 return manager;
+070 }
+071
+072 @Override
+073 public void sendMessageInternal(String message) {
+074 sender.sendMessage(ACFBukkitUtil.color(message));
+075 }
+076
+077 @Override
+078 public boolean hasPermission(String name) {
+079 return sender.hasPermission(name);
+080 }
+081
+082 @Override
+083 public boolean equals(Object o) {
+084 if (this == o) return true;
+085 if (o == null || getClass() != o.getClass()) return false;
+086 BukkitCommandIssuer that = (BukkitCommandIssuer) o;
+087 return Objects.equals(sender, that.sender);
+088 }
+089
+090 @Override
+091 public int hashCode() {
+092 return Objects.hash(sender);
+093 }
+094}
diff --git a/docs/acf-bukkit/src-html/co/aikar/commands/BukkitCommandManager.html b/docs/acf-bukkit/src-html/co/aikar/commands/BukkitCommandManager.html
index e38e72df..f1d9f5e3 100644
--- a/docs/acf-bukkit/src-html/co/aikar/commands/BukkitCommandManager.html
+++ b/docs/acf-bukkit/src-html/co/aikar/commands/BukkitCommandManager.html
@@ -105,325 +105,324 @@
092 private boolean cantReadLocale = false;
093 protected boolean autoDetectFromClient = true;
094
-095 @SuppressWarnings("JavaReflectionMemberAccess")
-096 public BukkitCommandManager(Plugin plugin) {
-097 this.plugin = plugin;
-098 String prefix = this.plugin.getDescription().getPrefix();
-099 this.logger = Logger.getLogger(prefix != null ? prefix : this.plugin.getName());
-100 this.timingManager = TimingManager.of(plugin);
-101 this.commandTiming = this.timingManager.of("Commands");
-102 this.commandMap = hookCommandMap();
-103 this.formatters.put(MessageType.ERROR, defaultFormatter = new BukkitMessageFormatter(ChatColor.RED, ChatColor.YELLOW, ChatColor.RED));
-104 this.formatters.put(MessageType.SYNTAX, new BukkitMessageFormatter(ChatColor.YELLOW, ChatColor.GREEN, ChatColor.WHITE));
-105 this.formatters.put(MessageType.INFO, new BukkitMessageFormatter(ChatColor.BLUE, ChatColor.DARK_GREEN, ChatColor.GREEN));
-106 this.formatters.put(MessageType.HELP, new BukkitMessageFormatter(ChatColor.AQUA, ChatColor.GREEN, ChatColor.YELLOW));
-107 Pattern versionPattern = Pattern.compile("\\(MC: (\\d)\\.(\\d+)\\.?(\\d+?)?\\)");
-108 Matcher matcher = versionPattern.matcher(Bukkit.getVersion());
-109 if (matcher.find()) {
-110 this.mcMinorVersion = ACFUtil.parseInt(matcher.toMatchResult().group(2), 0);
-111 this.mcPatchVersion = ACFUtil.parseInt(matcher.toMatchResult().group(3), 0);
-112 } else {
-113 this.mcMinorVersion = -1;
-114 this.mcPatchVersion = -1;
-115 }
-116 Bukkit.getHelpMap().registerHelpTopicFactory(BukkitRootCommand.class, command -> {
-117 if (hasUnstableAPI("help")) {
-118 return new ACFBukkitHelpTopic(this, (BukkitRootCommand) command);
-119 } else {
-120 return new GenericCommandHelpTopic(command);
-121 }
-122 });
-123
-124 Bukkit.getPluginManager().registerEvents(new ACFBukkitListener(this, plugin), plugin);
-125
-126 getLocales(); // auto load locales
-127 this.localeTask = Bukkit.getScheduler().runTaskTimer(plugin, () -> {
-128 if (this.cantReadLocale || !this.autoDetectFromClient) {
-129 return;
-130 }
-131 Bukkit.getOnlinePlayers().forEach(this::readPlayerLocale);
-132 }, 30, 30);
-133
-134 registerDependency(plugin.getClass(), plugin);
-135 registerDependency(Logger.class, plugin.getLogger());
-136 registerDependency(FileConfiguration.class, plugin.getConfig());
-137 registerDependency(FileConfiguration.class, "config", plugin.getConfig());
-138 registerDependency(Plugin.class, plugin);
-139 registerDependency(JavaPlugin.class, plugin);
-140 registerDependency(PluginManager.class, Bukkit.getPluginManager());
-141 registerDependency(Server.class, Bukkit.getServer());
-142 registerDependency(BukkitScheduler.class, Bukkit.getScheduler());
-143 registerDependency(ScoreboardManager.class, Bukkit.getScoreboardManager());
-144 registerDependency(ItemFactory.class, Bukkit.getItemFactory());
-145 }
-146
-147 @NotNull
-148 private CommandMap hookCommandMap() {
-149 CommandMap commandMap = null;
-150 try {
-151 Server server = Bukkit.getServer();
-152 Method getCommandMap = server.getClass().getDeclaredMethod("getCommandMap");
-153 getCommandMap.setAccessible(true);
-154 commandMap = (CommandMap) getCommandMap.invoke(server);
-155 if (!SimpleCommandMap.class.isAssignableFrom(commandMap.getClass())) {
-156 this.log(LogLevel.ERROR, "ERROR: CommandMap has been hijacked! Offending command map is located at: " + commandMap.getClass().getName());
-157 this.log(LogLevel.ERROR, "We are going to try to hijack it back and resolve this, but you are now in dangerous territory.");
-158 this.log(LogLevel.ERROR, "We can not guarantee things are going to work.");
-159 Field cmField = server.getClass().getDeclaredField("commandMap");
-160 commandMap = new ProxyCommandMap(this, commandMap);
-161 cmField.set(server, commandMap);
-162 this.log(LogLevel.INFO, "Injected Proxy Command Map... good luck...");
-163 }
-164 Field knownCommands = SimpleCommandMap.class.getDeclaredField("knownCommands");
-165 knownCommands.setAccessible(true);
-166 //noinspection unchecked
-167 this.knownCommands = (Map<String, Command>) knownCommands.get(commandMap);
-168 } catch (Exception e) {
-169 this.log(LogLevel.ERROR, "Failed to get Command Map. ACF will not function.");
-170 ACFUtil.sneaky(e);
-171 }
-172 return commandMap;
-173 }
-174
-175 public Plugin getPlugin() {
-176 return this.plugin;
-177 }
-178
-179 @Override
-180 public boolean isCommandIssuer(Class<?> type) {
-181 return CommandSender.class.isAssignableFrom(type);
-182 }
-183
-184 @Override
-185 public synchronized CommandContexts<BukkitCommandExecutionContext> getCommandContexts() {
-186 if (this.contexts == null) {
-187 this.contexts = new BukkitCommandContexts(this);
-188 }
-189 return contexts;
-190 }
-191
-192 @Override
-193 public synchronized CommandCompletions<BukkitCommandCompletionContext> getCommandCompletions() {
-194 if (this.completions == null) {
-195 this.completions = new BukkitCommandCompletions(this);
-196 }
-197 return completions;
-198 }
+095 public BukkitCommandManager(Plugin plugin) {
+096 this.plugin = plugin;
+097 String prefix = this.plugin.getDescription().getPrefix();
+098 this.logger = Logger.getLogger(prefix != null ? prefix : this.plugin.getName());
+099 this.timingManager = TimingManager.of(plugin);
+100 this.commandTiming = this.timingManager.of("Commands");
+101 this.commandMap = hookCommandMap();
+102 this.formatters.put(MessageType.ERROR, defaultFormatter = new BukkitMessageFormatter(ChatColor.RED, ChatColor.YELLOW, ChatColor.RED));
+103 this.formatters.put(MessageType.SYNTAX, new BukkitMessageFormatter(ChatColor.YELLOW, ChatColor.GREEN, ChatColor.WHITE));
+104 this.formatters.put(MessageType.INFO, new BukkitMessageFormatter(ChatColor.BLUE, ChatColor.DARK_GREEN, ChatColor.GREEN));
+105 this.formatters.put(MessageType.HELP, new BukkitMessageFormatter(ChatColor.AQUA, ChatColor.GREEN, ChatColor.YELLOW));
+106 Pattern versionPattern = Pattern.compile("\\(MC: (\\d)\\.(\\d+)\\.?(\\d+?)?\\)");
+107 Matcher matcher = versionPattern.matcher(Bukkit.getVersion());
+108 if (matcher.find()) {
+109 this.mcMinorVersion = ACFUtil.parseInt(matcher.toMatchResult().group(2), 0);
+110 this.mcPatchVersion = ACFUtil.parseInt(matcher.toMatchResult().group(3), 0);
+111 } else {
+112 this.mcMinorVersion = -1;
+113 this.mcPatchVersion = -1;
+114 }
+115 Bukkit.getHelpMap().registerHelpTopicFactory(BukkitRootCommand.class, command -> {
+116 if (hasUnstableAPI("help")) {
+117 return new ACFBukkitHelpTopic(this, (BukkitRootCommand) command);
+118 } else {
+119 return new GenericCommandHelpTopic(command);
+120 }
+121 });
+122
+123 Bukkit.getPluginManager().registerEvents(new ACFBukkitListener(this, plugin), plugin);
+124
+125 getLocales(); // auto load locales
+126 this.localeTask = Bukkit.getScheduler().runTaskTimer(plugin, () -> {
+127 if (this.cantReadLocale || !this.autoDetectFromClient) {
+128 return;
+129 }
+130 Bukkit.getOnlinePlayers().forEach(this::readPlayerLocale);
+131 }, 30, 30);
+132
+133 registerDependency(plugin.getClass(), plugin);
+134 registerDependency(Logger.class, plugin.getLogger());
+135 registerDependency(FileConfiguration.class, plugin.getConfig());
+136 registerDependency(FileConfiguration.class, "config", plugin.getConfig());
+137 registerDependency(Plugin.class, plugin);
+138 registerDependency(JavaPlugin.class, plugin);
+139 registerDependency(PluginManager.class, Bukkit.getPluginManager());
+140 registerDependency(Server.class, Bukkit.getServer());
+141 registerDependency(BukkitScheduler.class, Bukkit.getScheduler());
+142 registerDependency(ScoreboardManager.class, Bukkit.getScoreboardManager());
+143 registerDependency(ItemFactory.class, Bukkit.getItemFactory());
+144 }
+145
+146 @NotNull
+147 private CommandMap hookCommandMap() {
+148 CommandMap commandMap = null;
+149 try {
+150 Server server = Bukkit.getServer();
+151 Method getCommandMap = server.getClass().getDeclaredMethod("getCommandMap");
+152 getCommandMap.setAccessible(true);
+153 commandMap = (CommandMap) getCommandMap.invoke(server);
+154 if (!SimpleCommandMap.class.isAssignableFrom(commandMap.getClass())) {
+155 this.log(LogLevel.ERROR, "ERROR: CommandMap has been hijacked! Offending command map is located at: " + commandMap.getClass().getName());
+156 this.log(LogLevel.ERROR, "We are going to try to hijack it back and resolve this, but you are now in dangerous territory.");
+157 this.log(LogLevel.ERROR, "We can not guarantee things are going to work.");
+158 Field cmField = server.getClass().getDeclaredField("commandMap");
+159 commandMap = new ProxyCommandMap(this, commandMap);
+160 cmField.set(server, commandMap);
+161 this.log(LogLevel.INFO, "Injected Proxy Command Map... good luck...");
+162 }
+163 Field knownCommands = SimpleCommandMap.class.getDeclaredField("knownCommands");
+164 knownCommands.setAccessible(true);
+165 //noinspection unchecked
+166 this.knownCommands = (Map<String, Command>) knownCommands.get(commandMap);
+167 } catch (Exception e) {
+168 this.log(LogLevel.ERROR, "Failed to get Command Map. ACF will not function.");
+169 ACFUtil.sneaky(e);
+170 }
+171 return commandMap;
+172 }
+173
+174 public Plugin getPlugin() {
+175 return this.plugin;
+176 }
+177
+178 @Override
+179 public boolean isCommandIssuer(Class<?> type) {
+180 return CommandSender.class.isAssignableFrom(type);
+181 }
+182
+183 @Override
+184 public synchronized CommandContexts<BukkitCommandExecutionContext> getCommandContexts() {
+185 if (this.contexts == null) {
+186 this.contexts = new BukkitCommandContexts(this);
+187 }
+188 return contexts;
+189 }
+190
+191 @Override
+192 public synchronized CommandCompletions<BukkitCommandCompletionContext> getCommandCompletions() {
+193 if (this.completions == null) {
+194 this.completions = new BukkitCommandCompletions(this);
+195 }
+196 return completions;
+197 }
+198
199
-200
-201 @Override
-202 public BukkitLocales getLocales() {
-203 if (this.locales == null) {
-204 this.locales = new BukkitLocales(this);
-205 this.locales.loadLanguages();
-206 }
-207 return locales;
-208 }
+200 @Override
+201 public BukkitLocales getLocales() {
+202 if (this.locales == null) {
+203 this.locales = new BukkitLocales(this);
+204 this.locales.loadLanguages();
+205 }
+206 return locales;
+207 }
+208
209
-210
-211 @Override
-212 public boolean hasRegisteredCommands() {
-213 return !registeredCommands.isEmpty();
-214 }
-215
-216 public void registerCommand(BaseCommand command, boolean force) {
-217 final String plugin = this.plugin.getName().toLowerCase(Locale.ENGLISH);
-218 command.onRegister(this);
-219 for (Map.Entry<String, RootCommand> entry : command.registeredCommands.entrySet()) {
-220 String commandName = entry.getKey().toLowerCase(Locale.ENGLISH);
-221 BukkitRootCommand bukkitCommand = (BukkitRootCommand) entry.getValue();
-222 if (!bukkitCommand.isRegistered) {
-223 Command oldCommand = commandMap.getCommand(commandName);
-224 if (oldCommand instanceof PluginIdentifiableCommand && ((PluginIdentifiableCommand) oldCommand).getPlugin() == this.plugin) {
-225 knownCommands.remove(commandName);
-226 oldCommand.unregister(commandMap);
-227 } else if (oldCommand != null && force) {
-228 knownCommands.remove(commandName);
-229 for (Map.Entry<String, Command> ce : knownCommands.entrySet()) {
-230 String key = ce.getKey();
-231 Command value = ce.getValue();
-232 if (key.contains(":") && oldCommand.equals(value)) {
-233 String[] split = ACFPatterns.COLON.split(key, 2);
-234 if (split.length > 1) {
-235 oldCommand.unregister(commandMap);
-236 oldCommand.setLabel(split[0] + ":" + command.getName());
-237 oldCommand.register(commandMap);
-238 }
-239 }
-240 }
-241 }
-242 commandMap.register(commandName, plugin, bukkitCommand);
-243 }
-244 bukkitCommand.isRegistered = true;
-245 registeredCommands.put(commandName, bukkitCommand);
-246 }
-247 }
-248
-249 @Override
-250 public void registerCommand(BaseCommand command) {
-251 registerCommand(command, false);
-252 }
-253
-254 public void unregisterCommand(BaseCommand command) {
-255 for (RootCommand rootcommand : command.registeredCommands.values()) {
-256 BukkitRootCommand bukkitCommand = (BukkitRootCommand) rootcommand;
-257 bukkitCommand.getSubCommands().values().removeAll(command.subCommands.values());
-258 if (bukkitCommand.isRegistered && bukkitCommand.getSubCommands().isEmpty()) {
-259 unregisterCommand(bukkitCommand);
-260 bukkitCommand.isRegistered = false;
-261 }
-262 }
-263 }
-264
-265 /**
-266 * @param command
-267 * @deprecated Use unregisterCommand(BaseCommand) - this will be visibility reduced later.
-268 */
-269 @Deprecated
-270 public void unregisterCommand(BukkitRootCommand command) {
-271 final String plugin = this.plugin.getName().toLowerCase(Locale.ENGLISH);
-272 command.unregister(commandMap);
-273 String key = command.getName();
-274 Command registered = knownCommands.get(key);
-275 if (command.equals(registered)) {
-276 knownCommands.remove(key);
-277 }
-278 knownCommands.remove(plugin + ":" + key);
-279 registeredCommands.remove(key);
-280 }
-281
-282 public void unregisterCommands() {
-283 for (String key : new HashSet<>(registeredCommands.keySet())) {
-284 unregisterCommand(registeredCommands.get(key));
-285 }
-286 }
+210 @Override
+211 public boolean hasRegisteredCommands() {
+212 return !registeredCommands.isEmpty();
+213 }
+214
+215 public void registerCommand(BaseCommand command, boolean force) {
+216 final String plugin = this.plugin.getName().toLowerCase(Locale.ENGLISH);
+217 command.onRegister(this);
+218 for (Map.Entry<String, RootCommand> entry : command.registeredCommands.entrySet()) {
+219 String commandName = entry.getKey().toLowerCase(Locale.ENGLISH);
+220 BukkitRootCommand bukkitCommand = (BukkitRootCommand) entry.getValue();
+221 if (!bukkitCommand.isRegistered) {
+222 Command oldCommand = commandMap.getCommand(commandName);
+223 if (oldCommand instanceof PluginIdentifiableCommand && ((PluginIdentifiableCommand) oldCommand).getPlugin() == this.plugin) {
+224 knownCommands.remove(commandName);
+225 oldCommand.unregister(commandMap);
+226 } else if (oldCommand != null && force) {
+227 knownCommands.remove(commandName);
+228 for (Map.Entry<String, Command> ce : knownCommands.entrySet()) {
+229 String key = ce.getKey();
+230 Command value = ce.getValue();
+231 if (key.contains(":") && oldCommand.equals(value)) {
+232 String[] split = ACFPatterns.COLON.split(key, 2);
+233 if (split.length > 1) {
+234 oldCommand.unregister(commandMap);
+235 oldCommand.setLabel(split[0] + ":" + command.getName());
+236 oldCommand.register(commandMap);
+237 }
+238 }
+239 }
+240 }
+241 commandMap.register(commandName, plugin, bukkitCommand);
+242 }
+243 bukkitCommand.isRegistered = true;
+244 registeredCommands.put(commandName, bukkitCommand);
+245 }
+246 }
+247
+248 @Override
+249 public void registerCommand(BaseCommand command) {
+250 registerCommand(command, false);
+251 }
+252
+253 public void unregisterCommand(BaseCommand command) {
+254 for (RootCommand rootcommand : command.registeredCommands.values()) {
+255 BukkitRootCommand bukkitCommand = (BukkitRootCommand) rootcommand;
+256 bukkitCommand.getSubCommands().values().removeAll(command.subCommands.values());
+257 if (bukkitCommand.isRegistered && bukkitCommand.getSubCommands().isEmpty()) {
+258 unregisterCommand(bukkitCommand);
+259 bukkitCommand.isRegistered = false;
+260 }
+261 }
+262 }
+263
+264 /**
+265 * @param command
+266 * @deprecated Use unregisterCommand(BaseCommand) - this will be visibility reduced later.
+267 */
+268 @Deprecated
+269 public void unregisterCommand(BukkitRootCommand command) {
+270 final String plugin = this.plugin.getName().toLowerCase(Locale.ENGLISH);
+271 command.unregister(commandMap);
+272 String key = command.getName();
+273 Command registered = knownCommands.get(key);
+274 if (command.equals(registered)) {
+275 knownCommands.remove(key);
+276 }
+277 knownCommands.remove(plugin + ":" + key);
+278 registeredCommands.remove(key);
+279 }
+280
+281 public void unregisterCommands() {
+282 for (String key : new HashSet<>(registeredCommands.keySet())) {
+283 unregisterCommand(registeredCommands.get(key));
+284 }
+285 }
+286
287
-288
-289 private Field getEntityField(Player player) throws NoSuchFieldException {
-290 Class cls = player.getClass();
-291 while (cls != Object.class) {
-292 if (cls.getName().endsWith("CraftEntity")) {
-293 Field field = cls.getDeclaredField("entity");
-294 field.setAccessible(true);
-295 return field;
-296 }
-297 cls = cls.getSuperclass();
-298 }
-299 return null;
-300 }
-301
-302 public Locale setPlayerLocale(Player player, Locale locale) {
-303 return this.setIssuerLocale(player, locale);
-304 }
-305
-306 void readPlayerLocale(Player player) {
-307 if (!player.isOnline() || cantReadLocale) {
-308 return;
-309 }
-310 try {
-311 Field entityField = getEntityField(player);
-312 if (entityField == null) {
-313 return;
-314 }
-315 Object nmsPlayer = entityField.get(player);
-316 if (nmsPlayer != null) {
-317 Field localeField = nmsPlayer.getClass().getDeclaredField("locale");
-318 localeField.setAccessible(true);
-319 Object localeString = localeField.get(nmsPlayer);
-320 if (localeString instanceof String) {
-321 UUID playerUniqueId = player.getUniqueId();
-322 if (!localeString.equals(issuersLocaleString.get(playerUniqueId))) {
-323 String[] split = ACFPatterns.UNDERSCORE.split((String) localeString);
-324 Locale locale = split.length > 1 ? new Locale(split[0], split[1]) : new Locale(split[0]);
-325 Locale prev = issuersLocale.put(playerUniqueId, locale);
-326 issuersLocaleString.put(playerUniqueId, (String) localeString);
-327 if (!Objects.equals(locale, prev)) {
-328 this.notifyLocaleChange(getCommandIssuer(player), prev, locale);
-329 }
-330 }
-331 }
-332 }
-333 } catch (Exception e) {
-334 cantReadLocale = true;
-335 this.localeTask.cancel();
-336 this.log(LogLevel.INFO, "Can't read players locale, you will be unable to automatically detect players language. Only Bukkit 1.7+ is supported for this.", e);
-337 }
-338 }
-339
-340 public TimingManager getTimings() {
-341 return timingManager;
-342 }
-343
-344 @Override
-345 public RootCommand createRootCommand(String cmd) {
-346 return new BukkitRootCommand(this, cmd);
-347 }
-348
-349 @Override
-350 public Collection<RootCommand> getRegisteredRootCommands() {
-351 return Collections.unmodifiableCollection(registeredCommands.values());
-352 }
-353
-354 @Override
-355 public BukkitCommandIssuer getCommandIssuer(Object issuer) {
-356 if (!(issuer instanceof CommandSender)) {
-357 throw new IllegalArgumentException(issuer.getClass().getName() + " is not a Command Issuer.");
-358 }
-359 return new BukkitCommandIssuer(this, (CommandSender) issuer);
-360 }
-361
-362 @Override
-363 public BukkitCommandExecutionContext createCommandContext(RegisteredCommand command, CommandParameter parameter, CommandIssuer sender, List<String> args, int i, Map<String, Object> passedArgs) {
-364 return new BukkitCommandExecutionContext(command, parameter, (BukkitCommandIssuer) sender, args, i, passedArgs);
-365 }
-366
-367 @Override
-368 public BukkitCommandCompletionContext createCompletionContext(RegisteredCommand command, CommandIssuer sender, String input, String config, String[] args) {
-369 return new BukkitCommandCompletionContext(command, (BukkitCommandIssuer) sender, input, config, args);
-370 }
-371
-372 @Override
-373 public RegisteredCommand createRegisteredCommand(BaseCommand command, String cmdName, Method method, String prefSubCommand) {
-374 return new BukkitRegisteredCommand(command, cmdName, method, prefSubCommand);
-375 }
-376
-377 @Override
-378 public BukkitConditionContext createConditionContext(CommandIssuer issuer, String config) {
-379 return new BukkitConditionContext((BukkitCommandIssuer) issuer, config);
-380 }
+288 private Field getEntityField(Player player) throws NoSuchFieldException {
+289 Class cls = player.getClass();
+290 while (cls != Object.class) {
+291 if (cls.getName().endsWith("CraftEntity")) {
+292 Field field = cls.getDeclaredField("entity");
+293 field.setAccessible(true);
+294 return field;
+295 }
+296 cls = cls.getSuperclass();
+297 }
+298 return null;
+299 }
+300
+301 public Locale setPlayerLocale(Player player, Locale locale) {
+302 return this.setIssuerLocale(player, locale);
+303 }
+304
+305 void readPlayerLocale(Player player) {
+306 if (!player.isOnline() || cantReadLocale) {
+307 return;
+308 }
+309 try {
+310 Field entityField = getEntityField(player);
+311 if (entityField == null) {
+312 return;
+313 }
+314 Object nmsPlayer = entityField.get(player);
+315 if (nmsPlayer != null) {
+316 Field localeField = nmsPlayer.getClass().getDeclaredField("locale");
+317 localeField.setAccessible(true);
+318 Object localeString = localeField.get(nmsPlayer);
+319 if (localeString instanceof String) {
+320 UUID playerUniqueId = player.getUniqueId();
+321 if (!localeString.equals(issuersLocaleString.get(playerUniqueId))) {
+322 String[] split = ACFPatterns.UNDERSCORE.split((String) localeString);
+323 Locale locale = split.length > 1 ? new Locale(split[0], split[1]) : new Locale(split[0]);
+324 Locale prev = issuersLocale.put(playerUniqueId, locale);
+325 issuersLocaleString.put(playerUniqueId, (String) localeString);
+326 if (!Objects.equals(locale, prev)) {
+327 this.notifyLocaleChange(getCommandIssuer(player), prev, locale);
+328 }
+329 }
+330 }
+331 }
+332 } catch (Exception e) {
+333 cantReadLocale = true;
+334 this.localeTask.cancel();
+335 this.log(LogLevel.INFO, "Can't read players locale, you will be unable to automatically detect players language. Only Bukkit 1.7+ is supported for this.", e);
+336 }
+337 }
+338
+339 public TimingManager getTimings() {
+340 return timingManager;
+341 }
+342
+343 @Override
+344 public RootCommand createRootCommand(String cmd) {
+345 return new BukkitRootCommand(this, cmd);
+346 }
+347
+348 @Override
+349 public Collection<RootCommand> getRegisteredRootCommands() {
+350 return Collections.unmodifiableCollection(registeredCommands.values());
+351 }
+352
+353 @Override
+354 public BukkitCommandIssuer getCommandIssuer(Object issuer) {
+355 if (!(issuer instanceof CommandSender)) {
+356 throw new IllegalArgumentException(issuer.getClass().getName() + " is not a Command Issuer.");
+357 }
+358 return new BukkitCommandIssuer(this, (CommandSender) issuer);
+359 }
+360
+361 @Override
+362 public BukkitCommandExecutionContext createCommandContext(RegisteredCommand command, CommandParameter parameter, CommandIssuer sender, List<String> args, int i, Map<String, Object> passedArgs) {
+363 return new BukkitCommandExecutionContext(command, parameter, (BukkitCommandIssuer) sender, args, i, passedArgs);
+364 }
+365
+366 @Override
+367 public BukkitCommandCompletionContext createCompletionContext(RegisteredCommand command, CommandIssuer sender, String input, String config, String[] args) {
+368 return new BukkitCommandCompletionContext(command, (BukkitCommandIssuer) sender, input, config, args);
+369 }
+370
+371 @Override
+372 public RegisteredCommand createRegisteredCommand(BaseCommand command, String cmdName, Method method, String prefSubCommand) {
+373 return new BukkitRegisteredCommand(command, cmdName, method, prefSubCommand);
+374 }
+375
+376 @Override
+377 public BukkitConditionContext createConditionContext(CommandIssuer issuer, String config) {
+378 return new BukkitConditionContext((BukkitCommandIssuer) issuer, config);
+379 }
+380
381
-382
-383 @Override
-384 public void log(LogLevel level, String message, Throwable throwable) {
-385 Level logLevel = level == LogLevel.INFO ? Level.INFO : Level.SEVERE;
-386 logger.log(logLevel, LogLevel.LOG_PREFIX + message);
-387 if (throwable != null) {
-388 for (String line : ACFPatterns.NEWLINE.split(ApacheCommonsExceptionUtil.getFullStackTrace(throwable))) {
-389 logger.log(logLevel, LogLevel.LOG_PREFIX + line);
-390 }
-391 }
-392 }
-393
-394 public boolean usePerIssuerLocale(boolean usePerIssuerLocale, boolean autoDetectFromClient) {
-395 boolean old = this.usePerIssuerLocale;
-396 this.usePerIssuerLocale = usePerIssuerLocale;
-397 this.autoDetectFromClient = autoDetectFromClient;
-398 return old;
-399 }
-400
-401 @Override
-402 public String getCommandPrefix(CommandIssuer issuer) {
-403 return issuer.isPlayer() ? "/" : "";
-404 }
-405
-406 @Override
-407 protected boolean handleUncaughtException(BaseCommand scope, RegisteredCommand registeredCommand, CommandIssuer sender, List<String> args, Throwable t) {
-408 if (t instanceof CommandException && t.getCause() != null && t.getMessage().startsWith("Unhandled exception")) {
-409 t = t.getCause();
-410 }
-411 return super.handleUncaughtException(scope, registeredCommand, sender, args, t);
-412 }
-413}
+382 @Override
+383 public void log(LogLevel level, String message, Throwable throwable) {
+384 Level logLevel = level == LogLevel.INFO ? Level.INFO : Level.SEVERE;
+385 logger.log(logLevel, LogLevel.LOG_PREFIX + message);
+386 if (throwable != null) {
+387 for (String line : ACFPatterns.NEWLINE.split(ApacheCommonsExceptionUtil.getFullStackTrace(throwable))) {
+388 logger.log(logLevel, LogLevel.LOG_PREFIX + line);
+389 }
+390 }
+391 }
+392
+393 public boolean usePerIssuerLocale(boolean usePerIssuerLocale, boolean autoDetectFromClient) {
+394 boolean old = this.usePerIssuerLocale;
+395 this.usePerIssuerLocale = usePerIssuerLocale;
+396 this.autoDetectFromClient = autoDetectFromClient;
+397 return old;
+398 }
+399
+400 @Override
+401 public String getCommandPrefix(CommandIssuer issuer) {
+402 return issuer.isPlayer() ? "/" : "";
+403 }
+404
+405 @Override
+406 protected boolean handleUncaughtException(BaseCommand scope, RegisteredCommand registeredCommand, CommandIssuer sender, List<String> args, Throwable t) {
+407 if (t instanceof CommandException && t.getCause() != null && t.getMessage().startsWith("Unhandled exception")) {
+408 t = t.getCause();
+409 }
+410 return super.handleUncaughtException(scope, registeredCommand, sender, args, t);
+411 }
+412}
diff --git a/docs/acf-bukkit/src-html/co/aikar/commands/BukkitLocales.html b/docs/acf-bukkit/src-html/co/aikar/commands/BukkitLocales.html
index 060a9f70..7e424eb3 100644
--- a/docs/acf-bukkit/src-html/co/aikar/commands/BukkitLocales.html
+++ b/docs/acf-bukkit/src-html/co/aikar/commands/BukkitLocales.html
@@ -63,55 +63,58 @@
050
051 /**
052 * Loads the given file
-053 * @param file
-054 * @param locale
-055 * @return If any language keys were added
-056 * @throws IOException
-057 * @throws InvalidConfigurationException
-058 */
-059 public boolean loadYamlLanguageFile(File file, Locale locale) throws IOException, InvalidConfigurationException {
-060 YamlConfiguration yamlConfiguration = new YamlConfiguration();
-061 yamlConfiguration.load(file);
-062 return loadLanguage(yamlConfiguration, locale);
-063 }
-064
-065 /**
-066 * Loads a file out of the plugins data folder by the given name
-067 * @param file
-068 * @param locale
-069 * @return If any language keys were added
-070 * @throws IOException
-071 * @throws InvalidConfigurationException
-072 */
-073 public boolean loadYamlLanguageFile(String file, Locale locale) throws IOException, InvalidConfigurationException {
-074 YamlConfiguration yamlConfiguration = new YamlConfiguration();
-075 yamlConfiguration.load(new File(this.manager.plugin.getDataFolder(), file));
-076 return loadLanguage(yamlConfiguration, locale);
-077 }
-078
-079 /**
-080 * Loads every message from the Configuration object. Any nested values will be treated as namespace
-081 * so acf-core:\n\tfoo: bar will be acf-core.foo = bar
-082 * @param config
-083 * @param locale
-084 * @return If any language keys were added
-085 */
-086 public boolean loadLanguage(FileConfiguration config, Locale locale) {
-087 boolean loaded = false;
-088 for (String key : config.getKeys(true)) {
-089 if (config.isString(key) || config.isDouble(key) || config.isLong(key) || config.isInt(key)
-090 || config.isBoolean(key)) {
-091 String value = config.getString(key);
-092 if (value != null && !value.isEmpty()) {
-093 addMessage(locale, MessageKey.of(key), value);
-094 loaded = true;
-095 }
-096 }
-097 }
-098
-099 return loaded;
-100 }
-101}
+053 *
+054 * @param file
+055 * @param locale
+056 * @return If any language keys were added
+057 * @throws IOException
+058 * @throws InvalidConfigurationException
+059 */
+060 public boolean loadYamlLanguageFile(File file, Locale locale) throws IOException, InvalidConfigurationException {
+061 YamlConfiguration yamlConfiguration = new YamlConfiguration();
+062 yamlConfiguration.load(file);
+063 return loadLanguage(yamlConfiguration, locale);
+064 }
+065
+066 /**
+067 * Loads a file out of the plugin's data folder by the given name
+068 *
+069 * @param file
+070 * @param locale
+071 * @return If any language keys were added
+072 * @throws IOException
+073 * @throws InvalidConfigurationException
+074 */
+075 public boolean loadYamlLanguageFile(String file, Locale locale) throws IOException, InvalidConfigurationException {
+076 YamlConfiguration yamlConfiguration = new YamlConfiguration();
+077 yamlConfiguration.load(new File(this.manager.plugin.getDataFolder(), file));
+078 return loadLanguage(yamlConfiguration, locale);
+079 }
+080
+081 /**
+082 * Loads every message from the Configuration object. Any nested values will be treated as namespace
+083 * so acf-core:\n\tfoo: bar will be acf-core.foo = bar
+084 *
+085 * @param config
+086 * @param locale
+087 * @return If any language keys were added
+088 */
+089 public boolean loadLanguage(FileConfiguration config, Locale locale) {
+090 boolean loaded = false;
+091 for (String key : config.getKeys(true)) {
+092 if (config.isString(key) || config.isDouble(key) || config.isLong(key) || config.isInt(key)
+093 || config.isBoolean(key)) {
+094 String value = config.getString(key);
+095 if (value != null && !value.isEmpty()) {
+096 addMessage(locale, MessageKey.of(key), value);
+097 loaded = true;
+098 }
+099 }
+100 }
+101
+102 return loaded;
+103 }
+104}
diff --git a/docs/acf-bungee/co/aikar/commands/BungeeLocales.html b/docs/acf-bungee/co/aikar/commands/BungeeLocales.html
index b961654d..7cc1b697 100644
--- a/docs/acf-bungee/co/aikar/commands/BungeeLocales.html
+++ b/docs/acf-bungee/co/aikar/commands/BungeeLocales.html
@@ -135,7 +135,7 @@ loadScripts(document, 'script');
-
Loads a file out of the plugins data folder by the given name
+
Loads a file out of the plugin's data folder by the given name
@@ -205,7 +205,7 @@ loadScripts(document, 'script');
-Loads a file out of the plugins data folder by the given name
+Loads a file out of the plugin's data folder by the given name
- Parameters:
file -
diff --git a/docs/acf-bungee/index-all.html b/docs/acf-bungee/index-all.html
index a829ada2..ebe97054 100644
--- a/docs/acf-bungee/index-all.html
+++ b/docs/acf-bungee/index-all.html
@@ -237,7 +237,7 @@ loadScripts(document, 'script');
- loadYamlLanguageFile(String, Locale) - Method in class co.aikar.commands.BungeeLocales
-
-
Loads a file out of the plugins data folder by the given name
+Loads a file out of the plugin's data folder by the given name
- locales - Variable in class co.aikar.commands.BungeeCommandManager
-
diff --git a/docs/acf-bungee/src-html/co/aikar/commands/BungeeCommandManager.html b/docs/acf-bungee/src-html/co/aikar/commands/BungeeCommandManager.html
index d699bd43..3dcd64f0 100644
--- a/docs/acf-bungee/src-html/co/aikar/commands/BungeeCommandManager.html
+++ b/docs/acf-bungee/src-html/co/aikar/commands/BungeeCommandManager.html
@@ -61,7 +61,7 @@
048 BungeeMessageFormatter,
049 BungeeCommandExecutionContext,
050 BungeeConditionContext
-051 > {
+051 > {
052
053 protected final Plugin plugin;
054 protected Map<String, BungeeRootCommand> registeredCommands = new HashMap<>();
@@ -124,7 +124,7 @@
111 return;
112 }
113
-114 //This can be null if we didn't received a settings packet
+114 //This can be null if we didn't receive a settings packet
115 Locale locale = player.getLocale();
116 if (locale != null) {
117 setIssuerLocale(player, player.getLocale());
@@ -150,7 +150,7 @@
137 String commandName = entry.getKey().toLowerCase(Locale.ENGLISH);
138 BungeeRootCommand bungeeCommand = (BungeeRootCommand) entry.getValue();
139 bungeeCommand.getSubCommands().values().removeAll(command.subCommands.values());
-140 if (bungeeCommand.getSubCommands().isEmpty() && bungeeCommand.isRegistered) {
+140 if (bungeeCommand.getSubCommands().isEmpty() && bungeeCommand.isRegistered) {
141 unregisterCommand(bungeeCommand);
142 bungeeCommand.isRegistered = false;
143 registeredCommands.remove(commandName);
@@ -190,7 +190,7 @@
177 public RootCommand createRootCommand(String cmd) {
178 return new BungeeRootCommand(this, cmd);
179 }
-180
+180
181 @Override
182 public Collection<RootCommand> getRegisteredRootCommands() {
183 return Collections.unmodifiableCollection(registeredCommands.values());
diff --git a/docs/acf-bungee/src-html/co/aikar/commands/BungeeLocales.html b/docs/acf-bungee/src-html/co/aikar/commands/BungeeLocales.html
index ccb76c79..cfcb2090 100644
--- a/docs/acf-bungee/src-html/co/aikar/commands/BungeeLocales.html
+++ b/docs/acf-bungee/src-html/co/aikar/commands/BungeeLocales.html
@@ -53,7 +53,7 @@
040 }
041
042 /**
-043 * Loads a file out of the plugins data folder by the given name
+043 * Loads a file out of the plugin's data folder by the given name
044 *
045 * @param file
046 * @param locale
diff --git a/docs/acf-core/co/aikar/commands/ACFUtil.html b/docs/acf-core/co/aikar/commands/ACFUtil.html
index 436ce03f..9388adb6 100644
--- a/docs/acf-core/co/aikar/commands/ACFUtil.html
+++ b/docs/acf-core/co/aikar/commands/ACFUtil.html
@@ -913,13 +913,13 @@ loadScripts(document, 'script');
isBetween
-public static boolean isBetween(float num,
+public static boolean isBetween(float num,
double min,
double max)
@@ -927,27 +927,27 @@ loadScripts(document, 'script');
precision
-
- See Also:
diff --git a/docs/acf-core/co/aikar/commands/CommandManager.html b/docs/acf-core/co/aikar/commands/CommandManager.html
index f646168c..9cd5fcb6 100644
--- a/docs/acf-core/co/aikar/commands/CommandManager.html
+++ b/docs/acf-core/co/aikar/commands/CommandManager.html
@@ -392,13 +392,13 @@ loadScripts(document, 'script');
void
-
Sets the default
ExceptionHandler that is called when an exception occurs while executing a command, if the command doesn't have it's own exception handler registered.
+
Sets the default
ExceptionHandler that is called when an exception occurs while executing a command, if the command doesn't have its own exception handler registered.
void
-
Sets the default
ExceptionHandler that is called when an exception occurs while executing a command, if the command doesn't have it's own exception handler registered, and lets you control if ACF should also log the exception still.
+
Sets the default
ExceptionHandler that is called when an exception occurs while executing a command, if the command doesn't have its own exception handler registered, and lets you control if ACF should also log the exception still.
void
@@ -890,7 +890,7 @@ loadScripts(document, 'script');
setDefaultExceptionHandler
-Sets the default
ExceptionHandler that is called when an exception occurs while executing a command, if the command doesn't have it's own exception handler registered.
+Sets the default
ExceptionHandler that is called when an exception occurs while executing a command, if the command doesn't have its own exception handler registered.
- Parameters:
exceptionHandler - the handler that should handle uncaught exceptions. May not be null if logExceptions is false
@@ -902,7 +902,7 @@ loadScripts(document, 'script');
setDefaultExceptionHandler
-Sets the default
ExceptionHandler that is called when an exception occurs while executing a command, if the command doesn't have it's own exception handler registered, and lets you control if ACF should also log the exception still.
+
Sets the default
ExceptionHandler that is called when an exception occurs while executing a command, if the command doesn't have its own exception handler registered, and lets you control if ACF should also log the exception still.
If you disable logging, you need to log it yourself in your handler.
diff --git a/docs/acf-core/co/aikar/commands/RegisteredCommand.html b/docs/acf-core/co/aikar/commands/RegisteredCommand.html
index b25ed9f3..6cf68111 100644
--- a/docs/acf-core/co/aikar/commands/RegisteredCommand.html
+++ b/docs/acf-core/co/aikar/commands/RegisteredCommand.html
@@ -198,7 +198,7 @@ loadScripts(document, 'script');
Deprecated.
- See Also:
@@ -213,67 +213,67 @@ loadScripts(document, 'script');
-
getRequiredPermissions
-
+
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/acf-core/co/aikar/commands/class-use/ExceptionHandler.html b/docs/acf-core/co/aikar/commands/class-use/ExceptionHandler.html
index 428930d5..2e0afce8 100644
--- a/docs/acf-core/co/aikar/commands/class-use/ExceptionHandler.html
+++ b/docs/acf-core/co/aikar/commands/class-use/ExceptionHandler.html
@@ -93,13 +93,13 @@ loadScripts(document, 'script');
void
-
Sets the default
ExceptionHandler that is called when an exception occurs while executing a command, if the command doesn't have it's own exception handler registered.
+
Sets the default
ExceptionHandler that is called when an exception occurs while executing a command, if the command doesn't have its own exception handler registered.
void
-
Sets the default
ExceptionHandler that is called when an exception occurs while executing a command, if the command doesn't have it's own exception handler registered, and lets you control if ACF should also log the exception still.
+
Sets the default
ExceptionHandler that is called when an exception occurs while executing a command, if the command doesn't have its own exception handler registered, and lets you control if ACF should also log the exception still.
diff --git a/docs/acf-core/co/aikar/commands/contexts/class-use/IssuerAwareContextResolver.html b/docs/acf-core/co/aikar/commands/contexts/class-use/IssuerAwareContextResolver.html
index 2cf0357e..c46330f1 100644
--- a/docs/acf-core/co/aikar/commands/contexts/class-use/IssuerAwareContextResolver.html
+++ b/docs/acf-core/co/aikar/commands/contexts/class-use/IssuerAwareContextResolver.html
@@ -82,7 +82,7 @@ loadScripts(document, 'script');
Deprecated.
+ as the core wants to use the platform-agnostic term of "Issuer" instead of Sender
diff --git a/docs/acf-core/deprecated-list.html b/docs/acf-core/deprecated-list.html
index 34297cc6..6e4da380 100644
--- a/docs/acf-core/deprecated-list.html
+++ b/docs/acf-core/deprecated-list.html
@@ -133,7 +133,7 @@ loadScripts(document, 'script');
+ as the core wants to use the platform-agnostic term of "Issuer" instead of Sender
diff --git a/docs/acf-core/index-all.html b/docs/acf-core/index-all.html
index 6631d58f..d653eb31 100644
--- a/docs/acf-core/index-all.html
+++ b/docs/acf-core/index-all.html
@@ -1586,7 +1586,7 @@ loadScripts(document, 'script');
Deprecated.
+ as the core wants to use the platform-agnostic term of "Issuer" instead of Sender
registerStaticCompletion(String, String) - Method in class co.aikar.commands.CommandCompletions
@@ -1730,11 +1730,11 @@ loadScripts(document, 'script');
setDefaultExceptionHandler(ExceptionHandler) - Method in class co.aikar.commands.CommandManager
-Sets the default
ExceptionHandler that is called when an exception occurs while executing a command, if the command doesn't have it's own exception handler registered.
+Sets the default
ExceptionHandler that is called when an exception occurs while executing a command, if the command doesn't have its own exception handler registered.
setDefaultExceptionHandler(ExceptionHandler, boolean) - Method in class co.aikar.commands.CommandManager
-Sets the default
ExceptionHandler that is called when an exception occurs while executing a command, if the command doesn't have it's own exception handler registered, and lets you control if ACF should also log the exception still.
+Sets the default
ExceptionHandler that is called when an exception occurs while executing a command, if the command doesn't have its own exception handler registered, and lets you control if ACF should also log the exception still.
setDefaultFormatter(MF) - Method in class co.aikar.commands.CommandManager
diff --git a/docs/acf-core/src-html/co/aikar/commands/ACFUtil.html b/docs/acf-core/src-html/co/aikar/commands/ACFUtil.html
index 5d00ca82..080c384f 100644
--- a/docs/acf-core/src-html/co/aikar/commands/ACFUtil.html
+++ b/docs/acf-core/src-html/co/aikar/commands/ACFUtil.html
@@ -589,104 +589,102 @@
576
577 public static boolean isFloat(String string) {
578 try {
-579 //noinspection ResultOfMethodCallIgnored
-580 Float.parseFloat(string);
-581 return true;
-582 } catch (Exception e) {
-583 return false;
-584 }
-585 }
-586
-587 public static boolean isDouble(String string) {
-588 try {
-589 //noinspection ResultOfMethodCallIgnored
-590 Double.parseDouble(string);
-591 return true;
-592 } catch (Exception e) {
-593 return false;
-594 }
-595 }
-596
-597 public static boolean isBetween(float num, double min, double max) {
-598 return num >= min && num <= max;
-599 }
-600
-601 @SuppressWarnings("SameParameterValue")
-602 public static double precision(double x, int p) {
-603 double pow = Math.pow(10, p);
-604 return Math.round(x * pow) / pow;
-605 }
-606
-607 public static void sneaky(Throwable t) {
-608 //noinspection RedundantTypeArguments
-609 throw ACFUtil.<RuntimeException>superSneaky(t);
-610 }
-611
-612 private static <T extends Throwable> T superSneaky(Throwable t) throws T {
-613 //noinspection ConstantConditions,unchecked
-614 throw (T) t;
-615 }
-616
-617 public static <T> List<T> preformOnImmutable(List<T> list, Consumer<List<T>> action) {
-618 try {
-619 action.accept(list);
-620 } catch (UnsupportedOperationException ex) {
-621 list = new ArrayList<>(list);
-622 action.accept(list);
-623 }
-624
-625 return list;
-626 }
-627
-628 public static <T> T getFirstElement(Iterable<T> iterable) {
-629 if (iterable == null) {
-630 return null;
-631 }
-632 Iterator<T> iterator = iterable.iterator();
-633 if (iterator.hasNext()) {
-634 return iterator.next();
-635 }
-636
-637 return null;
-638 }
-639
-640 private static class ApplyModifierToNumber {
-641 private String num;
-642 private boolean suffixes;
-643 private double mod;
-644
-645 public ApplyModifierToNumber(String num, boolean suffixes) {
-646 this.num = num;
-647 this.suffixes = suffixes;
-648 }
-649
-650 public String getNum() {
-651 return num;
-652 }
-653
-654 public double getMod() {
-655 return mod;
-656 }
-657
-658 public ApplyModifierToNumber invoke() {
-659 mod = 1;
-660 if (suffixes) {
-661 switch (num.charAt(num.length() - 1)) {
-662 case 'M':
-663 case 'm':
-664 mod = 1000000D;
-665 num = num.substring(0, num.length() - 1);
-666 break;
-667 case 'K':
-668 case 'k':
-669 mod = 1000D;
-670 num = num.substring(0, num.length() - 1);
-671 }
-672 }
-673 return this;
-674 }
-675 }
-676}
+579 Float.parseFloat(string);
+580 return true;
+581 } catch (Exception e) {
+582 return false;
+583 }
+584 }
+585
+586 public static boolean isDouble(String string) {
+587 try {
+588 Double.parseDouble(string);
+589 return true;
+590 } catch (Exception e) {
+591 return false;
+592 }
+593 }
+594
+595 public static boolean isBetween(float num, double min, double max) {
+596 return num >= min && num <= max;
+597 }
+598
+599 @SuppressWarnings("SameParameterValue")
+600 public static double precision(double x, int p) {
+601 double pow = Math.pow(10, p);
+602 return Math.round(x * pow) / pow;
+603 }
+604
+605 public static void sneaky(Throwable t) {
+606 //noinspection RedundantTypeArguments
+607 throw ACFUtil.<RuntimeException>superSneaky(t);
+608 }
+609
+610 private static <T extends Throwable> T superSneaky(Throwable t) throws T {
+611 // noinspection unchecked
+612 throw (T) t;
+613 }
+614
+615 public static <T> List<T> preformOnImmutable(List<T> list, Consumer<List<T>> action) {
+616 try {
+617 action.accept(list);
+618 } catch (UnsupportedOperationException ex) {
+619 list = new ArrayList<>(list);
+620 action.accept(list);
+621 }
+622
+623 return list;
+624 }
+625
+626 public static <T> T getFirstElement(Iterable<T> iterable) {
+627 if (iterable == null) {
+628 return null;
+629 }
+630 Iterator<T> iterator = iterable.iterator();
+631 if (iterator.hasNext()) {
+632 return iterator.next();
+633 }
+634
+635 return null;
+636 }
+637
+638 private static class ApplyModifierToNumber {
+639 private String num;
+640 private boolean suffixes;
+641 private double mod;
+642
+643 public ApplyModifierToNumber(String num, boolean suffixes) {
+644 this.num = num;
+645 this.suffixes = suffixes;
+646 }
+647
+648 public String getNum() {
+649 return num;
+650 }
+651
+652 public double getMod() {
+653 return mod;
+654 }
+655
+656 public ApplyModifierToNumber invoke() {
+657 mod = 1;
+658 if (suffixes) {
+659 switch (num.charAt(num.length() - 1)) {
+660 case 'M':
+661 case 'm':
+662 mod = 1000000D;
+663 num = num.substring(0, num.length() - 1);
+664 break;
+665 case 'K':
+666 case 'k':
+667 mod = 1000D;
+668 num = num.substring(0, num.length() - 1);
+669 }
+670 }
+671 return this;
+672 }
+673 }
+674}
diff --git a/docs/acf-core/src-html/co/aikar/commands/CommandConditions.Condition.html b/docs/acf-core/src-html/co/aikar/commands/CommandConditions.Condition.html
index f2df9cb7..d47aa876 100644
--- a/docs/acf-core/src-html/co/aikar/commands/CommandConditions.Condition.html
+++ b/docs/acf-core/src-html/co/aikar/commands/CommandConditions.Condition.html
@@ -44,11 +44,11 @@
031import java.util.Map;
032
033@SuppressWarnings("BooleanMethodIsAlwaysInverted") // No IDEA, you are wrong
-034public class CommandConditions <
+034public class CommandConditions<
035 I extends CommandIssuer,
036 CEC extends CommandExecutionContext<CEC, I>,
037 CC extends ConditionContext<I>
-038 > {
+038 > {
039 private CommandManager manager;
040 private Map<String, Condition<I>> conditions = new HashMap<>();
041 private Table<Class<?>, String, ParameterCondition<?, ?, ?>> paramConditions = new Table<>();
@@ -101,55 +101,54 @@
088 String config = split.length == 2 ? split[1] : null;
089 //noinspection unchecked
090 CC conditionContext = (CC) this.manager.createConditionContext(issuer, config);
-091 //noinspection unchecked
-092 condition.validateCondition(conditionContext);
-093 }
-094 }
-095
-096 void validateConditions(CEC execContext, Object value) throws InvalidCommandArgument {
-097 String conditions = execContext.getCommandParameter().getConditions();
-098 if (conditions == null) {
-099 return;
-100 }
-101 conditions = this.manager.getCommandReplacements().replace(conditions);
-102 I issuer = execContext.getIssuer();
-103 for (String cond : ACFPatterns.PIPE.split(conditions)) {
-104 String[] split = ACFPatterns.COLON.split(cond, 2);
-105 ParameterCondition condition;
-106 Class<?> cls = execContext.getParam().getType();
-107 String id = split[0].toLowerCase(Locale.ENGLISH);
-108 do {
-109 condition = this.paramConditions.get(cls, id);
-110 if (condition == null && cls.getSuperclass() != null && cls.getSuperclass() != Object.class) {
-111 cls = cls.getSuperclass();
-112 } else {
-113 break;
-114 }
-115 } while (cls != null);
+091 condition.validateCondition(conditionContext);
+092 }
+093 }
+094
+095 void validateConditions(CEC execContext, Object value) throws InvalidCommandArgument {
+096 String conditions = execContext.getCommandParameter().getConditions();
+097 if (conditions == null) {
+098 return;
+099 }
+100 conditions = this.manager.getCommandReplacements().replace(conditions);
+101 I issuer = execContext.getIssuer();
+102 for (String cond : ACFPatterns.PIPE.split(conditions)) {
+103 String[] split = ACFPatterns.COLON.split(cond, 2);
+104 ParameterCondition condition;
+105 Class<?> cls = execContext.getParam().getType();
+106 String id = split[0].toLowerCase(Locale.ENGLISH);
+107 do {
+108 condition = this.paramConditions.get(cls, id);
+109 if (condition == null && cls.getSuperclass() != null && cls.getSuperclass() != Object.class) {
+110 cls = cls.getSuperclass();
+111 } else {
+112 break;
+113 }
+114 } while (cls != null);
+115
116
-117
-118 if (condition == null) {
-119 RegisteredCommand cmd = execContext.getCmd();
-120 this.manager.log(LogLevel.ERROR, "Could not find command condition " + id + " for " + cmd.method.getName() + "::" +execContext.getParam().getName());
-121 continue;
-122 }
-123 String config = split.length == 2 ? split[1] : null;
-124 //noinspection unchecked
-125 CC conditionContext = (CC) this.manager.createConditionContext(issuer, config);
-126
-127 //noinspection unchecked
-128 condition.validateCondition(conditionContext, execContext, value);
-129 }
-130 }
-131
-132 public interface Condition <I extends CommandIssuer> {
-133 void validateCondition(ConditionContext<I> context) throws InvalidCommandArgument;
-134 }
-135
-136 public interface ParameterCondition <P, CEC extends CommandExecutionContext, I extends CommandIssuer> {
-137 void validateCondition(ConditionContext<I> context, CEC execContext, P value) throws InvalidCommandArgument;
-138 }
-139}
+117 if (condition == null) {
+118 RegisteredCommand cmd = execContext.getCmd();
+119 this.manager.log(LogLevel.ERROR, "Could not find command condition " + id + " for " + cmd.method.getName() + "::" + execContext.getParam().getName());
+120 continue;
+121 }
+122 String config = split.length == 2 ? split[1] : null;
+123 //noinspection unchecked
+124 CC conditionContext = (CC) this.manager.createConditionContext(issuer, config);
+125
+126 //noinspection unchecked
+127 condition.validateCondition(conditionContext, execContext, value);
+128 }
+129 }
+130
+131 public interface Condition<I extends CommandIssuer> {
+132 void validateCondition(ConditionContext<I> context) throws InvalidCommandArgument;
+133 }
+134
+135 public interface ParameterCondition<P, CEC extends CommandExecutionContext, I extends CommandIssuer> {
+136 void validateCondition(ConditionContext<I> context, CEC execContext, P value) throws InvalidCommandArgument;
+137 }
+138}
diff --git a/docs/acf-core/src-html/co/aikar/commands/CommandConditions.ParameterCondition.html b/docs/acf-core/src-html/co/aikar/commands/CommandConditions.ParameterCondition.html
index eb792d6b..1b13f9bb 100644
--- a/docs/acf-core/src-html/co/aikar/commands/CommandConditions.ParameterCondition.html
+++ b/docs/acf-core/src-html/co/aikar/commands/CommandConditions.ParameterCondition.html
@@ -44,11 +44,11 @@
031import java.util.Map;
032
033@SuppressWarnings("BooleanMethodIsAlwaysInverted") // No IDEA, you are wrong
-034public class CommandConditions <
+034public class CommandConditions<
035 I extends CommandIssuer,
036 CEC extends CommandExecutionContext<CEC, I>,
037 CC extends ConditionContext<I>
-038 > {
+038 > {
039 private CommandManager manager;
040 private Map<String, Condition<I>> conditions = new HashMap<>();
041 private Table<Class<?>, String, ParameterCondition<?, ?, ?>> paramConditions = new Table<>();
@@ -101,55 +101,54 @@
088 String config = split.length == 2 ? split[1] : null;
089 //noinspection unchecked
090 CC conditionContext = (CC) this.manager.createConditionContext(issuer, config);
-091 //noinspection unchecked
-092 condition.validateCondition(conditionContext);
-093 }
-094 }
-095
-096 void validateConditions(CEC execContext, Object value) throws InvalidCommandArgument {
-097 String conditions = execContext.getCommandParameter().getConditions();
-098 if (conditions == null) {
-099 return;
-100 }
-101 conditions = this.manager.getCommandReplacements().replace(conditions);
-102 I issuer = execContext.getIssuer();
-103 for (String cond : ACFPatterns.PIPE.split(conditions)) {
-104 String[] split = ACFPatterns.COLON.split(cond, 2);
-105 ParameterCondition condition;
-106 Class<?> cls = execContext.getParam().getType();
-107 String id = split[0].toLowerCase(Locale.ENGLISH);
-108 do {
-109 condition = this.paramConditions.get(cls, id);
-110 if (condition == null && cls.getSuperclass() != null && cls.getSuperclass() != Object.class) {
-111 cls = cls.getSuperclass();
-112 } else {
-113 break;
-114 }
-115 } while (cls != null);
+091 condition.validateCondition(conditionContext);
+092 }
+093 }
+094
+095 void validateConditions(CEC execContext, Object value) throws InvalidCommandArgument {
+096 String conditions = execContext.getCommandParameter().getConditions();
+097 if (conditions == null) {
+098 return;
+099 }
+100 conditions = this.manager.getCommandReplacements().replace(conditions);
+101 I issuer = execContext.getIssuer();
+102 for (String cond : ACFPatterns.PIPE.split(conditions)) {
+103 String[] split = ACFPatterns.COLON.split(cond, 2);
+104 ParameterCondition condition;
+105 Class<?> cls = execContext.getParam().getType();
+106 String id = split[0].toLowerCase(Locale.ENGLISH);
+107 do {
+108 condition = this.paramConditions.get(cls, id);
+109 if (condition == null && cls.getSuperclass() != null && cls.getSuperclass() != Object.class) {
+110 cls = cls.getSuperclass();
+111 } else {
+112 break;
+113 }
+114 } while (cls != null);
+115
116
-117
-118 if (condition == null) {
-119 RegisteredCommand cmd = execContext.getCmd();
-120 this.manager.log(LogLevel.ERROR, "Could not find command condition " + id + " for " + cmd.method.getName() + "::" +execContext.getParam().getName());
-121 continue;
-122 }
-123 String config = split.length == 2 ? split[1] : null;
-124 //noinspection unchecked
-125 CC conditionContext = (CC) this.manager.createConditionContext(issuer, config);
-126
-127 //noinspection unchecked
-128 condition.validateCondition(conditionContext, execContext, value);
-129 }
-130 }
-131
-132 public interface Condition <I extends CommandIssuer> {
-133 void validateCondition(ConditionContext<I> context) throws InvalidCommandArgument;
-134 }
-135
-136 public interface ParameterCondition <P, CEC extends CommandExecutionContext, I extends CommandIssuer> {
-137 void validateCondition(ConditionContext<I> context, CEC execContext, P value) throws InvalidCommandArgument;
-138 }
-139}
+117 if (condition == null) {
+118 RegisteredCommand cmd = execContext.getCmd();
+119 this.manager.log(LogLevel.ERROR, "Could not find command condition " + id + " for " + cmd.method.getName() + "::" + execContext.getParam().getName());
+120 continue;
+121 }
+122 String config = split.length == 2 ? split[1] : null;
+123 //noinspection unchecked
+124 CC conditionContext = (CC) this.manager.createConditionContext(issuer, config);
+125
+126 //noinspection unchecked
+127 condition.validateCondition(conditionContext, execContext, value);
+128 }
+129 }
+130
+131 public interface Condition<I extends CommandIssuer> {
+132 void validateCondition(ConditionContext<I> context) throws InvalidCommandArgument;
+133 }
+134
+135 public interface ParameterCondition<P, CEC extends CommandExecutionContext, I extends CommandIssuer> {
+136 void validateCondition(ConditionContext<I> context, CEC execContext, P value) throws InvalidCommandArgument;
+137 }
+138}
diff --git a/docs/acf-core/src-html/co/aikar/commands/CommandConditions.html b/docs/acf-core/src-html/co/aikar/commands/CommandConditions.html
index 5e0851f9..94e7b9a8 100644
--- a/docs/acf-core/src-html/co/aikar/commands/CommandConditions.html
+++ b/docs/acf-core/src-html/co/aikar/commands/CommandConditions.html
@@ -44,11 +44,11 @@
031import java.util.Map;
032
033@SuppressWarnings("BooleanMethodIsAlwaysInverted") // No IDEA, you are wrong
-034public class CommandConditions <
+034public class CommandConditions<
035 I extends CommandIssuer,
036 CEC extends CommandExecutionContext<CEC, I>,
037 CC extends ConditionContext<I>
-038 > {
+038 > {
039 private CommandManager manager;
040 private Map<String, Condition<I>> conditions = new HashMap<>();
041 private Table<Class<?>, String, ParameterCondition<?, ?, ?>> paramConditions = new Table<>();
@@ -101,55 +101,54 @@
088 String config = split.length == 2 ? split[1] : null;
089 //noinspection unchecked
090 CC conditionContext = (CC) this.manager.createConditionContext(issuer, config);
-091 //noinspection unchecked
-092 condition.validateCondition(conditionContext);
-093 }
-094 }
-095
-096 void validateConditions(CEC execContext, Object value) throws InvalidCommandArgument {
-097 String conditions = execContext.getCommandParameter().getConditions();
-098 if (conditions == null) {
-099 return;
-100 }
-101 conditions = this.manager.getCommandReplacements().replace(conditions);
-102 I issuer = execContext.getIssuer();
-103 for (String cond : ACFPatterns.PIPE.split(conditions)) {
-104 String[] split = ACFPatterns.COLON.split(cond, 2);
-105 ParameterCondition condition;
-106 Class<?> cls = execContext.getParam().getType();
-107 String id = split[0].toLowerCase(Locale.ENGLISH);
-108 do {
-109 condition = this.paramConditions.get(cls, id);
-110 if (condition == null && cls.getSuperclass() != null && cls.getSuperclass() != Object.class) {
-111 cls = cls.getSuperclass();
-112 } else {
-113 break;
-114 }
-115 } while (cls != null);
+091 condition.validateCondition(conditionContext);
+092 }
+093 }
+094
+095 void validateConditions(CEC execContext, Object value) throws InvalidCommandArgument {
+096 String conditions = execContext.getCommandParameter().getConditions();
+097 if (conditions == null) {
+098 return;
+099 }
+100 conditions = this.manager.getCommandReplacements().replace(conditions);
+101 I issuer = execContext.getIssuer();
+102 for (String cond : ACFPatterns.PIPE.split(conditions)) {
+103 String[] split = ACFPatterns.COLON.split(cond, 2);
+104 ParameterCondition condition;
+105 Class<?> cls = execContext.getParam().getType();
+106 String id = split[0].toLowerCase(Locale.ENGLISH);
+107 do {
+108 condition = this.paramConditions.get(cls, id);
+109 if (condition == null && cls.getSuperclass() != null && cls.getSuperclass() != Object.class) {
+110 cls = cls.getSuperclass();
+111 } else {
+112 break;
+113 }
+114 } while (cls != null);
+115
116
-117
-118 if (condition == null) {
-119 RegisteredCommand cmd = execContext.getCmd();
-120 this.manager.log(LogLevel.ERROR, "Could not find command condition " + id + " for " + cmd.method.getName() + "::" +execContext.getParam().getName());
-121 continue;
-122 }
-123 String config = split.length == 2 ? split[1] : null;
-124 //noinspection unchecked
-125 CC conditionContext = (CC) this.manager.createConditionContext(issuer, config);
-126
-127 //noinspection unchecked
-128 condition.validateCondition(conditionContext, execContext, value);
-129 }
-130 }
-131
-132 public interface Condition <I extends CommandIssuer> {
-133 void validateCondition(ConditionContext<I> context) throws InvalidCommandArgument;
-134 }
-135
-136 public interface ParameterCondition <P, CEC extends CommandExecutionContext, I extends CommandIssuer> {
-137 void validateCondition(ConditionContext<I> context, CEC execContext, P value) throws InvalidCommandArgument;
-138 }
-139}
+117 if (condition == null) {
+118 RegisteredCommand cmd = execContext.getCmd();
+119 this.manager.log(LogLevel.ERROR, "Could not find command condition " + id + " for " + cmd.method.getName() + "::" + execContext.getParam().getName());
+120 continue;
+121 }
+122 String config = split.length == 2 ? split[1] : null;
+123 //noinspection unchecked
+124 CC conditionContext = (CC) this.manager.createConditionContext(issuer, config);
+125
+126 //noinspection unchecked
+127 condition.validateCondition(conditionContext, execContext, value);
+128 }
+129 }
+130
+131 public interface Condition<I extends CommandIssuer> {
+132 void validateCondition(ConditionContext<I> context) throws InvalidCommandArgument;
+133 }
+134
+135 public interface ParameterCondition<P, CEC extends CommandExecutionContext, I extends CommandIssuer> {
+136 void validateCondition(ConditionContext<I> context, CEC execContext, P value) throws InvalidCommandArgument;
+137 }
+138}
diff --git a/docs/acf-core/src-html/co/aikar/commands/CommandContexts.html b/docs/acf-core/src-html/co/aikar/commands/CommandContexts.html
index f283db5a..82164f2e 100644
--- a/docs/acf-core/src-html/co/aikar/commands/CommandContexts.html
+++ b/docs/acf-core/src-html/co/aikar/commands/CommandContexts.html
@@ -177,7 +177,7 @@
164 return s.charAt(0);
165 });
166 registerContext(String.class, (c) -> {
-167 // This will fail fast, its either in the values or its not
+167 // This will fail fast, it's either in the values or it's not
168 if (c.hasAnnotation(Values.class)) {
169 return c.popFirstArg();
170 }
@@ -252,7 +252,7 @@
239 } else if (first != null && ACFUtil.isInteger(first)) {
240 c.popFirstArg();
241 page = ACFUtil.parseInt(first);
-242 if (page == null){
+242 if (page == null) {
243 throw new InvalidCommandArgument(MessageKeys.MUST_BE_A_NUMBER, "{num}", first);
244 }
245 if (!c.getArgs().isEmpty()) {
@@ -307,7 +307,7 @@
294 /**
295 * @see #registerIssuerAwareContext(Class, IssuerAwareContextResolver)
296 * @deprecated Please switch to {@link #registerIssuerAwareContext(Class, IssuerAwareContextResolver)}
-297 * as the core wants to use the platform agnostic term of "Issuer" instead of Sender
+297 * as the core wants to use the platform-agnostic term of "Issuer" instead of Sender
298 */
299 @Deprecated
300 public <T> void registerSenderAwareContext(Class<T> context, IssuerAwareContextResolver<T, R> supplier) {
diff --git a/docs/acf-core/src-html/co/aikar/commands/CommandManager.html b/docs/acf-core/src-html/co/aikar/commands/CommandManager.html
index 72d9eb0a..1441d338 100644
--- a/docs/acf-core/src-html/co/aikar/commands/CommandManager.html
+++ b/docs/acf-core/src-html/co/aikar/commands/CommandManager.html
@@ -351,7 +351,7 @@
338 }
339
340 /**
-341 * Sets the default {@link ExceptionHandler} that is called when an exception occurs while executing a command, if the command doesn't have it's own exception handler registered.
+341 * Sets the default {@link ExceptionHandler} that is called when an exception occurs while executing a command, if the command doesn't have its own exception handler registered.
342 *
343 * @param exceptionHandler the handler that should handle uncaught exceptions. May not be null if logExceptions is false
344 */
@@ -363,7 +363,7 @@
350 }
351
352 /**
-353 * Sets the default {@link ExceptionHandler} that is called when an exception occurs while executing a command, if the command doesn't have it's own exception handler registered, and lets you control if ACF should also log the exception still.
+353 * Sets the default {@link ExceptionHandler} that is called when an exception occurs while executing a command, if the command doesn't have its own exception handler registered, and lets you control if ACF should also log the exception still.
354 * <p>
355 * If you disable logging, you need to log it yourself in your handler.
356 *
diff --git a/docs/acf-core/src-html/co/aikar/commands/RegisteredCommand.html b/docs/acf-core/src-html/co/aikar/commands/RegisteredCommand.html
index b97d8a29..c861eb13 100644
--- a/docs/acf-core/src-html/co/aikar/commands/RegisteredCommand.html
+++ b/docs/acf-core/src-html/co/aikar/commands/RegisteredCommand.html
@@ -238,157 +238,156 @@
225 final CommandParameter<CEC> parameter = parameters[i];
226 final String parameterName = parameter.getName();
227 final Class<?> type = parameter.getType();
-228 //noinspection unchecked
-229 final ContextResolver<?, CEC> resolver = parameter.getResolver();
-230 //noinspection unchecked
-231 CEC context = (CEC) this.manager.createCommandContext(this, parameter, sender, args, i, passedArgs);
-232 boolean requiresInput = parameter.requiresInput();
-233 if (requiresInput && remainingRequired > 0) {
-234 remainingRequired--;
-235 }
-236
-237 Set<String> parameterPermissions = parameter.getRequiredPermissions();
-238 if (args.isEmpty() && !(isLast && type == String[].class)) {
-239 if (allowOptional && parameter.getDefaultValue() != null) {
-240 args.add(parameter.getDefaultValue());
-241 } else if (allowOptional && parameter.isOptional()) {
-242 Object value;
-243 if (!parameter.isOptionalResolver() || !this.manager.hasPermission(sender, parameterPermissions)) {
-244 value = null;
-245 } else {
-246 value = resolver.getContext(context);
-247 }
-248
-249 if (value == null && parameter.getClass().isPrimitive()) {
-250 throw new IllegalStateException("Parameter " + parameter.getName() + " is primitive and does not support Optional.");
-251 }
-252 //noinspection unchecked
-253 this.manager.getCommandConditions().validateConditions(context, value);
-254 passedArgs.put(parameterName, value);
-255 continue;
-256 } else if (requiresInput) {
-257 scope.showSyntax(sender, this);
-258 return null;
-259 }
-260 } else {
-261 if (!this.manager.hasPermission(sender, parameterPermissions)) {
-262 sender.sendMessage(MessageType.ERROR, MessageKeys.PERMISSION_DENIED_PARAMETER, "{param}", parameterName);
-263 throw new InvalidCommandArgument(false);
-264 }
-265 }
-266
-267 if (parameter.getValues() != null) {
-268 String arg = !args.isEmpty() ? args.get(0) : "";
-269
-270 Set<String> possible = new HashSet<>();
-271 CommandCompletions commandCompletions = this.manager.getCommandCompletions();
-272 for (String s : parameter.getValues()) {
-273 if ("*".equals(s) || "@completions".equals(s)) {
-274 s = commandCompletions.findDefaultCompletion(this, origArgs);
-275 }
-276 //noinspection unchecked
-277 List<String> check = commandCompletions.getCompletionValues(this, sender, s, origArgs, opContext.isAsync());
-278 if (!check.isEmpty()) {
-279 possible.addAll(check.stream().filter(Objects::nonNull).
-280 map(String::toLowerCase).collect(Collectors.toList()));
-281 } else {
-282 possible.add(s.toLowerCase(Locale.ENGLISH));
-283 }
-284 }
-285 if (!possible.contains(arg.toLowerCase(Locale.ENGLISH))) {
-286 throw new InvalidCommandArgument(MessageKeys.PLEASE_SPECIFY_ONE_OF,
-287 "{valid}", ACFUtil.join(possible, ", "));
-288 }
-289 }
-290
-291 Object paramValue = resolver.getContext(context);
-292
-293 //noinspection unchecked
-294 this.manager.getCommandConditions().validateConditions(context, paramValue);
-295 passedArgs.put(parameterName, paramValue);
-296 }
-297 return passedArgs;
-298 }
-299
-300 boolean hasPermission(CommandIssuer issuer) {
-301 return this.manager.hasPermission(issuer, getRequiredPermissions());
-302 }
-303
-304 /**
-305 * @see #getRequiredPermissions()
-306 * @deprecated
-307 */
-308 @Deprecated
-309 public String getPermission() {
-310 if (this.permission == null || this.permission.isEmpty()) {
-311 return null;
-312 }
-313 return ACFPatterns.COMMA.split(this.permission)[0];
-314 }
-315
-316 void computePermissions() {
-317 this.permissions.clear();
-318 this.permissions.addAll(this.scope.getRequiredPermissions());
-319 if (this.permission != null && !this.permission.isEmpty()) {
-320 this.permissions.addAll(Arrays.asList(ACFPatterns.COMMA.split(this.permission)));
-321 }
-322 }
-323
-324 public Set<String> getRequiredPermissions() {
-325 return this.permissions;
-326 }
-327
-328 public boolean requiresPermission(String permission) {
-329 return getRequiredPermissions().contains(permission);
-330 }
-331
-332 public String getPrefSubCommand() {
-333 return prefSubCommand;
-334 }
-335
-336 public String getSyntaxText() {
-337 return getSyntaxText(null);
-338 }
-339
-340 public String getSyntaxText(CommandIssuer issuer) {
-341 if (syntaxText != null) return syntaxText;
-342 StringBuilder syntaxBuilder = new StringBuilder(64);
-343 for (CommandParameter<?> parameter : parameters) {
-344 String syntax = parameter.getSyntax(issuer);
-345 if (syntax != null) {
-346 if (syntaxBuilder.length() > 0) {
-347 syntaxBuilder.append(' ');
-348 }
-349 syntaxBuilder.append(syntax);
-350 }
-351 }
-352 return syntaxBuilder.toString().trim();
-353 }
-354
-355 public String getHelpText() {
-356 return helpText != null ? helpText : "";
-357 }
-358
-359 public boolean isPrivate() {
-360 return isPrivate;
-361 }
-362
-363 public String getCommand() {
-364 return command;
-365 }
-366
-367 public void addSubcommand(String cmd) {
-368 this.registeredSubcommands.add(cmd);
-369 }
-370
-371 public void addSubcommands(Collection<String> cmd) {
-372 this.registeredSubcommands.addAll(cmd);
-373 }
-374
-375 public <T extends Annotation> T getAnnotation(Class<T> annotation) {
-376 return method.getAnnotation(annotation);
-377 }
-378}
+228 final ContextResolver<?, CEC> resolver = parameter.getResolver();
+229 //noinspection unchecked
+230 CEC context = (CEC) this.manager.createCommandContext(this, parameter, sender, args, i, passedArgs);
+231 boolean requiresInput = parameter.requiresInput();
+232 if (requiresInput && remainingRequired > 0) {
+233 remainingRequired--;
+234 }
+235
+236 Set<String> parameterPermissions = parameter.getRequiredPermissions();
+237 if (args.isEmpty() && !(isLast && type == String[].class)) {
+238 if (allowOptional && parameter.getDefaultValue() != null) {
+239 args.add(parameter.getDefaultValue());
+240 } else if (allowOptional && parameter.isOptional()) {
+241 Object value;
+242 if (!parameter.isOptionalResolver() || !this.manager.hasPermission(sender, parameterPermissions)) {
+243 value = null;
+244 } else {
+245 value = resolver.getContext(context);
+246 }
+247
+248 if (value == null && parameter.getClass().isPrimitive()) {
+249 throw new IllegalStateException("Parameter " + parameter.getName() + " is primitive and does not support Optional.");
+250 }
+251 //noinspection unchecked
+252 this.manager.getCommandConditions().validateConditions(context, value);
+253 passedArgs.put(parameterName, value);
+254 continue;
+255 } else if (requiresInput) {
+256 scope.showSyntax(sender, this);
+257 return null;
+258 }
+259 } else {
+260 if (!this.manager.hasPermission(sender, parameterPermissions)) {
+261 sender.sendMessage(MessageType.ERROR, MessageKeys.PERMISSION_DENIED_PARAMETER, "{param}", parameterName);
+262 throw new InvalidCommandArgument(false);
+263 }
+264 }
+265
+266 if (parameter.getValues() != null) {
+267 String arg = !args.isEmpty() ? args.get(0) : "";
+268
+269 Set<String> possible = new HashSet<>();
+270 CommandCompletions commandCompletions = this.manager.getCommandCompletions();
+271 for (String s : parameter.getValues()) {
+272 if ("*".equals(s) || "@completions".equals(s)) {
+273 s = commandCompletions.findDefaultCompletion(this, origArgs);
+274 }
+275 //noinspection unchecked
+276 List<String> check = commandCompletions.getCompletionValues(this, sender, s, origArgs, opContext.isAsync());
+277 if (!check.isEmpty()) {
+278 possible.addAll(check.stream().filter(Objects::nonNull).
+279 map(String::toLowerCase).collect(Collectors.toList()));
+280 } else {
+281 possible.add(s.toLowerCase(Locale.ENGLISH));
+282 }
+283 }
+284 if (!possible.contains(arg.toLowerCase(Locale.ENGLISH))) {
+285 throw new InvalidCommandArgument(MessageKeys.PLEASE_SPECIFY_ONE_OF,
+286 "{valid}", ACFUtil.join(possible, ", "));
+287 }
+288 }
+289
+290 Object paramValue = resolver.getContext(context);
+291
+292 //noinspection unchecked
+293 this.manager.getCommandConditions().validateConditions(context, paramValue);
+294 passedArgs.put(parameterName, paramValue);
+295 }
+296 return passedArgs;
+297 }
+298
+299 boolean hasPermission(CommandIssuer issuer) {
+300 return this.manager.hasPermission(issuer, getRequiredPermissions());
+301 }
+302
+303 /**
+304 * @see #getRequiredPermissions()
+305 * @deprecated
+306 */
+307 @Deprecated
+308 public String getPermission() {
+309 if (this.permission == null || this.permission.isEmpty()) {
+310 return null;
+311 }
+312 return ACFPatterns.COMMA.split(this.permission)[0];
+313 }
+314
+315 void computePermissions() {
+316 this.permissions.clear();
+317 this.permissions.addAll(this.scope.getRequiredPermissions());
+318 if (this.permission != null && !this.permission.isEmpty()) {
+319 this.permissions.addAll(Arrays.asList(ACFPatterns.COMMA.split(this.permission)));
+320 }
+321 }
+322
+323 public Set<String> getRequiredPermissions() {
+324 return this.permissions;
+325 }
+326
+327 public boolean requiresPermission(String permission) {
+328 return getRequiredPermissions().contains(permission);
+329 }
+330
+331 public String getPrefSubCommand() {
+332 return prefSubCommand;
+333 }
+334
+335 public String getSyntaxText() {
+336 return getSyntaxText(null);
+337 }
+338
+339 public String getSyntaxText(CommandIssuer issuer) {
+340 if (syntaxText != null) return syntaxText;
+341 StringBuilder syntaxBuilder = new StringBuilder(64);
+342 for (CommandParameter<?> parameter : parameters) {
+343 String syntax = parameter.getSyntax(issuer);
+344 if (syntax != null) {
+345 if (syntaxBuilder.length() > 0) {
+346 syntaxBuilder.append(' ');
+347 }
+348 syntaxBuilder.append(syntax);
+349 }
+350 }
+351 return syntaxBuilder.toString().trim();
+352 }
+353
+354 public String getHelpText() {
+355 return helpText != null ? helpText : "";
+356 }
+357
+358 public boolean isPrivate() {
+359 return isPrivate;
+360 }
+361
+362 public String getCommand() {
+363 return command;
+364 }
+365
+366 public void addSubcommand(String cmd) {
+367 this.registeredSubcommands.add(cmd);
+368 }
+369
+370 public void addSubcommands(Collection<String> cmd) {
+371 this.registeredSubcommands.addAll(cmd);
+372 }
+373
+374 public <T extends Annotation> T getAnnotation(Class<T> annotation) {
+375 return method.getAnnotation(annotation);
+376 }
+377}
diff --git a/docs/acf-jda/src-html/co/aikar/commands/JDAMessageFormatter.html b/docs/acf-jda/src-html/co/aikar/commands/JDAMessageFormatter.html
index aad16595..276c467c 100644
--- a/docs/acf-jda/src-html/co/aikar/commands/JDAMessageFormatter.html
+++ b/docs/acf-jda/src-html/co/aikar/commands/JDAMessageFormatter.html
@@ -16,7 +16,7 @@
003public class JDAMessageFormatter extends MessageFormatter<String> {
004 public JDAMessageFormatter() {
005 // JDA does not support coloring messages outside of embed fields.
-006 // We pass three empty strings so as to remove color coded messages from appearing.
+006 // We pass three empty strings to remove color coded messages from appearing.
007 super("", "", "");
008 }
009
diff --git a/docs/acf-velocity/co/aikar/commands/ACFVelocityUtil.html b/docs/acf-velocity/co/aikar/commands/ACFVelocityUtil.html
index 19f060ae..858f1688 100644
--- a/docs/acf-velocity/co/aikar/commands/ACFVelocityUtil.html
+++ b/docs/acf-velocity/co/aikar/commands/ACFVelocityUtil.html
@@ -169,13 +169,13 @@ loadScripts(document, 'script');
validate
-public static <T> T validate(T object,
+
diff --git a/docs/acf-velocity/co/aikar/commands/VelocityRootCommand.html b/docs/acf-velocity/co/aikar/commands/VelocityRootCommand.html
index 15cb96cf..b294779f 100644
--- a/docs/acf-velocity/co/aikar/commands/VelocityRootCommand.html
+++ b/docs/acf-velocity/co/aikar/commands/VelocityRootCommand.html
@@ -80,7 +80,7 @@ loadScripts(document, 'script');
co.aikar.commands.RootCommand, com.velocitypowered.api.command.Command, com.velocitypowered.api.command.InvocableCommand<com.velocitypowered.api.command.SimpleCommand.Invocation>, com.velocitypowered.api.command.SimpleCommand
-public class VelocityRootCommand
+
public class VelocityRootCommand
extends Object
implements com.velocitypowered.api.command.SimpleCommand, co.aikar.commands.RootCommand
@@ -159,7 +159,7 @@ implements com.velocitypowered.api.command.SimpleCommand, co.aikar.commands.Root
getCommandName
-
+
- Specified by:
getCommandName in interface co.aikar.commands.RootCommand
@@ -169,7 +169,7 @@ implements com.velocitypowered.api.command.SimpleCommand, co.aikar.commands.Root
addChild
-public void addChild(co.aikar.commands.BaseCommand command)
+public void addChild(co.aikar.commands.BaseCommand command)
- Specified by:
addChild in interface co.aikar.commands.RootCommand
@@ -179,7 +179,7 @@ implements com.velocitypowered.api.command.SimpleCommand, co.aikar.commands.Root
getManager
-public co.aikar.commands.CommandManager getManager()
+public co.aikar.commands.CommandManager getManager()
- Specified by:
getManager in interface co.aikar.commands.RootCommand
@@ -189,7 +189,7 @@ implements com.velocitypowered.api.command.SimpleCommand, co.aikar.commands.Root
getSubCommands
-public com.google.common.collect.SetMultimap<String,co.aikar.commands.RegisteredCommand> getSubCommands()
+public com.google.common.collect.SetMultimap<String,co.aikar.commands.RegisteredCommand> getSubCommands()
- Specified by:
getSubCommands in interface co.aikar.commands.RootCommand
@@ -199,7 +199,7 @@ implements com.velocitypowered.api.command.SimpleCommand, co.aikar.commands.Root
getChildren
-
+
- Specified by:
getChildren in interface co.aikar.commands.RootCommand
@@ -209,7 +209,7 @@ implements com.velocitypowered.api.command.SimpleCommand, co.aikar.commands.Root
getDefCommand
-
+
- Specified by:
getDefCommand in interface co.aikar.commands.RootCommand
@@ -219,7 +219,7 @@ implements com.velocitypowered.api.command.SimpleCommand, co.aikar.commands.Root
execute
-public void execute(com.velocitypowered.api.command.SimpleCommand.Invocation invocation)
+public void execute(com.velocitypowered.api.command.SimpleCommand.Invocation invocation)
- Specified by:
execute in interface com.velocitypowered.api.command.InvocableCommand<com.velocitypowered.api.command.SimpleCommand.Invocation>
@@ -229,7 +229,7 @@ implements com.velocitypowered.api.command.SimpleCommand, co.aikar.commands.Root
suggest
-public List<String> suggest(com.velocitypowered.api.command.SimpleCommand.Invocation invocation)
+public List<String> suggest(com.velocitypowered.api.command.SimpleCommand.Invocation invocation)
- Specified by:
suggest in interface com.velocitypowered.api.command.InvocableCommand<com.velocitypowered.api.command.SimpleCommand.Invocation>
@@ -239,7 +239,7 @@ implements com.velocitypowered.api.command.SimpleCommand, co.aikar.commands.Root
suggestAsync
-
+
- Specified by:
suggestAsync in interface com.velocitypowered.api.command.InvocableCommand<com.velocitypowered.api.command.SimpleCommand.Invocation>
diff --git a/docs/acf-velocity/src-html/co/aikar/commands/ACFVelocityUtil.html b/docs/acf-velocity/src-html/co/aikar/commands/ACFVelocityUtil.html
index 35615682..15071c82 100644
--- a/docs/acf-velocity/src-html/co/aikar/commands/ACFVelocityUtil.html
+++ b/docs/acf-velocity/src-html/co/aikar/commands/ACFVelocityUtil.html
@@ -68,27 +68,26 @@
055 }
056
057 Optional<Player> exactMatch = server.getPlayer(partialName);
-058 //noinspection OptionalIsPresent
-059 if (exactMatch.isPresent()) {
-060 return Collections.singleton(exactMatch.get());
-061 }
-062
-063 return server.getAllPlayers().stream()
-064 .filter(player -> player.getUsername().regionMatches(true, 0, partialName, 0, partialName.length()))
-065 .collect(Collectors.toList());
-066 }
-067
-068 public static boolean isValidName(String name) {
-069 return name != null && !name.isEmpty() && ACFPatterns.VALID_NAME_PATTERN.matcher(name).matches();
-070 }
-071
-072 public static <T> T validate(T object, String message, Object... values) {
-073 if (object == null) {
-074 throw new NullPointerException(String.format(message, values));
-075 }
-076 return object;
-077 }
-078}
+058 if (exactMatch.isPresent()) {
+059 return Collections.singleton(exactMatch.get());
+060 }
+061
+062 return server.getAllPlayers().stream()
+063 .filter(player -> player.getUsername().regionMatches(true, 0, partialName, 0, partialName.length()))
+064 .collect(Collectors.toList());
+065 }
+066
+067 public static boolean isValidName(String name) {
+068 return name != null && !name.isEmpty() && ACFPatterns.VALID_NAME_PATTERN.matcher(name).matches();
+069 }
+070
+071 public static <T> T validate(T object, String message, Object... values) {
+072 if (object == null) {
+073 throw new NullPointerException(String.format(message, values));
+074 }
+075 return object;
+076 }
+077}
diff --git a/docs/acf-velocity/src-html/co/aikar/commands/VelocityCommandManager.html b/docs/acf-velocity/src-html/co/aikar/commands/VelocityCommandManager.html
index 4ecfa13c..0e012759 100644
--- a/docs/acf-velocity/src-html/co/aikar/commands/VelocityCommandManager.html
+++ b/docs/acf-velocity/src-html/co/aikar/commands/VelocityCommandManager.html
@@ -120,7 +120,7 @@
107 return;
108 }
109
-110 //This can be null if we didn't received a settings packet
+110 //This can be null if we didn't receive a settings packet
111 Locale locale = player.getPlayerSettings().getLocale();
112 if (locale != null) {
113 setIssuerLocale(player, player.getPlayerSettings().getLocale());
diff --git a/docs/acf-velocity/src-html/co/aikar/commands/VelocityRootCommand.html b/docs/acf-velocity/src-html/co/aikar/commands/VelocityRootCommand.html
index 4dd6e04b..1aa063be 100644
--- a/docs/acf-velocity/src-html/co/aikar/commands/VelocityRootCommand.html
+++ b/docs/acf-velocity/src-html/co/aikar/commands/VelocityRootCommand.html
@@ -42,74 +42,72 @@
029
030import com.google.common.collect.HashMultimap;
031import com.google.common.collect.SetMultimap;
-032import com.velocitypowered.api.command.Command;
-033import com.velocitypowered.api.command.CommandSource;
-034import com.velocitypowered.api.command.SimpleCommand;
+032import com.velocitypowered.api.command.SimpleCommand;
+033
+034public class VelocityRootCommand implements SimpleCommand, RootCommand {
035
-036public class VelocityRootCommand implements SimpleCommand, RootCommand {
-037
-038 private final VelocityCommandManager manager;
-039 private final String name;
-040 private BaseCommand defCommand;
-041 private SetMultimap<String, RegisteredCommand> subCommands = HashMultimap.create();
-042 private List<BaseCommand> children = new ArrayList<>();
-043 boolean isRegistered = false;
-044
-045 VelocityRootCommand(VelocityCommandManager manager, String name) {
-046 this.manager = manager;
-047 this.name = name;
-048 }
-049
-050 @Override
-051 public String getCommandName() {
-052 return name;
-053 }
-054
-055 @Override
-056 public void addChild(BaseCommand command) {
-057 if (this.defCommand == null || !command.subCommands.get(BaseCommand.DEFAULT).isEmpty()) {
-058 this.defCommand = command;
-059
-060 }
-061 this.addChildShared(this.children, this.subCommands, command);
-062 }
-063
-064 @Override
-065 public CommandManager getManager() {
-066 return manager;
-067 }
-068
-069 @Override
-070 public SetMultimap<String, RegisteredCommand> getSubCommands() {
-071 return subCommands;
-072 }
-073
-074 @Override
-075 public List<BaseCommand> getChildren() {
-076 return children;
-077 }
-078
-079 @Override
-080 public BaseCommand getDefCommand() {
-081 return defCommand;
-082 }
-083
-084 @Override
-085 public void execute(Invocation invocation) {
-086 execute(manager.getCommandIssuer(invocation.source()), getCommandName(), invocation.arguments());
-087 }
-088
-089
-090 @Override
-091 public List<String> suggest(Invocation invocation) {
-092 return getTabCompletions(manager.getCommandIssuer(invocation.source()), getCommandName(), invocation.arguments());
-093 }
-094
-095 @Override
-096 public CompletableFuture<List<String>> suggestAsync(Invocation invocation) {
-097 return CompletableFuture.completedFuture(getTabCompletions(manager.getCommandIssuer(invocation.source()), getCommandName(), invocation.arguments()));
-098 }
-099}
+036 private final VelocityCommandManager manager;
+037 private final String name;
+038 private BaseCommand defCommand;
+039 private SetMultimap<String, RegisteredCommand> subCommands = HashMultimap.create();
+040 private List<BaseCommand> children = new ArrayList<>();
+041 boolean isRegistered = false;
+042
+043 VelocityRootCommand(VelocityCommandManager manager, String name) {
+044 this.manager = manager;
+045 this.name = name;
+046 }
+047
+048 @Override
+049 public String getCommandName() {
+050 return name;
+051 }
+052
+053 @Override
+054 public void addChild(BaseCommand command) {
+055 if (this.defCommand == null || !command.subCommands.get(BaseCommand.DEFAULT).isEmpty()) {
+056 this.defCommand = command;
+057
+058 }
+059 this.addChildShared(this.children, this.subCommands, command);
+060 }
+061
+062 @Override
+063 public CommandManager getManager() {
+064 return manager;
+065 }
+066
+067 @Override
+068 public SetMultimap<String, RegisteredCommand> getSubCommands() {
+069 return subCommands;
+070 }
+071
+072 @Override
+073 public List<BaseCommand> getChildren() {
+074 return children;
+075 }
+076
+077 @Override
+078 public BaseCommand getDefCommand() {
+079 return defCommand;
+080 }
+081
+082 @Override
+083 public void execute(Invocation invocation) {
+084 execute(manager.getCommandIssuer(invocation.source()), getCommandName(), invocation.arguments());
+085 }
+086
+087
+088 @Override
+089 public List<String> suggest(Invocation invocation) {
+090 return getTabCompletions(manager.getCommandIssuer(invocation.source()), getCommandName(), invocation.arguments());
+091 }
+092
+093 @Override
+094 public CompletableFuture<List<String>> suggestAsync(Invocation invocation) {
+095 return CompletableFuture.completedFuture(getTabCompletions(manager.getCommandIssuer(invocation.source()), getCommandName(), invocation.arguments()));
+096 }
+097}