3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-25 02:20:07 +01:00

Removed command plugin.ymling from DocumentationPrinter

Dieser Commit ist enthalten in:
zml2008 2011-12-24 22:38:51 -08:00
Ursprung c8c0c69f6d
Commit d804144c27

Datei anzeigen

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