geforkt von Mirrors/FastAsyncWorldEdit
Removed command plugin.ymling from DocumentationPrinter
Dieser Commit ist enthalten in:
Ursprung
c8c0c69f6d
Commit
d804144c27
@ -51,7 +51,7 @@ public class DocumentationPrinter {
|
||||
System.out.println("Writing permissions wiki table...");
|
||||
writePermissionsWikiTable(commandClasses);
|
||||
System.out.println("Writing Bukkit plugin.yml...");
|
||||
writeBukkitYAML(commandClasses);
|
||||
writeBukkitYAML();
|
||||
|
||||
System.out.println("Done!");
|
||||
}
|
||||
@ -175,13 +175,13 @@ public class DocumentationPrinter {
|
||||
}
|
||||
}
|
||||
|
||||
private static void writeBukkitYAML(List<Class<?>> commandClasses)
|
||||
private static void writeBukkitYAML()
|
||||
throws IOException {
|
||||
FileOutputStream stream = null;
|
||||
try {
|
||||
stream = new FileOutputStream("plugin.yml");
|
||||
PrintStream print = new PrintStream(stream);
|
||||
_writeBukkitYAML(print, commandClasses);
|
||||
_writeBukkitYAML(print);
|
||||
} finally {
|
||||
if (stream != null) {
|
||||
stream.close();
|
||||
@ -189,34 +189,11 @@ public class DocumentationPrinter {
|
||||
}
|
||||
}
|
||||
|
||||
private static void _writeBukkitYAML(PrintStream stream,
|
||||
List<Class<?>> commandClasses) {
|
||||
private static void _writeBukkitYAML(PrintStream stream) {
|
||||
|
||||
stream.println("name: WorldEdit");
|
||||
stream.println("main: com.sk89q.worldedit.bukkit.WorldEditPlugin");
|
||||
stream.println("version: ${project.version}");
|
||||
stream.println("commands:");
|
||||
|
||||
for (Class<?> cls : commandClasses) {
|
||||
for (Method method : cls.getMethods()) {
|
||||
if (!method.isAnnotationPresent(Command.class)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Command cmd = method.getAnnotation(Command.class);
|
||||
|
||||
stream.println(" " + cmd.aliases()[0] + ":");
|
||||
stream.println(" description: " + cmd.desc());
|
||||
stream.println(" usage: /<command>"
|
||||
+ (cmd.flags().length() > 0 ? " [-" + cmd.flags() + "]" : "")
|
||||
+ (cmd.usage().length() > 0 ? " " + cmd.usage() : ""));
|
||||
if (cmd.aliases().length > 1) {
|
||||
stream.println(" aliases: ["
|
||||
+ StringUtil.joinQuotedString(cmd.aliases(), ", ", 1, "'")
|
||||
+ "]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stream.println();
|
||||
stream.println();
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren