/*
 * This file is part of Sponge, licensed under the MIT License (MIT).
 *
 * Copyright (c) SpongePowered.org <http://www.spongepowered.org>
 * Copyright (c) contributors
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package org.spongepowered.api.util;

/**
 * A class containing a main method which throws an Exception to cleanly
 * indicate to the user than running the jar file was a bad idea.
 */
public class InformativeMain {

    /**
     * The main method which throws a {@link PEBKACException} with some basic
     * information on how sponge works.
     * 
     * @param args The program args
     * @throws PEBKACException always
     */
    public static void main(String[] args) throws PEBKACException {
        throw new PEBKACException("\n\nOh dear... You have just attempted to run the SpongeAPI jar file.\n"
                                + "\n"
                                + "Please Note: This is the binary for the API **ONLY** and running it has absolutely no\n"
                                + "purpose nor effect. If you wish to use Sponge you will need to locate the correct\n"
                                + "implementation for the platform you wish to run Sponge on.\n"
                                + "\n"
                                + "For information on the correct process for running sponge please see the documentation:\n"
                                + "\n"
                                + "\t\tSponge Documentation: https://docs.spongepowered.org/\n"
                                + "\n"
                                + "For more general information on the Sponge project please see the FAQ:\n"
                                + "\n"
                                + "\t\tSponge FAQ: https://docs.spongepowered.org/en/faq.html\n");
    }

}

@@ -1282,16 +1282,87 @@
 .util;%0A%0A
+import java.awt.GraphicsEnvironment;%0A%0Aimport javax.swing.JOptionPane;%0A%0A
 /**%0A * A
@@ -1540,322 +1540,44 @@
     
-/**%0A     * The main method which throws a %7B@link PEBKACException%7D with some basic%0A     * information on how sponge works.%0A     * %0A     * @param args The program args%0A     * @throws PEBKACException always%0A     */%0A    public static void main(String%5B%5D args) throws PEBKACException %7B%0A        throw new PEBKACException(
+private static final String ERROR = 
 %22%5Cn%5C
@@ -1644,29 +1644,55 @@
  file.%5Cn
-%22%0A           
+%5CnPlease Note: This is the binary for%22%0A
         
@@ -1699,32 +1699,24 @@
             
- + %22%5Cn%22%0A
             
@@ -1727,58 +1727,11 @@
     
-            + %22Please Note: This is the binary for
++ %22
  the
@@ -1782,45 +1782,8 @@
 no%5Cn
-%22%0A                                + %22
 purp
@@ -1836,39 +1836,18 @@
 will
- need to locate the correct%5Cn%22%0A
+%22%0A        
     
@@ -1877,16 +1877,45 @@
      + %22
+ need to locate the correct%5Cn
 implemen
@@ -1970,49 +1970,35 @@
 n.%5Cn
-%22%0A                                + %22%5Cn%22%0A
+%5CnFor information%22%0A        
     
@@ -2028,31 +2028,16 @@
      + %22
-For information
  on the 
@@ -2106,49 +2106,200 @@
 n:%5Cn
-%22%0A                                + %22%5Cn%22%0A
+%5Cn%5Ct%5CtSponge Documentation: http%22%0A                                        + %22s://docs.spongepowered.org/%5Cn%5CnFor more general information on the Sponge project please see the FAQ:%5Cn%5Cn%22%0A        
     
@@ -2336,37 +2336,27 @@
 %22%5Ct%5CtSponge 
-Documentation
+FAQ
 : https://do
@@ -2380,297 +2380,533 @@
 org/
+en/faq.html
 %5Cn%22
+;%0A
 %0A    
+/**%0A
      
-                       + %22%5Cn%22%0A                      
+* The main method which throws a %7B@link PEBKACException%7D with some basic%0A     * information on how sponge works.%0A     * %0A     * @param args The program args%0A     * @throws PEBKACException always%0A
      
+*/%0A
     
- + %22For more general information on the Sponge project please see the FAQ:%5Cn%22%0A                                + %22%5Cn%22%0A                                + %22%5Ct%5CtSponge FAQ: https://docs.spongepowered.org/en/faq.html%5Cn%22);
+public static void main(String%5B%5D args) throws PEBKACException %7B%0A        if (!GraphicsEnvironment.isHeadless()) %7B%0A            JOptionPane.showMessageDialog(null, ERROR, %22PEBKACException!%22, JOptionPane.ERROR_MESSAGE);%0A        %7D else %7B%0A            throw new PEBKACException(ERROR);%0A        %7D
 %0A   

Use a JOptionPane if we have GUI.