Provide warnings for spaces in plugin names. Addresses BUKKIT-5419
By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
@ -135,13 +135,28 @@ public final class SimplePluginManager implements PluginManager {
|
||||
if (name.equalsIgnoreCase("bukkit") || name.equalsIgnoreCase("minecraft") || name.equalsIgnoreCase("mojang")) {
|
||||
server.getLogger().log(Level.SEVERE, "Could not load '" + file.getPath() + "' in folder '" + directory.getPath() + "': Restricted Name");
|
||||
continue;
|
||||
} else if (description.rawName.indexOf(' ') != -1) {
|
||||
server.getLogger().warning(String.format(
|
||||
"Plugin `%s' uses the space-character (0x20) in its name `%s' - this is discouraged",
|
||||
description.getFullName(),
|
||||
description.rawName
|
||||
));
|
||||
}
|
||||
} catch (InvalidDescriptionException ex) {
|
||||
server.getLogger().log(Level.SEVERE, "Could not load '" + file.getPath() + "' in folder '" + directory.getPath() + "'", ex);
|
||||
continue;
|
||||
}
|
||||
|
||||
plugins.put(description.getName(), file);
|
||||
File replacedFile = plugins.put(description.getName(), file);
|
||||
if (replacedFile != null) {
|
||||
server.getLogger().severe(String.format(
|
||||
"Ambiguous plugin name `%s' for files `%s' and `%s' in `%s'",
|
||||
description.getName(),
|
||||
file.getPath(),
|
||||
replacedFile.getPath(),
|
||||
directory.getPath()
|
||||
));
|
||||
}
|
||||
|
||||
Collection<String> softDependencySet = description.getSoftDepend();
|
||||
if (softDependencySet != null && !softDependencySet.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user