3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-10 05:20:04 +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..."); System.out.println("Writing permissions wiki table...");
writePermissionsWikiTable(commandClasses); writePermissionsWikiTable(commandClasses);
System.out.println("Writing Bukkit plugin.yml..."); System.out.println("Writing Bukkit plugin.yml...");
writeBukkitYAML(commandClasses); writeBukkitYAML();
System.out.println("Done!"); System.out.println("Done!");
} }
@ -175,13 +175,13 @@ public class DocumentationPrinter {
} }
} }
private static void writeBukkitYAML(List<Class<?>> commandClasses) private static void writeBukkitYAML()
throws IOException { throws IOException {
FileOutputStream stream = null; FileOutputStream stream = null;
try { try {
stream = new FileOutputStream("plugin.yml"); stream = new FileOutputStream("plugin.yml");
PrintStream print = new PrintStream(stream); PrintStream print = new PrintStream(stream);
_writeBukkitYAML(print, commandClasses); _writeBukkitYAML(print);
} finally { } finally {
if (stream != null) { if (stream != null) {
stream.close(); stream.close();
@ -189,34 +189,11 @@ public class DocumentationPrinter {
} }
} }
private static void _writeBukkitYAML(PrintStream stream, private static void _writeBukkitYAML(PrintStream stream) {
List<Class<?>> commandClasses) {
stream.println("name: WorldEdit"); stream.println("name: WorldEdit");
stream.println("main: com.sk89q.worldedit.bukkit.WorldEditPlugin"); stream.println("main: com.sk89q.worldedit.bukkit.WorldEditPlugin");
stream.println("version: ${project.version}"); 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();
stream.println(); stream.println();