geforkt von Mirrors/Paper
[Bleeding] Also blacklist ":" in plugin command aliases.
By: t00thpick1 <t00thpick1dirko@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
2ee5a01e78
Commit
2c68d4b554
@ -44,11 +44,19 @@ public class PluginCommandYamlParser {
|
|||||||
|
|
||||||
if (aliases instanceof List) {
|
if (aliases instanceof List) {
|
||||||
for (Object o : (List<?>) aliases) {
|
for (Object o : (List<?>) aliases) {
|
||||||
|
if (o.toString().contains(":")) {
|
||||||
|
Bukkit.getServer().getLogger().severe("Could not load alias " + o.toString() + " for plugin " + plugin.getName() + ": Illegal Characters");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
aliasList.add(o.toString());
|
aliasList.add(o.toString());
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (aliases.toString().contains(":")) {
|
||||||
|
Bukkit.getServer().getLogger().severe("Could not load alias " + aliases.toString() + " for plugin " + plugin.getName() + ": Illegal Characters");
|
||||||
} else {
|
} else {
|
||||||
aliasList.add(aliases.toString());
|
aliasList.add(aliases.toString());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
newCmd.setAliases(aliasList);
|
newCmd.setAliases(aliasList);
|
||||||
}
|
}
|
||||||
|
@ -537,7 +537,9 @@ public final class PluginDescriptionFile {
|
|||||||
* <td>Alternative command names, with special usefulness for commands
|
* <td>Alternative command names, with special usefulness for commands
|
||||||
* that are already registered. <i>Aliases are not effective when
|
* that are already registered. <i>Aliases are not effective when
|
||||||
* defined at runtime,</i> so the plugin description file is the
|
* defined at runtime,</i> so the plugin description file is the
|
||||||
* only way to have them properly defined.</td>
|
* only way to have them properly defined.
|
||||||
|
* <p>
|
||||||
|
* Note: Command aliases may not have a colon in them.</td>
|
||||||
* <td>Single alias format:
|
* <td>Single alias format:
|
||||||
* <blockquote><pre>aliases: combust_me</pre></blockquote> or
|
* <blockquote><pre>aliases: combust_me</pre></blockquote> or
|
||||||
* multiple alias format:
|
* multiple alias format:
|
||||||
@ -617,7 +619,7 @@ public final class PluginDescriptionFile {
|
|||||||
* # Having an empty declaration is useful for defining the description, permission, and messages from a configuration dynamically
|
* # Having an empty declaration is useful for defining the description, permission, and messages from a configuration dynamically
|
||||||
* apocalypse:
|
* apocalypse:
|
||||||
*</pre></blockquote>
|
*</pre></blockquote>
|
||||||
* Note: command names may not have a colon in their name.
|
* Note: Command names may not have a colon in their name.
|
||||||
*
|
*
|
||||||
* @return the commands this plugin will register
|
* @return the commands this plugin will register
|
||||||
*/
|
*/
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren