Skip to content

Commit

Permalink
Continuation of fix of backward compatibility with plugins using Song…
Browse files Browse the repository at this point in the history
….getPath method
  • Loading branch information
koca2000 committed Mar 27, 2023
1 parent e6aede1 commit 6011aa1
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ public static Song loadSong(@NotNull File file){
@Nullable
public static Song loadSong(@NotNull Path path){
try {
return loadSongInternal(Files.newInputStream(path));
Song song = loadSongInternal(Files.newInputStream(path));
song.getMetadata().setSourceFile(path.toFile());
return song;
}
catch (SongCorruptedException e){
Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.RED + "Song is corrupted: " + path.getFileName());
Expand Down

0 comments on commit 6011aa1

Please sign in to comment.