diff --git a/.idea/artifacts/PGNator_jar.xml b/.idea/artifacts/PGNator_jar.xml deleted file mode 100644 index 43cfe47..0000000 --- a/.idea/artifacts/PGNator_jar.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - $PROJECT_DIR$/out/artifacts/PGNator_jar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/java/moe/wah/pgnator/commands/Pgn2Gif.java b/src/main/java/moe/wah/pgnator/commands/Pgn2Gif.java index fa21c2d..6634639 100644 --- a/src/main/java/moe/wah/pgnator/commands/Pgn2Gif.java +++ b/src/main/java/moe/wah/pgnator/commands/Pgn2Gif.java @@ -59,19 +59,8 @@ public class Pgn2Gif extends ApplicationCommand { } // Load PGN from file PgnHolder pgn = new PgnHolder("./temp/pgn/" + attachment.getFileName()); - Game game = null; try { - game = pgnToGame(pgn); - } catch (Exception e) { - throw new RuntimeException(e); - } - - if (pgn.getGames().getFirst().getHalfMoves().isEmpty()) { - log.debug("Invalid PGN!"); - event.getHook().sendMessage("Invalid PGN!").queue(); - } - try { - outputFile = gameToGif(game); + outputFile = pgnToGif(pgn); } catch (Exception e) { throw new RuntimeException(e); } @@ -91,9 +80,11 @@ public class Pgn2Gif extends ApplicationCommand { }); } - private static File gameToGif(Game game) throws Exception { + private static File pgnToGif(PgnHolder pgn) throws Exception { ChessRenderer renderer = new ChessRenderer(ChessThemeLibrary.GREEN_THEME, 60); + Game game = pgnToGame(pgn); String boardID = String.valueOf(Instant.now().toEpochMilli()); + game.loadMoveText(); MoveList moves = game.getHalfMoves(); Board board = new Board(); diff --git a/src/main/resources/META-INF/MANIFEST.MF b/src/main/resources/META-INF/MANIFEST.MF deleted file mode 100644 index 8353d93..0000000 --- a/src/main/resources/META-INF/MANIFEST.MF +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -Main-Class: moe.wah.pgnator.PGNator -